]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/mdi/mdi.cpp
reverted my previous change to WINVER - it is already defined elsewhere
[wxWidgets.git] / samples / mdi / mdi.cpp
index 6ccae6ba4f00046e4327e7dc4cf97e670eeed2b3..f3077f4ade76753d6385dc99b3d168b4a15145f0 100644 (file)
@@ -31,7 +31,7 @@
 
 #include <wx/toolbar.h>
 
-#if defined(__WXGTK__) || defined(__WXMOTIF__)
+#if defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXMAC__)
     #include "mondrian.xpm"
     #include "bitmaps/new.xpm"
     #include "bitmaps/open.xpm"
@@ -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()