src/w/x/wxPython-In-Action-HEAD/demo/Joystick.py wxPython-In-Action(Download)
class Label(wx.StaticText):
# A derived StaticText that always aligns right and renders
# in a bold font.
def __init__(self, parent, label):
wx.StaticText.__init__(self, parent, -1, label, style=wx.ALIGN_RIGHT)
self.SetFont(
wx.BOLD
)
t = wx.StaticText(self, -1, "X - Y Axes", style = wx.ALIGN_CENTRE)
t.SetFont(fn)
sizer.Add(t, 0, wx.ALL | wx.EXPAND | wx.ALIGN_CENTER | wx.ALIGN_CENTER_HORIZONTAL, 1)
parent.GetFont().GetStyle(),
wx.BOLD
)
t = wx.StaticText(self, -1, "POV Control", style = wx.ALIGN_CENTER)
t.SetFont(fn)
gsizer.Add(t, 0, wx.ALL | wx.EXPAND, 1)
wx.BOLD
)
t = wx.StaticText(self, -1, "Buttons", style = wx.ALIGN_LEFT)
t.SetFont(fn)
tsizer.Add(t, 0, wx.ALL | wx.EXPAND | wx.ALIGN_LEFT, 1)
self.GetMax = eval('stick.Get%sMax' % token)
# Create our displays and set them up.
self.Min = wx.StaticText(self, -1, str(self.GetMin()), style=wx.ALIGN_RIGHT)
self.Max = wx.StaticText(self, -1, str(self.GetMax()), style=wx.ALIGN_LEFT)
self.bar = AxisBar(self)
sizer.Add(self.Min, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 1)
sizer.Add(self.bar, 1, wx.ALL | wx.ALIGN_CENTER | wx.ALIGN_CENTER_VERTICAL, 1)
sizer.Add(self.Max, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 1)
else:
# We go here if the axis in question is not available.
self.control = wx.StaticText(self, -1, ' *** Not Present ***')
src/a/l/als4etracker-HEAD/4eCombatUi.py als4etracker(Download)
ApplyCtrlStyle(self, "Default", "Section")
# Power name
name_ctrl=wx.StaticText(self, style=wx.ALIGN_LEFT | wx.BORDER_SIMPLE, label = "")
self.name_ctrl = name_ctrl
ApplyCtrlStyle(name_ctrl, "Default", "SectionBold")
# Power usage
trigger_ctrl=wx.StaticText(self, style=wx.ALIGN_RIGHT | wx.BORDER_DOUBLE, label="")
if icon_type in G_BITMAPS:
icon_ctrl = wx.StaticBitmap(self, bitmap=G_BITMAPS[icon_type])
else:
icon_ctrl=wx.StaticText(self, style=wx.ALIGN_CENTER, label = icon_type)
ApplyCtrlStyle(icon_ctrl, "Default", "SectionBold")
class CreatureFieldStaticText(wx.StaticText):
"""A self-updating/self-styling field that displays information about the creature."""
STYLE_METHODS=[None, "StyleByHealthStatus", "StyleBySelected"]
def __init__(self, parent, creature, label_function, update_events=[], style_method=None, *args, **kwargs):
""" creature: The creature that we are linked against
# Create the new controls, and add them to the new subsection
for coords in table:
attr, label_text, span, ctrl_style, sizer_flags, style = table[coords]
ctrl = wx.StaticText(self, style=style, label=label_text if label_text else "")
ApplyCtrlStyle(ctrl, "Default", ctrl_style)
# Next, create new controls
for column_id in set(self.display_columns).difference(self.header_ctrls.keys()):
column_label, text_style, label_function, styling_function, update_events, style_flags = self.header_table[column_id]
ctrl = wx.StaticText(self, label=column_label if column_label else "", style=style_flags)
#ApplyPanelStyle(ctrl, "Header", "Bold")
ApplyCtrlStyle(ctrl, "Default", "HeaderBold")
self.header_ctrls[column_id] = ctrl
src/b/i/bitpim-HEAD/bitpim/src/sms_tab.py bitpim(Download)
class StaticText(wx.StaticText):
def __init__(self, parent, _=None):
super(StaticText, self).__init__(parent, -1)
def SetValue(self, v):
if v.find('subject') and (v.find('\n')>-1):
v=v.split('\n')[0]
if len(v)==10 and v.isdigit():
v='(%03d)-%03d-%04d'%(int(v[:3]),int(v[3:6]),int(v[6:10]))
elif len(v)==11 and v.isdigit() and v[0]=='1':
v='1-(%03d)-%03d-%04d'%(int(v[1:4]),int(v[4:7]),int(v[7:11]))
self.SetLabel(v)
#-------------------------------------------------------------------------------
class TimeStamp(wx.StaticText):
class DeliveryStatus(wx.StaticText):
def __init__(self, parent, _=None):
super(DeliveryStatus, self).__init__(parent, -1)
def SetValue(self, v):
self.SetLabel('\n'.join(v))
#-------------------------------------------------------------------------------
gs=wx.FlexGridSizer(-1, 2, 5, 5)
gs.AddGrowableCol(1)
for n in self._fields:
gs.Add(wx.StaticText(self, -1, n[self._label_index],
style=wx.ALIGN_LEFT),0, wx.EXPAND|wx.BOTTOM, 0)
w=n[self._class_index](self, -1)
gs.Add(w, 0, n[self._flg_index]|wx.BOTTOM, 0)
self.historical_date=None
static_bs=wx.StaticBoxSizer(wx.StaticBox(self, -1, 'Historical Data Status:'),
wx.VERTICAL)
self.historical_data_label=wx.StaticText(self, -1, 'Current Data')
static_bs.Add(self.historical_data_label, 1, wx.EXPAND|wx.ALL, 5)
hbs.Add(static_bs, 1, wx.EXPAND|wx.ALL, 5)
vbs.Add(hbs, 0, wx.EXPAND|wx.ALL, 5)
static_bs1=wx.StaticBoxSizer(wx.StaticBox(self, -1, 'Canned Messages:'),
wx.HORIZONTAL)
self.canned_list=gizmos.EditableListBox(self, -1, 'User Defined Canned Messages:')
static_bs1.Add(self.canned_list, 1, wx.EXPAND|wx.ALL, 5)
vbs1=wx.BoxSizer(wx.VERTICAL)
vbs1.Add(wx.StaticText(self, -1, ' Built-in Canned Messages:'), 0, wx.ALL, 0)
hbs=wx.BoxSizer(wx.HORIZONTAL)
static_bs=wx.StaticBoxSizer(wx.StaticBox(self, -1, 'Historical Data Status:'),
wx.VERTICAL)
self.historical_data_label=wx.StaticText(self, -1, 'Current Data')
static_bs.Add(self.historical_data_label, 1, wx.EXPAND|wx.ALL, 5)
hbs.Add(static_bs, 1, wx.EXPAND|wx.ALL, 5)
vbs.Add(hbs, 0, wx.EXPAND|wx.ALL, 5)
self._item_list.ResetView(self.nodes, self.nodes_keys)
vbs0=wx.BoxSizer(wx.VERTICAL)
vbs0.Add(self._item_list, 1, wx.EXPAND|wx.ALL, 5)
vbs0.Add(wx.StaticText(self, -1, ' Note: Click column headings to sort data'), 0, wx.ALIGN_CENTRE|wx.BOTTOM, 10)
hbmessage.Add(vbs0, 1, wx.EXPAND|wx.ALL, 5)
vbs1=wx.BoxSizer(wx.VERTICAL)
self._item_info=SMSInfo(self)
src/w/u/wuu-HEAD/trunk/WUUDialogs.py wuu(Download)
class Label(wx.StaticText):
"""
Special StaticText control that automatically shows up as bold and right-aligned.
Used as a label in a grid layout.
"""
def __init__(self, parent, text):
""""""
# Special instructions
if key == "Instructions":
# add a blank line before
grid.Add(wx.StaticText(self, -1, label=""), 0, rcflags, 3)
grid.Add(wx.StaticText(self, -1, label=""), 1, rcflags, 3)
grid.Add(Label(self, "Instructions: "), 0, lcflags, 3)
grid.Add(wx.StaticText(self, -1, label=desc), 1, rcflags, 3)
# add a blank line after
grid.Add(wx.StaticText(self, -1, label=""), 0, rcflags, 3)
grid.Add(wx.StaticText(self, -1, label=""), 1, rcflags, 3)
src/w/u/wuu-HEAD/WUUDialogs.py wuu(Download)
class Label(wx.StaticText):
"""
Special StaticText control that automatically shows up as bold and right-aligned.
Used as a label in a grid layout.
"""
def __init__(self, parent, text):
""""""
# Special instructions
if key == "Instructions":
# add a blank line before
grid.Add(wx.StaticText(self, -1, label=""), 0, rcflags, 3)
grid.Add(wx.StaticText(self, -1, label=""), 1, rcflags, 3)
grid.Add(Label(self, "Instructions: "), 0, lcflags, 3)
grid.Add(wx.StaticText(self, -1, label=desc), 1, rcflags, 3)
# add a blank line after
grid.Add(wx.StaticText(self, -1, label=""), 0, rcflags, 3)
grid.Add(wx.StaticText(self, -1, label=""), 1, rcflags, 3)
src/w/x/wxPython-In-Action-HEAD/demo/GetMouseState.py wxPython-In-Action(Download)
class StaticText(wx.StaticText):
"""
A StaticText that only updates the label if it has changed, to
help reduce potential flicker since these controls would be
updated very frequently otherwise.
"""
def SetLabel(self, label):
self.SetSizer(sizer)
sizer.Add((25,25))
sizer.Add(wx.StaticText(
self, -1,
"Mouse and modifier state can be polled with wx.GetMouseState"),
0, wx.CENTER|wx.ALL, 10)
sizer.Add(wx.StaticLine(self), 0, wx.EXPAND|wx.TOP, 10)
src/v/t/VT-USRP-daughterboard-drivers_python-HEAD/gr-wxgui/src/python/fftsink2.py VT-USRP-daughterboard-drivers_python(Download)
class LabelText(wx.StaticText):
def __init__(self, window, label):
wx.StaticText.__init__(self, window, -1, label)
font = self.GetFont()
font.SetWeight(wx.FONTWEIGHT_BOLD)
font.SetUnderlined(True)
self.SetFont(font)
src/w/x/wxPython-In-Action-HEAD/demo/MediaCtrl.py wxPython-In-Action(Download)
class StaticText(wx.StaticText):
"""
A StaticText that only updates the label if it has changed, to
help reduce potential flicker since these controls would be
updated very frequently otherwise.
"""
def SetLabel(self, label):
src/p/y/pyogame-HEAD/trunk/GUI/GUIKernel.py pyogame(Download)
class OGText(wx.StaticText): def __init__(self, parent, id, label, font = 1, pos = wx.DefaultPosition, size = wx.DefaultSize, style = 0, name = "staticText"): wx.StaticText.__init__(self, parent, id, label, pos, size, style, name) font1 = wx.Font(7, wx.SWISS, wx.NORMAL, wx.NORMAL, True, 'Verdana', wx.FONTFLAG_NOT_ANTIALIASED) font2 = wx.Font(7, wx.SWISS, wx.NORMAL, wx.BOLD, True, 'Verdana', wx.FONTFLAG_NOT_ANTIALIASED) font3 = wx.Font(5, wx.SWISS, wx.NORMAL, wx.BOLD, True, 'Verdana', wx.FONTFLAG_NOT_ANTIALIASED)
src/p/y/pyepics-HEAD/lib/wx/wxlib.py pyepics(Download)
class pvText(wx.StaticText, pvCtrlMixin):
""" static text for PV display, with callback for automatic updates"""
def __init__(self, parent, pv=None, as_string=True,
font=None, fg=None, bg=None, style=None, **kw):
self.as_string = as_string
self.pv = pv
1 | 2 | 3 Next