def _create_category_selector(self): ROWS = 4 COLS = 2 VGAP = BORDER HGAP = BORDER GROWABLE_COL_INDEX = 1 grid = wx.FlexGridSizer(ROWS, COLS, VGAP, HGAP) grid.AddGrowableCol(GROWABLE_COL_INDEX) self.lst_category = CategoryChoice(self, self.timeline) self.lst_category.select(None) label = wx.StaticText(self, label=_("Select a Category:")) grid.Add(label, flag=wx.ALIGN_CENTER_VERTICAL) grid.Add(self.lst_category) return grid
class CategoryEditorGuiCreator(object): def _create_gui(self): properties_box = wx.BoxSizer(wx.VERTICAL) self._add_input_controls(properties_box) self._add_buttons(properties_box) self._make_sure_title_is_visible(properties_box) self.SetSizerAndFit(properties_box) self._bind_handlers() def _add_input_controls(self, sizer): category_selector = self._create_category_selector() sizer.Add(category_selector, flag=wx.EXPAND|wx.ALL, border=BORDER, proportion=1) def _add_buttons(self, properties_box): button_box = self.CreateStdDialogButtonSizer(wx.OK|wx.CANCEL) properties_box.Add(button_box, flag=wx.EXPAND|wx.ALL, border=BORDER) def _make_sure_title_is_visible(self, sizer): sizer.SetMinSize((270,-1)) def _bind_handlers(self): self.Bind(wx.EVT_CHOICE, self.lst_category.on_choice, self.lst_category) self.Bind(wx.EVT_BUTTON, self._btn_ok_on_click, id=wx.ID_OK) def _create_category_selector(self): ROWS = 4 COLS = 2 VGAP = BORDER HGAP = BORDER GROWABLE_COL_INDEX = 1 grid = wx.FlexGridSizer(ROWS, COLS, VGAP, HGAP) grid.AddGrowableCol(GROWABLE_COL_INDEX) self.lst_category = CategoryChoice(self, self.timeline) self.lst_category.select(None) label = wx.StaticText(self, label=_("Select a Category:")) grid.Add(label, flag=wx.ALIGN_CENTER_VERTICAL) grid.Add(self.lst_category) return grid
def _create_categories_listbox(self, grid): self.lst_category = CategoryChoice(self, self.db) label = wx.StaticText(self, label=_("Category:")) grid.Add(label, flag=wx.ALIGN_CENTER_VERTICAL) grid.Add(self.lst_category)