BoxSizer: support top bottom left right center? or bottom and center? or right and center?

I know:
BoxSizer(wx.HORIZONTAL): button top and center
BoxSizer(wx.VERTICAL): button left and center

My question:
BoxSizer: button support top bottom left right center? or bottom and
center? or right and center?

Please check my test script:
import wx

class Frame1(wx.Frame):
    def __init__(self):
        wx.Frame.__init__(self, None, -1, "frame1", size=(300, 200))
        panel = wx.Panel(self)
        testBtn = wx.Button(panel, -1, label="Test")
        vbox_cmd = wx.BoxSizer(wx.HORIZONTAL)
        # vbox_cmd = wx.BoxSizer(wx.VERTICAL)
        vbox_cmd.Add(testBtn, 0, wx.ALIGN_CENTER|wx.ALL)
        panel.SetSizer(vbox_cmd)

class Frame(wx.Frame):
    def __init__(self):
        wx.Frame.__init__(self, None, -1, "frame", size=(600, 400))
        panel = wx.Panel(self)
        testBtn = wx.Button(panel, -1, label="Test")
        vbox_cmd = wx.BoxSizer(wx.VERTICAL)
        vbox_cmd.Add(testBtn, 0, wx.ALIGN_CENTER|wx.ALL)
        panel.SetSizer(vbox_cmd)
        self.Bind(wx.EVT_BUTTON, self.OnTest, testBtn)

    def OnTest(self, event):
        frame1 = Frame1()
        frame1.Show(True)

class App(wx.App):
    def OnInit(self):
        self.frame = Frame()
        self.frame.Show(True)
        return True
def main():
    app = App()
    app.MainLoop()

if __name__ == '__main__':
    main()

···

--
jiang zhixiang

another and same question:
toolbar can set to bottom center? same as statusbar.

There are some pages on the wiki, such as UsingSizers - wxPyWiki, that discuss sizers and the alignment flags. I'm not sure exactly what you are asking for, but perhaps those pages will help you understand.

And, as usual, I recommend the use of the WIT to help you with layout issues. It has a Highlight button on the toolbar that you can use to help you visualize how items are laid out by the sizer. http://wiki.wxpython.org/Widget_Inspection_Tool

···

On 9/22/12 7:44 AM, Rill wrote:

I know:
BoxSizer(wx.HORIZONTAL): button top and center
BoxSizer(wx.VERTICAL): button left and center

My question:
BoxSizer: button support top bottom left right center? or bottom and
center? or right and center?

--
Robin Dunn
Software Craftsman

The toolbar can be used as a normal widget, so it can be parented by something other than the frame and positioned using some other layout mechanism, like sizers. You just need to create the toolbar directly instead of using the frame's CreateToolBar, and do not call the frame's SetToolBar method.

···

On 9/24/12 1:35 AM, luckrill wrote:

another and same question:
toolbar can set to bottom center? same as statusbar.

--
Robin Dunn
Software Craftsman