def __init__(self, cursorName, type, hotSpotX=0, hotSpotY=0): ''' Associate a curses cursor visibility mode with a wxPython cursor name instead of the following. Construct a Cursor from a file. Specify the type of file using wx.BITMAP_TYPE* constants, and specify the hotspot if not using a .cur file. :see: Alternate constructors wx.StockCursor, `wx.CursorFromImage` ''' theClass = 'Cursor' wx.RegisterFirstCallerClassName(self, theClass) Object.__init__(self) try: self.theFirstCallerName != theClass except AttributeError: self.theFirstCallerName = theClass self.tsBeginClassRegistration(theClass, wx.ID_ANY) try: self.logger = tsLogger.TsLogger(threshold=tsLogger.ERROR, start=time.time(), name=tsLogger.StandardOutputFile) except AttributeError, e: self.logger = None msg = 'tsWxCursor.__init__: Exception = %s' % e raise tse.ProgramException(tse.APPLICATION_TRAP, msg)
def __init__(self, red, green, blue, alpha): ''' Constructs a colour from red, green, blue and alpha values. ''' theClass = 'Color' wx.RegisterFirstCallerClassName(self, theClass) Object.__init__(self) try: self.theFirstCallerName != theClass except AttributeError: self.theFirstCallerName = theClass self.tsBeginClassRegistration(theClass, wx.ID_ANY) self.ts_Alpha = alpha self.ts_Blue = blue self.ts_Green = green self.ts_Red = red ## if TheColourDatabase == {}: ## TheColourDatabase = ColorListRGB self.tsEndClassRegistration(theClass)
def __init__(self, entries): ''' ''' theClass = 'AcceleratorTable' wx.RegisterFirstCallerClassName(self, theClass) Object.__init__(self) self.tsBeginClassRegistration(theClass, wx.ID_ANY) self.ts_AceleratorTable = wx.NullAcceleratorTable for anEntry in entries: self.ts_AceleratorTable += [anEntry] self.tsEndClassRegistration(theClass)
def __init__(self, size, isShown=True): """ Constructs an empty wx.SizerSpacer. """ theClass = "SizerSpacer" wx.RegisterFirstCallerClassName(self, theClass) Object.__init__(self) self.tsBeginClassRegistration(theClass, wx.ID_ANY) # Set Default Values self.ts_Size = self.SetSize(size) self.ts_IsShown = isShown ## self.ts_Children = [] self.tsEndClassRegistration(theClass)
eventType=None, handlerToProcessOnlyIn=None, # added isCommandEvent=False, propagationLevel=wxEVENT_PROPAGATE_NONE, skipped=False, timeStamp=0L, veto=False, wasProcessed=False): ''' Constructor. ''' theClass = 'Event' wx.RegisterFirstCallerClassName(self, theClass) Object.__init__(self) self.tsBeginClassRegistration(theClass, wx.ID_ANY) self.ts_id = id self.ts_CanVeto = canVeto self.ts_Veto = veto self.ts_callbackUserData = callbackUserData self.ts_EventCategory = eventCategory self.ts_EventCriteria = eventCriteria self.ts_EventData = eventData self.ts_EventSource = eventSource self.ts_EventType = eventType self.ts_isCommandEvent = False
def __init__(self, *args, **kwargs): ''' Constructor for Sizer, Spacer and Window variants of SizerItem. Design for wxPython 2.8.12 supported no arguments and no key word arguments. The application first had to instantiate the SizerItem Class and then use various Set methods to configure the kind of SizerItem. Design for wxWidgets 2.9.2.2 supported optional arguments and key word arguments. The application could instantiate the SizerItem Class in the manner of wxPython 2.8.12 or optionally instantiate the Sizer, Spacer or Window variant via the appropriate args and kwargs. Since there is no wxPython 2.9.2.2, the following implementation attempts to cover all wxWidgets 2.9.2.2 instantiation forms. ''' theClass = 'SizerItem' wx.RegisterFirstCallerClassName(self, theClass) Object.__init__(self) self.tsBeginClassRegistration(theClass, wx.ID_ANY) # Begin setup to avoid triggering pylint errors and warnings. # Set Default Values # ***** Begin Default Attributes self.ts_Border = 0 self.ts_Flag = 0 self.ts_ID = self.ts_LastSizerItemId = wx.ID_NONE self.ts_Kind = wx.Item_None self.ts_MinSize = wxSize(0, 0) self.ts_MinSizeWithBorder = wxSize(0, 0) self.ts_Proportion = 0 self.ts_Ratio = 0.0 self.ts_Rect = wxRect(0, 0, 0, 0) self.ts_Show = False self.ts_Size = wxSize(0, 0) self.ts_Sizer = None self.ts_Spacer = None self.ts_UserData = None self.ts_Window = None # ***** End Default Attributes # End setup to avoid triggering pylint errors and warnings. if (len(args) == 0) and \ (len(kwargs) == 0): # Instatiate SizerItem Class without using args or kwargs # associated with Sizer, Spacer or Window variants. self.__init_No_Args_No_KwArgs__() elif (len(args) > 0) and \ (isinstance(args[0], wxWindow)): # Instatiate SizerItem Class using args or kwargs # associated with Window variant. self.__init_Item_Window__(args, kwargs) elif (len(args) > 0) and \ (isinstance(args[0], wxSizerSpacer)): # Instatiate SizerItem Class using args or kwargs # associated with Spacer variants. self.__init_Item_Spacer__(args, kwargs) else: # Instatiate SizerItem Class using args or kwargs # associated with Sizer variants. self.__init_Item_Sizer__(args, kwargs) self.tsEndClassRegistration(theClass)