]> git.saurik.com Git - wxWidgets.git/blobdiff - utils/wxPython/demo/PrintFramework.py
forgot to add the image with binary flags
[wxWidgets.git] / utils / wxPython / demo / PrintFramework.py
index 133d6270d8dd0b931b0c76d42cb5e77e2ba8b749..6b77eb1f2b8ab8b5a88b1a94908f08f99aa8c4be 100644 (file)
@@ -1,6 +1,5 @@
 
 from wxPython.wx         import *
 
 from wxPython.wx         import *
-from wxPython.lib.sizers import *
 from wxScrolledWindow    import MyCanvas
 
 #----------------------------------------------------------------------
 from wxScrolledWindow    import MyCanvas
 
 #----------------------------------------------------------------------
@@ -97,31 +96,29 @@ class TestPrintPanel(wxPanel):
         self.printData = wxPrintData()
         self.printData.SetPaperId(wxPAPER_LETTER)
 
         self.printData = wxPrintData()
         self.printData.SetPaperId(wxPAPER_LETTER)
 
-        self.box = box.wxBoxSizer(wxVERTICAL)
+        self.box = wxBoxSizer(wxVERTICAL)
         self.canvas = MyCanvas(self)
         self.canvas = MyCanvas(self)
-        self.box.Add(self.canvas, 1)
+        self.box.Add(self.canvas, 1, wxGROW)
 
         subbox = wxBoxSizer(wxHORIZONTAL)
         btn = wxButton(self, 1201, "Print Setup")
         EVT_BUTTON(self, 1201, self.OnPrintSetup)
 
         subbox = wxBoxSizer(wxHORIZONTAL)
         btn = wxButton(self, 1201, "Print Setup")
         EVT_BUTTON(self, 1201, self.OnPrintSetup)
-        subbox.Add(btn, 1)
+        subbox.Add(btn, 1, wxGROW | wxALL, 2)
 
         btn = wxButton(self, 1202, "Print Preview")
         EVT_BUTTON(self, 1202, self.OnPrintPreview)
 
         btn = wxButton(self, 1202, "Print Preview")
         EVT_BUTTON(self, 1202, self.OnPrintPreview)
-        subbox.Add(btn, 1)
+        subbox.Add(btn, 1, wxGROW | wxALL, 2)
 
         btn = wxButton(self, 1203, "Print")
         EVT_BUTTON(self, 1203, self.OnDoPrint)
 
         btn = wxButton(self, 1203, "Print")
         EVT_BUTTON(self, 1203, self.OnDoPrint)
-        subbox.Add(btn, 1)
+        subbox.Add(btn, 1, wxGROW | wxALL, 2)
 
 
-        self.box.Add(subbox)
+        self.box.Add(subbox, 0, wxGROW)
 
 
+        self.SetAutoLayout(true)
+        self.SetSizer(self.box)
 
 
 
 
-    def OnSize(self, event):
-        size = self.GetClientSize()
-        self.box.Layout(size)
-
     def OnPrintSetup(self, event):
         printerDialog = wxPrintDialog(self)
         printerDialog.GetPrintDialogData().SetPrintData(self.printData)
     def OnPrintSetup(self, event):
         printerDialog = wxPrintDialog(self)
         printerDialog.GetPrintDialogData().SetPrintData(self.printData)