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, id=wx.ID_ANY, callbackUserData=None, canVeto=False, eventCategory=wxEVT_CATEGORY_UI, eventCriteria=None, eventData=None, eventObject=None, # added eventSource=None, # Deprecated ??? eventType=None, handlerToProcessOnlyIn=None, # added isCommandEvent=False, propagationLevel=wxEVENT_PROPAGATE_NONE, skipped=False, timeStamp=0, 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 # Indicates how many levels the event can propagate. # This member is protected and should typically only be set in the # constructors of the derived classes. It may be temporarily changed # by StopPropagation() and ResumePropagation() and tested with # ShouldPropagate(). # # The initial value is set to either wxEVENT_PROPAGATE_NONE # (by default) meaning that the event shouldn't be propagated at all # or to wxEVENT_PROPAGATE_MAX (for command events) meaning that it # should be propagated as much as necessary. # # Any positive number means that the event should be propagated but # no more than the given number of times. E.g. the propagation level # may be set to 1 to propagate the event to its parent only, but not # to its grandparent. self.ts_propagationLevel = wxEVENT_PROPAGATE_NONE self.ts_skipped = skipped self.ts_timeStamp = timeStamp self.ts_wasProcessed = wasProcessed ## self.thisown = theClass self.tsEndClassRegistration(theClass)
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)