def create_widgets(self): vert = wx.BoxSizer(wx.VERTICAL) top_row = wx.BoxSizer(wx.HORIZONTAL) name_row = wx.BoxSizer(wx.HORIZONTAL) bottom_row = wx.BoxSizer(wx.HORIZONTAL) get_photos_btn = wx.Button(self, label="Get Photos") self.discard_btn = wx.Button(self, label="Discard") self.discard_btn.Disable() self.prev_btn = wx.Button(self, label="<") self.prev_btn.Disable() self.static_image = Photo(self) self.next_btn = wx.Button(self, label=">") self.next_btn.Disable() group_label = wx.StaticText(self, label="Group Name:") self.group_name = wx.TextCtrl(self) num_copies_label = wx.StaticText(self, label="Number of copies:") self.num_copies = wx.TextCtrl(self) self.num_copies.SetValue("1") process_label = tools.DO_PRINT and "Print" or "Process" process_btn = wx.Button(self, label=process_label) self.Bind(wx.EVT_BUTTON, self.on_get_photos, get_photos_btn) self.Bind(wx.EVT_BUTTON, self.on_discard, self.discard_btn) self.Bind(wx.EVT_BUTTON, self.on_previous, self.prev_btn) self.Bind(wx.EVT_BUTTON, self.on_next, self.next_btn) self.Bind(wx.EVT_BUTTON, self.on_process, process_btn) top_row.Add(self.prev_btn, 1) top_row.Add(get_photos_btn, 2) top_row.Add(self.next_btn, 1) top_row.Add(wx.Size(20, 10)) top_row.Add(self.discard_btn, 2) name_row.Add(group_label, 1, wx.ALIGN_CENTER_VERTICAL) name_row.Add(wx.Size(10, 10)) name_row.Add(self.group_name, 4, wx.ALIGN_CENTER_VERTICAL) bottom_row.Add(num_copies_label, 1, wx.ALIGN_CENTER_VERTICAL) bottom_row.Add(wx.Size(10, 10)) bottom_row.Add(self.num_copies, 1, wx.ALIGN_CENTER_VERTICAL) bottom_row.Add(wx.Size(20, 10)) bottom_row.Add(process_btn, 1, wx.ALIGN_CENTER_VERTICAL) vert.Add(wx.Size(10, 10)) vert.Add(top_row, 0, wx.ALIGN_CENTER_HORIZONTAL) vert.Add(wx.Size(10, 10)) vert.Add(self.static_image, 1, wx.SHAPED | wx.ALIGN_CENTER) vert.Add(wx.Size(10, 10)) vert.Add(name_row, 0, wx.ALIGN_CENTER_HORIZONTAL) vert.Add(wx.Size(10, 10)) vert.Add(bottom_row, 0, wx.ALIGN_CENTER_HORIZONTAL) vert.Add(wx.Size(10, 10)) self.SetSizer(vert) self.Centre()
def create_widgets(self): vert = wx.BoxSizer(wx.VERTICAL) open_row = wx.BoxSizer(wx.HORIZONTAL) name_row = wx.BoxSizer(wx.HORIZONTAL) bottom_row = wx.BoxSizer(wx.HORIZONTAL) open_btn = wx.Button(self, label="Open") restore_btn = wx.Button(self, label="Restore Discarded") self.static_image = Photo(self) group_label = wx.StaticText(self, label="Group Name:") self.group_name = wx.TextCtrl(self) keep_timeid_label = wx.StaticText(self, label="Keep day/time ID?") self.keep_timeid = wx.CheckBox(self) num_copies_label = wx.StaticText(self, label="Number of copies:") self.num_copies = wx.TextCtrl(self) self.num_copies.SetValue("1") process_label = tools.DO_PRINT and "Print" or "Process" process_btn = wx.Button(self, label=process_label) self.Bind(wx.EVT_BUTTON, self.on_open, open_btn) self.Bind(wx.EVT_BUTTON, self.on_restore, restore_btn) self.Bind(wx.EVT_BUTTON, self.on_process, process_btn) open_row.Add(open_btn, 1, wx.ALIGN_CENTER_VERTICAL) open_row.Add(wx.Size(10, 10)) open_row.Add(restore_btn, 2, wx.ALIGN_CENTER_VERTICAL) name_row.Add(group_label, 1, wx.ALIGN_CENTER_VERTICAL) name_row.Add(wx.Size(10, 10)) name_row.Add(self.group_name, 4, wx.ALIGN_CENTER_VERTICAL) bottom_row.Add(num_copies_label, 1, wx.ALIGN_CENTER_VERTICAL) bottom_row.Add(wx.Size(10, 10)) bottom_row.Add(self.num_copies, 0, wx.ALIGN_CENTER_VERTICAL) bottom_row.Add(wx.Size(20, 10)) bottom_row.Add(keep_timeid_label, 1, wx.ALIGN_CENTER_VERTICAL) bottom_row.Add(wx.Size(10, 10)) bottom_row.Add(self.keep_timeid, 0, wx.ALIGN_CENTER_VERTICAL) bottom_row.Add(wx.Size(20, 10)) bottom_row.Add(process_btn, 1, wx.ALIGN_CENTER_VERTICAL) vert.Add(wx.Size(10, 10)) vert.Add(open_row, 0, wx.ALIGN_CENTER_HORIZONTAL) vert.Add(wx.Size(10, 10)) vert.Add(self.static_image, 1, wx.SHAPED | wx.ALIGN_CENTER) vert.Add(wx.Size(10, 10)) vert.Add(name_row, 0, wx.ALIGN_CENTER_HORIZONTAL) vert.Add(wx.Size(10, 10)) vert.Add(bottom_row, 0, wx.ALIGN_CENTER_HORIZONTAL) vert.Add(wx.Size(10, 10)) self.SetSizer(vert) self.Centre()
def create_widgets(self): vert = wx.BoxSizer(wx.VERTICAL) top_row = wx.BoxSizer(wx.HORIZONTAL) bottom_row = wx.BoxSizer(wx.HORIZONTAL) get_photos_btn = wx.Button(self, label="Get Photos") self.discard_btn = wx.Button(self, label="Discard") self.discard_btn.Disable() self.prev_btn = wx.Button(self, label="<") self.prev_btn.Disable() self.static_image = Photo(self) self.next_btn = wx.Button(self, label=">") self.next_btn.Disable() process_label = tools.DO_PRINT and "Print" or "Process" process_btn = wx.Button(self, label=process_label) self.Bind(wx.EVT_BUTTON, self.on_get_photos, get_photos_btn) self.Bind(wx.EVT_BUTTON, self.on_discard, self.discard_btn) self.Bind(wx.EVT_BUTTON, self.on_previous, self.prev_btn) self.Bind(wx.EVT_BUTTON, self.on_next, self.next_btn) self.Bind(wx.EVT_BUTTON, self.on_process, process_btn) top_row.Add(self.prev_btn, 1) top_row.Add(get_photos_btn, 2) top_row.Add(self.next_btn, 1) top_row.Add(wx.Size(20, 10)) top_row.Add(self.discard_btn, 2) bottom_row.Add(process_btn, 1, wx.ALIGN_CENTER_VERTICAL) vert.Add(wx.Size(10, 10)) vert.Add(top_row, 0, wx.ALIGN_CENTER_HORIZONTAL) vert.Add(wx.Size(10, 10)) vert.Add(self.static_image, 1, wx.SHAPED | wx.ALIGN_CENTER) vert.Add(wx.Size(10, 10)) vert.Add(bottom_row, 0, wx.ALIGN_CENTER_HORIZONTAL) vert.Add(wx.Size(10, 10)) self.SetSizer(vert) self.Centre()