X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e70d4ce8d64540515d51834f08fe3338ae73a02c..edb89f7e356761b4fbdaebb8b5ebd5c7a7643da7:/samples/mdi/mdi.cpp diff --git a/samples/mdi/mdi.cpp b/samples/mdi/mdi.cpp index 6e84cdb231..5e67d487e2 100644 --- a/samples/mdi/mdi.cpp +++ b/samples/mdi/mdi.cpp @@ -163,7 +163,8 @@ MyFrame::MyFrame(wxWindow *parent, const wxPoint& pos, const wxSize& size, const long style) - : wxMDIParentFrame(parent, id, title, pos, size, style) + : wxMDIParentFrame(parent, id, title, pos, size, + style | wxNO_FULL_REPAINT_ON_RESIZE) { textWindow = new wxTextCtrl(this, -1, "A help window", wxDefaultPosition, wxDefaultSize, @@ -345,7 +346,9 @@ void MyFrame::InitToolBar(wxToolBar* toolBar) // Define a constructor for my canvas MyCanvas::MyCanvas(wxWindow *parent, const wxPoint& pos, const wxSize& size) : wxScrolledWindow(parent, -1, pos, size, - wxSUNKEN_BORDER|wxVSCROLL|wxHSCROLL) + wxSUNKEN_BORDER | + wxNO_FULL_REPAINT_ON_RESIZE | + wxVSCROLL | wxHSCROLL) { SetBackgroundColour(wxColour("WHITE")); @@ -408,10 +411,14 @@ void MyCanvas::OnEvent(wxMouseEvent& event) MyChild::MyChild(wxMDIParentFrame *parent, const wxString& title, const wxPoint& pos, const wxSize& size, const long style) - : wxMDIChildFrame(parent, -1, title, pos, size, style) + : wxMDIChildFrame(parent, -1, title, pos, size, + style | wxNO_FULL_REPAINT_ON_RESIZE) { canvas = (MyCanvas *) NULL; my_children.Append(this); + + // this should work for MDI frames as well as for normal ones + SetSizeHints(100, 100); } MyChild::~MyChild() @@ -468,7 +475,7 @@ void MyChild::OnMove(wxMoveEvent& event) // to be the width of the MDI canvas border) wxPoint pos1 = event.GetPosition(), pos2 = GetPosition(); - wxLogStatus("position from event: (%d, %d), from frame (%d, %d)", + wxLogStatus(wxT("position from event: (%d, %d), from frame (%d, %d)"), pos1.x, pos1.y, pos2.x, pos2.y); event.Skip(); @@ -482,7 +489,7 @@ void MyChild::OnSize(wxSizeEvent& event) wxSize size1 = event.GetSize(), size2 = GetSize(), size3 = GetClientSize(); - wxLogStatus("size from event: %dx%d, from frame %dx%d, client %dx%d", + wxLogStatus(wxT("size from event: %dx%d, from frame %dx%d, client %dx%d"), size1.x, size1.y, size2.x, size2.y, size3.x, size3.y); event.Skip();