def remove_programs(self, event): """alle aangevinkte items verwijderen uit self.gsizer""" checked = [(x, y.GetLabel()) for x, y in enumerate(self.checks) if y.GetValue()] if checked: with DeleteDialog(self) as dlg: if dlg.ShowModal() == wx.ID_OK: dlg.accept() for row, name in reversed(checked): csv_name, prg_name = '', '' try: csv_name = self.paths[row][1].GetValue() # input.text() prg_name = self.settingsdata[name][0] except KeyError: shared.log_exc('') shared.log('csv name is %s', csv_name) shared.log('prg name is %s', prg_name) if self.remove_data: if csv_name: self.data_to_remove.append(csv_name) if self.remove_code: if prg_name: self.code_to_remove.append( prg_name.replace('.', '/') + '.py') self.delete_row(row)
def remove_programs(self): """alle aangevinkte items verwijderen uit self.gsizer""" checked = [(x, y.text()) for x, y in enumerate(self.checks) if y.isChecked()] if checked: dlg = DeleteDialog(self).exec_() if dlg == qtw.QDialog.Accepted: for row, name in reversed(checked): csv_name, prg_name = '', '' try: csv_name = self.paths[row][1].input.text() prg_name = self.settingsdata[name][0] except KeyError: shared.log_exc('') shared.log('csv name is %s', csv_name) shared.log('prg name is %s', prg_name) if self.remove_data: if csv_name: self.data_to_remove.append(csv_name) if self.remove_code: if prg_name: self.code_to_remove.append( prg_name.replace('.', '/') + '.py') self.delete_row(row)
def __init__(self, parent, master): self.parent = parent self.master = master # self.title = self.master.title self.captions = self.master.captions super().__init__(parent) ## self.resize(680, 400) self.setWindowTitle(self.master.title) self.sizer = qtw.QVBoxLayout() pnl = qtw.QFrame() vsizer = qtw.QVBoxLayout() hsizer = qtw.QHBoxLayout() text = qtw.QLabel(self.master.captions['S_PLGNAM'], self) self.t_program = qtw.QLineEdit( self.master.book.page.settings[shared.SettType.PLG.value], self) hsizer.addWidget(text) hsizer.addWidget(self.t_program) vsizer.addLayout(hsizer) hsizer = qtw.QHBoxLayout() text = qtw.QLabel(self.master.captions['S_PNLNAM'], self) self.t_title = qtw.QLineEdit( self.master.book.page.settings[shared.SettType.PNL.value], self) hsizer.addWidget(text) hsizer.addWidget(self.t_title) vsizer.addLayout(hsizer) hsizer = qtw.QHBoxLayout() self.c_rebuild = qtw.QCheckBox( self.master.captions['T_MAKE'].format( self.master.captions['S_RBLD']), self) if self.master.book.page.settings[shared.SettType.RBLD.value] == '1': self.c_rebuild.toggle() hsizer.addWidget(self.c_rebuild) vsizer.addLayout(hsizer) hsizer = qtw.QHBoxLayout() self.c_showdet = qtw.QCheckBox(self.master.captions['S_DETS'], self) try: if self.master.book.page.settings[ shared.SettType.DETS.value] == '1': self.c_showdet.toggle() except KeyError: shared.log_exc() hsizer.addWidget(self.c_showdet) vsizer.addLayout(hsizer) hsizer = qtw.QHBoxLayout() self.c_redef = qtw.QCheckBox( self.master.captions['T_MAKE'].format( self.master.captions['S_RSAV']), self) if self.master.book.page.settings[shared.SettType.RDEF.value] == '1': self.c_redef.toggle() hsizer.addWidget(self.c_redef) vsizer.addLayout(hsizer) pnl.setLayout(vsizer) pnl.setFrameStyle(qtw.QFrame.Box | qtw.QFrame.Raised) self.sizer.addWidget(pnl) pnl = qtw.QFrame(self) vsizer = qtw.QVBoxLayout() text = self.master.captions['T_XTRASET'].format( self.master.book.page.settings[shared.SettType.PNL.value]) hsizer = qtw.QHBoxLayout() label = qtw.QLabel(text, self) hsizer.addStretch() hsizer.addWidget(label) hsizer.addStretch() vsizer.addLayout(hsizer) hsizer = qtw.QHBoxLayout() hsizer.addSpacing(41) hsizer.addWidget(qtw.QLabel(self.master.captions['C_NAM'], self), alignment=core.Qt.AlignHCenter) hsizer.addSpacing(52) hsizer.addWidget(qtw.QLabel(self.master.captions['C_VAL'], self), alignment=core.Qt.AlignHCenter) hsizer.addStretch() vsizer.addLayout(hsizer) pnl2 = qtw.QFrame(self) self.scrl = qtw.QScrollArea(self) self.scrl.setWidget(pnl2) self.scrl.setWidgetResizable(True) self.bar = self.scrl.verticalScrollBar() self.gsizer = qtw.QGridLayout() rownum = 0 self.rownum = rownum self.data, self.checks = [], [] for name, value in self.master.book.page.settings.items(): if name not in shared.csv_settingnames and name != 'extra': try: desc = self.master.book.page.settings['extra'][name] except KeyError: desc = '' self.add_row(name, value, desc) pnl2.setLayout(self.gsizer) pnl.setFrameStyle(qtw.QFrame.Box) self.scrl.ensureVisible(0, 0) vsizer.addWidget(self.scrl) hsizer = qtw.QHBoxLayout() hsizer.addStretch() btn = qtw.QPushButton(self.master.captions['C_ADDSET'], self) btn.clicked.connect(self.add_setting) hsizer.addWidget(btn) btn = qtw.QPushButton(self.master.captions['C_REMSET'], self) btn.clicked.connect(self.remove_settings) hsizer.addWidget(btn) hsizer.addStretch() vsizer.addLayout(hsizer) pnl.setLayout(vsizer) pnl.setFrameStyle(qtw.QFrame.Box | qtw.QFrame.Raised) self.sizer.addWidget(pnl) buttonbox = qtw.QDialogButtonBox() btn = buttonbox.addButton(qtw.QDialogButtonBox.Ok) btn = buttonbox.addButton(qtw.QDialogButtonBox.Cancel) buttonbox.accepted.connect(self.accept) buttonbox.rejected.connect(self.reject) hsizer = qtw.QHBoxLayout() hsizer.addStretch() hsizer.addWidget(buttonbox) hsizer.addStretch() self.sizer.addLayout(hsizer) self.setLayout(self.sizer)
def layout_extra_fields(self, sizer): """add the extra fields to the layout """ bsizer = wx.BoxSizer(wx.VERTICAL) bsizer.AddSpacer(5) sizer1 = wx.BoxSizer(wx.HORIZONTAL) sizer2 = wx.BoxSizer(wx.HORIZONTAL) if 'C_KEY' in self.master.fields: sizer2.Add(self.lbl_key, 0, wx.ALIGN_CENTER_VERTICAL) if self.master.keylist is None: sizer2.Add(self.txt_key, 0, wx.ALIGN_CENTER_VERTICAL) else: sizer2.Add(self.cmb_key, 0, wx.ALIGN_CENTER_VERTICAL) if 'C_MODS' in self.master.fields: sizer2.Add(self.cb_ctrl, 0, wx.ALIGN_CENTER_VERTICAL | wx.LEFT, 5) sizer2.Add(self.cb_alt, 0, wx.ALIGN_CENTER_VERTICAL) sizer2.Add(self.cb_shift, 0, wx.ALIGN_CENTER_VERTICAL) sizer2.Add(self.cb_win, 0, wx.ALIGN_CENTER_VERTICAL) sizer1.Add(sizer2, 0) sizer1.AddStretchSpacer(1) if 'C_CNTXT' in self.master.fields: sizer2 = wx.BoxSizer(wx.HORIZONTAL) sizer2.Add(self.lbl_context, 0, wx.ALIGN_CENTER_VERTICAL) sizer2.Add(self.cmb_context, 0, wx.ALIGN_CENTER_VERTICAL) sizer1.Add(sizer2, 0) if 'C_CMD' in self.master.fields: sizer2 = wx.BoxSizer(wx.HORIZONTAL) sizer2.Add(self.txt_cmd, 0, wx.ALIGN_CENTER_VERTICAL) sizer2.Add(self.cmb_commando, 0, wx.ALIGN_CENTER_VERTICAL) sizer1.Add(sizer2, 0) try: self.master.reader.layout_extra_fields_topline(self, sizer1) # user exit except AttributeError: shared.log_exc() sizer1.Add(self.b_save, 0) sizer1.Add(self.b_del, 0) bsizer.Add(sizer1, 0, wx.EXPAND | wx.LEFT | wx.RIGHT, 10) self.toplinesizer = sizer1 try: test = self.master.reader.layout_extra_fields_nextline except AttributeError: shared.log_exc() else: sizer1 = wx.BoxSizer(wx.HORIZONTAL) self.master.reader.layout_extra_fields_nextline(self, sizer1) # user exit bsizer.Add(sizer1, 0) sizer1 = wx.BoxSizer(wx.HORIZONTAL) if 'C_DESC' in self.master.fields: # sizer2 = wx.BoxSizer(wx.VERTICAL) sizer1.Add(self.txt_oms, 1, wx.EXPAND) # sizer1.Add(sizer2, 1, wx.EXPAND) try: self.master.reader.layout_extra_fields(self, sizer1) # user exit except AttributeError: shared.log_exc() bsizer.Add(sizer1, 1, wx.EXPAND | wx.LEFT | wx.RIGHT, 10) self._box.SetSizer(bsizer) # bsizer.Fit(self._box) sizer.Add(self._box, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.EXPAND | wx.ALL, 2)
def add_extra_fields(self): """fields showing details for selected keydef, to make editing possible """ self.screenfields = [] self._box = box = wx.Panel(self) frameheight = 90 try: frameheight = self.master.reader.get_frameheight() # user exit except AttributeError: shared.log_exc() # box.setMaximumHeight(frameheight) if 'C_KEY' in self.master.fields: self.lbl_key = wx.StaticText(box, label=self.master.captions['C_KTXT'] + " ") if self.master.keylist is None: ted = wx.TextCtrl(box, size=(90, -1)) ted.Bind(wx.EVT_TEXT, self.master.on_text) self.screenfields.append(ted) self.txt_key = ted else: cb = wx.ComboBox(box, size=(140, -1), style=wx.CB_READONLY, choices=self.master.keylist) # niet sorteren cb.Bind(wx.EVT_COMBOBOX, self.master.on_combobox) self.screenfields.append(cb) self.cmb_key = cb if 'C_MODS' in self.master.fields: for ix, x in enumerate(('M_CTRL', 'M_ALT', 'M_SHFT', 'M_WIN')): cb = wx.CheckBox(box, label=self.master.captions[x].join(("+ ", ""))) cb.SetValue(False) self.screenfields.append(cb) cb.Bind(wx.EVT_CHECKBOX, self.master.on_checkbox) if ix == 0: self.cb_ctrl = cb elif ix == 1: self.cb_alt = cb elif ix == 2: self.cb_shift = cb elif ix == 3: self.cb_win = cb if 'C_CNTXT' in self.master.fields: self.lbl_context = wx.StaticText(box, label=self.master.captions['C_CNTXT']) cb = wx.ComboBox(box, size=(110, -1), style=wx.CB_READONLY, choices=self.master.contextslist) cb.Bind(wx.EVT_COMBOBOX, self.master.on_combobox) self.screenfields.append(cb) self.cmb_context = cb if 'C_CMD' in self.master.fields: self.txt_cmd = wx.StaticText(box, label=self.master.captions['C_CTXT'] + " ") cb = wx.ComboBox(box, size=(150, -1), style=wx.CB_READONLY) if 'C_CNTXT' not in self.master.fields: # load on choosing context cb.SetItems(self.master.commandslist) cb.Bind(wx.EVT_COMBOBOX, self.master.on_combobox) self.screenfields.append(cb) self.cmb_commando = cb if 'C_PARMS' in self.master.fields: self.lbl_parms = wx.StaticText(box, label=self.master.captions['C_PARMS']) self.txt_parms = wx.TextCtrl(box, size=(280, -1)) self.screenfields.append(self.txt_parms) if 'C_CTRL' in self.master.fields: self.lbl_controls = wx.StaticText(box, label=self.master.captions['C_CTRL']) cb = wx.ComboBox(box, choices=self.master.controlslist, style=wx.CB_READONLY) # cb.Bind(wx.EVT_COMBOBOX, functools.partial(on_combobox, self, cb, str)) self.screenfields.append(cb) self.cmb_controls = cb if 'C_BPARMS' in self.master.fields: self.pre_parms_label = wx.StaticText(box) self.pre_parms_text = wx.TextCtrl(box) self.screenfields.append(self.pre_parms_text) if 'C_APARMS' in self.master.fields: self.post_parms_label = wx.StaticText(box) self.post_parms_text = wx.TextCtrl(box) self.screenfields.append(self.post_parms_text) if 'C_FEAT' in self.master.fields: self.feature_label = wx.StaticText(box) self.feature_select = wx.ComboBox(box, choices=self.master.featurelist, style=wx.CB_READONLY) self.screenfields.append(self.feature_select) if 'C_DESC' in self.master.fields: self.txt_oms = wx.TextCtrl(box, size=(480, 40), style=wx.TE_MULTILINE | wx.TE_READONLY) self.b_save = wx.Button(box, label=self.master.captions['C_SAVE']) self.b_save.Enable(False) self.b_save.Bind(wx.EVT_BUTTON, self.on_update) self.b_del = wx.Button(box, label=self.master.captions['C_DEL']) self.b_del.Enable(False) self.b_del.Bind(wx.EVT_BUTTON, self.on_delete) self._savestates = (False, False)
def add_extra_fields(self): """fields showing details for selected keydef, to make editing possible """ self.screenfields = [] self._box = box = qtw.QFrame(self) frameheight = 90 try: frameheight = self.master.reader.get_frameheight() # user exit except AttributeError: shared.log_exc() box.setMaximumHeight(frameheight) if 'C_KEY' in self.master.fields: self.lbl_key = qtw.QLabel(self.master.captions['C_KTXT'] + " ", box) if self.master.keylist is None: ted = qtw.QLineEdit(box) ted.setMaximumWidth(90) ted.textChanged[str].connect( functools.partial(self.master.on_text, ted, str)) self.screenfields.append(ted) self.txt_key = ted else: cb = qtw.QComboBox(box) cb.setMaximumWidth(90) cb.addItems(self.master.keylist) # niet sorteren cb.currentIndexChanged[str].connect( functools.partial(self.master.on_combobox, cb, str)) self.screenfields.append(cb) self.cmb_key = cb if 'C_MODS' in self.master.fields: for ix, x in enumerate(('M_CTRL', 'M_ALT', 'M_SHFT', 'M_WIN')): cb = qtw.QCheckBox(self.master.captions[x].join(("+ ", "")), box) cb.setChecked(False) self.screenfields.append(cb) cb.stateChanged.connect( functools.partial(self.master.on_checkbox, cb)) if ix == 0: self.cb_ctrl = cb elif ix == 1: self.cb_alt = cb elif ix == 2: self.cb_shift = cb elif ix == 3: self.cb_win = cb if 'C_CNTXT' in self.master.fields: self.lbl_context = qtw.QLabel(self.master.captions['C_CNTXT'], box) cb = qtw.QComboBox(box) cb.addItems(self.master.contextslist) cb.setMaximumWidth(110) cb.currentIndexChanged[str].connect( functools.partial(self.master.on_combobox, cb, str)) self.screenfields.append(cb) self.cmb_context = cb if 'C_CMD' in self.master.fields: self.txt_cmd = qtw.QLabel(self.master.captions['C_CTXT'] + " ", box) cb = qtw.QComboBox(self) cb.setMaximumWidth(150) if 'C_CNTXT' not in self.master.fields: # load on choosing context cb.addItems(self.master.commandslist) cb.currentIndexChanged[str].connect( functools.partial(self.master.on_combobox, cb, str)) self.screenfields.append(cb) self.cmb_commando = cb if 'C_PARMS' in self.master.fields: self.lbl_parms = qtw.QLabel(self.master.captions['C_PARMS'], box) self.txt_parms = qtw.QLineEdit(box) self.txt_parms.setMaximumWidth(280) self.screenfields.append(self.txt_parms) if 'C_CTRL' in self.master.fields: self.lbl_controls = qtw.QLabel(self.master.captions['C_CTRL'], box) cb = qtw.QComboBox(box) cb.addItems(self.master.controlslist) cb.currentIndexChanged[str].connect( functools.partial(self.master.on_combobox, cb, str)) self.screenfields.append(cb) self.cmb_controls = cb if 'C_BPARMS' in self.master.fields: self.pre_parms_label = qtw.QLabel(box) self.pre_parms_text = qtw.QLineEdit(box) self.screenfields.append(self.pre_parms_text) if 'C_APARMS' in self.master.fields: self.post_parms_label = qtw.QLabel(box) self.post_parms_text = qtw.QLineEdit(box) self.screenfields.append(self.post_parms_text) if 'C_FEAT' in self.master.fields: self.feature_label = qtw.QLabel(box) self.feature_select = qtw.QComboBox(box) self.feature_select.addItems(self.master.featurelist) self.screenfields.append(self.feature_select) if 'C_DESC' in self.master.fields: self.txt_oms = qtw.QTextEdit(box) self.txt_oms.setReadOnly(True) self.b_save = qtw.QPushButton(self.master.captions['C_SAVE'], box) self.b_save.setEnabled(False) self.b_save.clicked.connect(self.on_update) self.b_del = qtw.QPushButton(self.master.captions['C_DEL'], box) self.b_del.setEnabled(False) self.b_del.clicked.connect(self.on_delete) self._savestates = (False, False)
def layout_extra_fields(self, sizer): """add the extra fields to the layout """ bsizer = qtw.QVBoxLayout() sizer1 = qtw.QHBoxLayout() sizer2 = qtw.QHBoxLayout() if 'C_KEY' in self.master.fields: sizer3 = qtw.QHBoxLayout() sizer3.addWidget(self.lbl_key) if self.master.keylist is None: sizer3.addWidget(self.txt_key) else: sizer3.addWidget(self.cmb_key) sizer3.addStretch() sizer2.addLayout(sizer3) if 'C_MODS' in self.master.fields: sizer3 = qtw.QHBoxLayout() sizer3.addWidget(self.cb_ctrl) sizer3.addWidget(self.cb_alt) sizer3.addWidget(self.cb_shift) sizer3.addWidget(self.cb_win) sizer3.addStretch() sizer2.addLayout(sizer3) sizer1.addLayout(sizer2) sizer1.addStretch() if 'C_CNTXT' in self.master.fields: sizer2 = qtw.QHBoxLayout() sizer2.addWidget(self.lbl_context) sizer2.addWidget(self.cmb_context) sizer1.addLayout(sizer2) if 'C_CMD' in self.master.fields: sizer2 = qtw.QHBoxLayout() sizer2.addWidget(self.txt_cmd) sizer2.addWidget(self.cmb_commando) sizer1.addLayout(sizer2) try: self.master.reader.layout_extra_fields_topline(self, sizer1) # user exit except AttributeError: shared.log_exc() sizer1.addWidget(self.b_save) sizer1.addWidget(self.b_del) bsizer.addLayout(sizer1) try: test = self.master.reader.layout_extra_fields_nextline except AttributeError: shared.log_exc() else: sizer1 = qtw.QHBoxLayout() self.master.reader.layout_extra_fields_nextline( self, sizer1) # user exit bsizer.addLayout(sizer1) sizer1 = qtw.QHBoxLayout() if 'C_DESC' in self.master.fields: sizer2 = qtw.QVBoxLayout() sizer2.addWidget(self.txt_oms) sizer1.addLayout(sizer2, 2) try: self.master.reader.layout_extra_fields(self, sizer1) # user exit except AttributeError: shared.log_exc() bsizer.addLayout(sizer1) self._box.setLayout(bsizer) sizer.addWidget(self._box)
def __init__(self, parent, master): self.parent = parent self.master = master # self.title = self.master.title self.captions = self.master.captions super().__init__(parent, size=(680, 400), title=self.master.title) self.sizer = wx.BoxSizer(wx.VERTICAL) pnl = wx.Panel(self, style=wx.BORDER_RAISED) vsizer = wx.BoxSizer(wx.VERTICAL) hsizer = wx.BoxSizer(wx.HORIZONTAL) hsizer.Add(wx.StaticText(pnl, label=self.master.captions['S_PLGNAM']), 0, wx.ALIGN_CENTER_VERTICAL) self.t_program = wx.TextCtrl(pnl, size=(260, -1)) self.t_program.SetValue(self.master.book.page.settings[shared.SettType.PLG.value]) hsizer.Add(self.t_program, 0, wx.EXPAND | wx.TOP | wx.LEFT, 5) vsizer.Add(hsizer, 0, wx.EXPAND | wx.LEFT | wx.RIGHT, 5) hsizer = wx.BoxSizer(wx.HORIZONTAL) hsizer.Add(wx.StaticText(pnl, label=self.master.captions['S_PNLNAM']), 0, wx.ALIGN_CENTER_VERTICAL) self.t_title = wx.TextCtrl(pnl, size=(260, -1)) self.t_title.SetValue(self.master.book.page.settings[shared.SettType.PNL.value]) hsizer.Add(self.t_title, 0, wx.EXPAND | wx.LEFT, 5) vsizer.Add(hsizer, 0, wx.EXPAND | wx.LEFT | wx.RIGHT, 5) hsizer = wx.BoxSizer(wx.HORIZONTAL) self.c_rebuild = wx.CheckBox(pnl, label=self.master.captions['T_MAKE'].format( self.master.captions['S_RBLD'])) if self.master.book.page.settings[shared.SettType.RBLD.value] == '1': self.c_rebuild.SetValue(True) hsizer.Add(self.c_rebuild, 0) vsizer.Add(hsizer, 0, wx.LEFT | wx.RIGHT, 5) hsizer = wx.BoxSizer(wx.HORIZONTAL) self.c_showdet = wx.CheckBox(pnl, label=self.master.captions['S_DETS']) try: if self.master.book.page.settings[shared.SettType.DETS.value] == '1': self.c_showdet.SetValue(True) except KeyError: shared.log_exc() hsizer.Add(self.c_showdet) vsizer.Add(hsizer, 0, wx.LEFT | wx.RIGHT, 5) hsizer = wx.BoxSizer(wx.HORIZONTAL) self.c_redef = wx.CheckBox(pnl, label=self.master.captions['T_MAKE'].format( self.master.captions['S_RSAV'])) if self.master.book.page.settings[shared.SettType.RDEF.value] == '1': self.c_redef.SetValue(True) hsizer.Add(self.c_redef) vsizer.Add(hsizer, 0, wx.LEFT | wx.RIGHT | wx.BOTTOM, 5) pnl.SetSizer(vsizer) self.sizer.Add(pnl, 0, wx.EXPAND | wx.ALL, 10) pnl = wx.Panel(self, style=wx.BORDER_RAISED) vsizer = wx.BoxSizer(wx.VERTICAL) text = self.master.captions['T_XTRASET'].format( self.master.book.page.settings[shared.SettType.PNL.value]) hsizer = wx.BoxSizer(wx.HORIZONTAL) hsizer.Add(wx.StaticText(pnl, label=text), 0) vsizer.Add(hsizer, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.LEFT | wx.RIGHT, 5) hsizer = wx.BoxSizer(wx.HORIZONTAL) hsizer.AddSpacer(41) hsizer.Add(wx.StaticText(pnl, label=self.master.captions['C_NAM']), 0) hsizer.AddSpacer(52) hsizer.Add(wx.StaticText(pnl, label=self.master.captions['C_VAL']), 0) vsizer.Add(hsizer, 0) self.scrl = wxsp.ScrolledPanel(pnl, style=wx.BORDER_SIMPLE) # self.scrl = wx.ScrolledWindow(pnl, style=wx.BORDER_SIMPLE) self.gsizer = wx.BoxSizer(wx.VERTICAL) rownum = 0 self.rownum = rownum self.data, self.checks = [], [] for name, value in self.master.book.page.settings.items(): if name not in shared.csv_settingnames and name != 'extra': try: desc = self.master.book.page.settings['extra'][name] except KeyError: desc = '' self.add_row(name, value, desc) self.rows_present = self.rownum # size = self.rownum or 1 # if self.rownum < 2: # self.scrl.SetSize(500, 75) # elif self.rownum > 5: # self.scrl.SetSize(500, 200) # else: # self.scrl.Fit() self.scrl.SetSizer(self.gsizer) self.gsizer.Fit(self.scrl) self.gsizer.SetSizeHints(self.scrl) self.scrl.SetupScrolling() vsizer.Add(self.scrl, 1, wx.EXPAND | wx.ALL, 5) # sizer.Add(self.scrl, 1, wx.ALL, 5) hsizer = wx.BoxSizer(wx.HORIZONTAL) btn = wx.Button(pnl, label=self.master.captions['C_ADDSET']) btn.Bind(wx.EVT_BUTTON, self.add_setting) hsizer.Add(btn) btn = wx.Button(pnl, label=self.master.captions['C_REMSET']) btn.Bind(wx.EVT_BUTTON, self.remove_settings) hsizer.Add(btn) vsizer.Add(hsizer, 0, wx.ALIGN_CENTER_HORIZONTAL) pnl.SetSizer(vsizer) self.sizer.Add(pnl, 1, wx.EXPAND | wx.ALL, 10) hbox = wx.BoxSizer(wx.HORIZONTAL) hbox.Add(wx.Button(self, id=wx.ID_OK)) hbox.Add(wx.Button(self, id=wx.ID_CANCEL)) self.sizer.Add(hbox, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.BOTTOM, 2) # if self.rownum > 3: self.sizer.SetSizeHints(self) self.SetSizer(self.sizer)