Hi,
I have used sizers in my application and here how the code goes:
vbox = wx.BoxSizer(wx.VERTICAL)
hbox1 = wx.BoxSizer(wx.HORIZONTAL)
hbox1.Add(self.staticBitmap1)
vbox.Add(hbox1, 0, wx.ALIGN_CENTER|wx.BOTTOM|wx.TOP,5)
hbox2 = wx.BoxSizer(wx.HORIZONTAL)
hbox2.Add(self.staticText1, 0)
vbox.Add(hbox2, 0, wx.LEFT|wx.BOTTOM , 10)
hbox3 = wx.BoxSizer(wx.HORIZONTAL)
hbox3.Add(self.txtActionId, 1)
vbox.Add(hbox3, 0, wx.LEFT | wx.RIGHT | wx.EXPAND|wx.BOTTOM, 10)
hbox5 = wx.BoxSizer(wx.HORIZONTAL)
hbox5.Add(self.btnProceed, 0)
vbox.Add(hbox5, 0, wx.ALIGN_CENTER|wx.BOTTOM, 10)
hbox4 = wx.BoxSizer(wx.HORIZONTAL)
hbox4.Add(self.treeAction, 1, wx.EXPAND)
vbox.Add(hbox4, 1, wx.LEFT | wx.RIGHT | wx.EXPAND|wx.BOTTOM, 10)
hbox8 = wx.BoxSizer(wx.HORIZONTAL)
hbox8.Add(self.customTree, 1, wx.EXPAND)
hbox8.Add(self.chkLstBox, 2, wx.EXPAND)
vbox.Add(hbox8, 1, wx.LEFT | wx.RIGHT | wx.EXPAND|wx.BOTTOM, 10)
hbox6 = wx.BoxSizer(wx.HORIZONTAL)
hbox6.Add((100,0), 1)
hbox6.Add(self.btnNext, 0,wx.ALIGN_CENTER|wx.BOTTOM,10)
hbox6.Add((100,0), 1)
hbox6.Add(self.btnExit1, 0, wx.ALIGN_CENTER|wx.BOTTOM , 10)
hbox6.Add((100,0), 1)
vbox.Add(hbox6, 0, wx.ALIGN_CENTER, 0)
hbox9 = wx.BoxSizer(wx.HORIZONTAL)
hbox9.Add((30,0), 1)
hbox9.Add(self.btnPrev, 0,wx.ALIGN_CENTER|wx.BOTTOM,10)
hbox9.Add((30,0), 1)
hbox9.Add(self.btnProcSel, 0, wx.ALIGN_CENTER|wx.BOTTOM , 10)
hbox9.Add((30,0), 1)
hbox9.Add(self.btnOutput, 0, wx.ALIGN_CENTER|wx.BOTTOM , 10)
hbox9.Add((30,0), 1)
hbox9.Add(self.btnExit2, 0, wx.ALIGN_CENTER|wx.BOTTOM , 10)
hbox9.Add((30,0), 1)
vbox.Add(hbox9, 0, wx.ALIGN_CENTER, 0)
hbox7 = wx.BoxSizer(wx.HORIZONTAL)
hbox7.Add(self.gauge1, 1,wx.EXPAND)
vbox.Add(hbox7, 0, wx.EXPAND|wx.BOTTOM, 5)
self.SetSizer(vbox)
r = self.GetSize()
#set the minimal size of the main frame
self.SetMinSize®
self.Centre()
self.Show(True)
I have done the following on the frame:
-
A single frame contains all the controls. screen1.jpg is how the frame looks
when the frame is initialised. -
On click of ‘Next’ button, the tree control, ‘Next’ and ‘Exit1’ buttons are
hidden and the custom tree control, check list box, ‘Previous’, ‘Process
Selected’ ‘Open Detailed Output’ and ‘Exit2’ buttons are made visible.
Now when I click the ‘Next’ button, the frame looks like screen2.jpg. If I
resize it(manually drag), it looks like screen3.jpg and when I click on
‘Previous’ button it looks screen4.jpg.
The problem is that when I hide or unhide those controls, all the space on the
frame is not occupied on click of buttons. The problem may be with hiding/
unhiding of controls.
Please help me!!!..
Regards,
Dinil
**************** CAUTION - Disclaimer *****************
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system.
***INFOSYS******** End of Disclaimer ********INFOSYS***