我们从Python开源项目中,提取了以下50个代码示例,用于说明如何使用wx.ComboBox()。
def initMethod(self): methodControlBox = widgets.ControlBox(self, label='Method', orient=wx.VERTICAL) self.methodComboBox = wx.ComboBox(self, value=self.pg.method, style=wx.CB_READONLY, choices=('Welch Power', 'Autoregressive')) self.Bind(wx.EVT_COMBOBOX, self.setMethod, self.methodComboBox) self.offlineControls += [self.methodComboBox] methodControlBox.Add(self.methodComboBox, proportion=0, flag=wx.ALL | wx.EXPAND, border=10) self.sizer.Add(methodControlBox, proportion=0, flag=wx.LEFT | wx.BOTTOM | wx.RIGHT | wx.EXPAND, border=10) self.methodConfigSizer = wx.BoxSizer(orient=wx.VERTICAL) self.welchPanel = WelchConfigPanel(self, pg=self.pg, cp=self) self.methodConfigSizer.Add(self.welchPanel, proportion=1, flag=wx.EXPAND) self.autoregPanel = AutoregConfigPanel(self, pg=self.pg, cp=self) self.methodConfigSizer.Add(self.autoregPanel, proportion=1, flag=wx.EXPAND) self.sizer.Add(self.methodConfigSizer, proportion=1, flag=wx.EXPAND) self.methodConfig = self.welchPanel
def initOptions(self): optionsSizer = wx.BoxSizer(wx.HORIZONTAL) kernTypeControlBox = widgets.ControlBox(self, label='Kernel Type', orient=wx.HORIZONTAL) self.kernTypeComboBox = wx.ComboBox(self, choices=self.flt.kernMap.keys(), value=self.flt.kernType, style=wx.CB_DROPDOWN) self.Bind(wx.EVT_COMBOBOX, self.setKernType, self.kernTypeComboBox) kernTypeControlBox.Add(self.kernTypeComboBox, proportion=1, flag=wx.ALL, border=8) optionsSizer.Add(kernTypeControlBox, proportion=1, flag=wx.ALL | wx.ALIGN_CENTER, border=8) widthControlBox = widgets.ControlBox(self, label='Width', orient=wx.HORIZONTAL) self.widthSpinCtrl = wx.SpinCtrl(self, value=str(self.flt.width), min=2, max=100) self.Bind(wx.EVT_SPINCTRL, self.setWidth, self.widthSpinCtrl) widthControlBox.Add(self.widthSpinCtrl, proportion=1, flag=wx.ALL, border=8) optionsSizer.Add(widthControlBox, proportion=0, flag=wx.TOP | wx.RIGHT | wx.BOTTOM | wx.EXPAND, border=8) self.sizer.Add(optionsSizer, proportion=0)#, flag=wx.EXPAND)
def initOptions(self): STransConfigPanel.initOptions(self) optionsSizer = wx.BoxSizer(wx.HORIZONTAL) kurtosisControlBox = widgets.ControlBox(self, label='Kurtosis', orient=wx.VERTICAL) self.kurtosisComboBox = wx.ComboBox(self, choices=('Adapt', 'Sub', 'Super'), value=self.flt.kurtosis, style=wx.CB_DROPDOWN) self.Bind(wx.EVT_COMBOBOX, self.setKurtosis, self.kurtosisComboBox) kurtosisControlBox.Add(self.kurtosisComboBox, proportion=1, flag=wx.ALL, border=8) optionsSizer.Add(kurtosisControlBox, proportion=1, flag=wx.LEFT | wx.RIGHT, border=8) maxIterControlBox = widgets.ControlBox(self, label='Max Iter.', orient=wx.HORIZONTAL) self.maxIterSpinCtrl = wx.SpinCtrl(self, value=str(self.flt.maxIter), min=50, max=3500) self.Bind(wx.EVT_SPINCTRL, self.setMaxIter, self.maxIterSpinCtrl) maxIterControlBox.Add(self.maxIterSpinCtrl, proportion=1, flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=8) optionsSizer.Add(maxIterControlBox, proportion=0, flag=wx.RIGHT | wx.EXPAND, border=8) #lrControlBox = widgets.ControlBox(self, label='Learning Rate.', orient=wx.HORIZONTAL) self.sizer.Add(optionsSizer, proportion=0)
def __init__(self, *args, **kwds): # begin wxGlade: LogicalVolumeDialog.__init__ wx.Dialog.__init__(self, *args, **kwds) self.panel_1 = wx.Panel(self, wx.ID_ANY) self.panel_4 = wx.Panel(self, wx.ID_ANY) self.label_1 = wx.StaticText(self, wx.ID_ANY, _("Select Logical Volume: "), style=wx.ALIGN_CENTER_HORIZONTAL) self.panel_7 = wx.Panel(self, wx.ID_ANY) self.combo_logical_volumes = wx.ComboBox(self, wx.ID_ANY, choices=[], style=wx.CB_DROPDOWN) self.panel_8 = wx.Panel(self, wx.ID_ANY) self.panel_3 = wx.Panel(self, wx.ID_ANY) self.panel_5 = wx.Panel(self, wx.ID_ANY) self.button_select = wx.Button(self, wx.ID_OK, _("Select")) self.panel_9 = wx.Panel(self, wx.ID_ANY) self.button_cancel = wx.Button(self, wx.ID_CANCEL, _("Cancel")) self.panel_6 = wx.Panel(self, wx.ID_ANY) self.panel_2 = wx.Panel(self, wx.ID_ANY) self.__set_properties() self.__do_layout() self.Bind(wx.EVT_BUTTON, self.button_select_click, id=wx.ID_OK) self.Bind(wx.EVT_BUTTON, self.button_cancel_click, id=wx.ID_CANCEL) # end wxGlade self.PopulateVolumes()
def __init__(self,parent,**kwargs): wx.Panel.__init__(self,parent,**kwargs) self.componenttitle = wx.StaticText(self,-1,label='Component',size=(100,-1)) self.componentcombobox = wx.ComboBox(self, size=(10,-1), value='0') choices = ['0','1','2'] self.normaltitle = wx.StaticText(self,-1,label='Normal', size=(100,-1)) self.normalcombobox = wx.ComboBox(self, choices=choices, size=(10,-1), value='0') grid = wx.GridBagSizer(hgap=3) grid.Add(self.componenttitle, (0,0), flag=wx.EXPAND) grid.Add(self.componentcombobox, (1,0), flag=wx.EXPAND) grid.Add(self.normaltitle, (0,1), flag=wx.EXPAND) grid.Add(self.normalcombobox, (1,1), flag=wx.EXPAND) grid.AddGrowableCol(0) grid.AddGrowableCol(1) self.SetSizer(grid)
def GetTransitionType(self): """ Return type selected for SFC transition and associated value @return: Type selected and associated value (None if no value) """ # Go through radio buttons and return type and value associated to the # one that is selected for type, (radio, control) in self.TypeRadioButtons.iteritems(): if radio.GetValue(): if isinstance(control, wx.ComboBox): return type, control.GetStringSelection() elif isinstance(control, wx.TextCtrl): return type, control.GetValue() else: return type, None return None, None
def ClearHighlights(self, highlight_type=None): if highlight_type is None: self.Highlights = [] else: self.Highlights = [(infos, start, end, highlight) for (infos, start, end, highlight) in self.Highlights if highlight != highlight_type] for control in self.HighlightControls.itervalues(): if isinstance(control, (wx.ComboBox, wx.SpinCtrl)): control.SetBackgroundColour(wx.NullColour) control.SetForegroundColour(wx.NullColour) elif isinstance(control, wx.TextCtrl): value = control.GetValue() control.SetStyle(0, len(value), wx.TextAttr(wx.NullColour)) elif isinstance(control, wx.gizmos.EditableListBox): listctrl = control.GetListCtrl() for i in xrange(listctrl.GetItemCount()): listctrl.SetItemBackgroundColour(i, wx.NullColour) listctrl.SetItemTextColour(i, wx.NullColour) self.StructureElementsTable.ClearHighlights(highlight_type) self.RefreshView()
def ShowHighlights(self): type_infos = self.Controler.GetDataTypeInfos(self.TagName) for infos, start, end, highlight_type in self.Highlights: if infos[0] == "struct": self.StructureElementsTable.AddHighlight(infos[1:], highlight_type) else: control = self.HighlightControls.get((type_infos["type"], infos[0]), None) if control is not None: if isinstance(control, (wx.ComboBox, wx.SpinCtrl)): control.SetBackgroundColour(highlight_type[0]) control.SetForegroundColour(highlight_type[1]) elif isinstance(control, wx.TextCtrl): control.SetStyle(start[1], end[1] + 1, wx.TextAttr(highlight_type[1], highlight_type[0])) elif isinstance(control, wx.gizmos.EditableListBox): listctrl = control.GetListCtrl() listctrl.SetItemBackgroundColour(infos[1], highlight_type[0]) listctrl.SetItemTextColour(infos[1], highlight_type[1]) listctrl.Select(listctrl.FocusedItem, False)
def onSave(self, event): """ Saves values to disk """ for name in self.widgetNames: widget = wx.FindWindowByName(name) if isinstance(widget, wx.ComboBox): selection = widget.GetValue() choices = widget.GetItems() choices.insert(0, selection) self.widgetNames[name] = choices else: value = widget.GetValue() self.widgetNames[name] = value self.config.write() self.EndModal(0)
def __init__(self): wx.Frame.__init__(self, None, title="Tutorial") panel = wx.Panel(self, wx.ID_ANY) cars = [Car(0, "Ford", "F-150", "2008"), Car(1, "Chevrolet", "Camaro", "2010"), Car(2, "Nissan", "370Z", "2005")] sampleList = [] self.cb = wx.ComboBox(panel, size=wx.DefaultSize, choices=sampleList) self.widgetMaker(self.cb, cars) sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(self.cb, 0, wx.ALL, 5) panel.SetSizer(sizer)
def addStaticBoxWithLabels(self): boxSizerH = wx.BoxSizer(wx.HORIZONTAL) staticBox = wx.StaticBox( self.panel, -1, "Labels within a Frame" ) staticBoxSizerV = wx.StaticBoxSizer( staticBox, wx.VERTICAL ) boxSizerV = wx.BoxSizer( wx.VERTICAL ) staticText1 = wx.StaticText( self.panel, -1, " Choose a number:" ) boxSizerV.Add( staticText1, 0, wx.ALL) staticText2 = wx.StaticText( self.panel, -1, " Label 2") boxSizerV.Add( staticText2, 0, wx.ALL ) #------------------------------------------------------ staticBoxSizerV.Add( boxSizerV, 0, wx.ALL ) boxSizerH.Add(staticBoxSizerV) #------------------------------------------------------ boxSizerH.Add(wx.ComboBox(self.panel, size=(70, -1))) #------------------------------------------------------ boxSizerH.Add(wx.SpinCtrl(self.panel, size=(50, -1), style=wx.BORDER_RAISED)) # Add local boxSizer to main frame self.statBoxSizerV.Add( boxSizerH, 1, wx.ALL ) #----------------------------------------------------------
def __init__(self, parent, columns, df_list_ctrl, change_callback): wx.Panel.__init__(self, parent) columns_with_neutral_selection = [''] + list(columns) self.columns = columns self.df_list_ctrl = df_list_ctrl self.change_callback = change_callback self.num_filters = 10 self.main_sizer = wx.BoxSizer(wx.VERTICAL) self.combo_boxes = [] self.text_controls = [] for i in range(self.num_filters): combo_box = wx.ComboBox(self, choices=columns_with_neutral_selection, style=wx.CB_READONLY) text_ctrl = wx.TextCtrl(self, wx.ID_ANY, '') self.Bind(wx.EVT_COMBOBOX, self.on_combo_box_select) self.Bind(wx.EVT_TEXT, self.on_text_change) row_sizer = wx.BoxSizer(wx.HORIZONTAL) row_sizer.Add(combo_box, 0, wx.ALL, 5) row_sizer.Add(text_ctrl, 1, wx.ALL | wx.EXPAND | wx.ALIGN_RIGHT, 5) self.combo_boxes.append(combo_box) self.text_controls.append(text_ctrl) self.main_sizer.Add(row_sizer, 0, wx.EXPAND) self.SetSizer(self.main_sizer)
def __init__(self, parent, columns, df_list_ctrl): wx.Panel.__init__(self, parent) columns_with_neutral_selection = [''] + list(columns) self.columns = columns self.df_list_ctrl = df_list_ctrl self.figure = Figure(facecolor="white", figsize=(1, 1)) self.axes = self.figure.add_subplot(111) self.canvas = FigureCanvas(self, -1, self.figure) chart_toolbar = NavigationToolbar2Wx(self.canvas) self.combo_box1 = wx.ComboBox(self, choices=columns_with_neutral_selection, style=wx.CB_READONLY) self.Bind(wx.EVT_COMBOBOX, self.on_combo_box_select) row_sizer = wx.BoxSizer(wx.HORIZONTAL) row_sizer.Add(self.combo_box1, 0, wx.ALL | wx.ALIGN_CENTER, 5) row_sizer.Add(chart_toolbar, 0, wx.ALL, 5) sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(self.canvas, 1, flag=wx.EXPAND, border=5) sizer.Add(row_sizer) self.SetSizer(sizer)
def __init__(self, parent, columns, df_list_ctrl): wx.Panel.__init__(self, parent) columns_with_neutral_selection = [''] + list(columns) self.columns = columns self.df_list_ctrl = df_list_ctrl self.figure = Figure(facecolor="white", figsize=(1, 1)) self.axes = self.figure.add_subplot(111) self.canvas = FigureCanvas(self, -1, self.figure) chart_toolbar = NavigationToolbar2Wx(self.canvas) self.combo_box1 = wx.ComboBox(self, choices=columns_with_neutral_selection, style=wx.CB_READONLY) self.combo_box2 = wx.ComboBox(self, choices=columns_with_neutral_selection, style=wx.CB_READONLY) self.Bind(wx.EVT_COMBOBOX, self.on_combo_box_select) row_sizer = wx.BoxSizer(wx.HORIZONTAL) row_sizer.Add(self.combo_box1, 0, wx.ALL | wx.ALIGN_CENTER, 5) row_sizer.Add(self.combo_box2, 0, wx.ALL | wx.ALIGN_CENTER, 5) row_sizer.Add(chart_toolbar, 0, wx.ALL, 5) sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(self.canvas, 1, flag=wx.EXPAND, border=5) sizer.Add(row_sizer) self.SetSizer(sizer)
def initMethod(self): methodControlBox = widgets.ControlBox(self, label='Method', orient=wx.VERTICAL) self.methodComboBox = wx.ComboBox(self, value=self.pg.method, style=wx.CB_READONLY, choices=('Welch Power', 'Autoregressive', 'Time Embedded Net', 'Convolutional Net')) self.Bind(wx.EVT_COMBOBOX, self.setMethod, self.methodComboBox) self.offlineControls += [self.methodComboBox] methodControlBox.Add(self.methodComboBox, proportion=0, flag=wx.ALL | wx.EXPAND, border=10) self.sizer.Add(methodControlBox, proportion=0, flag=wx.LEFT | wx.BOTTOM | wx.RIGHT | wx.EXPAND, border=10) self.methodConfigSizer = wx.BoxSizer(orient=wx.VERTICAL) self.welchPanel = WelchConfigPanel(self, pg=self.pg, cp=self) self.methodConfigSizer.Add(self.welchPanel, proportion=1, flag=wx.EXPAND) self.autoregPanel = AutoregConfigPanel(self, pg=self.pg, cp=self) self.methodConfigSizer.Add(self.autoregPanel, proportion=1, flag=wx.EXPAND) self.tdeNetPanel = ConvNetConfigPanel(self, pg=self.pg, cp=self) self.methodConfigSizer.Add(self.tdeNetPanel, proportion=1, flag=wx.EXPAND) self.convNetPanel = ConvNetConfigPanel(self, pg=self.pg, cp=self) self.methodConfigSizer.Add(self.convNetPanel, proportion=1, flag=wx.EXPAND) self.sizer.Add(self.methodConfigSizer, proportion=1, flag=wx.EXPAND) self.methodConfig = self.welchPanel
def initClassifierKind(self): classifierKindControlBox = widgets.ControlBox(self, label='Classifier', orient=wx.VERTICAL) self.classifierKindComboBox = wx.ComboBox(self, value=self.pg.classifierKind, style=wx.CB_READONLY, choices=self.pg.classifierChoices) self.Bind(wx.EVT_COMBOBOX, self.setClassifierKind, self.classifierKindComboBox) self.offlineControls += [self.classifierKindComboBox] classifierKindControlBox.Add(self.classifierKindComboBox, proportion=0, flag=wx.ALL | wx.EXPAND, border=10) self.sizer.Add(classifierKindControlBox, proportion=0, flag=wx.LEFT | wx.BOTTOM | wx.RIGHT | wx.EXPAND, border=10)
def initClassifier(self): classifierKindControlBox = widgets.ControlBox(self, label='Classifier', orient=wx.VERTICAL) self.classifierKindComboBox = wx.ComboBox(self, value=self.pg.classifierKind, style=wx.CB_READONLY, choices=self.pg.classifierChoices) self.Bind(wx.EVT_COMBOBOX, self.setClassifierKind, self.classifierKindComboBox) self.offlineControls += [self.classifierKindComboBox] classifierKindControlBox.Add(self.classifierKindComboBox, proportion=0, flag=wx.ALL | wx.EXPAND, border=10) self.sizer.Add(classifierKindControlBox, proportion=0, flag=wx.LEFT | wx.BOTTOM | wx.RIGHT | wx.EXPAND, border=10)
def initClassifierKind(self): classifierControlBox = widgets.ControlBox(self, label='Classifier', orient=wx.VERTICAL) self.classifierKindComboBox = wx.ComboBox(self, value=self.pg.classifierKind, style=wx.CB_READONLY, choices=self.pg.classifierChoices) self.Bind(wx.EVT_COMBOBOX, self.setClassifier, self.classifierKindComboBox) self.offlineControls += [self.classifierKindComboBox] classifierControlBox.Add(self.classifierKindComboBox, proportion=0, flag=wx.ALL | wx.EXPAND, border=10) self.sizer.Add(classifierControlBox, proportion=0, flag=wx.LEFT | wx.BOTTOM | wx.RIGHT | wx.EXPAND, border=10)
def initClassifier(self): classifierKindControlBox = widgets.ControlBox(self, label='Classifier', orient=wx.VERTICAL) self.classifierKindComboBox = wx.ComboBox(self, value=self.pg.classifierKind.upper(), style=wx.CB_READONLY, choices=('LDA', 'NN')) self.Bind(wx.EVT_COMBOBOX, self.setClassifierKind, self.classifierKindComboBox) self.offlineControls += [self.classifierKindComboBox] classifierKindControlBox.Add(self.classifierKindComboBox, proportion=0, flag=wx.ALL | wx.EXPAND, border=10) self.sizer.Add(classifierKindControlBox, proportion=0, flag=wx.LEFT | wx.BOTTOM | wx.RIGHT | wx.EXPAND, border=10)
def initSigControls(self): """Initialize signal controls. """ sigSizer = wx.BoxSizer(orient=wx.VERTICAL) distControlBox = widgets.ControlBox(self, label='Distribution', orient=wx.VERTICAL) self.distComboBox = wx.ComboBox(self, choices=list(distributions.keys()), value='uniform', style=wx.CB_SORT | wx.CB_READONLY) self.distComboBox.Bind(wx.EVT_COMBOBOX, self.setDist, self.distComboBox) distControlBox.Add(self.distComboBox, proportion=0, flag=wx.ALL, border=10) self.walkCheckBox = wx.CheckBox(self, label='Walk') self.walkCheckBox.Bind(wx.EVT_CHECKBOX, self.setWalk, self.walkCheckBox) distControlBox.Add(self.walkCheckBox, proportion=0, flag=wx.LEFT | wx.BOTTOM | wx.RIGHT, border=10) sigSizer.Add(distControlBox, proportion=0, flag=wx.ALL, border=10) scaleControlBox = widgets.ControlBox(self, label='Scale', orient=wx.HORIZONTAL) self.scaleText = wx.StaticText(self, label='%4.1f' % 1.0) scaleTextSizer = wx.BoxSizer(orient=wx.VERTICAL) scaleTextSizer.Add(self.scaleText, proportion=1, flag=wx.EXPAND) self.scaleSlider = wx.Slider(self, style=wx.SL_HORIZONTAL, value=10, minValue=1, maxValue=300) self.Bind(wx.EVT_SLIDER, self.setScale, self.scaleSlider) scaleControlBox.Add(scaleTextSizer, proportion=0, flag=wx.ALL, border=10) scaleControlBox.Add(self.scaleSlider, proportion=1, flag=wx.ALL | wx.EXPAND, border=10) sigSizer.Add(scaleControlBox, proportion=0, flag=wx.EXPAND | wx.LEFT | wx.BOTTOM | wx.RIGHT, border=10) self.sizer.Add(sigSizer)
def initOptions(self): optionsSizer = wx.BoxSizer(wx.HORIZONTAL) self.filtTypeComboBox = wx.ComboBox(self, choices=self.flt.filtMap.keys(), value=self.flt.filtType, style=wx.CB_DROPDOWN) self.Bind(wx.EVT_COMBOBOX, self.setFiltType, self.filtTypeComboBox) optionsSizer.Add(self.filtTypeComboBox, proportion=1, flag=wx.LEFT | wx.TOP | wx.RIGHT | wx.ALIGN_CENTER, border=20) self.sizer.Add(optionsSizer, proportion=0)#, flag=wx.EXPAND)
def InitUI(self): # these need to be set by whoever calls the dialog box before it's created device = config_ctrl_pnl.device_toedit gpio = config_ctrl_pnl.gpio_toedit wiring = config_ctrl_pnl.wiring_toedit # draw the pannel pnl = wx.Panel(self) wx.StaticText(self, label='Device GPIO Config', pos=(20, 10)) #background image png = wx.Image('./relaydialogue.png', wx.BITMAP_TYPE_ANY).ConvertToBitmap() wx.StaticBitmap(self, -1, png, (0, 0), (png.GetWidth(), png.GetHeight())) # devices combo box switch_list = self.list_switch_scripts() unlinked_devices = self.list_unused_devices(switch_list) wx.StaticText(self, label='Device;', pos=(20, 50)) self.devices_combo = wx.ComboBox(self, choices = unlinked_devices, pos=(90,50), size=(175, 25)) self.devices_combo.SetValue(device) # gpio text box wx.StaticText(self, label='GPIO', pos=(10, 100)) self.gpio_tc = wx.TextCtrl(self, pos=(56, 98), size=(40, 25)) self.gpio_tc.SetValue(gpio) self.gpio_tc.Bind(wx.EVT_CHAR, self.onChar) #limit to valid gpio numbers # wiring direction combo box wiring_choices = ['low', 'high'] wx.StaticText(self, label='Wiring side;', pos=(100, 100)) self.wiring_combo = wx.ComboBox(self, choices = wiring_choices, pos=(200,98), size=(110, 25)) self.wiring_combo.SetValue(wiring) #Buttom Row of Buttons okButton = wx.Button(self, label='Ok', pos=(200, 250)) closeButton = wx.Button(self, label='Cancel', pos=(300, 250)) okButton.Bind(wx.EVT_BUTTON, self.set_new_gpio_link) closeButton.Bind(wx.EVT_BUTTON, self.OnClose)
def __init__( self, parent ): wx.Panel.__init__ ( self, parent, id = wx.ID_ANY, pos = (0, 190), size = wx.Size( 285,35 ), style = wx.TAB_TRAVERSAL ) self.SetBackgroundColour((230,200,170)) #TESTING ONLY REMOVE WHEN SIZING IS DONE AND ALL THAT BUSINESS view_opts = ['System Config', 'Pigrow Setup', 'Camera Config', 'Cron Timing', 'multi-script', 'Local Files', 'Timelapse', 'Graphs', 'Live View', 'pieye watcher'] #Showing only completed tabs view_opts = ['System Config', 'Pigrow Setup', 'Cron Timing', 'Local Files'] self.view_cb = wx.ComboBox(self, choices = view_opts, pos=(10,2), size=(265, 30)) self.view_cb.Bind(wx.EVT_COMBOBOX, self.view_combo_go)
def update_current_search_tab(self): sizer = self.current_sizer sizer.Clear(True) sizer.RemoveGrowableRow(0) sizer.RemoveGrowableRow(1) sizer.RemoveGrowableCol(0) sizer.RemoveGrowableCol(2) if( len(self.current_search) == 0 ): sizer.AddGrowableRow(0) sizer.AddGrowableCol(0) sizer.Add(wx.StaticText(parent=self.current_tab,label="There are no search items."),flag=wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL,pos=(0,0)) else: sizer.AddGrowableCol(2) for i in range(len(self.current_search)): if i%2 == 0: not_box = wx.ComboBox(parent=self.current_tab,value=self.current_search[i][0],choices=['','not'],style=wx.CB_READONLY,size=(60,-1),id=i/2) not_box.Bind(wx.EVT_COMBOBOX,self.not_search_item) sizer.Add(not_box,pos=(i,0),flag=wx.ALIGN_LEFT|wx.TOP,border=5) key = self.current_search[i][1] value = self.current_search[i][2] sizer.Add(wx.StaticText(parent=self.current_tab,label=key+" = '"+value+"'"),pos=(i,1),flag=wx.TOP|wx.LEFT|wx.ALIGN_LEFT|wx.ALIGN_CENTER_VERTICAL,border=5) removeButton = wx.Button(self.current_tab,label='Remove',id=i/2) removeButton.Bind(wx.EVT_BUTTON,self.remove_search_item) sizer.Add(removeButton,pos=(i,2),flag=wx.ALIGN_RIGHT|wx.TOP,border=5) else: and_or_box = wx.ComboBox(parent=self.current_tab,value=self.current_search[i],choices=['and','or'],style=wx.CB_READONLY,size=(60,-1),id=(i-1)/2) and_or_box.Bind(wx.EVT_COMBOBOX,self.and_or_search_item) sizer.Add(and_or_box,pos=(i,0),flag=wx.ALIGN_LEFT|wx.TOP,border=5) self.current_tab.EnableScrolling(x_scrolling=True,y_scrolling=True) self.current_tab.SetScrollbars(20,20,10,10) self.current_tab.Fit()
def SetValues(self, values): """ Set default SFC transition parameters @param values: Transition parameters values """ # Extract transition value according to type type_value = values.get("value", None) # For each parameters defined, set corresponding control value for name, value in values.items(): # Parameter is SFC transition priority if name == "priority": self.Priority.SetValue(values["priority"]) # Parameter is SFC transition type elif name == "type": for type, (radio, control) in self.TypeRadioButtons.iteritems(): radio.SetValue(type == value) if control is not None: # Enable associated control to type and set value control.Enable(type == value) if type == value: if isinstance(control, wx.ComboBox): control.SetStringSelection(type_value) elif isinstance(control, wx.TextCtrl): control.ChangeValue(type_value) # Refresh preview panel self.RefreshPreview()
def __init__(self, parent): wx.Dialog.__init__(self, parent, title=_('Create a new action')) main_sizer = wx.FlexGridSizer(cols=1, hgap=0, rows=2, vgap=10) main_sizer.AddGrowableCol(0) main_sizer.AddGrowableRow(0) infos_sizer = wx.FlexGridSizer(cols=2, hgap=5, rows=3, vgap=15) infos_sizer.AddGrowableCol(1) main_sizer.AddSizer(infos_sizer, border=20, flag=wx.GROW | wx.TOP | wx.LEFT | wx.RIGHT) actionname_label = wx.StaticText(self, label=_('Action Name:')) infos_sizer.AddWindow(actionname_label, border=4, flag=wx.ALIGN_CENTER_VERTICAL | wx.TOP) self.ActionName = wx.TextCtrl(self, size=wx.Size(180, -1)) infos_sizer.AddWindow(self.ActionName, flag=wx.GROW) language_label = wx.StaticText(self, label=_('Language:')) infos_sizer.AddWindow(language_label, border=4, flag=wx.ALIGN_CENTER_VERTICAL | wx.TOP) self.Language = wx.ComboBox(self, style=wx.CB_READONLY) infos_sizer.AddWindow(self.Language, flag=wx.GROW) button_sizer = self.CreateButtonSizer(wx.OK | wx.CANCEL | wx.CENTRE) self.Bind(wx.EVT_BUTTON, self.OnOK, button_sizer.GetAffirmativeButton()) main_sizer.AddSizer(button_sizer, border=20, flag=wx.ALIGN_RIGHT | wx.BOTTOM | wx.LEFT | wx.RIGHT) self.SetSizer(main_sizer) for option in GetActionLanguages(): self.Language.Append(_(option)) self.Fit() self.PouNames = [] self.PouElementNames = []
def __init__(self, parent): wx.Dialog.__init__(self, parent, title=_('Create a new transition')) main_sizer = wx.FlexGridSizer(cols=1, hgap=0, rows=2, vgap=10) main_sizer.AddGrowableCol(0) main_sizer.AddGrowableRow(0) infos_sizer = wx.FlexGridSizer(cols=2, hgap=5, rows=3, vgap=10) infos_sizer.AddGrowableCol(1) main_sizer.AddSizer(infos_sizer, border=20, flag=wx.GROW | wx.TOP | wx.LEFT | wx.RIGHT) transitionname_label = wx.StaticText(self, label=_('Transition Name:')) infos_sizer.AddWindow(transitionname_label, border=4, flag=wx.ALIGN_CENTER_VERTICAL | wx.TOP) self.TransitionName = wx.TextCtrl(self, size=wx.Size(180, -1)) infos_sizer.AddWindow(self.TransitionName, flag=wx.GROW) language_label = wx.StaticText(self, label=_('Language:')) infos_sizer.AddWindow(language_label, border=4, flag=wx.ALIGN_CENTER_VERTICAL | wx.TOP) self.Language = wx.ComboBox(self, style=wx.CB_READONLY) infos_sizer.AddWindow(self.Language, flag=wx.GROW) button_sizer = self.CreateButtonSizer(wx.OK | wx.CANCEL | wx.CENTRE) self.Bind(wx.EVT_BUTTON, self.OnOK, button_sizer.GetAffirmativeButton()) main_sizer.AddSizer(button_sizer, border=20, flag=wx.ALIGN_RIGHT | wx.BOTTOM) self.SetSizer(main_sizer) for language in GetTransitionLanguages(): self.Language.Append(_(language)) self.Fit() self.PouNames = [] self.PouElementNames = []
def OnSelectAllMenu(self, event): control = self.FindFocus() if control is not None and control.GetName() == "Viewer": control.Parent.SelectAll() elif isinstance(control, wx.stc.StyledTextCtrl): control.SelectAll() elif isinstance(control, wx.TextCtrl): control.SetSelection(0, control.GetLastPosition()) elif isinstance(control, wx.ComboBox): control.SetMark(0, control.GetLastPosition() + 1)
def __init__(self, *args, **kwds): # begin wxGlade: working_days.__init__ kwds["style"] = wx.CAPTION | wx.CLOSE_BOX | wx.MINIMIZE_BOX wx.Frame.__init__(self, *args, **kwds) self.label_1 = wx.StaticText(self, -1, "Year") self.combo_box_1 = wx.ComboBox(self, -1, choices=[ ], style=wx.CB_DROPDOWN | wx.CB_DROPDOWN | wx.CB_READONLY) self.label_5 = wx.StaticText(self, -1, "Total Working Days") self.label_2 = wx.StaticText(self, -1, " Term I") self.text_ctrl_1 = wx.TextCtrl(self, -1, "") self.label_3 = wx.StaticText(self, -1, "Term II") self.text_ctrl_2 = wx.TextCtrl(self, -1, "") self.label_4 = wx.StaticText(self, -1, "Final") self.text_ctrl_3 = wx.TextCtrl(self, -1, "") self.button_1 = wx.Button(self, -1, "Cancel") self.button_2 = wx.Button(self, -1, "Save") self.button_2.Enabled=False self.combo_box_1.SetSelection(0) self.DB=db_operations() self.__set_properties() self.__do_layout() self.YEAR='Select' self.Bind(wx.EVT_COMBOBOX, self.OnCombo, self.combo_box_1) self.Bind(wx.EVT_BUTTON, self.OnCancel, self.button_1) self.Bind(wx.EVT_BUTTON, self.OnSave, self.button_2) self.load_year() self.OnLoad() # end wxGlade
def __init__(self, *args, **kwds): # begin wxGlade: Login.__init__ kwds["style"] = wx.ICONIZE | wx.CAPTION | wx.MINIMIZE | wx.CLOSE_BOX | wx.MINIMIZE_BOX wx.Frame.__init__(self, *args, **kwds) self.label_1 = wx.StaticText(self, -1, "Username") self.combo_box_1 = wx.ComboBox(self, -1, choices=["Select", "admin", "teacher"], style=wx.CB_DROPDOWN) self.label_2 = wx.StaticText(self, -1, "Password") self.text_ctrl_1 = wx.TextCtrl(self, -1, "", style=wx.TE_PROCESS_TAB | wx.TE_PASSWORD) self.button_1 = wx.Button(self, -1, "Cancel") self.button_2 = wx.Button(self, -1, "Login") self.__set_properties() self.__do_layout() self.Bind(wx.EVT_COMBOBOX, self.OnCombo_Change, self.combo_box_1) self.Bind(wx.EVT_BUTTON, self.OnCancel_Click, self.button_1) self.Bind(wx.EVT_BUTTON, self.OnLogin_Click, self.button_2) self.Bind(wx.EVT_TEXT,self.OnText_Change,self.text_ctrl_1) #self.Bind(wx.EVT_KEY_DOWN,self.OnKeyPress,self.text_ctrl_1) self.Bind(wx.EVT_CLOSE,self.on_close,self) self.text_ctrl_1.Bind(wx.EVT_KEY_DOWN, self.OnKeyPress) self.UO=user_operations(self) # DB Connection obj # end wxGlade
def __init__(self, *args, **kwds): # begin wxGlade: delete.__init__ kwds["style"] = wx.MAXIMIZE | wx.CLOSE_BOX | wx.THICK_FRAME|wx.CAPTION wx.Dialog.__init__(self, *args, **kwds) self.panel_2 = wx.ScrolledWindow(self, -1, style=wx.TAB_TRAVERSAL) self.label_1 = wx.StaticText(self.panel_2, -1, "Specify Class") self.combo_box_1 = wx.ComboBox(self.panel_2, -1, choices=[], style=wx.CB_DROPDOWN | wx.CB_READONLY ) self.combo_box_2 = wx.ComboBox(self.panel_2, -1, choices=["Select Standard", "8", "9", "10"], style=wx.CB_DROPDOWN | wx.CB_READONLY ) self.combo_box_3 = wx.ComboBox(self.panel_2, -1, choices=['Select Division'], style=wx.CB_DROPDOWN | wx.CB_READONLY ) self.static_line_2 = wx.StaticLine(self.panel_2, -1) self.panel_1 = wx.Panel(self.panel_2, -1) self.check_list_box_1 = wx.CheckListBox(self.panel_1, -1, (60, 50), (30,30), ['Admission No Name']) self.check_list_box_2 = wx.CheckListBox(self.panel_1, -1, (60, 50), wx.DefaultSize, []) self.button_close = wx.Button(self.panel_2, -1, "Close") self.button_proceed = wx.Button(self.panel_2, -1, "Proceed") self.__set_properties() self.__do_layout() self.Bind(wx.EVT_COMBOBOX, self.oncombo_year, self.combo_box_1) self.Bind(wx.EVT_COMBOBOX, self.oncombo_class, self.combo_box_2) self.Bind(wx.EVT_COMBOBOX, self.oncombo_div, self.combo_box_3) self.Bind(wx.EVT_CHECKLISTBOX, self.on_check, self.check_list_box_1) self.Bind(wx.EVT_CHECKLISTBOX, self.on_check_2, self.check_list_box_2) self.Bind(wx.EVT_BUTTON, self.on_close, self.button_close) self.Bind(wx.EVT_BUTTON, self.on_proceed, self.button_proceed) self.checkedItems=() self.DB=db_operations() self.load_year() # end wxGlade
def __init__(self, *args, **kwds): # begin wxGlade: chng_pass.__init__ kwds["style"] = wx.CAPTION | wx.CLOSE_BOX | wx.MINIMIZE_BOX wx.Dialog.__init__(self, *args, **kwds) self.label_3 = wx.StaticText(self, -1, "Username") self.combo_box_1 = wx.ComboBox(self, -1, choices=['Select','admin','teacher'], style=wx.CB_DROPDOWN | wx.CB_SIMPLE | wx.CB_DROPDOWN | wx.CB_READONLY) self.label_4 = wx.StaticText(self, -1, "Current Password") self.text_ctrl_1 = wx.TextCtrl(self, -1, "", style=wx.TE_PASSWORD) self.label_5 = wx.StaticText(self, -1, "New Password") self.text_ctrl_2 = wx.TextCtrl(self, -1, "", style=wx.TE_PASSWORD) self.label_6 = wx.StaticText(self, -1, "Confirm New Password") self.text_ctrl_3 = wx.TextCtrl(self, -1, "", style=wx.TE_PASSWORD) self.button_1 = wx.Button(self, -1, "Cancel") self.button_2 = wx.Button(self, -1, "Save") self.__set_properties() self.__do_layout() self.Bind(wx.EVT_COMBOBOX, self.on_combo, self.combo_box_1) self.Bind(wx.EVT_TEXT, self.on_password_1, self.text_ctrl_1) self.Bind(wx.EVT_TEXT, self.on_password_2, self.text_ctrl_2) self.Bind(wx.EVT_TEXT, self.on_password_3, self.text_ctrl_3) self.Bind(wx.EVT_BUTTON, self.on_cancel, self.button_1) self.Bind(wx.EVT_BUTTON, self.on_save, self.button_2) self.UO=user_operations(self) # end wxGlade
def __init__(self, *args, **kwds): wx.Frame.__init__(self, *args, **kwds) self.icon = wx.Icon("/usr/share/icons/hicolor/128x128/apps/switch-icon.png", wx.BITMAP_TYPE_PNG) self.SetIcon(self.icon) with open(CurrentHosts, "rb") as fp: self.current = fp.read() self.all_hosts = get_all_hosts() self.combo_box_1 = wx.ComboBox(self, wx.ID_ANY, choices = self.all_hosts, style = wx.CB_DROPDOWN) index = 0 try: index = self.all_hosts.index(self.current) except Exception: pass self.combo_box_1.Select(index) self.button_add = wx.Button(self, wx.ID_ANY, "Add") self.button_delete = wx.Button(self, wx.ID_ANY, "Delete") self.button_edit = wx.Button(self, wx.ID_ANY, "Edit") self.button_set = wx.Button(self, wx.ID_ANY, "Set") self.Bind(wx.EVT_BUTTON, self.OnAdd, self.button_add) self.Bind(wx.EVT_BUTTON, self.OnDelete, self.button_delete) self.Bind(wx.EVT_BUTTON, self.OnEdit, self.button_edit) self.Bind(wx.EVT_BUTTON, self.OnSet, self.button_set) self.statusbar = self.CreateStatusBar(1) self.__set_properties() self.__do_layout()
def __init__(self, *args, **kwds): # grab the serial keyword and remove it from the dict self.serial = kwds['serial'] del kwds['serial'] self.show = SHOW_ALL if 'show' in kwds: self.show = kwds.pop('show') # begin wxGlade: SerialConfigDialog.__init__ kwds["style"] = wx.DEFAULT_DIALOG_STYLE wx.Dialog.__init__(self, *args, **kwds) self.label_2 = wx.StaticText(self, -1, "Port") self.choice_port = wx.Choice(self, -1, choices=[]) self.label_1 = wx.StaticText(self, -1, "Baudrate") self.combo_box_baudrate = wx.ComboBox(self, -1, choices=[], style=wx.CB_DROPDOWN) self.sizer_1_staticbox = wx.StaticBox(self, -1, "Basics") self.panel_format = wx.Panel(self, -1) self.label_3 = wx.StaticText(self.panel_format, -1, "Data Bits") self.choice_databits = wx.Choice(self.panel_format, -1, choices=["choice 1"]) self.label_4 = wx.StaticText(self.panel_format, -1, "Stop Bits") self.choice_stopbits = wx.Choice(self.panel_format, -1, choices=["choice 1"]) self.label_5 = wx.StaticText(self.panel_format, -1, "Parity") self.choice_parity = wx.Choice(self.panel_format, -1, choices=["choice 1"]) self.sizer_format_staticbox = wx.StaticBox(self.panel_format, -1, "Data Format") self.panel_timeout = wx.Panel(self, -1) self.checkbox_timeout = wx.CheckBox(self.panel_timeout, -1, "Use Timeout") self.text_ctrl_timeout = wx.TextCtrl(self.panel_timeout, -1, "") self.label_6 = wx.StaticText(self.panel_timeout, -1, "seconds") self.sizer_timeout_staticbox = wx.StaticBox(self.panel_timeout, -1, "Timeout") self.panel_flow = wx.Panel(self, -1) self.checkbox_rtscts = wx.CheckBox(self.panel_flow, -1, "RTS/CTS") self.checkbox_xonxoff = wx.CheckBox(self.panel_flow, -1, "Xon/Xoff") self.sizer_flow_staticbox = wx.StaticBox(self.panel_flow, -1, "Flow Control") self.button_ok = wx.Button(self, wx.ID_OK, "") self.button_cancel = wx.Button(self, wx.ID_CANCEL, "") self.__set_properties() self.__do_layout() # end wxGlade # attach the event handlers self.__attach_events()
def createLayout(self): """ Create widgets and lay them out """ choices = ["is.gd"] if bitlyFlag: choices.append("bit.ly") if tinyURLFlag: choices.append("tinyURL") choices.sort() # create the widgets self.URLCbo = wx.ComboBox(self, wx.ID_ANY, "is.gd", choices=choices, size=wx.DefaultSize, style=wx.CB_DROPDOWN) self.inputURLTxt = wx.TextCtrl(self, value="Paste long URL here") self.inputURLTxt.Bind(wx.EVT_SET_FOCUS, self.onFocus) self.outputURLTxt = wx.TextCtrl(self, style=wx.TE_READONLY) shortenBtn = wx.Button(self, label="Shorten URL") shortenBtn.Bind(wx.EVT_BUTTON, self.onShorten) copyBtn = wx.Button(self, label="Copy to Clipboard") copyBtn.Bind(wx.EVT_BUTTON, self.onCopy) # create the sizers mainSizer = wx.BoxSizer(wx.VERTICAL) btnSizer = wx.BoxSizer(wx.HORIZONTAL) # layout the widgets mainSizer.Add(self.URLCbo, 0, wx.ALL, 5) mainSizer.Add(self.inputURLTxt, 0, wx.ALL|wx.EXPAND, 5) mainSizer.Add(self.outputURLTxt, 0, wx.ALL|wx.EXPAND, 5) btnSizer.Add(shortenBtn, 0, wx.ALL|wx.CENTER, 5) btnSizer.Add(copyBtn, 0, wx.ALL|wx.CENTER, 5) mainSizer.Add(btnSizer, 0, wx.ALL|wx.CENTER, 5) self.SetSizer(mainSizer)
def create_wxwindow(self): return self.initfn(wx.ComboBox)(self.parent, self.id, self.value, self.pos, self.size, self.choices, self.style, self.validator, self.name)
def __init__(self, parent, board): wx.Frame.__init__(self, parent, title="this is the title") self.panel = wx.Panel(self) label = wx.StaticText(self.panel, label = "Hello World") button = wx.Button(self.panel, label="Button label", id=1) nets = board.GetNetsByName() self.netnames = [] for netname, net in nets.items(): if (str(netname) == ""): continue self.netnames.append(str(netname)) netcb = wx.ComboBox(self.panel, choices=self.netnames) netcb.SetSelection(0) netsbox = wx.BoxSizer(wx.HORIZONTAL) netsbox.Add(wx.StaticText(self.panel, label="Nets:")) netsbox.Add(netcb, proportion=1) modules = board.GetModules() self.modulenames = [] for mod in modules: self.modulenames.append("{}({})".format(mod.GetReference(), mod.GetValue())) modcb = wx.ComboBox(self.panel, choices=self.modulenames) modcb.SetSelection(0) modsbox = wx.BoxSizer(wx.HORIZONTAL) modsbox.Add(wx.StaticText(self.panel, label="Modules:")) modsbox.Add(modcb, proportion=1) box = wx.BoxSizer(wx.VERTICAL) box.Add(label, proportion=0) box.Add(button, proportion=0) box.Add(netsbox, proportion=0) box.Add(modsbox, proportion=0) self.panel.SetSizer(box) self.Bind(wx.EVT_BUTTON, self.OnPress, id=1) self.Bind(wx.EVT_COMBOBOX, self.OnSelectNet, id=netcb.GetId()) self.Bind(wx.EVT_COMBOBOX, self.OnSelectMod, id=modcb.GetId())
def __init__(self, *args, **kwargs): self._uiobj = wx.ComboBox(*args, **kwargs) self._OM = ObjectManager(self) self.well_uid = None self.index2uid = None self.propuid2pttnuid = None self.items = None self.default = None
def __init__(self, *args, **kwargs): wx.Panel.__init__(self, *args, **kwargs) sizer = wx.BoxSizer(wx.VERTICAL) # Main vertical sizer self.display = wx.ComboBox(self) # Current calculation sizer.Add(self.display, 0, wx.EXPAND|wx.BOTTOM, 8) # Add to main sizer # [7][8][9][/] # [4][5][6][*] # [1][2][3][-] # [0][.][C][+] gsizer = wx.GridSizer(4, 4, 8, 8) for row in (("7", "8", "9", "/"), ("4", "5", "6", "*"), ("1", "2", "3", "-"), ("0", ".", "C", "+")): for label in row: b = wx.Button(self, label=label, size=(40,-1)) gsizer.Add(b) b.Bind(wx.EVT_BUTTON, self.OnButton) sizer.Add(gsizer, 1, wx.EXPAND) # [ = ] b = wx.Button(self, label="=") b.Bind(wx.EVT_BUTTON, self.OnButton) sizer.Add(b, 0, wx.EXPAND|wx.ALL, 8) self.equal = b # Set sizer and center self.SetSizerAndFit(sizer)
def __init__(self): # creat app object self.app = wx.App() # Set up the main window wx.Frame.__init__(self, parent=None, title='Background Checker', size=(400, 300)) # The platforms available self.platforms = ['reddit', 'twitter'] """ Layout panel and hbox """ self.panel = wx.Panel(self, size=(500, 100)) self.box = wx.BoxSizer(wx.VERTICAL) # Greeting combobox self.platform = wx.ComboBox(parent=self.panel, value='Please Select an Option', size=(180, -1), choices=self.platforms) # Add the platform button to the hbox self.box.Add(self.platform, 0, wx.TOP) self.box.Add((-1, 10)) """ setup username textbox entry """ username_prompt = 'Please type a username (type a letter to clear this field)' self.username_textbox = wx.TextCtrl(parent=self.panel, size=(280, -1), value=username_prompt) # Add the greeting combo to the hbox self.box.Add(self.username_textbox, 0, wx.TOP) # Add padding to lower the button position self.box.Add((-1, 100)) # The background check button self.background_check_button = wx.Button(self.panel, 10, '&Background Check') """ Bind an event for the button """ self.Bind(wx.EVT_TEXT, self.clear_textbox, self.username_textbox) self.Bind(wx.EVT_BUTTON, self.record_username, self.background_check_button) # Add the button to the hbox self.box.Add(self.background_check_button, 0, flag=wx.ALIGN_CENTER | wx.BOTTOM) # Tell the panel to use the hbox self.panel.SetSizer(self.box)
def initSigControls(self): """Initialize signal controls. """ sigSizer = wx.BoxSizer(orient=wx.VERTICAL) waveformControlBox = widgets.ControlBox(self, label='Waveform', orient=wx.VERTICAL) self.waveformComboBox = wx.ComboBox(self, id=wx.ID_ANY, choices=list(waveforms.keys()), value='sinusoid', style=wx.CB_SORT | wx.CB_READONLY) self.waveformComboBox.Bind(wx.EVT_COMBOBOX, self.setWaveform) waveformControlBox.Add(self.waveformComboBox, proportion=0, flag=wx.ALL, border=10) sigSizer.Add(waveformControlBox, proportion=0, flag=wx.ALL | wx.EXPAND, border=10) freqControlBox = widgets.ControlBox(self, label='Base Frequency', orient=wx.HORIZONTAL) self.freqText = wx.StaticText(self, label='%4.1f(Hz)' % 1.0) freqTextSizer = wx.BoxSizer(orient=wx.VERTICAL) freqTextSizer.Add(self.freqText, proportion=1, flag=wx.EXPAND) self.freqSlider = wx.Slider(self, style=wx.SL_HORIZONTAL, value=10, minValue=1, maxValue=300) self.Bind(wx.EVT_SLIDER, self.setFreq, self.freqSlider) freqControlBox.Add(freqTextSizer, proportion=0, flag=wx.ALL, border=10) freqControlBox.Add(self.freqSlider, proportion=1, flag=wx.ALL | wx.EXPAND, border=10) sigSizer.Add(freqControlBox, proportion=0, flag=wx.LEFT | wx.BOTTOM | wx.RIGHT | wx.EXPAND, border=10) mixControlBox = widgets.ControlBox(self, label='Channel Mixer', orient=wx.HORIZONTAL) self.mixNoneButton = wx.RadioButton(self, label='None', style=wx.RB_GROUP) #mixControlBox.Add(self.mixNoneButton, proportion=0, flag=wx.TOP | wx.LEFT | wx.BOTTOM, border=10) mixControlBox.Add(self.mixNoneButton, proportion=0, flag=wx.ALL, border=10) self.mixNoneButton.SetValue(True) self.Bind(wx.EVT_RADIOBUTTON, self.setMixNone, self.mixNoneButton) #self.mixEqualButton = wx.RadioButton(self, label='Equal') #mixControlBox.Add(self.mixEqualButton, proportion=0, flag=wx.ALL, border=10) #self.Bind(wx.EVT_RADIOBUTTON, self.setMixEqual, self.mixEqualButton) self.mixRandomButton = wx.RadioButton(self, label='Random') #mixControlBox.Add(self.mixRandomButton, proportion=0, flag=wx.BOTTOM | wx.RIGHT | wx.TOP, border=10) mixControlBox.Add(self.mixRandomButton, proportion=0, flag=wx.ALL, border=10) self.Bind(wx.EVT_RADIOBUTTON, self.setMixRandom, self.mixRandomButton) sigSizer.Add(mixControlBox, proportion=0, flag=wx.LEFT | wx.BOTTOM | wx.RIGHT | wx.EXPAND, border=10) self.sizer.Add(sigSizer)
def __init__(self, parent, id, title): wx.Frame.__init__(self,parent,wx.ID_ANY, title, size=(600, 600), pos=(200, 200)) self.splitter_window = wx.SplitterWindow(self, -1, style=wx.SP_3D|wx.SP_BORDER) self.splitter_window.SetMinimumPaneSize(20) self.left_panel = wx.Panel(self.splitter_window, -1) self.right_panel = wx.Panel(self.splitter_window, -1) self.tree = CT.CustomTreeCtrl(self.left_panel, 1002, pos=(0, 0), style=wx.TR_DEFAULT_STYLE | wx.TR_HAS_VARIABLE_ROW_HEIGHT | wx.TR_HAS_BUTTONS | wx.TR_FULL_ROW_HIGHLIGHT | wx.TR_MULTIPLE | wx.TR_EDIT_LABELS) self.root = self.tree.AddRoot("Root Item") offset_lists = ["Clearance Reports", "Other Offsets"] offset_list_combo_box = wx.ComboBox(self.right_panel, -1, choices=offset_lists) #Sizers offset_sizer = wx.BoxSizer(wx.VERTICAL) offset_sizer.Add(offset_list_combo_box, 0, wx.EXPAND) vbox = wx.BoxSizer(wx.VERTICAL) vbox.Add(self.tree, 1, wx.EXPAND) self.left_panel.SetSizer(vbox) vbox2 = wx.BoxSizer(wx.VERTICAL) vbox2.Add(offset_sizer, 1, wx.EXPAND) self.right_panel.SetSizer(vbox2) main_sizer = wx.BoxSizer(wx.HORIZONTAL) self.splitter_window.SplitVertically(self.left_panel, self.right_panel) main_sizer.Add(self.splitter_window, 1, wx.EXPAND) self.SetSizer(main_sizer) self.Bind(wx.EVT_TREE_END_LABEL_EDIT, self.OnEndLabelEdit) self.Bind(wx.EVT_TREE_BEGIN_LABEL_EDIT, self.OnBeginLabelEdit) self.Bind(wx.EVT_KEY_DOWN, self.enterpressed) self.tree.Bind(wx.EVT_KEY_DOWN, self.enterpressed) self.Bind(wx.EVT_KEY_DOWN, self.enterpressed, self.tree) self.Bind(wx.EVT_COMMAND_ENTER, self.enterpressed) self.Bind(wx.EVT_TEXT_ENTER, self.enterpressed) self.Show(True)
def __init__(self, parent=None): super(WebPanel, self).__init__(parent=parent) self.current_url = HOMEURL sizer = wx.BoxSizer(orient=wx.VERTICAL) btn_sizer = wx.BoxSizer(orient=wx.HORIZONTAL) self.web_view = webview.WebView.New(parent=self) self.Bind(event=webview.EVT_WEBVIEW_LOADED, handler=self.webview_loaded, source=self.web_view) self.Bind(event=webview.EVT_WEBVIEW_NEWWINDOW, handler=self.open_new_window, source=self.web_view) btn_home = wx.Button(parent=self, label=u"??", style=wx.BU_EXACTFIT) self.Bind(event=wx.EVT_BUTTON, handler=self.click_home_button, source=btn_home) btn_sizer.Add(item=btn_home, proportion=CAN_NOT_CHANGE, flag=wx.EXPAND | wx.ALL, border=2) btn_back_page = wx.Button(parent=self, label=u"<--", style=wx.BU_EXACTFIT) self.Bind(event=wx.EVT_BUTTON, handler=self.click_preview_page_button, source=btn_back_page) self.Bind(event=wx.EVT_UPDATE_UI, handler=self.check_can_goback, source=btn_back_page) btn_sizer.Add(item=btn_back_page, proportion=CAN_NOT_CHANGE, flag=wx.EXPAND | wx.ALL, border=2) btn_next_page = wx.Button(parent=self, label=u"-->", style=wx.BU_EXACTFIT) self.Bind(event=wx.EVT_BUTTON, handler=self.click_next_page_button, source=btn_next_page) self.Bind(event=wx.EVT_UPDATE_UI, handler=self.check_can_goforward, source=btn_next_page) btn_sizer.Add(item=btn_next_page, proportion=CAN_NOT_CHANGE, flag=wx.EXPAND | wx.ALL, border=2) btn_stop = wx.Button(parent=self, label=u"??", style=wx.BU_EXACTFIT) self.Bind(event=wx.EVT_BUTTON, handler=self.click_stop_button, source=btn_stop) btn_sizer.Add(item=btn_stop, proportion=CAN_NOT_CHANGE, flag=wx.EXPAND | wx.ALL, border=2) btn_refresh = wx.Button(parent=self, label=u"??", style=wx.BU_EXACTFIT) self.Bind(event=wx.EVT_BUTTON, handler=self.click_refresh_page_button, source=btn_refresh) btn_sizer.Add(btn_refresh, proportion=CAN_NOT_CHANGE, flag=wx.EXPAND | wx.ALL, border=2) url_bar_title = wx.StaticText(parent=self, label=u"??:") btn_sizer.Add(url_bar_title, proportion=CAN_NOT_CHANGE, flag=wx.CENTER | wx.ALL, border=2) self.location = wx.ComboBox(parent=self, value=wx.EmptyString, style=wx.CB_DROPDOWN | wx.TE_PROCESS_ENTER) self.location.Bind(event=wx.EVT_TEXT_ENTER, handler=self.enter_location) self.Bind(event=wx.EVT_COMBOBOX, handler=self.select_location, source=self.location) btn_sizer.Add(item=self.location, proportion=CAN_CHANGE, flag=wx.EXPAND | wx.ALL, border=2) sizer.Add(item=btn_sizer, proportion=CAN_NOT_CHANGE, flag=wx.EXPAND) sizer.Add(item=self.web_view, proportion=CAN_CHANGE, flag=wx.EXPAND) self.SetSizer(sizer=sizer) self.web_view.LoadURL(url=self.current_url)
def __init__(self, parent, datatypes, infos): wx.Dialog.__init__(self, parent, title=_('Edit array type properties')) main_sizer = wx.FlexGridSizer(cols=1, hgap=0, rows=3, vgap=10) main_sizer.AddGrowableCol(0) main_sizer.AddGrowableRow(1) top_sizer = wx.BoxSizer(wx.HORIZONTAL) main_sizer.AddSizer(top_sizer, border=20, flag=wx.GROW | wx.TOP | wx.LEFT | wx.RIGHT) basetype_label = wx.StaticText(self, label=_('Base Type:')) top_sizer.AddWindow(basetype_label, 1, flag=wx.ALIGN_BOTTOM) self.BaseType = wx.ComboBox(self, style=wx.CB_READONLY) top_sizer.AddWindow(self.BaseType, 1, flag=wx.GROW) self.Dimensions = CustomEditableListBox(self, label=_("Dimensions:"), style=(wx.gizmos.EL_ALLOW_NEW | wx.gizmos.EL_ALLOW_EDIT | wx.gizmos.EL_ALLOW_DELETE)) for func in ["_OnLabelEndEdit", "_OnAddButton", "_OnDelButton", "_OnUpButton", "_OnDownButton"]: setattr(self.Dimensions, func, self.OnDimensionsChanged) main_sizer.AddSizer(self.Dimensions, border=20, flag=wx.GROW | wx.LEFT | wx.RIGHT) button_sizer = self.CreateButtonSizer(wx.OK | wx.CANCEL | wx.CENTRE) self.Bind(wx.EVT_BUTTON, self.OnOK, button_sizer.GetAffirmativeButton()) main_sizer.AddSizer(button_sizer, border=20, flag=wx.ALIGN_RIGHT | wx.BOTTOM | wx.LEFT | wx.RIGHT) self.SetSizer(main_sizer) for datatype in datatypes: self.BaseType.Append(datatype) if isinstance(infos, TupleType) and infos[0] == "array": self.BaseType.SetStringSelection(infos[1]) self.Dimensions.SetStrings(map(lambda x: "..".join(x), infos[2])) elif infos in datatypes: self.BaseType.SetStringSelection(infos) self.BaseType.SetFocus() self.Fit()
def __init__(self, parent, folder, filter=None, editable=True): wx.Panel.__init__(self, parent, style=wx.TAB_TRAVERSAL) main_sizer = wx.BoxSizer(wx.VERTICAL) self.Tree = wx.TreeCtrl(self, style=(wx.TR_HAS_BUTTONS | wx.TR_SINGLE | wx.SUNKEN_BORDER | wx.TR_HIDE_ROOT | wx.TR_LINES_AT_ROOT | wx.TR_EDIT_LABELS)) if wx.Platform == '__WXMSW__': self.Bind(wx.EVT_TREE_ITEM_ACTIVATED, self.OnTreeItemExpanded, self.Tree) self.Tree.Bind(wx.EVT_LEFT_DOWN, self.OnTreeLeftDown) else: self.Bind(wx.EVT_TREE_ITEM_EXPANDED, self.OnTreeItemExpanded, self.Tree) self.Bind(wx.EVT_TREE_ITEM_COLLAPSED, self.OnTreeItemCollapsed, self.Tree) self.Bind(wx.EVT_TREE_BEGIN_LABEL_EDIT, self.OnTreeBeginLabelEdit, self.Tree) self.Bind(wx.EVT_TREE_END_LABEL_EDIT, self.OnTreeEndLabelEdit, self.Tree) main_sizer.AddWindow(self.Tree, 1, flag=wx.GROW) if filter is not None: self.Filter = wx.ComboBox(self, style=wx.CB_READONLY) self.Bind(wx.EVT_COMBOBOX, self.OnFilterChanged, self.Filter) main_sizer.AddWindow(self.Filter, flag=wx.GROW) else: self.Filter = None self.SetSizer(main_sizer) self.Folder = folder self.Editable = editable self.TreeImageList = wx.ImageList(16, 16) self.TreeImageDict = {} for item_type, bitmap in [(DRIVE, "tree_drive"), (FOLDER, "tree_folder"), (FILE, "tree_file")]: self.TreeImageDict[item_type] = self.TreeImageList.Add(GetBitmap(bitmap)) self.Tree.SetImageList(self.TreeImageList) self.Filters = {} if self.Filter is not None: filter_parts = filter.split("|") for idx in xrange(0, len(filter_parts), 2): if filter_parts[idx + 1] == "*.*": self.Filters[filter_parts[idx]] = "" else: self.Filters[filter_parts[idx]] = filter_parts[idx + 1].replace("*", "") self.Filter.Append(filter_parts[idx]) if idx == 0: self.Filter.SetStringSelection(filter_parts[idx]) self.CurrentFilter = self.Filters[self.Filter.GetStringSelection()] else: self.CurrentFilter = ""
def __init__(self, *args, **kwds): # Constructor kwds["style"] = wx.CAPTION|wx.CLOSE_BOX|wx.MINIMIZE_BOX wx.Frame.__init__(self, *args, **kwds) try: self.Parent.Hide() except: print "Error Closing Prent" self.label_1 = wx.StaticText(self, -1, "Year", style=wx.ALIGN_RIGHT|wx.ALIGN_CENTRE) self.combo_box_1 = wx.ComboBox(self, -1, choices=[ ], style=wx.CB_DROPDOWN|wx.CB_DROPDOWN|wx.CB_READONLY | wx.CB_SORT) self.label_2 = wx.StaticText(self, -1, "Standard", style=wx.ALIGN_RIGHT|wx.ALIGN_CENTRE) self.combo_box_2 = wx.ComboBox(self, -1, choices=[ 'Select',"8", "9", "10"], style=wx.CB_DROPDOWN|wx.CB_DROPDOWN|wx.CB_READONLY) self.label_3 = wx.StaticText(self, -1, "Div", style=wx.ALIGN_CENTRE) self.combo_box_3 = wx.ComboBox(self, -1, choices=[ 'Select',], style=wx.CB_DROPDOWN|wx.CB_DROPDOWN|wx.CB_READONLY | wx.CB_SORT) self.label_4 = wx.StaticText(self, -1, "Term", style=wx.ALIGN_CENTRE) self.combo_box_4 = wx.ComboBox(self, -1, choices=[ 'Select', "Term 1", "Term 2", "Annual"], style=wx.CB_DROPDOWN|wx.CB_DROPDOWN|wx.CB_READONLY) self.button_1 = wx.Button(self, -1, "Close") self.button_2 = wx.Button(self, -1, "Go") #self.SetMenu() self.__set_properties() self.__do_layout() self.IsGridChild=0 self.Bind(wx.EVT_COMBOBOX, self.on_year, self.combo_box_1) self.Bind(wx.EVT_COMBOBOX, self.on_class, self.combo_box_2) self.Bind(wx.EVT_COMBOBOX, self.on_division, self.combo_box_3) self.Bind(wx.EVT_BUTTON, self.Go_Clicked, self.button_2) self.Bind(wx.EVT_BUTTON, self.Cancel_Clicked, self.button_1) self.Bind(wx.EVT_CLOSE, self.OnClose) self.GridFrame = None self.YEAR='' #self.CalcSheet=SpreadSheet(self) self.DB=db_operations() self.load_year()
def __init__(self, *args, **kwds): # begin wxGlade: student_profie.__init__ kwds["style"] = wx.CAPTION | wx.CLOSE_BOX | wx.MINIMIZE_BOX | wx.MAXIMIZE | wx.MAXIMIZE_BOX | wx.SYSTEM_MENU | wx.RESIZE_BORDER | wx.CLIP_CHILDREN wx.Frame.__init__(self, *args, **kwds) self.panel_1 = wx.Panel(self, wx.ID_ANY, style=wx.RAISED_BORDER | wx.TAB_TRAVERSAL) self.combo_box_13 = wx.ComboBox(self.panel_1, wx.ID_ANY, choices=[], style=wx.CB_DROPDOWN) self.combo_box_14 = wx.ComboBox(self.panel_1, wx.ID_ANY, choices=[], style=wx.CB_DROPDOWN) self.combo_box_15 = wx.ComboBox(self.panel_1, wx.ID_ANY, choices=[], style=wx.CB_DROPDOWN) self.button_1 = wx.Button(self.panel_1, wx.ID_ANY, _("Add New")) self.text_ctrl_1 = wx.TextCtrl(self.panel_1, wx.ID_ANY, "", style=wx.TE_PROCESS_ENTER | wx.TE_CENTRE) self.bitmap_button_2 = wx.BitmapButton(self.panel_1, wx.ID_ANY, wx.Bitmap("/media/ghssvythiri/10C63D64C63D4AEC/asif/sqlite_working_aug_16/Resources/img/pass.jpg", wx.BITMAP_TYPE_ANY), style=wx.BU_AUTODRAW) self.static_line_1 = wx.StaticLine(self.panel_1, wx.ID_ANY) self.bitmap_button_1 = wx.BitmapButton(self.panel_1, wx.ID_ANY, wx.Bitmap("/media/ghssvythiri/10C63D64C63D4AEC/asif/sqlite_working_aug_16/Resources/img/exit.jpg", wx.BITMAP_TYPE_ANY)) self.label_1 = wx.StaticText(self.panel_1, wx.ID_ANY, _("Name")) self.label_2 = wx.StaticText(self.panel_1, wx.ID_ANY, _("UID")) self.label_3 = wx.StaticText(self.panel_1, wx.ID_ANY, _("Gender")) self.text_ctrl_2 = wx.TextCtrl(self.panel_1, wx.ID_ANY, "") self.text_ctrl_3 = wx.TextCtrl(self.panel_1, wx.ID_ANY, "") self.combo_box_16 = wx.ComboBox(self.panel_1, wx.ID_ANY, choices=[], style=wx.CB_DROPDOWN) self.label_4 = wx.StaticText(self.panel_1, wx.ID_ANY, _("Date of Birth")) self.label_5 = wx.StaticText(self.panel_1, wx.ID_ANY, _("Category")) self.label_6 = wx.StaticText(self.panel_1, wx.ID_ANY, _("Reigion")) self.text_ctrl_4 = wx.TextCtrl(self.panel_1, wx.ID_ANY, "") self.text_ctrl_5 = wx.TextCtrl(self.panel_1, wx.ID_ANY, "") self.text_ctrl_6 = wx.TextCtrl(self.panel_1, wx.ID_ANY, "") self.label_7 = wx.StaticText(self.panel_1, wx.ID_ANY, _("Caste")) self.label_8 = wx.StaticText(self.panel_1, wx.ID_ANY, _("First Language")) self.label_9 = wx.StaticText(self.panel_1, wx.ID_ANY, _("Father")) self.text_ctrl_7 = wx.TextCtrl(self.panel_1, wx.ID_ANY, "") self.text_ctrl_8 = wx.TextCtrl(self.panel_1, wx.ID_ANY, "") self.text_ctrl_9 = wx.TextCtrl(self.panel_1, wx.ID_ANY, "") self.label_10 = wx.StaticText(self.panel_1, wx.ID_ANY, _("Mother")) self.label_11 = wx.StaticText(self.panel_1, wx.ID_ANY, _("Mobile")) self.label_12 = wx.StaticText(self.panel_1, wx.ID_ANY, _("Email")) self.text_ctrl_10 = wx.TextCtrl(self.panel_1, wx.ID_ANY, "") self.text_ctrl_11 = wx.TextCtrl(self.panel_1, wx.ID_ANY, "") self.text_ctrl_12 = wx.TextCtrl(self.panel_1, wx.ID_ANY, "") self.hyperlink_1 = wx.HyperlinkCtrl(self.panel_1, wx.ID_ANY, "", "") self.hyperlink_2 = wx.HyperlinkCtrl(self.panel_1, wx.ID_ANY, "", "") self.hyperlink_3 = wx.HyperlinkCtrl(self.panel_1, wx.ID_ANY, "", "") self.static_line_2 = wx.StaticLine(self.panel_1, wx.ID_ANY) self.button_3 = wx.Button(self.panel_1, wx.ID_ANY, _("Delete")) self.button_2 = wx.Button(self.panel_1, wx.ID_ANY, _("Close")) self.button_4 = wx.Button(self.panel_1, wx.ID_ANY, _("Save")) self.__set_properties() self.__do_layout() self.Bind(wx.EVT_BUTTON, self.on_search, self.bitmap_button_2) # end wxGlade
def __init__(self, *args, **kwds): # begin wxGlade: consolidated_report.__init__ kwds["style"] = wx.CAPTION | wx.CLOSE_BOX | wx.MINIMIZE_BOX | wx.FRAME_FLOAT_ON_PARENT wx.Dialog.__init__(self, *args, **kwds) self.panel_1 = wx.Panel(self, -1) self.combo_box_1 = wx.ComboBox(self.panel_1, -1, choices=[], style=wx.CB_DROPDOWN | wx.CB_SIMPLE | wx.CB_DROPDOWN | wx.CB_READONLY) self.combo_box_2 = wx.ComboBox(self.panel_1, -1, choices=["Select Standard", "8", "9", "10"], style=wx.CB_DROPDOWN | wx.CB_SIMPLE | wx.CB_DROPDOWN | wx.CB_READONLY) self.combo_box_3 = wx.ComboBox(self.panel_1, -1, choices=["Select Division"], style=wx.CB_DROPDOWN | wx.CB_SIMPLE | wx.CB_DROPDOWN | wx.CB_READONLY) self.combo_box_4 = wx.ComboBox(self.panel_1, -1, choices=["Select Term","Term1","Term2","Annual"], style=wx.CB_DROPDOWN | wx.CB_SIMPLE | wx.CB_DROPDOWN | wx.CB_READONLY) self.label_1 = wx.StaticText(self.panel_1, -1, "Select What to Include") self.checkbox_1 = wx.CheckBox(self.panel_1, -1, "CE") self.checkbox_2 = wx.CheckBox(self.panel_1, -1, "TE") self.checkbox_3 = wx.CheckBox(self.panel_1, -1, "Total") self.checkbox_4 = wx.CheckBox(self.panel_1, -1, "Grade") self.checkbox_5 = wx.CheckBox(self.panel_1, -1, "CE Total") self.checkbox_6 = wx.CheckBox(self.panel_1, -1, "TE Total") self.checkbox_7 = wx.CheckBox(self.panel_1, -1, "Grand Total") allLoc = ['Select All'] list2=['I Language','Malayalam','English','Hindi','S.S','Physics','Biology','Chemistry','Maths','IT'] self.check_list_box_1 = wx.CheckListBox(self.panel_1, -1, (60, 50), (30,30), allLoc) self.check_list_box_2 = wx.CheckListBox(self.panel_1, -1, (60, 50), wx.DefaultSize, list2) self.button_1 = wx.Button(self.panel_1, -1, "Close") self.button_2 = wx.Button(self.panel_1, -1, "Proceed") self.__set_properties() self.__do_layout() self.Bind(wx.EVT_COMBOBOX, self.oncombo_year, self.combo_box_1) self.Bind(wx.EVT_COMBOBOX, self.oncombo_class, self.combo_box_2) self.Bind(wx.EVT_COMBOBOX, self.oncombo_div, self.combo_box_3) self.Bind(wx.EVT_COMBOBOX, self.oncombo_term, self.combo_box_4) self.Bind(wx.EVT_CHECKLISTBOX, self.on_check, self.check_list_box_1) self.Bind(wx.EVT_CHECKLISTBOX, self.on_check_2, self.check_list_box_2) self.Bind(wx.EVT_BUTTON, self.on_close, self.button_1) self.Bind(wx.EVT_BUTTON, self.on_proceed, self.button_2) self.Bind(wx.EVT_CHECKBOX, self.on_check_ce, self.checkbox_1) self.Bind(wx.EVT_CHECKBOX, self.on_check_te, self.checkbox_2) self.Bind(wx.EVT_CHECKBOX, self.on_check_tota, self.checkbox_3) self.Bind(wx.EVT_CHECKBOX, self.on_check_grade, self.checkbox_4) self.Bind(wx.EVT_CHECKBOX, self.on_check_ce_total, self.checkbox_5) self.Bind(wx.EVT_CHECKBOX, self.on_check_te_total, self.checkbox_6) self.Bind(wx.EVT_CHECKBOX, self.on_check_grand, self.checkbox_7) self.checkedItems=() self.checkedItems_2=[0,1,2,3] self.DB=db_operations() self.Selected_Index=[] self.YEAR='' self.CLASS='' self.DIV='' self.TERM='' self.load_year() # end wxGlade
def __init__(self, *args, **kwds): # Constructor kwds["style"] = wx.CAPTION|wx.CLOSE_BOX|wx.MINIMIZE_BOX wx.Dialog.__init__(self, *args, **kwds) self.label_1 = wx.StaticText(self, -1, "Year", style=wx.ALIGN_RIGHT|wx.ALIGN_CENTRE) self.combo_box_1 = wx.ComboBox(self, -1, choices=[], style=wx.CB_DROPDOWN|wx.CB_DROPDOWN|wx.CB_READONLY) self.label_2 = wx.StaticText(self, -1, "Standard", style=wx.ALIGN_RIGHT|wx.ALIGN_CENTRE) self.combo_box_2 = wx.ComboBox(self, -1, choices=[ 'All',"8", "9"], style=wx.CB_DROPDOWN|wx.CB_DROPDOWN|wx.CB_READONLY) #self.label_3 = wx.StaticText(self, -1, "Division", style=wx.ALIGN_CENTRE) #self.combo_box_3 = wx.ComboBox(self, -1, choices=['All'], style=wx.CB_DROPDOWN|wx.CB_DROPDOWN|wx.CB_READONLY) #self.label_4 = wx.StaticText(self, -1, "Term", style=wx.ALIGN_CENTRE) #self.button_3 = wx.Button(self, -1, "Import File") #self.combo_box_4 = wx.ComboBox(self, -1, choices=[ "Term 1", "Term 2", "Annual"], style=wx.CB_DROPDOWN|wx.CB_DROPDOWN|wx.CB_READONLY) self.button_2 = wx.Button(self, -1, "Proceed") self.button_1 = wx.Button(self, -1, "Close") #self.SetMenu() self.__set_properties() self.__do_layout() self.Bind(wx.EVT_COMBOBOX, self.on_year, self.combo_box_1) self.Bind(wx.EVT_COMBOBOX, self.on_class, self.combo_box_2) #self.Bind(wx.EVT_COMBOBOX, self.on_division, self.combo_box_3) self.Bind(wx.EVT_BUTTON, self.ok_clicked, self.button_2) self.Bind(wx.EVT_BUTTON,self.on_close, self.button_1) #self.CalcSheet=SpreadSheet(self) self.YEAR='' self.DIVS=[] self.DB=db_operations() self.load_year()