Python wx.TE_RIGHT Examples
The following are 7
code examples of wx.TE_RIGHT().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
wx
, or try the search function
.
Example #1
Source File: configuration_dialogs.py From superpaper with MIT License | 5 votes |
def display_opt_widget_row(self, row_id): """Return a display option widget row.""" statbox_disp_opts = self.sizer_disp_opts.GetStaticBox() row_id = wx.StaticText(statbox_disp_opts, -1, str(row_id)) row_sax = wx.Choice(statbox_disp_opts, -1, name="SwivelAxisChoice", size=(self.tc_width*0.7, -1), choices=["No swivel", "Left", "Right"]) row_san = wx.TextCtrl(statbox_disp_opts, -1, size=(self.tc_width*0.69, -1), style=wx.TE_RIGHT) row_sol = wx.TextCtrl(statbox_disp_opts, -1, size=(self.tc_width*0.69, -1), style=wx.TE_RIGHT) row_sod = wx.TextCtrl(statbox_disp_opts, -1, size=(self.tc_width*0.69, -1), style=wx.TE_RIGHT) row_tan = wx.TextCtrl(statbox_disp_opts, -1, size=(self.tc_width*0.69, -1), style=wx.TE_RIGHT) row_tov = wx.TextCtrl(statbox_disp_opts, -1, size=(self.tc_width*0.69, -1), style=wx.TE_RIGHT) row_tod = wx.TextCtrl(statbox_disp_opts, -1, size=(self.tc_width*0.69, -1), style=wx.TE_RIGHT) # Prefill neutral data row_sax.SetSelection(0) row_san.SetValue("0") row_sol.SetValue("0") row_sod.SetValue("0") row_tan.SetValue("0") row_tov.SetValue("0") row_tod.SetValue("0") row = [row_id, row_sax, row_san, row_sol, row_sod, row_tan, row_tov, row_tod] return row
Example #2
Source File: gui.py From superpaper with MIT License | 5 votes |
def list_of_textctrl(self, ctrl_parent, num_disp, fraction = 1/2): tcrtl_list = [] for i in range(num_disp): tcrtl_list.append( wx.TextCtrl(ctrl_parent, -1, size=(self.tc_width * fraction, -1), style=wx.TE_RIGHT ) ) return tcrtl_list
Example #3
Source File: gui.py From superpaper with MIT License | 5 votes |
def __init__(self, parent, style): wx.PopupTransientWindow.__init__(self, parent, style) self.preview = parent pnl = wx.Panel(self) # pnl.SetBackgroundColour("CADET BLUE") st = wx.StaticText(pnl, -1, "Enter the size of adjacent bezels and gap\n" "in millimeters:") # self.tc_bez = wx.TextCtrl(pnl, -1, size=(100, -1)) self.tc_bez = wx.TextCtrl(pnl, -1, style=wx.TE_RIGHT|wx.TE_PROCESS_ENTER) self.tc_bez.Bind(wx.EVT_TEXT_ENTER, self.OnEnter) self.current_bez_val = None butt_save = wx.Button(pnl, label="Apply") butt_canc = wx.Button(pnl, label="Cancel") butt_save.Bind(wx.EVT_BUTTON, self.onApply) butt_canc.Bind(wx.EVT_BUTTON, self.onCancel) butt_sizer = wx.BoxSizer(wx.HORIZONTAL) # butt_sizer.AddStretchSpacer() butt_sizer.Add(self.tc_bez, 0, wx.ALL, 5) butt_sizer.Add(butt_save, 0, wx.ALL, 5) butt_sizer.Add(butt_canc, 0, wx.ALL, 5) sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(st, 0, wx.ALL, 5) # sizer.Add(self.tc_bez, 0, wx.ALL, 5) sizer.Add(butt_sizer, 0, wx.ALL|wx.EXPAND, 0) pnl.SetSizer(sizer) sizer.Fit(pnl) sizer.Fit(self) self.Layout()
Example #4
Source File: SmartSpinNumCtrl.py From EventGhost with GNU General Public License v2.0 | 5 votes |
def __init__( self, parent, id=-1, value=0.0, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.TE_RIGHT, validator=wx.DefaultValidator, name="eg.SmartSpinNumCtrl", **kwargs ): self.initValue = value self.value = value self.parent = parent self.kwargs = kwargs self.name = name self.nW = size[0] if size[0] != -1 else 60 self.tW = size[0] if size[0] != -1 else 120 if 'numWidth' in self.kwargs: self.nW = self.kwargs['numWidth'] del self.kwargs['numWidth'] if 'textWidth' in self.kwargs: self.tW = self.kwargs['textWidth'] del self.kwargs['textWidth'] wx.Window.__init__(self, parent, id, pos, size, 0) self.SetThemeEnabled(True) self.sizer = wx.BoxSizer(wx.HORIZONTAL) self.SetSizer(self.sizer) self.ctrl = self.CreateCtrl(int(not isinstance(value, (int, float)))) self.Bind(wx.EVT_SIZE, self.OnSize)
Example #5
Source File: ObjectListView.py From bookhub with MIT License | 5 votes |
def GetAlignmentForText(self): """ Return the alignment of this column in a form that can be used as a style flag on a text control """ return { "l": wx.TE_LEFT, "c": wx.TE_CENTRE, "r": wx.TE_RIGHT, }.get(self.align[:1], wx.TE_LEFT) #------------------------------------------------------------------------------- # Value accessing
Example #6
Source File: commondialogs.py From CANFestivino with GNU Lesser General Public License v2.1 | 4 votes |
def _init_ctrls(self, prnt): wx.Dialog.__init__(self, id=ID_USERTYPEDIALOG, name='UserTypeDialog', parent=prnt, pos=wx.Point(376, 223), size=wx.Size(444, 210), style=wx.DEFAULT_DIALOG_STYLE, title=_('Add User Type')) self.SetClientSize(wx.Size(444, 210)) self.staticText1 = wx.StaticText(id=ID_USERTYPEDIALOGSTATICTEXT1, label=_('Type:'), name='staticText1', parent=self, pos=wx.Point(0, 0), size=wx.Size(0, 17), style=0) self.Type = wx.ComboBox(choices=[], id=ID_USERTYPEDIALOGTYPE, name='Type', parent=self, pos=wx.Point(0, 0), size=wx.Size(0, 28), style=wx.CB_READONLY) self.Type.Bind(wx.wx.EVT_COMBOBOX, self.OnTypeChoice, id=ID_USERTYPEDIALOGTYPE) self.Spacer = wx.Panel(id=ID_MAPVARIABLEDIALOGSPACER, name='Spacer', parent=self, pos=wx.Point(0, 0), size=wx.Size(0, 0), style=wx.TAB_TRAVERSAL) self.staticBox1 = wx.StaticBox(id=ID_USERTYPEDIALOGSTATICBOX1, label=_('Values'), name='staticBox1', parent=self, pos=wx.Point(0, 0), size=wx.Size(0, 0), style=0) self.staticText2 = wx.StaticText(id=ID_USERTYPEDIALOGSTATICTEXT2, label=_('Minimum:'), name='staticText2', parent=self, pos=wx.Point(0, 0), size=wx.Size(80, 17), style=0) self.Min = wx.TextCtrl(id=ID_USERTYPEDIALOGMIN, name='Min', parent=self, pos=wx.Point(0, 0), size=wx.Size(0, 24), style=wx.TE_RIGHT, value='0') self.staticText3 = wx.StaticText(id=ID_USERTYPEDIALOGSTATICTEXT3, label=_('Maximum:'), name='staticText3', parent=self, pos=wx.Point(0, 0), size=wx.Size(80, 17), style=0) self.Max = wx.TextCtrl(id=ID_USERTYPEDIALOGMAX, name='Max', parent=self, pos=wx.Point(0, 0), size=wx.Size(0, 24), style=wx.TE_RIGHT, value='0') self.staticText4 = wx.StaticText(id=ID_USERTYPEDIALOGSTATICTEXT4, label=_('Length:'), name='staticText4', parent=self, pos=wx.Point(0, 0), size=wx.Size(80, 17), style=0) self.Length = wx.TextCtrl(id=ID_USERTYPEDIALOGLENGTH, name='Length', parent=self, pos=wx.Point(0, 0), size=wx.Size(0, 24), style=wx.TE_RIGHT, value='0') self.ButtonSizer = self.CreateButtonSizer(wx.OK|wx.CANCEL) self.Bind(wx.EVT_BUTTON, self.OnOK, id=self.ButtonSizer.GetAffirmativeButton().GetId()) self._init_sizers()
Example #7
Source File: commondialogs.py From CANFestivino with GNU Lesser General Public License v2.1 | 4 votes |
def _init_ctrls(self, prnt): wx.Dialog.__init__(self, id=ID_NODEINFOSDIALOG, name='NodeInfosDialog', parent=prnt, pos=wx.Point(376, 223), size=wx.Size(300, 380), style=wx.DEFAULT_DIALOG_STYLE, title=_('Node infos')) self.SetClientSize(wx.Size(300, 380)) self.staticText1 = wx.StaticText(id=ID_NODEINFOSDIALOGSTATICTEXT1, label=_('Name:'), name='staticText1', parent=self, pos=wx.Point(0, 0), size=wx.Size(0, 17), style=0) self.NodeName = wx.TextCtrl(id=ID_NODEINFOSDIALOGNAME, name='NodeName', parent=self, pos=wx.Point(0, 0), size=wx.Size(0, 24), style=0, value='') self.staticText2 = wx.StaticText(id=ID_NODEINFOSDIALOGSTATICTEXT2, label=_('Node ID:'), name='staticText2', parent=self, pos=wx.Point(0, 0), size=wx.Size(0, 17), style=0) self.NodeID = wx.TextCtrl(id=ID_NODEINFOSDIALOGNODEID, name='NodeID', parent=self, pos=wx.Point(0, 0), size=wx.Size(0, 25), style=wx.TE_RIGHT, value='') self.staticText3 = wx.StaticText(id=ID_NODEINFOSDIALOGSTATICTEXT3, label=_('Type:'), name='staticText3', parent=self, pos=wx.Point(0, 0), size=wx.Size(0, 17), style=0) self.Type = wx.ComboBox(choices=[], id=ID_NODEINFOSDIALOGTYPE, name='Type', parent=self, pos=wx.Point(0, 0), size=wx.Size(0, 28), style=wx.CB_READONLY) self.staticText4 = wx.StaticText(id=ID_NODEINFOSDIALOGSTATICTEXT4, label=_('Default String Size:'), name='staticText4', parent=self, pos=wx.Point(0, 0), size=wx.Size(0, 17), style=0) self.DefaultStringSize = wx.SpinCtrl(id=ID_NODEINFOSDIALOGDEFAULTSTRINGSIZE, name='DefaultStringSize', parent=self, pos=wx.Point(0, 0), size=wx.Size(0, 25), style=wx.TE_RIGHT) self.staticText5 = wx.StaticText(id=ID_NODEINFOSDIALOGSTATICTEXT5, label=_('Description:'), name='staticText5', parent=self, pos=wx.Point(0, 0), size=wx.Size(0, 17), style=0) self.Description = wx.TextCtrl(id=ID_NODEINFOSDIALOGDESCRIPTION, name='Description', parent=self, pos=wx.Point(0, 0), size=wx.Size(0, 24), style=0, value='') self.ButtonSizer = self.CreateButtonSizer(wx.OK|wx.CANCEL) self.Bind(wx.EVT_BUTTON, self.OnOK, id=self.ButtonSizer.GetAffirmativeButton().GetId()) self._init_sizers()