Delete most of VideoBox's members

VideoBox is down to one method so it doesn't actually need to be able to
reference most of the stuff it constructs.

Originally committed to SVN as r6331.
This commit is contained in:
Thomas Goyne 2012-01-22 05:59:23 +00:00
parent d1d4d7840b
commit 6d4a56d391
3 changed files with 16 additions and 30 deletions

View file

@ -38,6 +38,7 @@
#ifndef AGI_PRE
#include <wx/filename.h>
#include <wx/sizer.h>
#include <wx/display.h> /// Must be included last.
#endif

View file

@ -37,11 +37,19 @@
#include "config.h"
#ifndef AGI_PRE
#include <wx/filename.h>
#include <wx/bmpbuttn.h>
#include <wx/combobox.h>
#include <wx/rawbmp.h>
#include <wx/settings.h>
#include <wx/sizer.h>
#include <wx/statline.h>
#include <wx/textctrl.h>
#include <wx/tglbtn.h>
#include <wx/toolbar.h>
#endif
#include "video_box.h"
#include "include/aegisub/context.h"
#include "include/aegisub/toolbar.h"
@ -49,15 +57,12 @@
#include "ass_file.h"
#include "command/command.h"
#include "compat.h"
#include "help_button.h"
#include "libresrc/libresrc.h"
#include "main.h"
#include "selection_controller.h"
#include "subs_grid.h"
#include "toggle_bitmap.h"
#include "tooltip_manager.h"
#include "utils.h"
#include "video_box.h"
#include "video_context.h"
#include "video_display.h"
#include "video_slider.h"
@ -75,7 +80,7 @@ VideoBox::VideoBox(wxWindow *parent, bool isDetached, agi::Context *context)
, context(context)
{
// Visual controls sub-toolbar
visualSubToolBar = new wxToolBar(this,-1,wxDefaultPosition,wxDefaultSize,wxTB_HORIZONTAL | wxTB_BOTTOM | wxTB_FLAT);
wxToolBar *visualSubToolBar = new wxToolBar(this,-1,wxDefaultPosition,wxDefaultSize,wxTB_HORIZONTAL | wxTB_BOTTOM | wxTB_FLAT);
// Buttons
wxSizer *videoBottomSizer = new wxBoxSizer(wxHORIZONTAL);
@ -85,7 +90,7 @@ VideoBox::VideoBox(wxWindow *parent, bool isDetached, agi::Context *context)
videoBottomSizer->Add(new ToggleBitmap(this, context, "video/opt/autoscroll", 24, "Video"), 0, wxTOP | wxLEFT | wxBOTTOM | wxALIGN_CENTER, 2);
// Seek
videoSlider = new VideoSlider(this, context);
VideoSlider *videoSlider = new VideoSlider(this, context);
videoSlider->SetToolTip(_("Seek video."));
// Position
@ -101,15 +106,15 @@ VideoBox::VideoBox(wxWindow *parent, bool isDetached, agi::Context *context)
for (int i = 1 ; i <= 24; ++i) {
choices.Add(wxString::Format("%g%%", i * 12.5));
}
zoomBox = new wxComboBox(this, -1, "75%", wxDefaultPosition, wxDefaultSize, choices, wxCB_DROPDOWN);
wxComboBox *zoomBox = new wxComboBox(this, -1, "75%", wxDefaultPosition, wxDefaultSize, choices, wxCB_DROPDOWN);
// Typesetting buttons
visualToolBar = toolbar::GetToolbar(this, "visual_tools", context, "Video", true);
wxToolBar *visualToolBar = toolbar::GetToolbar(this, "visual_tools", context, "Video", true);
// Avoid ugly themed background on Vista and possibly also Win7
visualToolBar->SetBackgroundStyle(wxBG_STYLE_COLOUR);
visualToolBar->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE));
videoDisplay = new VideoDisplay(visualSubToolBar,isDetached,zoomBox,this,context);
VideoDisplay *videoDisplay = new VideoDisplay(visualSubToolBar, isDetached, zoomBox, this, context);
// Top sizer
// Detached and attached video needs different flags, see bugs #742 and #853
@ -188,5 +193,4 @@ void VideoBox::UpdateTimeBoxes() {
time - active_line->Start,
time - active_line->End));
}
}

View file

@ -38,10 +38,6 @@
#include <list>
#include <wx/panel.h>
#include <wx/sizer.h>
#include <wx/textctrl.h>
#include <wx/tglbtn.h>
#include <wx/toolbar.h>
#endif
#include <libaegisub/signal.h>
@ -50,10 +46,8 @@
namespace agi { struct Context; }
class AssDialogue;
class ToggleBitmap;
class VideoDisplay;
class VideoSlider;
class wxComboBox;
class wxTextCtrl;
/// DOCME
/// @class VideoBox
@ -65,7 +59,6 @@ class VideoBox : public wxPanel, private SelectionListener<AssDialogue> {
agi::Context *context; ///< Project context
wxTextCtrl *VideoPosition; ///< Current frame/time
wxTextCtrl *VideoSubsPos; ///< Time relative to the active subtitle line
wxComboBox *zoomBox;
/// Update VideoPosition and VideoSubsPos
void UpdateTimeBoxes();
@ -73,18 +66,6 @@ class VideoBox : public wxPanel, private SelectionListener<AssDialogue> {
void OnSelectedSetChanged(Selection const&, Selection const&) { }
void OnActiveLineChanged(AssDialogue*) { UpdateTimeBoxes(); }
/// DOCME
wxToolBar *visualToolBar;
/// DOCME
wxToolBar *visualSubToolBar;
/// DOCME
VideoDisplay *videoDisplay;
/// DOCME
VideoSlider *videoSlider;
public:
VideoBox(wxWindow *parent, bool isDetached, agi::Context *context);
~VideoBox();