Make several of VideoDisplay's members private

Originally committed to SVN as r5265.
This commit is contained in:
Thomas Goyne 2011-01-23 07:47:59 +00:00
parent 14420102e4
commit 091c8170f2
4 changed files with 17 additions and 22 deletions

View File

@ -77,7 +77,6 @@ DialogDetachedVideo::DialogDetachedVideo(FrameMain *parent, agi::Context *contex
// Video area;
videoBox = new VideoBox(panel, true, NULL, context);
videoBox->videoDisplay->freeSize = true;
videoBox->videoDisplay->SetClientSize(initialDisplaySize);
// Set sizer

View File

@ -118,7 +118,7 @@ VideoBox::VideoBox(wxWindow *parent, bool isDetached, wxComboBox *zoomBox, agi::
visualToolBar->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE));
// Display
videoDisplay = new VideoDisplay(this,VideoPosition,VideoSubsPos,zoomBox,this,context);
videoDisplay = new VideoDisplay(this,isDetached,VideoPosition,VideoSubsPos,zoomBox,this,context);
// Top sizer
// Detached and attached video needs different flags, see bugs #742 and #853

View File

@ -97,9 +97,6 @@ enum {
BEGIN_EVENT_TABLE(VideoDisplay, wxGLCanvas)
EVT_MOUSE_EVENTS(VideoDisplay::OnMouseEvent)
EVT_KEY_DOWN(VideoDisplay::OnKeyDown)
EVT_PAINT(VideoDisplay::OnPaint)
EVT_SIZE(VideoDisplay::OnSizeEvent)
EVT_ERASE_BACKGROUND(VideoDisplay::OnEraseBackground)
EVT_MENU(VIDEO_MENU_COPY_COORDS,VideoDisplay::OnCopyCoords)
EVT_MENU(VIDEO_MENU_COPY_TO_CLIPBOARD,VideoDisplay::OnCopyToClipboard)
@ -127,6 +124,7 @@ public:
VideoDisplay::VideoDisplay(
VideoBox *box,
bool freeSize,
wxTextCtrl *PositionDisplay,
wxTextCtrl *SubsPosition,
wxComboBox *zoomBox,
@ -147,7 +145,7 @@ VideoDisplay::VideoDisplay(
, scriptH(INT_MIN)
, zoomBox(zoomBox)
, box(box)
, freeSize(false)
, freeSize(freeSize)
{
assert(box);
@ -160,6 +158,11 @@ VideoDisplay::VideoDisplay(
slots.push_back(con->videoController->AddARChangeListener(&VideoDisplay::UpdateSize, this));
slots.push_back(con->ass->AddCommitListener(&VideoDisplay::OnCommit, this));
Bind(wxEVT_PAINT, std::tr1::bind(&VideoDisplay::Render, this));
if (freeSize) {
Bind(wxEVT_SIZE, &VideoDisplay::OnSizeEvent, this);
}
SetCursor(wxNullCursor);
}
@ -443,15 +446,11 @@ void VideoDisplay::UpdateSize(int arType, double arValue) {
if (tool.get()) tool->Refresh();
wxGLCanvas::Refresh(false);
}
void VideoDisplay::OnPaint(wxPaintEvent&) {
Render();
Refresh(false);
}
void VideoDisplay::OnSizeEvent(wxSizeEvent &event) {
if (freeSize) UpdateSize();
UpdateSize();
event.Skip();
}

View File

@ -106,8 +106,6 @@ class VideoDisplay : public wxGLCanvas {
/// Upload the image for the current frame to the video card
void UploadFrameData(FrameReadyEvent&);
/// @brief Paint event
void OnPaint(wxPaintEvent& event);
/// @brief Key event handler
/// @param event
void OnKeyDown(wxKeyEvent &event);
@ -115,8 +113,6 @@ class VideoDisplay : public wxGLCanvas {
/// @param event
void OnMouseEvent(wxMouseEvent& event);
/// @brief NOP event handler
void OnEraseBackground(wxEraseEvent &) {}
/// @brief Recalculate video positioning and scaling when the available area or zoom changes
/// @param event
void OnSizeEvent(wxSizeEvent &event);
@ -185,16 +181,22 @@ class VideoDisplay : public wxGLCanvas {
/// The dropdown box for selecting zoom levels
wxComboBox *zoomBox;
public:
/// The VideoBox this display is contained in
VideoBox *box;
/// Whether the display can be freely resized by the user
bool freeSize;
/// @brief Set the cursor to either default or blank
/// @param show Whether or not the cursor should be visible
void ShowCursor(bool show);
/// @brief Set the size of the display based on the current zoom and video resolution
void UpdateSize(int arType = -1, double arValue = -1.);
public:
/// @brief Constructor
VideoDisplay(
VideoBox *box,
bool isDetached,
wxTextCtrl *PositionDisplay,
wxTextCtrl *SubsPosition,
wxComboBox *zoomBox,
@ -205,11 +207,6 @@ public:
/// @brief Render the currently visible frame
void Render();
/// @brief Set the cursor to either default or blank
/// @param show Whether or not the cursor should be visible
void ShowCursor(bool show);
/// @brief Set the size of the display based on the current zoom and video resolution
void UpdateSize(int arType = -1, double arValue = -1.);
/// @brief Set the zoom level
/// @param value The new zoom level
void SetZoom(double value);