def __init__(self, parent): wx.Panel.__init__(self, parent) # default settings self.format_preset=[".png",".jpg",".tiff"] self.zeros_preset =["0" , "1" , "2", "3", "4" ,"5" ,"6" ,"7" ,"8"] #buttons #---input self.b_i_format=wx.Choice(self,wx.ID_ANY,(7,130),(70,30),self.format_preset) self.b_zeros=wx.Choice(self,wx.ID_ANY,(7,190),(50,30),self.zeros_preset) #--output b_o_dir=wx.Button(self,wx.ID_ANY,"Browse",(7,250),(70,25),wx.BU_EXACTFIT) b_o_file=wx.Button(self,wx.ID_ANY,"Edit",(7,310),(50,25),wx.BU_EXACTFIT) self.b_fps=GUIelements.iChoice(self,(2,3),"fps") b_accept=wx.Button(self,wx.ID_ANY,"Accept",(67,410),(70,25),wx.BU_EXACTFIT) #static text s_dummy1 = wx.StaticText(self,-1,"Video Configuration:",(7,20)) self.s_o_dir = iwx.iStaticText(self,-1,"Output Directory:") self.s_o_file = iwx.iStaticText(self,-1,"Output Filename:") self.s_zeros = iwx.iStaticText(self,-1,"Leading Zeros:") self.s_format = iwx.iStaticText(self,-1,"Input File Format:") #events b_o_dir.Bind(wx.EVT_BUTTON, lambda evt, string=self.s_o_dir: self.OnBrowseDir(evt, string) ) b_o_file.Bind(wx.EVT_BUTTON, lambda evt, string=self.s_o_file: self.OnEdit(evt, string) ) self.bs=wx.BoxSizer(wx.VERTICAL) self.bs.Add(s_dummy1,1, wx.ALL,10) self.bs.Add(self.s_o_dir,1, wx.ALL,10) self.bs.Add(b_o_dir,1, wx.ALL,10) self.bs.Add(self.s_format,1, wx.ALL,10) self.bs.Add(self.b_i_format,1, wx.ALL,10) self.bs.Add(self.b_fps,1, wx.ALL,10) self.bs.Add(self.s_o_file,1, wx.ALL,10) self.bs.Add(b_o_file,1, wx.ALL,10) self.bs.Add(b_accept,1, wx.ALL,10) self.bs.Add(self.s_zeros,1, wx.ALL,10) self.bs.Add(self.b_zeros,1, wx.ALL,10) self.SetAutoLayout(True) self.SetSizer(self.bs) self.Layout() b_accept.Bind(wx.EVT_BUTTON, self.OnAccept ) #self.Bind(wx.EVT_BUTTON, self.OnProcess,b_process) self.Show(True)
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()