我们从Python开源项目中,提取了以下50个代码示例,用于说明如何使用wx.ALIGN_RIGHT。
def createWidgets(self): # Main window resizer object sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(topPanel(self, self.SIM), 1, wx.ALL|wx.EXPAND, 5) sizer.Add(bottomPanel(self, self.SIM), 1, wx.ALL|wx.EXPAND, 5) #buttons = wx.BoxSizer(wx.HORIZONTAL) #buttons.Add(wx.Button(self, ID_BUTTON_CHANGE_PIN, "Okay"), 1, wx.ALIGN_LEFT | wx.ALL, 20) #buttons.Add(wx.Button(self, wxID_CANCEL, "Cancel"), 1, wx.ALIGN_RIGHT | wx.ALL, 20) #sizer.Add(buttons, 1, wx.ALL) self.SetSizer(sizer) self.SetAutoLayout(1) sizer.Fit(self) self.Layout() wx.EVT_CLOSE(self, self.closeWindow)
def __do_layout(self): # begin wxGlade: Dialog_snapshot.__do_layout sizer_2 = wx.BoxSizer(wx.VERTICAL) grid_sizer_2 = wx.FlexGridSizer(4, 2, 10, 10) grid_sizer_2.Add(self.label_1, 0, 0, 0) grid_sizer_2.Add(self.nombre_snap, 0, 0, 0) grid_sizer_2.Add(self.label_2, 0, 0, 0) grid_sizer_2.Add(self.descripcion_snap, 0, 0, 0) grid_sizer_2.Add(self.checkbox_memory, 0, 0, 0) grid_sizer_2.Add(self.checkbox_quiesce, 0, 0, 0) grid_sizer_2.Add(self.snap_ok, 0, wx.ALIGN_RIGHT | wx.RIGHT, 0) grid_sizer_2.Add(self.snap_cancel, 0, 0, 0) grid_sizer_2.AddGrowableCol(1) sizer_2.Add(grid_sizer_2, 1, wx.ALL | wx.EXPAND, 10) self.SetSizer(sizer_2) sizer_2.Fit(self) self.Layout() # end wxGlade # end of class Dialog_snapshot
def __do_layout(self): # begin wxGlade: Dialogo_user_pass.__do_layout sizer_3 = wx.BoxSizer(wx.VERTICAL) grid_sizer_4 = wx.FlexGridSizer(1, 2, 0, 0) grid_sizer_1 = wx.FlexGridSizer(2, 2, 5, 5) grid_sizer_1.Add(self.label_3, 0, 0, 0) grid_sizer_1.Add(self.usuario, 0, 0, 0) grid_sizer_1.Add(self.label_4, 0, 0, 0) grid_sizer_1.Add(self.password, 0, 0, 0) grid_sizer_1.AddGrowableCol(0) sizer_3.Add(grid_sizer_1, 1, wx.ALIGN_CENTER | wx.ALIGN_RIGHT | wx.ALL | wx.EXPAND, 10) grid_sizer_4.Add(self.button_OK, 0, 0, 0) grid_sizer_4.Add(self.button_cancel, 0, wx.ALIGN_RIGHT, 0) sizer_3.Add(grid_sizer_4, 1, wx.ALIGN_RIGHT | wx.ALL, 4) self.SetSizer(sizer_3) sizer_3.Fit(self) self.Layout() # end wxGlade # end of class Dialogo_user_pass
def __do_layout(self): # begin wxGlade: MyFrame.__do_layout sizer_4 = wx.BoxSizer(wx.VERTICAL) sizer_5 = wx.BoxSizer(wx.HORIZONTAL) sizer_5.Add(self.label_5, 0, wx.ALIGN_CENTER_VERTICAL, 0) sizer_5.Add(self.text_ctrl_bucar, 0, wx.ALIGN_CENTER_VERTICAL | wx.ALL, 7) sizer_5.Add(self.button_buscar, 0, wx.ALIGN_CENTER_VERTICAL, 0) sizer_5.Add(self.label_6, 0, wx.ALIGN_CENTER_VERTICAL | wx.ALL, 5) sizer_5.Add(self.bitmap_button_1, 0, wx.ALIGN_CENTER_VERTICAL, 0) sizer_4.Add(sizer_5, 1, wx.ALIGN_BOTTOM | wx.ALIGN_RIGHT | wx.ALL, 6) sizer_4.Add(self.list_ctrl_1, 1, 0, 0) self.SetSizer(sizer_4) sizer_4.Fit(self) self.Layout() # end wxGlade # end of class MyFrame
def __init__(self, parent, info): wx.Dialog.__init__(self, parent, title=_("License"), size=(500, 400), style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER) if parent and parent.GetIcon(): self.SetIcon(parent.GetIcon()) self.SetMinSize((400, 300)) close = wx.Button(self, id=wx.ID_CLOSE, label=_("&Close")) ctrl = wx.TextCtrl(self, style=wx.TE_READONLY | wx.TE_MULTILINE) ctrl.SetValue(info.License) btnSizer = wx.BoxSizer(wx.HORIZONTAL) btnSizer.Add(close) sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(ctrl, 1, wx.EXPAND | wx.ALL, 10) sizer.Add(btnSizer, flag=wx.ALIGN_RIGHT | wx.RIGHT | wx.BOTTOM, border=10) self.SetSizer(sizer) self.Layout() self.Show() self.SetEscapeId(close.GetId()) close.Bind(wx.EVT_BUTTON, lambda evt: self.Destroy())
def __init__(self, parent, enable_required=True): wx.Dialog.__init__(self, parent, title=_('Project properties'), style=wx.DEFAULT_DIALOG_STYLE) main_sizer = wx.FlexGridSizer(cols=1, hgap=0, rows=2, vgap=10) main_sizer.AddGrowableCol(0) main_sizer.AddGrowableRow(0) self.ProjectProperties = ProjectPropertiesPanel( self, enable_required=enable_required) main_sizer.AddWindow(self.ProjectProperties, flag=wx.GROW) self.ButtonSizer = self.CreateButtonSizer(wx.OK | wx.CANCEL | wx.CENTRE) self.Bind(wx.EVT_BUTTON, self.OnOK, self.ButtonSizer.GetAffirmativeButton()) main_sizer.AddSizer(self.ButtonSizer, border=20, flag=wx.ALIGN_RIGHT | wx.BOTTOM | wx.LEFT | wx.RIGHT) self.SetSizer(main_sizer) self.ProjectProperties.Fit() self.Fit()
def __do_layout(self): # begin wxGlade: MyFrame.__do_layout sizer_1 = wx.BoxSizer(wx.VERTICAL) grid_sizer_1 = wx.GridSizer(5, 2, 0, 0) grid_sizer_1.Add(self.label_1, 0, wx.LEFT|wx.TOP, 20) grid_sizer_1.Add(self.combo_box_1, 0, wx.TOP, 20) grid_sizer_1.Add(self.label_2, 0, wx.LEFT|wx.TOP, 20) grid_sizer_1.Add(self.combo_box_2, 0, wx.TOP, 20) grid_sizer_1.Add(self.label_3, 0, wx.LEFT|wx.TOP, 20) grid_sizer_1.Add(self.combo_box_3, 0, wx.RIGHT|wx.TOP, 20) grid_sizer_1.Add(self.label_4, 0, wx.LEFT|wx.TOP|wx.BOTTOM|wx.EXPAND, 20) grid_sizer_1.Add(self.combo_box_4, 0, wx.RIGHT|wx.TOP|wx.BOTTOM, 20) grid_sizer_1.Add(self.button_1, 0, wx.TOP|wx.ALIGN_RIGHT, 0) grid_sizer_1.Add(self.button_2, 0, wx.LEFT, 30) sizer_1.Add(grid_sizer_1, 1, wx.EXPAND, 0) self.SetSizer(sizer_1) self.Layout() self.Centre() # end wxGlade
def __do_layout(self): # begin wxGlade: CE_TE.__do_layout sizer_5 = wx.BoxSizer(wx.VERTICAL) sizer_8 = wx.BoxSizer(wx.HORIZONTAL) sizer_7 = wx.BoxSizer(wx.HORIZONTAL) sizer_6 = wx.BoxSizer(wx.HORIZONTAL) sizer_6.Add(self.label_1, 0, wx.LEFT, 0) sizer_6.Add(self.text_ctrl_1, 0, wx.LEFT|wx.ALIGN_RIGHT, 35) sizer_5.Add(sizer_6, 1, wx.LEFT|wx.RIGHT|wx.TOP|wx.EXPAND, 30) sizer_7.Add(self.label_2, 0, wx.LEFT, 0) sizer_7.Add(self.text_ctrl_2, 0, wx.LEFT, 35) sizer_5.Add(sizer_7, 1, wx.LEFT|wx.RIGHT|wx.TOP|wx.EXPAND, 30) sizer_8.Add(self.button_2, 0, 0, 0) sizer_8.Add(self.button_1, 0, wx.LEFT, 35) sizer_5.Add(sizer_8, 1, wx.LEFT|wx.RIGHT|wx.TOP|wx.EXPAND, 20) self.SetSizer(sizer_5) self.text_ctrl_1.SetFocus() self.Layout() # end wxGlade
def __do_layout(self): # begin wxGlade: MyFrame.__do_layout sizer_1 = wx.BoxSizer(wx.VERTICAL) grid_sizer_1 = wx.GridSizer(5, 2, 0, 0) grid_sizer_1.Add(self.label_1, 0, wx.LEFT|wx.TOP, 20) grid_sizer_1.Add(self.combo_box_1, 0, wx.TOP, 20) grid_sizer_1.Add(self.label_2, 0, wx.LEFT|wx.TOP, 20) grid_sizer_1.Add(self.combo_box_2, 0, wx.TOP, 20) #grid_sizer_1.Add(self.button_3, 0, wx.LEFT|wx.TOP|wx.BOTTOM|wx.EXPAND, 20) #grid_sizer_1.Add(self.combo_box_4, 0, wx.RIGHT|wx.TOP|wx.BOTTOM, 20) grid_sizer_1.Add(self.button_1, 0, wx.TOP|wx.ALIGN_RIGHT, 0) grid_sizer_1.Add(self.button_2, 0, wx.LEFT, 30) sizer_1.Add(grid_sizer_1, 1, wx.EXPAND, 0) self.SetSizer(sizer_1) self.Layout() self.Centre()
def __do_layout(self): # begin wxGlade: MyFrame.__do_layout sizer_1 = wx.BoxSizer(wx.VERTICAL) grid_sizer_1 = wx.GridSizer(5, 2, 0, 0) grid_sizer_1.Add(self.label_1, 0, wx.LEFT|wx.TOP, 20) grid_sizer_1.Add(self.combo_box_1, 0, wx.TOP, 20) grid_sizer_1.Add(self.label_2, 0, wx.LEFT|wx.TOP, 20) grid_sizer_1.Add(self.combo_box_2, 0, wx.TOP, 20) grid_sizer_1.Add(self.label_3, 0, wx.LEFT|wx.TOP, 20) grid_sizer_1.Add(self.combo_box_3, 0, wx.RIGHT|wx.TOP, 20) #grid_sizer_1.Add(self.button_3, 0, wx.LEFT|wx.TOP|wx.BOTTOM|wx.EXPAND, 20) #grid_sizer_1.Add(self.combo_box_4, 0, wx.RIGHT|wx.TOP|wx.BOTTOM, 20) grid_sizer_1.Add(self.button_1, 0, wx.TOP|wx.ALIGN_RIGHT, 0) grid_sizer_1.Add(self.button_2, 0, wx.LEFT, 30) sizer_1.Add(grid_sizer_1, 1, wx.EXPAND, 0) self.SetSizer(sizer_1) self.Layout() self.Centre()
def __do_layout(self): # begin wxGlade: TerminalSettingsDialog.__do_layout sizer_2 = wx.BoxSizer(wx.VERTICAL) sizer_3 = wx.BoxSizer(wx.HORIZONTAL) self.sizer_4_staticbox.Lower() sizer_4 = wx.StaticBoxSizer(self.sizer_4_staticbox, wx.VERTICAL) sizer_4.Add(self.checkbox_echo, 0, wx.ALL, 4) sizer_4.Add(self.checkbox_unprintable, 0, wx.ALL, 4) sizer_4.Add(self.radio_box_newline, 0, 0, 0) sizer_2.Add(sizer_4, 0, wx.EXPAND, 0) sizer_3.Add(self.button_ok, 0, 0, 0) sizer_3.Add(self.button_cancel, 0, 0, 0) sizer_2.Add(sizer_3, 0, wx.ALL | wx.ALIGN_RIGHT, 4) self.SetSizer(sizer_2) sizer_2.Fit(self) self.Layout() # end wxGlade
def create_page_buttons(self, sizer, panel): button_sizer = wx.BoxSizer(wx.HORIZONTAL) button_sizer.Add( self.create_button( panel=panel, key=['settings', 'ok_button'], bind=self.button_clicked, multiple=True)['item'], 0, wx.ALIGN_RIGHT) button_sizer.Add( self.create_button( panel=panel, key=['settings', 'apply_button'], bind=self.button_clicked, enabled=False, multiple=True)['item'], 0, wx.ALIGN_RIGHT) button_sizer.Add( self.create_button( panel=panel, key=['settings', 'cancel_button'], bind=self.button_clicked, multiple=True)['item'], 0, wx.ALIGN_RIGHT) sizer.Add(button_sizer, 0, wx.ALIGN_RIGHT | wx.ALL, 4)
def GetAttr(self, row, col, kind): #if _iswxphoenix: attr = wx.grid.GridCellAttr().Clone() #else: # attr = wx.grid.GridCellAttr() if col >= self.N_COLS: attr.SetAlignment(wx.ALIGN_RIGHT, wx.ALIGN_CENTER) elif col == 0: attr.SetAlignment(wx.ALIGN_RIGHT, wx.ALIGN_CENTER) elif col == 1: part = self._OM.get(self.partmap[row]) attr.SetBackgroundColour(part.color) attr.SetReadOnly(True) elif col == 2: attr.SetAlignment(wx.ALIGN_RIGHT, wx.ALIGN_CENTER) elif col == 3: attr.SetAlignment(wx.ALIGN_RIGHT, wx.ALIGN_CENTER) return attr
def getPanelBottomButtons(self): panel = wx.Panel(self) sizer = wx.BoxSizer(wx.HORIZONTAL) b1 = wx.Button(panel, -1, "OK") sizer.Add(b1, 0, wx.ALIGN_RIGHT, border=5) b2 = wx.Button(panel, -1, "Apply") sizer.Add(b2, 0, wx.ALIGN_RIGHT, border=5) b3 = wx.Button(panel, -1, "Cancel") sizer.Add(b3, 0, wx.LEFT|wx.RIGHT, border=5) b1.Bind(wx.EVT_BUTTON, self._OnButtonOK) b2.Bind(wx.EVT_BUTTON, self._OnButtonApply) b3.Bind(wx.EVT_BUTTON, self._OnButtonCancel) panel.SetSizer(sizer) return panel
def GetAttr(self, row, col, kind): #if _iswxphoenix: attr = wx.grid.GridCellAttr().Clone() if col >= self.N_COLS: attr.SetAlignment(wx.ALIGN_RIGHT, wx.ALIGN_CENTER) elif col == 0: attr.SetAlignment(wx.ALIGN_RIGHT, wx.ALIGN_CENTER) elif col == 1: rocktype = self._OM.get(self.rocktypemap[row]) attr.SetBackgroundColour(rocktype.color) attr.SetReadOnly(True) elif col == 2: attr.SetAlignment(wx.ALIGN_RIGHT, wx.ALIGN_CENTER) elif col == 3: attr.SetAlignment(wx.ALIGN_RIGHT, wx.ALIGN_CENTER) return attr
def __init__(self, *args, **kwargs): if 'on_ok_callback' in kwargs: self.on_ok_callback = kwargs.pop('on_ok_callback') else: self.on_ok_callback = None if 'on_cancel_callback' in kwargs: self.on_cancel_callback = kwargs.pop('on_cancel_callback') else: self.on_cancel_callback = None super(Dialog, self).__init__(*args, **kwargs) self.header_panel = Panel(self) button_sizer = self.CreateButtonSizer(wx.OK | wx.CANCEL) self.Bind(wx.EVT_BUTTON, self.on_button) vbox = wx.BoxSizer(wx.VERTICAL) vbox.Add(self.header_panel, proportion=1, flag=wx.ALL | wx.EXPAND) vbox.Add(button_sizer, flag=wx.ALIGN_RIGHT) self.SetSizer(vbox) self.SetSize((800, 600)) self.SetTitle(u"Editor de Cabeçalho ODT")
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 InitLayout(self): """Lay out controls and add buttons.""" sizer = wx.BoxSizer(wx.HORIZONTAL) txtSizer = wx.BoxSizer(wx.VERTICAL) btnSizer = wx.BoxSizer(wx.VERTICAL) replaceSizer = wx.BoxSizer(wx.HORIZONTAL) txtSizer.Add(wx.StaticText(self, -1, "Unrecognised Word:"), 0, wx.LEFT|wx.TOP, 5) txtSizer.Add(self.error_text, 1, wx.ALL|wx.EXPAND, 5) replaceSizer.Add(wx.StaticText(self, -1, "Replace with:"), 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5) replaceSizer.Add(self.replace_text, 1, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5) txtSizer.Add(replaceSizer, 0, wx.EXPAND, 0) txtSizer.Add(self.replace_list, 2, wx.ALL|wx.EXPAND, 5) sizer.Add(txtSizer, 1, wx.EXPAND, 0) self.buttons = [] for label, action, tip in (\ ("Ignore", self.OnIgnore, "Ignore this word and continue"), ("Ignore All", self.OnIgnoreAll, "Ignore all instances of this word and continue"), ("Replace", self.OnReplace, "Replace this word"), ("Replace All", self.OnReplaceAll, "Replace all instances of this word"), ("Add", self.OnAdd, "Add this word to the dictionary"), ("Done", self.OnDone, "Finish spell-checking and accept changes"), ): btn = wx.Button(self, -1, label) btn.SetToolTip(wx.ToolTip(tip)) btnSizer.Add(btn, 0, wx.ALIGN_RIGHT|wx.ALL, 4) btn.Bind(wx.EVT_BUTTON, action) self.buttons.append(btn) sizer.Add(btnSizer, 0, wx.ALL|wx.EXPAND, 5) self.SetAutoLayout(True) self.SetSizer(sizer) sizer.Fit(self)
def __init__(self, parent, name, number, minnamelen, maxnamelen): wxskinDialog.__init__(self, parent, -1, "Phonebook edit entry") self.SetAutoLayout(True) self.name = None self.number = None nameTextId = wx.NewId() # Main window resizer object border = wx.BoxSizer(wx.VERTICAL) label = wx.StaticText(self, -1, "Enter the phonebook entry name, number and press OK.") border.Add(label, 1, wx.ALL, 10) #fgs = wx.FlexGridSizer(2,3,5,20) fgs = wx.BoxSizer(wx.HORIZONTAL) label = wx.StaticText(self, -1, "Name (max %d): " % maxnamelen) fgs.Add(label, 1, wx.ALIGN_LEFT | wx.LEFT, 10) self.nameCtrl = wx.TextCtrl(self, nameTextId, name, validator = pySIMvalidator(None, minnamelen, maxnamelen)) fgs.Add(self.nameCtrl, 1, wx.ALIGN_RIGHT | wx.RIGHT, 10) border.Add(fgs, 1, wx.ALL) fgs = wx.BoxSizer(wx.HORIZONTAL) label = wx.StaticText(self, -1, "Number (max 20): ") fgs.Add(label, 1, wx.ALIGN_LEFT | wx.LEFT, 10) self.numberCtrl = wx.TextCtrl(self, -1, number, validator = pySIMvalidator("+*#pw0123456789", None, 20)) fgs.Add(self.numberCtrl, 1, wx.ALIGN_RIGHT | wx.RIGHT, 10) border.Add(fgs, 1, wx.ALL) buttons = wx.BoxSizer(wx.HORIZONTAL) buttons.Add(wx.Button(self, ID_BUTTON_OK, "Okay"), 1, wx.ALIGN_LEFT | wx.ALL, 20) buttons.Add(wx.Button(self, wx.ID_CANCEL, "Cancel"), 1, wx.ALIGN_RIGHT | wx.ALL, 20) border.Add(buttons, 1, wx.ALL) wx.EVT_BUTTON(self, ID_BUTTON_OK, self.onOK) wx.EVT_TEXT_ENTER(self, nameTextId, self.onOK) self.SetAutoLayout(1); self.SetSizer(border) border.Fit(self) self.Layout()
def __init__(self, parent, name): wxskinDialog.__init__(self, parent, -1, "Phonebook import") self.SetAutoLayout(True) self.function = 0 # Main window resizer object border = wx.BoxSizer(wx.VERTICAL) label = wx.StaticText(self, -1, "Name '%s' already exists in SIM phonebook.\n\nDo you want to overwrite exisiting, duplicate or skip!?" % (name)) border.Add(label, 1, wx.ALL, 10) buttons = wx.BoxSizer(wx.HORIZONTAL) buttons.Add(wx.Button(self, ID_BUTTON_OVERWRITE, "Overwrite"), 1, wx.ALIGN_LEFT | wx.ALL, 20) buttons.Add(wx.Button(self, ID_BUTTON_COPY, "Duplicate"), 1, wx.ALIGN_RIGHT | wx.ALL, 20) buttons.Add(wx.Button(self, ID_BUTTON_SKIP, "Skip"), 1, wx.ALIGN_RIGHT | wx.ALL, 20) buttons.Add(wx.Button(self, wx.ID_CANCEL, "Cancel"), 1, wx.ALIGN_RIGHT | wx.ALL, 20) border.Add(buttons, 1, wx.ALL) self.applyAll = wx.CheckBox(self, ID_CHECKBOX_APPLY_ALL, " Apply to all", wx.Point(65, 40), wx.Size(150, 20), wx.NO_BORDER) border.Add(self.applyAll, 1, wx.ALIGN_CENTER | wx.ALL) wx.EVT_BUTTON(self, ID_BUTTON_OVERWRITE, self.onOverwrite) wx.EVT_BUTTON(self, ID_BUTTON_COPY, self.onDuplicate) wx.EVT_BUTTON(self, ID_BUTTON_SKIP, self.onSkip) self.SetAutoLayout(1); self.SetSizer(border) border.Fit(self) self.Layout()
def __init__(self, parent, date, number): wxskinDialog.__init__(self, parent, -1, "SMS import") self.SetAutoLayout(False) self.function = 0 # Main window resizer object border = wx.BoxSizer(wx.VERTICAL) label = wx.StaticText(self, -1, "SMS from '%s' on '%s' already exists in SMS folder.\n\nDo you want to overwrite exisiting, duplicate or skip!?" % (number, date)) border.Add(label, 1, wx.ALL, 10) buttons = wx.BoxSizer(wx.HORIZONTAL) buttons.Add(wx.Button(self, ID_BUTTON_OVERWRITE, "Overwrite"), 1, wx.ALIGN_LEFT | wx.ALL, 20) buttons.Add(wx.Button(self, ID_BUTTON_COPY, "Duplicate"), 1, wx.ALIGN_RIGHT | wx.ALL, 20) buttons.Add(wx.Button(self, ID_BUTTON_SKIP, "Skip"), 1, wx.ALIGN_RIGHT | wx.ALL, 20) buttons.Add(wx.Button(self, wx.ID_CANCEL, "Cancel"), 1, wx.ALIGN_RIGHT | wx.ALL, 20) border.Add(buttons, 1, wx.ALL) self.applyAll = wx.CheckBox(self, ID_CHECKBOX_APPLY_ALL, " Apply to all", wx.Point(65, 40), wx.Size(150, 20), wx.NO_BORDER) border.Add(self.applyAll, 1, wx.ALIGN_CENTER | wx.ALL) wx.EVT_BUTTON(self, ID_BUTTON_OVERWRITE, self.onOverwrite) wx.EVT_BUTTON(self, ID_BUTTON_COPY, self.onDuplicate) wx.EVT_BUTTON(self, ID_BUTTON_SKIP, self.onSkip) #EVT_CHECKBOX(self, ID_CHECKBOX_APPLY_ALL, self.EvtCheckBox) self.SetAutoLayout(1); self.SetSizer(border) border.Fit(self) self.Layout()
def __do_layout(self): # begin wxGlade: Dialogo_texto.__do_layout self.sizer_1_staticbox.Lower() sizer_1 = wx.StaticBoxSizer(self.sizer_1_staticbox, wx.VERTICAL) sizer_1.Add(self.salida_texto, 0, wx.ALL | wx.EXPAND, 4) sizer_1.Add(self.bnt_salida_ok, 0, wx.ALIGN_RIGHT | wx.RIGHT | wx.SHAPED, 5) self.SetSizer(sizer_1) sizer_1.Fit(self) self.Layout() # end wxGlade # end of class Dialogo_texto
def __init__(self, parent): wx.Panel.__init__(self, parent, style=wx.SUNKEN_BORDER) self.panelphase = self.GetParent().GetParent().GetParent() self.font = self.GetParent().font self.file = None vbox = wx.BoxSizer(wx.VERTICAL) title = wx.StaticText(self, label="Convert HDF5 to Numpy array.") vbox.Add(title ,0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.input_filename = TextPanelObject(self, "Input HDF5 File: ", "",150,"HDF files (*.hdf)|*.hdf|HDF5 files (*.h5)|*.h5|All files (*.*)|*.*") vbox.Add(self.input_filename, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) hbox = wx.BoxSizer(wx.HORIZONTAL) label = wx.StaticText(self, -1,"HDF Key Path:" , style =wx.ALIGN_RIGHT, size=(150,-1) ) label.SetFont(self.font) hbox.Add( label, 0, wx.CENTER ) def OnEdit(event): self.objectpath.ChangeValue(event.GetString()) self.objectpath = TextCtrlNew(self, -1) self.objectpath.SetFont(self.font) self.objectpath.SetValue("") self.objectpath.SetToolTipNew("Comma separated key names.") self.objectpath.Bind(wx.EVT_TEXT_ENTER, OnEdit) hbox.Add( self.objectpath, 1, wx.CENTER |wx.EXPAND ) self.button = ButtonNew(self, -1, "Browse") self.button.SetFont(self.font) self.button.SetToolTipNew("Browse for HDF5 key path.") self.button.Bind(wx.EVT_BUTTON, self.OnBrowse) hbox.Add( self.button, 0, wx.LEFT|wx.CENTER) vbox.Add(hbox, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.output_filename = TextPanelObject(self, "Output File: ", "output.npy",150,'*.npy') vbox.Add(self.output_filename, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.SetAutoLayout(True) self.SetSizer( vbox )
def __init__(self, parent, name, objectpath, textwidth, file_extension): def assign(input): self.objectpath.ChangeValue(input) def OnBrowse(self): if IsNotWX4(): dlg = wx.FileDialog(parent, 'Choose a file', os.getcwd(), '', file_extension, wx.OPEN) else: dlg = wx.FileDialog(parent, 'Choose a file', os.getcwd(), '', file_extension, wx.FD_OPEN) if dlg.ShowModal() == wx.ID_OK: assign(dlg.GetPath()) dlg.Destroy() def OnEdit(event): self.objectpath.ChangeValue(event.GetString()) fontpointsize=wx.SystemSettings.GetFont(wx.SYS_SYSTEM_FONT).GetPointSize() self.font = wx.Font(fontpointsize, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL) dc = wx.ScreenDC() dc.SetFont(self.font) textw,texth = dc.GetTextExtent(name) if textw > textwidth: labelw = textw else: labelw = textwidth wx.BoxSizer.__init__(self, wx.HORIZONTAL) self.label = StaticTextNew(parent, -1, name, style =wx.ALIGN_RIGHT, size=(labelw,-1) ) self.label.SetFont(self.font) self.Add( self.label, 0, wx.CENTER ) self.objectpath = TextCtrlNew(parent, -1) self.objectpath.SetFont(self.font) self.objectpath.SetValue(objectpath) self.objectpath.SetToolTipNew("Browse for file or type "+os.linesep+"path and name") self.objectpath.Bind(wx.EVT_TEXT_ENTER, OnEdit) self.Add( self.objectpath, 1, wx.CENTER |wx.EXPAND ) self.button = ButtonNew(parent, -1, "Browse") self.button.SetFont(self.font) self.button.SetToolTipNew("Browse for file or type "+os.linesep+"path and name") self.button.Bind(wx.EVT_BUTTON, OnBrowse) self.Add( self.button, 0, wx.LEFT|wx.CENTER)
def __init__(self, parent, name, init, stextwidth): def OnEdit(event): text = event.GetString() point = self.value.GetInsertionPoint() if (IsNumber(self.value.GetValue()) == False): self.value.SetBackgroundColour( "Pink" ) self.value.SetForegroundColour( "Black" ) else: self.value.SetBackgroundColour(wx.NullColour) self.value.SetForegroundColour(wx.NullColour) self.value.ChangeValue(text) self.value.SetInsertionPoint(point) fontpointsize=wx.SystemSettings.GetFont(wx.SYS_SYSTEM_FONT).GetPointSize() self.font = wx.Font(fontpointsize, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL) wx.BoxSizer.__init__(self, wx.HORIZONTAL) dc = wx.ScreenDC() dc.SetFont(self.font) textw,texth = dc.GetTextExtent(name) if textw > stextwidth: labelw = textw else: labelw = stextwidth self.label = StaticTextNew(parent, -1, name, style =wx.ALIGN_RIGHT, size=(labelw,-1) ) self.label.SetFont(self.font) self.Add( self.label, 0, wx.CENTER ) self.value = TextCtrlNew(parent, value=str(init), style=wx.TE_PROCESS_ENTER) self.value.SetWindowStyle(wx.TE_RIGHT) self.value.SetFont(self.font) self.value.Bind(wx.EVT_TEXT, OnEdit) self.Add( self.value, 1, wx.CENTER|wx.EXPAND )
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 __init__(self, parent, name, library, default=None): wx.Dialog.__init__(self, name='BrowseValueDialog', parent=parent, style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER, title=_('Browse %s values library') % name) self.staticText1 = wx.StaticText( label=_('Choose a value for %s:') % name, name='staticText1', parent=self, pos=wx.Point(0, 0), size=wx.DefaultSize, style=0) self.ValuesLibrary = wx.TreeCtrl( name='ValuesLibrary', parent=self, pos=wx.Point(0, 0), size=wx.Size(400, 200), style=wx.TR_HAS_BUTTONS | wx.TR_SINGLE | wx.SUNKEN_BORDER | wx.TR_HIDE_ROOT | wx.TR_LINES_AT_ROOT) self.ButtonSizer = self.CreateButtonSizer(wx.OK | wx.CANCEL | wx.CENTRE) self.Bind(wx.EVT_BUTTON, self.OnOK, id=self.ButtonSizer.GetAffirmativeButton().GetId()) self.flexGridSizer1 = wx.FlexGridSizer(cols=1, hgap=0, rows=3, vgap=10) self.flexGridSizer1.AddWindow(self.staticText1, 0, border=20, flag=wx.GROW | wx.TOP | wx.LEFT | wx.RIGHT) self.flexGridSizer1.AddWindow(self.ValuesLibrary, 0, border=20, flag=wx.GROW | wx.LEFT | wx.RIGHT) self.flexGridSizer1.AddSizer(self.ButtonSizer, 0, border=20, flag=wx.ALIGN_RIGHT | wx.BOTTOM | wx.LEFT | wx.RIGHT) self.flexGridSizer1.AddGrowableCol(0) self.flexGridSizer1.AddGrowableRow(1) self.SetSizer(self.flexGridSizer1) self.Fit() root = self.ValuesLibrary.AddRoot("") self.GenerateValuesLibraryBranch(root, library, default)
def __init__(self, parent, info): wx.Dialog.__init__(self, parent, title=_("Credits"), size=(475, 320), style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER) if parent and parent.GetIcon(): self.SetIcon(parent.GetIcon()) self.SetMinSize((300, 200)) notebook = wx.Notebook(self) close = wx.Button(self, id=wx.ID_CLOSE, label=_("&Close")) close.SetDefault() developer = wx.TextCtrl(notebook, style=wx.TE_READONLY | wx.TE_MULTILINE) translators = wx.TextCtrl(notebook, style=wx.TE_READONLY | wx.TE_MULTILINE) developer.SetValue(u'\n'.join(info.Developers)) translators.SetValue(u'\n'.join(info.Translators)) notebook.AddPage(developer, text=_("Written by")) notebook.AddPage(translators, text=_("Translated by")) btnSizer = wx.BoxSizer(wx.HORIZONTAL) btnSizer.Add(close) sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(notebook, 1, wx.EXPAND | wx.ALL, 10) sizer.Add(btnSizer, flag=wx.ALIGN_RIGHT | wx.RIGHT | wx.BOTTOM, border=10) self.SetSizer(sizer) self.Layout() self.Show() self.SetEscapeId(close.GetId()) close.Bind(wx.EVT_BUTTON, lambda evt: self.Destroy())
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 __init__(self, parent): wx.Dialog.__init__(self, parent, title=_('Edit Duration')) main_sizer = wx.FlexGridSizer(cols=1, hgap=0, rows=2, vgap=10) main_sizer.AddGrowableCol(0) main_sizer.AddGrowableRow(0) controls_sizer = wx.FlexGridSizer(cols=len(CONTROLS), hgap=10, rows=2, vgap=10) main_sizer.AddSizer(controls_sizer, border=20, flag=wx.TOP | wx.LEFT | wx.RIGHT | wx.GROW) controls = [] for i, (name, label) in enumerate(CONTROLS): controls_sizer.AddGrowableCol(i) st = wx.StaticText(self, label=label) txtctrl = wx.TextCtrl(self, value='0', style=wx.TE_PROCESS_ENTER) self.Bind(wx.EVT_TEXT_ENTER, self.GetControlValueTestFunction(txtctrl), txtctrl) setattr(self, name, txtctrl) controls.append((st, txtctrl)) for st, txtctrl in controls: controls_sizer.AddWindow(st, flag=wx.GROW) for st, txtctrl in controls: controls_sizer.AddWindow(txtctrl, 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) self.Fit() self.Days.SetFocus()
def add_confirm(self, modal=True): self.lst.AddStretchSpacer(1) sizer = wx.BoxSizer( wx.HORIZONTAL ) self.btn_OK = wx.Button( self, wx.ID_OK, 'OK') sizer.Add( self.btn_OK, 0, wx.ALIGN_RIGHT|wx.ALL, 5 ) self.btn_cancel = wx.Button( self, wx.ID_CANCEL, 'Cancel') sizer.Add( self.btn_cancel, 0, wx.ALIGN_RIGHT|wx.ALL, 5 ) self.lst.Add(sizer, 0, wx.ALIGN_RIGHT, 5 ) if not modal: self.btn_OK.Bind( wx.EVT_BUTTON, lambda e:self.commit('ok')) self.btn_cancel.Bind( wx.EVT_BUTTON, lambda e:self.commit('cancel'))
def __do_layout(self): # begin wxGlade: Add_Student.__do_layout sizer_1 = wx.BoxSizer(wx.VERTICAL) sizer_2 = wx.BoxSizer(wx.HORIZONTAL) sizer_2.Add(self.text_ctrl_1, 0, wx.LEFT | wx.RIGHT, 10) sizer_2.Add(self.text_ctrl_2, 0, 0, 0) sizer_2.Add(self.text_ctrl_3, 0, wx.LEFT, 10) sizer_2.Add(self.button_1, 0, wx.LEFT | wx.RIGHT | wx.ALIGN_RIGHT, 10) sizer_1.Add(sizer_2, 1, wx.TOP | wx.EXPAND, 30) self.SetSizer(sizer_1) self.Layout() self.Centre() # end wxGlade
def __do_layout(self): # begin wxGlade: sampoorna_win.__do_layout sizer_1 = wx.BoxSizer(wx.VERTICAL) sizer_2 = wx.BoxSizer(wx.VERTICAL) sizer_5 = wx.BoxSizer(wx.VERTICAL) grid_sizer_2 = wx.GridSizer(1, 3, 0, 0) sizer_4 = wx.BoxSizer(wx.VERTICAL) grid_sizer_1 = wx.GridSizer(2, 2, 0, 0) sizer_3 = wx.BoxSizer(wx.VERTICAL) sizer_3.Add(self.label_1, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_CENTER_VERTICAL, 0) self.panel_warning.SetSizer(sizer_3) sizer_2.Add(self.panel_warning, 1, wx.EXPAND, 0) sizer_4.Add(self.bitmap_1, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_CENTER_VERTICAL, 0) grid_sizer_1.Add(self.label_2, 0, 0, 0) grid_sizer_1.Add(self.text_ctrl_1, 0, 0, 0) grid_sizer_1.Add(self.label_3, 0, 0, 0) grid_sizer_1.Add(self.text_ctrl_2, 0, 0, 0) sizer_4.Add(grid_sizer_1, 1, wx.EXPAND, 0) sizer_4.Add(self.button_1, 0, wx.ALIGN_RIGHT | wx.ALIGN_CENTER_HORIZONTAL, 0) self.panel_login.SetSizer(sizer_4) sizer_2.Add(self.panel_login, 1, wx.EXPAND | wx.ALIGN_CENTER_VERTICAL, 0) grid_sizer_2.Add(self.checkbox_1, 0, 0, 0) grid_sizer_2.Add(self.checkbox_2, 0, 0, 0) grid_sizer_2.Add(self.checkbox_3, 0, 0, 0) sizer_5.Add(grid_sizer_2, 1, wx.EXPAND, 0) sizer_5.Add(self.button_2, 0, 0, 0) self.panel_class.SetSizer(sizer_5) sizer_2.Add(self.panel_class, 1, wx.EXPAND, 0) sizer_2.Add(self.panel_progress, 1, wx.EXPAND, 0) sizer_2.Add(self.panel_report, 1, wx.EXPAND, 0) self.panel_1.SetSizer(sizer_2) sizer_1.Add(self.panel_1, 1, wx.EXPAND, 0) self.SetSizer(sizer_1) sizer_1.Fit(self) self.Layout() # end wxGlade
def __do_layout(self): # begin wxGlade: consolidated_report.__do_layout sizer_1 = wx.BoxSizer(wx.HORIZONTAL) sizer_2 = wx.BoxSizer(wx.VERTICAL) sizer_3 = wx.BoxSizer(wx.HORIZONTAL) sizer_5 = wx.BoxSizer(wx.VERTICAL) sizer_4 = wx.BoxSizer(wx.VERTICAL) sizer_6 = wx.BoxSizer(wx.VERTICAL) grid_sizer_2 = wx.GridSizer(2, 4, 5, 5) grid_sizer_1 = wx.GridSizer(4, 1, 0, 10) grid_sizer_1.Add(self.combo_box_1, 0, wx.BOTTOM | wx.ALIGN_CENTER_HORIZONTAL, 10) grid_sizer_1.Add(self.combo_box_2, 0, wx.ALIGN_CENTER_HORIZONTAL, 0) grid_sizer_1.Add(self.combo_box_3, 0, wx.ALIGN_CENTER_HORIZONTAL, 0) grid_sizer_1.Add(self.combo_box_4, 0, wx.ALIGN_CENTER_HORIZONTAL, 0) sizer_2.Add(grid_sizer_1, 0, wx.EXPAND, 0) sizer_6.Add(self.label_1, 0, wx.TOP | wx.BOTTOM | wx.ALIGN_CENTER_HORIZONTAL, 10) grid_sizer_2.Add(self.checkbox_1, 0, 0, 0) grid_sizer_2.Add(self.checkbox_2, 0, 0, 0) grid_sizer_2.Add(self.checkbox_3, 0, 0, 0) grid_sizer_2.Add(self.checkbox_4, 0, 0, 0) grid_sizer_2.Add(self.checkbox_5, 0, 0, 0) grid_sizer_2.Add(self.checkbox_6, 0, 0, 0) grid_sizer_2.Add(self.checkbox_7, 0, 0, 0) sizer_6.Add(grid_sizer_2, 0, wx.EXPAND, 0) sizer_6.Add(self.check_list_box_1, 0, wx.EXPAND, 0) sizer_6.Add(self.check_list_box_2, 1, wx.EXPAND, 0) sizer_2.Add(sizer_6, 1, wx.EXPAND, 0) sizer_4.Add(self.button_1, 0, wx.RIGHT | wx.TOP | wx.BOTTOM | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_HORIZONTAL, 10) sizer_3.Add(sizer_4, 1, wx.EXPAND, 0) sizer_5.Add(self.button_2, 0, wx.RIGHT | wx.TOP | wx.BOTTOM | wx.ALIGN_CENTER_HORIZONTAL, 10) sizer_3.Add(sizer_5, 1, wx.EXPAND, 0) sizer_2.Add(sizer_3, 0, wx.EXPAND, 0) self.panel_1.SetSizer(sizer_2) sizer_1.Add(self.panel_1, 1, wx.ALL | wx.EXPAND, 5) self.SetSizer(sizer_1) self.Layout() # end wxGlade
def __do_layout(self): # begin wxGlade: institution.__do_layout sizer_1 = wx.BoxSizer(wx.VERTICAL) sizer_2 = wx.BoxSizer(wx.HORIZONTAL) sizer_3 = wx.BoxSizer(wx.VERTICAL) sizer_6 = wx.BoxSizer(wx.HORIZONTAL) sizer_8 = wx.BoxSizer(wx.HORIZONTAL) sizer_7 = wx.BoxSizer(wx.VERTICAL) grid_sizer_1 = wx.GridSizer(5, 2, 0, 0) sizer_4 = wx.BoxSizer(wx.HORIZONTAL) sizer_5 = wx.BoxSizer(wx.VERTICAL) sizer_5.Add(self.label_1, 0, 0, 0) sizer_4.Add(sizer_5, 1, wx.ALIGN_CENTER_HORIZONTAL, 0) sizer_3.Add(sizer_4, 1, wx.ALIGN_CENTER_HORIZONTAL, 0) grid_sizer_1.Add(self.label_2, 0, 0, 0) grid_sizer_1.Add(self.text_ctrl_name, 0, 0, 0) grid_sizer_1.Add(self.label_3, 0, 0, 0) grid_sizer_1.Add(self.text_ctrl_code, 0, 0, 0) grid_sizer_1.Add(self.label_4, 0, 0, 0) grid_sizer_1.Add(self.text_ctrl_email, 0, 0, 0) grid_sizer_1.Add(self.label_5, 0, 0, 0) grid_sizer_1.Add(self.text_ctrl_phone, 0, 0, 0) grid_sizer_1.Add(self.label_6, 0, 0, 0) grid_sizer_1.Add(self.text_ctrl_deo, 0, 0, 0) sizer_3.Add(grid_sizer_1, 1, wx.BOTTOM | wx.EXPAND | wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_CENTER_VERTICAL, 50) sizer_7.Add(self.button_cancel, 0, wx.ALIGN_RIGHT, 0) sizer_6.Add(sizer_7, 1, wx.RIGHT | wx.ALIGN_CENTER_VERTICAL, 50) sizer_8.Add(self.button_save, 0, wx.ALIGN_CENTER_VERTICAL, 0) sizer_6.Add(sizer_8, 1, wx.LEFT | wx.EXPAND, 50) sizer_3.Add(sizer_6, 0, wx.EXPAND | wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_CENTER_VERTICAL, 0) sizer_2.Add(sizer_3, 1, wx.ALL | wx.EXPAND, 40) sizer_1.Add(sizer_2, 30, wx.ALL | wx.EXPAND, 0) self.SetSizer(sizer_1) self.Layout() # end wxGlade
def __do_layout(self): # begin wxGlade: promote.__do_layout sizer_3 = wx.BoxSizer(wx.VERTICAL) sizer_2 = wx.BoxSizer(wx.VERTICAL) sizer_6 = wx.BoxSizer(wx.HORIZONTAL) sizer_1 = wx.BoxSizer(wx.VERTICAL) sizer_7 = wx.BoxSizer(wx.HORIZONTAL) sizer_8 = wx.BoxSizer(wx.VERTICAL) sizer_3_copy = wx.BoxSizer(wx.HORIZONTAL) sizer_5 = wx.BoxSizer(wx.VERTICAL) sizer_4 = wx.BoxSizer(wx.VERTICAL) sizer_4.Add(self.label_10, 0, 0, 0) sizer_4.Add(self.combo_box_1, 0, wx.BOTTOM, 10) sizer_4.Add(self.combo_box_2, 0, wx.BOTTOM, 10) sizer_4.Add(self.combo_box_3, 0, wx.BOTTOM, 10) sizer_3_copy.Add(sizer_4, 0, wx.RIGHT | wx.EXPAND, 150) sizer_3_copy.Add(self.static_line_1, 0, wx.EXPAND, 0) sizer_5.Add(self.label_11, 0, 0, 0) sizer_5.Add(self.combo_box_4, 0, wx.BOTTOM, 10) sizer_5.Add(self.combo_box_5, 0, wx.BOTTOM, 10) sizer_5.Add(self.combo_box_6, 0, wx.BOTTOM, 10) sizer_3_copy.Add(sizer_5, 1, wx.LEFT | wx.EXPAND | wx.ALIGN_RIGHT, 100) sizer_2.Add(sizer_3_copy, 0, wx.EXPAND | wx.ALIGN_RIGHT, 0) sizer_2.Add(self.static_line_2, 0, wx.EXPAND, 0) sizer_8.Add(self.check_list_box_1, 0, wx.EXPAND, 0) sizer_8.Add(self.check_list_box_2, 1, wx.EXPAND, 0) sizer_7.Add(sizer_8, 1, wx.EXPAND, 0) self.panel_1.SetSizer(sizer_7) sizer_1.Add(self.panel_1, 1, wx.EXPAND, 0) sizer_2.Add(sizer_1, 1, wx.EXPAND, 0) sizer_6.Add(self.button_cancel, 0, wx.LEFT, 250) sizer_6.Add(self.button_proceed, 0, wx.LEFT, 50) sizer_2.Add(sizer_6, 0, wx.EXPAND, 0) self.panel_2.SetSizer(sizer_2) sizer_3.Add(self.panel_2, 1, wx.ALL | wx.EXPAND, 20) self.SetSizer(sizer_3) self.Layout() self.Center() # end wxGlade
def __init__(self, welluid, *args, **kwargs): super(Dialog, self).__init__(*args, **kwargs) self.welluid = welluid self.partitionuid = None self._OM = ObjectManager(self) self.partitionmap = [pttn.uid for pttn in self._OM.list('partition', self.welluid)] partitionchoiceitems = [pttn.name for pttn in self._OM.list('partition', self.welluid)] self.partmap = [] self.partitionchoice = wx.Choice(self) self.partitionchoice.AppendItems(partitionchoiceitems) self.partitionchoice.Bind(wx.EVT_CHOICE, self.on_partition_choice) self.partslistbox = wx.CheckListBox(self) button_sizer = self.CreateButtonSizer(wx.OK | wx.CANCEL) main_sizer = wx.BoxSizer(wx.VERTICAL) main_sizer.Add(self.partitionchoice, proportion=0, flag=wx.EXPAND) main_sizer.Add(self.partslistbox, proportion=1, flag=wx.EXPAND) main_sizer.AddSizer(button_sizer, proportion=0, flag=wx.ALIGN_RIGHT) self.SetSizer(main_sizer) if len(self.partitionmap) == 1: self.set_partitionuid(self.partitionmap[0])
def __init__(self, *args, **kwargs): if 'on_ok_callback' in kwargs: self.on_ok_callback = kwargs.pop('on_ok_callback') else: self.on_ok_callback = None if 'on_cancel_callback' in kwargs: self.on_cancel_callback = kwargs.pop('on_cancel_callback') else: self.on_cancel_callback = None super(Dialog, self).__init__(*args, **kwargs) self._OM = ObjectManager(self) self._OM.subscribe(self.on_wells_changed, 'add') self._OM.subscribe(self.on_wells_changed, 'post_remove') #self._OM.addcallback("add", self.on_wells_change) #self._OM.addcallback("post-remove", self.on_wells_change) self._mapui = [] self.choice = wx.Choice(self) self.choice.Bind(wx.EVT_CHOICE, self.on_select) self.ls_panel = Panel(self) button_sizer = self.CreateButtonSizer(wx.OK | wx.CANCEL) self.Bind(wx.EVT_BUTTON, self.on_button) vbox = wx.BoxSizer(wx.VERTICAL) vbox.Add(self.choice, flag=wx.ALIGN_CENTER) vbox.Add(self.ls_panel, 1, wx.ALL | wx.EXPAND) vbox.Add(button_sizer, flag=wx.ALIGN_RIGHT) self.SetSizer(vbox) self.SetSize((400, 600)) self.SetTitle(u"Seletor de Perfis para Plotagem") self.on_wells_change(None)
def __init__(self, parent, names, units, curvetypes, datatypes, *args, **kwargs): if 'on_ok_callback' in kwargs: self.on_ok_callback = kwargs.pop('on_ok_callback') else: self.on_ok_callback = None if 'on_cancel_callback' in kwargs: self.on_cancel_callback = kwargs.pop('on_cancel_callback') else: self.on_cancel_callback = None super(Dialog, self).__init__(parent, *args, **kwargs) self.names = names self.units = units self.curvetypes = curvetypes self.datatypes = datatypes self.nrows = len(self.names) style = wx.LC_REPORT | wx.LC_VRULES | wx.LC_HRULES | wx.LC_SINGLE_SEL | ULC.ULC_HAS_VARIABLE_ROW_HEIGHT self.list = ULC.UltimateListCtrl(self, wx.ID_ANY, agwStyle=style) self._fill_list() button_sizer = self.CreateButtonSizer(wx.OK | wx.CANCEL) self.Bind(wx.EVT_BUTTON, self.on_button) vbox = wx.BoxSizer(wx.VERTICAL) vbox.Add(self.list, proportion=1, flag=wx.EXPAND) vbox.Add(button_sizer, flag=wx.ALIGN_RIGHT) self.SetSizerAndFit(vbox) self.SetSize((400, 600)) self.SetTitle(u"Importar como:")
def getPanelBottomButtons(self): panel = wx.Panel(self.panel) sizer = wx.BoxSizer(wx.HORIZONTAL) b1 = wx.Button(panel, -1, "Selecionar Todos") sizer.Add(b1, 0, wx.ALIGN_RIGHT, border=5) b2 = wx.Button(panel, -1, "Desmarcar Todos") sizer.Add(b2, 0, wx.ALIGN_RIGHT, border=5) b3 = wx.Button(panel, -1, "Importar Selecionados") sizer.Add(b3, 0, wx.LEFT|wx.RIGHT, border=5) b1.Bind(wx.EVT_BUTTON, self._OnToggleAll) b2.Bind(wx.EVT_BUTTON, self._OnToggleNone) b3.Bind(wx.EVT_BUTTON, self._OnImportToggled) panel.SetSizer(sizer) return panel
def __init__(self, *args, **kwargs): if 'on_ok_callback' in kwargs: self.on_ok_callback = kwargs.pop('on_ok_callback') else: self.on_ok_callback = None if 'on_cancel_callback' in kwargs: self.on_cancel_callback = kwargs.pop('on_cancel_callback') else: self.on_cancel_callback = None super(Dialog, self).__init__(*args, **kwargs) self.wells = None self.choice = wx.Choice(self) button_sizer = self.CreateButtonSizer(wx.OK | wx.CANCEL) self.Bind(wx.EVT_BUTTON, self.on_button) vbox = wx.BoxSizer(wx.VERTICAL) vbox.Add(self.choice, flag=wx.ALIGN_CENTER) vbox.Add(button_sizer, flag=wx.ALIGN_RIGHT) self.SetSizer(vbox) self.SetSize((300, 200)) self.SetTitle(u"Seletcione o poço")
def __init__(self, *args, **kwargs): super(Panel, self).__init__(*args, **kwargs) self._OM = ObjectManager(self) self.xselector = wx.Choice(self) self.yselector = wx.Choice(self) self.zselector = wx.Choice(self) self.wselector = wx.Choice(self) gridsizer = wx.FlexGridSizer(rows=4, cols=2, hgap=5, vgap=5) gridsizer.Add(wx.StaticText(self, label="Eixo x: "), 0, wx.ALIGN_RIGHT) gridsizer.Add(self.xselector, 1, wx.EXPAND) gridsizer.Add(wx.StaticText(self, label="Eixo y: "), 0, wx.ALIGN_RIGHT) gridsizer.Add(self.yselector, 1, wx.EXPAND) gridsizer.Add(wx.StaticText(self, label="Barra de cor: "), 0, wx.ALIGN_RIGHT) gridsizer.Add(self.zselector, 1, wx.EXPAND) gridsizer.Add(wx.StaticText(self, label="Particionamento: "), 0, wx.ALIGN_RIGHT) gridsizer.Add(self.wselector, 1, wx.EXPAND) self.SetSizer(gridsizer) self.xmap = [] self.ixmap = {} self.ymap = [] self.iymap = {} self.zmap = [] self.izmap = {} self.wmap = [] self.iwmap = {} self.welluid = None
def _layout_widgets(self, inputdesc): nwidgets = len(self.widgets) fgridsizer = wx.FlexGridSizer(nwidgets, 2, 5, 5) for i, idesc in enumerate(inputdesc): dispname = idesc['dispname'] + ":" name = idesc['name'] widget = self.widgets[name] label = wx.StaticText(self, label=dispname) fgridsizer.Add(label, proportion=0.0, flag=wx.ALIGN_RIGHT) fgridsizer.Add(widget.get_uiobj(), proportion=1.0, flag=wx.EXPAND) if idesc['type'] == 'ommulti': fgridsizer.AddGrowableRow(i) # if idesc['type'] == 'ommulti': # fgridsizer.Add(widget.get_uiobj(), proportion=1.0, flag=wx.EXPAND) # else: # fgridsizer.Add(widget.get_uiobj(), proportion=0.0, flag=wx.EXPAND) fgridsizer.AddGrowableCol(1) self.SetSizerAndFit(fgridsizer)
def __init__(self, uiparent, inputdesc, *args, **kwargs): if 'on_ok_callback' in kwargs: self.on_ok_callback = kwargs.pop('on_ok_callback') else: self.on_ok_callback = None if 'on_cancel_callback' in kwargs: self.on_cancel_callback = kwargs.pop('on_cancel_callback') else: self.on_cancel_callback = None super(AutoGenDialog, self).__init__(uiparent, *args, **kwargs) self._OM = ObjectManager(self) well_label = wx.StaticText(self, label=u"Poço:") self.well_choice = self._create_well_choice() hbox = wx.BoxSizer(wx.HORIZONTAL) hbox.Add(well_label, proportion=0, flag=wx.ALL, border=5) hbox.Add(self.well_choice, proportion=1, flag=wx.EXPAND | wx.ALL, border=5) self.autogenpanel = AutoGenPanel(self, inputdesc) button_sizer = self.CreateButtonSizer(wx.OK | wx.CANCEL) self.Bind(wx.EVT_BUTTON, self.on_button) vbox = wx.BoxSizer(wx.VERTICAL) vbox.Add(hbox, proportion=0, flag=wx.EXPAND | wx.ALL, border=5) vbox.Add(self.autogenpanel, proportion=1, flag=wx.EXPAND | wx.ALL, border=5) vbox.Add(button_sizer, flag=wx.ALIGN_RIGHT | wx.ALL, border=5) self.SetSizerAndFit(vbox) # self.SetSize((400, 800))
def createWidgets(self): # Main window resizer object border = wx.BoxSizer(wx.VERTICAL) label = wxskinStaticText(self, -1, "Your old and new PIN must be exactly 4 digits in length.") border.Add(label, 1, wx.ALL, 10) fgs = wx.BoxSizer(wx.HORIZONTAL) label = wxskinStaticText(self, -1, "Current PIN: ") fgs.Add(label, 1, wx.ALIGN_LEFT | wx.LEFT, 10) if self.SIM.chv1_enabled: self.textCtrlOldPin = wx.TextCtrl(self, -1, '', validator = pySIMvalidator("0123456789", 4, 4), style=wx.TE_PASSWORD) else: self.textCtrlOldPin = wx.TextCtrl(self, -1, '(Not set)', style=wx.TE_READONLY) fgs.Add(self.textCtrlOldPin, 1, wx.ALIGN_RIGHT | wx.RIGHT, 10) border.Add(fgs, 1, wx.ALL) fgs = wx.BoxSizer(wx.HORIZONTAL) label = wxskinStaticText(self, -1, "New PIN: ") fgs.Add(label, 1, wx.ALIGN_LEFT | wx.LEFT, 10) self.textCtrlNewPin1 = wx.TextCtrl(self, -1, '', validator = pySIMvalidator("0123456789", 4, 4), style=wx.TE_PASSWORD) fgs.Add(self.textCtrlNewPin1, 1, wx.ALIGN_RIGHT | wx.RIGHT, 10) border.Add(fgs, 1, wx.ALL) fgs = wx.BoxSizer(wx.HORIZONTAL) label = wxskinStaticText(self, -1, "New PIN (verify): ") fgs.Add(label, 1, wx.ALIGN_LEFT | wx.LEFT, 10) self.textCtrlNewPin2 = wx.TextCtrl(self, -1, '', validator = pySIMvalidator("0123456789", 4, 4), style=wx.TE_PASSWORD) fgs.Add(self.textCtrlNewPin2, 1, wx.ALIGN_RIGHT | wx.RIGHT, 10) border.Add(fgs, 1, wx.ALL) buttons = wx.BoxSizer(wx.HORIZONTAL) buttons.Add(wx.Button(self, ID_BUTTON_CHANGE_PIN, "Okay"), 1, wx.ALIGN_LEFT | wx.ALL, 20) buttons.Add(wx.Button(self, wx.ID_CANCEL, "Cancel"), 1, wx.ALIGN_RIGHT | wx.ALL, 20) border.Add(buttons, 1, wx.ALL) wx.EVT_BUTTON(self, ID_BUTTON_CHANGE_PIN, self.onOK) self.SetAutoLayout(1); self.SetSizer(border) border.Fit(self) self.Layout()
def __init__(self, parent): """Constructor""" wx.Panel.__init__(self, parent, -1, style=wx.WANTS_CHARS) # self.Bind(wx.EVT_BUTTON, self.OnSelectFont, btn) self.list_ctrl = theListCtrl(self, -1, style=wx.LC_REPORT | wx.LC_HRULES | wx.LC_VRULES | wx.SUNKEN_BORDER) st1 = wx.StaticText(self, label=' Cadena Busqueda') self.cadenaBusqueda = wx.TextCtrl(self) btnbusqueda = wx.Button(self, label="Buscar") btnrecargaVM = wx.Button(self, label="Actualizar VM") name_rows = ['Carpeta', 'Nombre', 'IP', 'Estado', 'pregunta', 'Disco Path', 'Sistema', 'Notas', 'uuid'] # cargamos los nombres de los elementos for x in range(len(name_rows)): self.list_ctrl.InsertColumn(x, name_rows[x]) # conexion = conectar_con_vcenter(self, id) self.tabla = [] self.tabla = sacar_listado_capertas(conexion) self.vm_buscados = [] self.cargardatos_en_listctrl(self.tabla) # para la ordenacion--- llama a Getlistctrl self.itemDataMap = self.tabla listmix.ColumnSorterMixin.__init__(self, len(name_rows)) self.list_ctrl.Bind(wx.EVT_LIST_ITEM_SELECTED, self.onItemSelected, self.list_ctrl) # self.list_ctrl.Bind(wx.EVT_CONTEXT_MENU, self.onItemSelected, self.list_ctrl) # Metemos las cosas en le ventana en orden txtcontador = wx.StaticText(self, label='total VM: ' + str(len(self.tabla))) sizer = wx.BoxSizer(wx.VERTICAL) hbox1 = wx.BoxSizer(wx.HORIZONTAL) hbox1.Add(st1, wx.ALL | wx.ALIGN_CENTER, 5) hbox1.Add(self.cadenaBusqueda, wx.ALL | wx.ALIGN_CENTER, 5) hbox1.Add(btnbusqueda, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER, 5) hbox1.Add(btnrecargaVM, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER, 5) hbox1.Add(txtcontador, wx.ALL | wx.ALIGN_CENTER, 5) sizer.Add(hbox1, flag=wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP | wx.ALIGN_CENTER, border=2) self.Bind(wx.EVT_BUTTON, self.busquedadatos, btnbusqueda) self.Bind(wx.EVT_BUTTON, self.recarga_VM, btnrecargaVM) sizer.Add(self.list_ctrl, 1, wx.ALL | wx.EXPAND, 5) self.SetSizer(sizer) # tools for search an debug (to use uncomment the next line, works only linux) # wx.lib.inspection.InspectionTool().Show() # ---------------------------------------------------------------------- # Used by the ColumnSorterMixin, see wx/lib/mixins/listctrl.py