def make_layout(self,parent): size_canvas=wx.Size(900,600) # init wx panel wx.Panel.__init__(self, parent) # init sizers fgs0=wx.FlexGridSizer(rows=3,cols=1) bs0 = wx.BoxSizer(wx.HORIZONTAL) bs1 = wx.BoxSizer(wx.HORIZONTAL) bs2 = wx.BoxSizer(wx.HORIZONTAL) # canvas element self.canvas=iwx.iCanvas(self,size_canvas) # button panel for output options # TODO: MAKE iChoice position independent # TODO: do i really want to use this? self.choices_res=GUIelements.iChoice(self,"res") self.choices_fps=GUIelements.iChoice(self,"fps") choices_out_mode=["Img Sequence","Video"] self.choices_out_mode_lookup=["1","2"] self.choices_out_mode=wx.Choice(self, wx.ID_ANY, size=(130,30), choices=choices_out_mode) # put elements in box sizer bs0.Add(self.choices_res) bs0.Add(self.choices_fps) bs0.Add(self.choices_out_mode) # button panel for process options choices_tl_mode=["Pan Only","Zoom&Pan","Full Image"] self.choices_tl_mode_lookup=[1,2,3] self.choices_tl_mode=wx.Choice(self, wx.ID_ANY,size=(130,30), choices=choices_tl_mode) self.b_reset = wx.Button(self,-1,"Reset") # put element in box sizer bs1.Add(self.choices_tl_mode) bs1.Add(self.b_reset) # button panel for path self.b_accept=wx.Button(self,-1,"OK") self.b_browse = GUIelements.iBrowse(self) # put elements in box sizer bs2.Add(self.b_browse) bs2.Add(self.b_accept) # put elements to top level sizer # fgs0.AddGrowableRow(0,0) fgs0.Add(self.canvas) fgs0.Add(bs0) fgs0.Add(bs1) fgs0.Add(bs2) # make layout self.SetSizer(fgs0) self.Layout() self.Fit()
def make_layout(self, parent): # layout --------------------------------------- size_over = wx.Size(600, 400) size_zoom = wx.Size(200, 200) # parent panel p1 wx.Panel.__init__(self, parent) # BOX SIZERS bs1 = wx.FlexGridSizer(rows=4, cols=1) bs11 = wx.BoxSizer(wx.HORIZONTAL) bs12 = wx.BoxSizer(wx.HORIZONTAL) bs13 = wx.BoxSizer(wx.HORIZONTAL) ###### LAYOUT PANEL 0-------------------------------------- self.button_up11 = wx.Button(self, -1, "U\nP", size=(30, 200)) self.over0 = iwx.iCanvas(self, size_over) bs111 = wx.FlexGridSizer(rows=3, cols=1) self.zoom0 = iwx.iCanvas(self, size_zoom) bs1111 = wx.BoxSizer(wx.HORIZONTAL) self.ResetF0 = wx.Button(self, -1, "Reset Frame") bs1111.Add(self.ResetF0, wx.EXPAND) bs1111.Add(wx.Button(self, -1, "BUT!"), wx.EXPAND) self.list11 = wx.ListBox(self, -1, size=(200, 170)) bs111.Add(self.zoom0, wx.EXPAND, 1) bs111.Add(bs1111, wx.EXPAND, 1) bs111.Add(self.list11, wx.EXPAND, 1) bs111.AddGrowableRow(0, 0) bs111.AddGrowableRow(2, 0) bs11.Add(self.over0, wx.ALIGN_TOP, 0) bs11.Add(bs111, wx.ALIGN_TOP, 0) bs11.Add(self.button_up11, wx.ALIGN_TOP, 0) ###### LAYOUT PANEL 1------------------------------------ self.button_down12 = wx.Button(self, -1, "D\nO\nW\nN", size=(30, 200)) self.over1 = iwx.iCanvas(self, size_over) bs121 = wx.FlexGridSizer(rows=3, cols=1) self.zoom1 = iwx.iCanvas(self, size_zoom) bs1211 = wx.BoxSizer(wx.HORIZONTAL) bs1211.Add(wx.Button(self, -1, "Reset Frame"), wx.EXPAND) bs1211.Add(wx.Button(self, -1, "BUT!"), wx.EXPAND) self.list12 = wx.ListBox(self, -1, size=(200, 170)) bs121.Add(self.zoom1, wx.EXPAND, 1) bs121.Add(bs1211, wx.CENTER, 1) bs121.Add(self.list12, wx.EXPAND, 1) bs121.AddGrowableRow(0, 0) bs121.AddGrowableRow(2, 0) bs12.Add(self.over1, wx.ALIGN_TOP, 0) bs12.Add(bs121, wx.ALIGN_TOP, 0) bs12.Add(self.button_down12, wx.ALIGN_LEFT, 0) ###### LAYOUT Bottom PANEL self.button_exe = wx.Button(self, -1, "recalculate Trafo") self.button_down13 = wx.Button(self, -1, "Process") ##### LAYOUT NAVPANEL bs_nav = wx.BoxSizer(wx.HORIZONTAL) self.nav = GUIelements.iNavpanel(self, 3) bs_nav.Add(self.nav, wx.EXPAND) bs_nav.Add(self.button_exe, wx.EXPAND) bs_nav.Add(self.button_down13, wx.EXPAND) ###### MAKE LAYOUT bs1.Add(bs11, 1, wx.ALIGN_LEFT) bs1.Add(bs_nav, 1, wx.EXPAND) bs1.Add(bs12, 1, wx.ALIGN_TOP) bs1.AddGrowableRow(0, 0) bs1.AddGrowableRow(1, 0) self.SetSizer(bs1) self.Layout() self.Fit()