Replace analyzer calls to Fit() with SetClientSize().
authorLuc Trudeau <luc.trudeau.1@ens.etsmtl.ca>
Fri, 6 May 2016 01:50:37 +0000 (21:50 -0400)
committerNathan E. Egge <negge@dgql.org>
Thu, 19 May 2016 18:09:37 +0000 (14:09 -0400)
This solves window resizing issues when using wxWidgets 3.0 on both
 Linux and OSX when zooming in and out and when toggling the show
 padding option.
For a description of why, see the documentation on wxWindow::Fit()
 http://docs.wxwidgets.org/trunk/classwx_window.html

Signed-off-by: Nathan E. Egge <negge@dgql.org>
examples/analyzer.cc

index ec0c938..e7f2fc1 100644 (file)
@@ -1302,7 +1302,7 @@ bool TestFrame::setZoom(int zoom) {
     GetMenuBar()->Enable(wxID_ACTUAL_SIZE, zoom != MIN_ZOOM);
     GetMenuBar()->Enable(wxID_ZOOM_IN, zoom != MAX_ZOOM);
     GetMenuBar()->Enable(wxID_ZOOM_OUT, zoom != MIN_ZOOM);
-    Fit();
+    SetClientSize(panel->GetSize());
     panel->render();
     panel->Refresh();
     return true;
@@ -1321,7 +1321,7 @@ void TestFrame::onFilter(wxCommandEvent &WXUNUSED(event)) {
 
 void TestFrame::onPaddingChange(wxCommandEvent &event) {
   panel->setShowPadding(event.IsChecked());
-  Fit();
+  SetClientSize(panel->GetSize());
   panel->render();
   panel->Refresh();
 }
@@ -1339,21 +1339,21 @@ void TestFrame::onFilterBits(wxCommandEvent &WXUNUSED(event)) {
 
 void TestFrame::onYChange(wxCommandEvent &event) {
   panel->setShowPlane(event.IsChecked(), OD_LUMA_MASK);
-  Fit();
+  SetClientSize(panel->GetSize());
   panel->render();
   panel->Refresh();
 }
 
 void TestFrame::onUChange(wxCommandEvent &event) {
   panel->setShowPlane(event.IsChecked(), OD_CB_MASK);
-  Fit();
+  SetClientSize(panel->GetSize());
   panel->render();
   panel->Refresh();
 }
 
 void TestFrame::onVChange(wxCommandEvent &event) {
   panel->setShowPlane(event.IsChecked(), OD_CR_MASK);
-  Fit();
+  SetClientSize(panel->GetSize());
   panel->render();
   panel->Refresh();
 }
@@ -1384,7 +1384,7 @@ bool TestFrame::open(const wxString &path) {
     GetMenuBar()->Enable(wxID_ACTUAL_SIZE, false);
     GetMenuBar()->Enable(wxID_ZOOM_IN, true);
     GetMenuBar()->Enable(wxID_ZOOM_OUT, false);
-    Fit();
+    SetClientSize(panel->GetSize());
     panel->Refresh();
     SetStatusText(_("loaded file: ") + path);
     fileMenu->Enable(wxID_OPEN, false);