Update the zoom on Enter in the zoom box. Updates #1433.

Originally committed to SVN as r6378.
This commit is contained in:
Thomas Goyne 2012-01-27 19:23:16 +00:00
parent 772c8dee3b
commit 2d5df24fd6
2 changed files with 2 additions and 1 deletions

View file

@ -103,7 +103,7 @@ VideoBox::VideoBox(wxWindow *parent, bool isDetached, agi::Context *context)
for (int i = 1 ; i <= 24; ++i) { for (int i = 1 ; i <= 24; ++i) {
choices.Add(wxString::Format("%g%%", i * 12.5)); choices.Add(wxString::Format("%g%%", i * 12.5));
} }
wxComboBox *zoomBox = new wxComboBox(this, -1, "75%", wxDefaultPosition, wxDefaultSize, choices, wxCB_DROPDOWN); wxComboBox *zoomBox = new wxComboBox(this, -1, "75%", wxDefaultPosition, wxDefaultSize, choices, wxCB_DROPDOWN | wxTE_PROCESS_ENTER);
// Typesetting buttons // Typesetting buttons
wxToolBar *visualToolBar = toolbar::GetToolbar(this, "visual_tools", context, "Video", true); wxToolBar *visualToolBar = toolbar::GetToolbar(this, "visual_tools", context, "Video", true);

View file

@ -110,6 +110,7 @@ VideoDisplay::VideoDisplay(
{ {
zoomBox->SetValue(wxString::Format("%g%%", zoomValue * 100.)); zoomBox->SetValue(wxString::Format("%g%%", zoomValue * 100.));
zoomBox->Bind(wxEVT_COMMAND_COMBOBOX_SELECTED, &VideoDisplay::SetZoomFromBox, this); zoomBox->Bind(wxEVT_COMMAND_COMBOBOX_SELECTED, &VideoDisplay::SetZoomFromBox, this);
zoomBox->Bind(wxEVT_COMMAND_TEXT_ENTER, &VideoDisplay::SetZoomFromBox, this);
con->videoController->Bind(EVT_FRAME_READY, &VideoDisplay::UploadFrameData, this); con->videoController->Bind(EVT_FRAME_READY, &VideoDisplay::UploadFrameData, this);
slots.push_back(con->videoController->AddVideoOpenListener(&VideoDisplay::OnVideoOpen, this)); slots.push_back(con->videoController->AddVideoOpenListener(&VideoDisplay::OnVideoOpen, this));