本文整理汇总了Python中BaseWidget.BaseWidget.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python BaseWidget.__init__方法的具体用法?Python BaseWidget.__init__怎么用?Python BaseWidget.__init__使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseWidget.BaseWidget
的用法示例。
在下文中一共展示了BaseWidget.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from BaseWidget import BaseWidget [as 别名]
# 或者: from BaseWidget.BaseWidget import __init__ [as 别名]
def __init__(self, checked_text, unchecked_text, height, width, y, x, attr=None):
BaseWidget.__init__(self, height, width, y, x, attr)
self.CheckedText = "< " + checked_text + " >"
self.UncheckedText = "< " + unchecked_text + " >"
self.Text = self.UncheckedText
self.Checked = False
self.UpdateDisplay()
示例2: __init__
# 需要导入模块: from BaseWidget import BaseWidget [as 别名]
# 或者: from BaseWidget.BaseWidget import __init__ [as 别名]
def __init__( self, parent ):
BaseWidget.__init__ ( self, parent )
self.m_mainSizer = wx.BoxSizer( wx.VERTICAL )
m_errorMsgSizer = wx.BoxSizer( wx.VERTICAL )
self.m_errorLabel = wx.StaticText( self, wx.ID_ANY, u"Error Message", wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_errorLabel.Wrap( -1 )
m_errorMsgSizer.Add( self.m_errorLabel, 0, wx.TOP|wx.RIGHT|wx.LEFT, 5 )
self.m_errorMsgCtrl = wx.richtext.RichTextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0|wx.VSCROLL|wx.HSCROLL|wx.NO_BORDER|wx.WANTS_CHARS )
m_errorMsgSizer.Add( self.m_errorMsgCtrl, 1, wx.EXPAND |wx.ALL, 5 )
self.m_mainSizer.Add( m_errorMsgSizer, 1, wx.EXPAND, 5 )
m_diagnosticSizer = wx.BoxSizer( wx.VERTICAL )
self.m_diagnosticLabel = wx.StaticText( self, wx.ID_ANY, u"Diagnostics", wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_diagnosticLabel.Wrap( -1 )
m_diagnosticSizer.Add( self.m_diagnosticLabel, 0, wx.TOP|wx.RIGHT|wx.LEFT, 5 )
self.m_diagnosticCtrl = wx.richtext.RichTextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0|wx.VSCROLL|wx.HSCROLL|wx.NO_BORDER|wx.WANTS_CHARS )
m_diagnosticSizer.Add( self.m_diagnosticCtrl, 1, wx.EXPAND |wx.ALL, 5 )
self.m_mainSizer.Add( m_diagnosticSizer, 2, wx.EXPAND, 5 )
self.initButtons( [Globals.ButtonTypes.NETWORK_LOG] )
self.SetSizer( self.m_mainSizer )
self.Layout()
示例3: __init__
# 需要导入模块: from BaseWidget import BaseWidget [as 别名]
# 或者: from BaseWidget.BaseWidget import __init__ [as 别名]
def __init__(self, lines, characters, y, x, resultsObj=None, colWidth=7, rowHeight=1, delimiter=" | "):
BaseWidget.__init__(self, lines, characters, y, x)
# position of the selector in DataTable
self.PosY = 0 # row
self.PosX = 0 # col
# DataTable UI Settings independent of Results Object
# Can update these as we choose for each DataTable Widget
if colWidth < 4:
self.ColWidth = 4
else:
self.ColWidth = colWidth # Width of each column, update as desired
if rowHeight < 1:
self.RowHeight = 1
else:
self.RowHeight = rowHeight # Height of each row, update as desired
if delimiter == "":
self.ColumnDelimiter = " | "
else:
self.ColumnDelimiter = delimiter # Delimiter string between each column's data, update as desired
# variables that govern table data
# these are base values to show an empty data table
# LoadResultsObject() will overwrite these with resultsObj data
self.Rows = 10
self.Columns = 10
self.RowLabelWidth = 2
# load data from resultsObj to be displayed
self.LoadResultsObject(resultsObj) # must be called upon init to set graphics for widget
self.UpdateDisplay()
示例4: __init__
# 需要导入模块: from BaseWidget import BaseWidget [as 别名]
# 或者: from BaseWidget.BaseWidget import __init__ [as 别名]
def __init__(self, height, width, y, x, attr=None):
BaseWidget.__init__(self, height, width, y, x, attr)
self.Type = "TextBox"
self.Text = ""
self.DisplayText = ' ' * (width - 1)
self.DisplayMode = "STANDARD"
self.IsActive = False
self.UpdateDisplay()
示例5: __init__
# 需要导入模块: from BaseWidget import BaseWidget [as 别名]
# 或者: from BaseWidget.BaseWidget import __init__ [as 别名]
def __init__ (self, image):
BaseWidget.__init__ (self)
self._padding = 2
self._border = BORDER_NONE
self._picture = None
self._path = None
self.set_picture (image)
示例6: __init__
# 需要导入模块: from BaseWidget import BaseWidget [as 别名]
# 或者: from BaseWidget.BaseWidget import __init__ [as 别名]
def __init__ (self, scrolledlist):
BaseWidget.__init__ (self)
self._itemcollection = None
self.itemcollection = ListItemCollection ()
self.scrolledlist = scrolledlist
self._spacing = 2
self._signals[SIG_MOUSEDOWN] = []
self._signals[SIG_KEYDOWN] = None # Dummy for keyboard activation.
示例7: __init__
# 需要导入模块: from BaseWidget import BaseWidget [as 别名]
# 或者: from BaseWidget.BaseWidget import __init__ [as 别名]
def __init__ (self):
BaseWidget.__init__ (self)
self.size = 104, 24 # Use a fixed size.
# The current value, max is 100 (%), min is 0 (%) and step range.
self._value = 0
self._step = 0.1
self._text = None
self._signals[SIG_VALCHANGE] = []
示例8: __init__
# 需要导入模块: from BaseWidget import BaseWidget [as 别名]
# 或者: from BaseWidget.BaseWidget import __init__ [as 别名]
def __init__( self, parent ):
BaseWidget.__init__ ( self, parent )
self.m_mainSizer = wx.BoxSizer( wx.VERTICAL )
self.m_bitmapHolder = wx.StaticBitmap( self, wx.ID_ANY, wx.NullBitmap, wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_mainSizer.Add( self.m_bitmapHolder, 1, wx.ALL|wx.EXPAND, 5 )
self.initButtons( [Globals.ButtonTypes.OLD, Globals.ButtonTypes.NEW, Globals.ButtonTypes.DIFF, Globals.ButtonTypes.UPDATE] )
self.SetSizer( self.m_mainSizer )
self.Layout()
示例9: __init__
# 需要导入模块: from BaseWidget import BaseWidget [as 别名]
# 或者: from BaseWidget.BaseWidget import __init__ [as 别名]
def __init__ (self, text):
BaseWidget.__init__ (self)
# Mnemonic identifiers in a tuple: (index, key).
self._mnemonic = (-1, None)
self._widget = None
self.__active = False # Internal mnemonic handler.
self._text = None
self.set_text (text)
self._padding = 2
示例10: __init__
# 需要导入模块: from BaseWidget import BaseWidget [as 别名]
# 或者: from BaseWidget.BaseWidget import __init__ [as 别名]
def __init__ (self, minimum, maximum, step=1.0):
BaseWidget.__init__ (self)
self._signals[SIG_VALCHANGED] = []
# Ranges and step value.
self._minimum = minimum # Set the min and max values temporary
self._maximum = maximum # and check them later.
self._step = 0.0
self._value = 0.0
if minimum >= maximum:
raise ValueError ("minimum must be smaller than maximum")
self.set_step (step)
示例11: __init__
# 需要导入模块: from BaseWidget import BaseWidget [as 别名]
# 或者: from BaseWidget.BaseWidget import __init__ [as 别名]
def __init__ (self, image):
BaseWidget.__init__ (self)
self._picture = None
self._path = None
self.__click = False
self._lastevent = None
self._signals[SIG_MOUSEDOWN] = []
self._signals[SIG_MOUSEUP] = []
self._signals[SIG_CLICKED] = []
self._signals[SIG_MOUSEMOVE] = []
self.set_picture (image)
示例12: __init__
# 需要导入模块: from BaseWidget import BaseWidget [as 别名]
# 或者: from BaseWidget.BaseWidget import __init__ [as 别名]
def __init__ (self):
BaseWidget.__init__ (self)
self._text = ''
self._editable = True
# Caret | position.
self._caret = 0
self._caretvisible = True
self._timer = _TIMER
self._signals[SIG_KEYDOWN] = []
self._signals[SIG_INPUT] = []
self._signals[SIG_TICK] = None # No events for this one.
# Temporary placeholder for text input and ESCAPE.
self._temp = None
示例13: __init__
# 需要导入模块: from BaseWidget import BaseWidget [as 别名]
# 或者: from BaseWidget.BaseWidget import __init__ [as 别名]
def __init__ (self):
BaseWidget.__init__ (self)
# Negative values. Influences the axes.
self._negative = False
# Horizontal or vertical mapping of the axes.
self._orientation = ORIENTATION_HORIZONTAL
# Coordinates of the point of origin on the widget.
self._origin = (0, 0)
# The data to evaluate and the return values.
self._data = None
self._values = None
# The eval func.
self._evalfunc = None
示例14: __init__
# 需要导入模块: from BaseWidget import BaseWidget [as 别名]
# 或者: from BaseWidget.BaseWidget import __init__ [as 别名]
def __init__ (self):
BaseWidget.__init__ (self)
self._text = None
self._editable = True
# Caret | position.
self._caret = 0
self._caret_visible = True
# Internal counter for tick events (time measuring).
self._counter = 50
self._signals[SIG_KEYDOWN] = []
self._signals[SIG_INPUT] = []
self._signals[SIG_TICK] = None # No events for this one.
# Temporary placeholder for text input and ESCAPE.
self._temp = None
示例15: __init__
# 需要导入模块: from BaseWidget import BaseWidget [as 别名]
# 或者: from BaseWidget.BaseWidget import __init__ [as 别名]
def __init__( self, parent ):
BaseWidget.__init__(self, parent)
self.m_mainSizer = wx.BoxSizer( wx.VERTICAL )
self.m_mainPanel = wx.Panel( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL )
m_outcomeCont = wx.BoxSizer( wx.VERTICAL )
self.m_outcomeLabel = wx.StaticText( self, wx.ID_ANY, u"Outcome", wx.DefaultPosition, wx.Size( -1,20 ), 0 )
self.m_outcomeLabel.Wrap( -1 )
m_outcomeCont.Add( self.m_outcomeLabel, 0, wx.TOP|wx.RIGHT|wx.LEFT, 5 )
self.m_outcomeCtrl = wx.richtext.RichTextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0|wx.VSCROLL|wx.HSCROLL|wx.NO_BORDER|wx.WANTS_CHARS )
m_outcomeCont.Add( self.m_outcomeCtrl, 1, wx.EXPAND |wx.ALL, 5 )
self.m_mainSizer.Add( m_outcomeCont, 1, wx.EXPAND, 5 )
self.initButtons( [Globals.ButtonTypes.UPDATE, Globals.ButtonTypes.NETWORK_LOG] )
self.SetSizer( self.m_mainSizer )
self.Layout()