Skip to content

Commit 4a81ac5

Browse files
committed
solves gnudatalanguage#1487 : window sizes are OK in all cases I tested.
1 parent b8aeafc commit 4a81ac5

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

src/devicewx.hpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,11 @@ if(hide) {
185185

186186
plotFrame->Connect(wxEVT_CLOSE_WINDOW, wxCloseEventHandler(gdlwxPlotFrame::OnUnhandledClosePlotFrame));
187187
//OnPlotSizeWithTimer does not work on GNOME. OnPlotWindowSize works.
188-
//#ifdef __WXMSW__
188+
#ifdef __WXMSW__
189189
plotFrame->Connect(wxEVT_SIZE, wxSizeEventHandler(gdlwxPlotFrame::OnPlotWindowSize)); //Timer resize do not work on MSW
190-
//#else
191-
// plotFrame->Connect(wxEVT_SIZE, wxSizeEventHandler(gdlwxPlotFrame::OnPlotSizeWithTimer));
192-
//#endif
190+
#else
191+
plotFrame->Connect(wxEVT_SIZE, wxSizeEventHandler(gdlwxPlotFrame::OnPlotSizeWithTimer));
192+
#endif
193193
return true;
194194
}
195195

src/gdlwidgeteventhandler.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -964,7 +964,8 @@ void gdlwxPlotFrame::OnTimerPlotResize(wxTimerEvent& event) {
964964
#if (GDL_DEBUG_ALL_EVENTS || GDL_DEBUG_TIMER_EVENTS)
965965
wxMessageOutputStderr().Printf(_T(".. Processed.\n"));
966966
#endif
967-
wxSizeEvent sizeEvent(frameSize, w->GetId());
967+
wxSize panelSize=this->GetClientSize(); //event.GetSize();
968+
wxSizeEvent sizeEvent(panelSize, w->GetId());
968969
w->OnPlotWindowSize(sizeEvent);
969970
}
970971

@@ -979,11 +980,11 @@ void gdlwxPlotFrame::OnPlotWindowSize(wxSizeEvent &event) {
979980
#endif
980981
}
981982

982-
wxSize frameSize=event.GetSize();
983+
wxSize panelSize=this->GetClientSize(); //event.GetSize();
983984
#if (GDL_DEBUG_ALL_EVENTS || GDL_DEBUG_SIZE_EVENTS)
984985
wxMessageOutputStderr().Printf(_T("in gdlwxPlotFrame::OnPlotWindowSize: event %d size: (%d,%d) processed."), event.GetId(), frameSize.x, frameSize.y);
985986
#endif
986-
wxSizeEvent sizeEvent(frameSize, w->GetId());
987+
wxSizeEvent sizeEvent(panelSize, w->GetId());
987988
w->OnPlotWindowSize(sizeEvent);
988989
}
989990

0 commit comments

Comments
 (0)