def __init__(self, parent, id=wx.ID_ANY, title=wx.EmptyString, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.DEFAULT_FRAME_STYLE, name=wx.ScreenNameStr): ''' Construct class. ''' theClass = 'Screen' # Capture initial caller parametsrs before they are changed self.caller_parent = parent self.caller_id = id self.caller_title = title self.caller_pos = pos self.caller_size = size self.caller_style = style self.caller_name = name wx.RegisterFirstCallerClassName(self, theClass) TopLevelWindow.__init__(self) self.tsBeginClassRegistration(theClass, id) myRect = self.display.Geometry myClientRect = self.display.ClientArea self.ts_Rect = myRect self.ts_ClientRect = myClientRect thePosition = self.Position theSize = self.Size if DEBUG: self.logger.debug(' self: %s' % self) self.logger.debug(' parent: %s' % parent) self.logger.debug(' id: %s' % self.ts_Id) self.logger.debug(' AssignedId: %s' % self.ts_AssignedId) self.logger.debug(' title: %s' % title) self.logger.debug(' pos: %s' % thePosition) self.logger.debug(' size: %s' % theSize) self.logger.debug(' style: 0x%X' % style) self.logger.debug(' name: %s' % name) self.logger.debug(' myRect: %s' % str(myRect)) self.logger.debug(' myClientRect: %s' % str(myClientRect)) self.ts_Name = name self.ts_Parent = parent self.ts_DescendantOrderOfShow = [self.ts_AssignedId] theTopLevelClass = self self.SetTopLevelAncestor(theTopLevelClass) if parent is None: self.ts_GrandParent = None else: self.ts_GrandParent = parent.Parent if self.TermName in BlackOnWhiteDefault: self.ts_ForegroundColour = wx.COLOR_BLACK self.ts_BackgroundColour = wx.COLOR_WHITE else: self.ts_ForegroundColour = wx.COLOR_WHITE self.ts_BackgroundColour = wx.COLOR_BLACK ## self.ts_FocusEnabled = True self.SetFocus() self.ts_Label = title self.ts_Style = style self.ts_Title = title try: self.ts_Handle = self.display.TheTerminalScreen msg = 'tsWxScreen.__init__: ts_handle=%s' % self.ts_Handle self.logger.debug(msg) except Exception, handleError: self.ts_Handle = None msg = 'tsWxScreen.__init__: handleError=%s' % str(handleError) self.logger.warning(msg)
def __init__(self, parent, id=wx.ID_ANY, bitmap=None, splashStyle=0, milliseconds=0, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.DEFAULT_SPLASHSCREEN_STYLE): ''' Construct class. ''' theClass = 'SplashScreen' # Capture initial caller parametsrs before they are changed self.caller_bitmap = bitmap self.caller_splashStyle = splashStyle self.caller_milliseconds = milliseconds self.caller_parent = parent self.caller_id = id self.caller_pos = pos self.caller_size = size self.caller_style = style wx.RegisterFirstCallerClassName(self, theClass) TopLevelWindow.__init__(self) self.tsBeginClassRegistration(theClass, id) ## size = wxSize(500, 300) Frame.__init__( self, parent, id=wx.ID_ANY, title=wx.EmptyString, pos=pos, size=size, style=wx.BORDER_SIMPLE, #wx.DEFAULT_SPLASHSCREEN_STYLE, name=wx.SplashScreenNameStr) splashWindow = self splashWindow.ts_ForegroundColour = wx.COLOR_RED splashWindow.ts_BackgroundColour = wx.COLOR_WHITE self.ts_SplashStyle = splashStyle self.ts_SplashWindow = splashWindow self.ts_SplashTimeout = milliseconds self.ts_bitmap = wxTextCtrl( splashWindow, id=-1, value=wx.EmptyString, pos=wxPoint( splashWindow.ts_ClientRect.x + wx.pixelWidthPerCharacter, splashWindow.ts_ClientRect.y + wx.pixelHeightPerCharacter), size=wxSize( splashWindow.ts_ClientRect.width - ( 2 * wx.pixelWidthPerCharacter), splashWindow.ts_ClientRect.height -( 2 * wx.pixelHeightPerCharacter)), style=0, # wx.TE_MULTILINE |wx.TE_READONLY, validator=wx.DefaultValidator, name=wx.TextCtrlNameStr) self.ts_bitmap.AppendText(bitmap) self.ts_bitmap.Show() self.SetFocus() ## print('SplashScreen: Show') ## self.Show() ## print('SplashScreen: Sleep(%d)' % self.ts_SplashTimeout) ## time.sleep(self.ts_SplashTimeout / 1000) ## print('SplashScreen: Hide') ## self.Hide() self.tsEndClassRegistration(theClass)
def __init__(self, parent, id=wx.ID_ANY, title=wx.EmptyString, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.DEFAULT_FRAME_STYLE, name=wx.ScreenNameStr): ''' Construct class. ''' theClass = 'Screen' # Capture initial caller parametsrs before they are changed self.caller_parent = parent self.caller_id = id self.caller_title = title self.caller_pos = pos self.caller_size = size self.caller_style = style self.caller_name = name wx.RegisterFirstCallerClassName(self, theClass) TopLevelWindow.__init__(self) self.tsBeginClassRegistration(theClass, id) myRect = self.display.Geometry myClientRect = self.display.ClientArea self.ts_Rect = myRect self.ts_ClientRect = myClientRect thePosition = self.Position theSize = self.Size if DEBUG: self.logger.debug(' self: %s' % self) self.logger.debug(' parent: %s' % parent) self.logger.debug(' id: %s' % self.ts_Id) self.logger.debug(' AssignedId: %s' % self.ts_AssignedId) self.logger.debug(' title: %s' % title) self.logger.debug(' pos: %s' % thePosition) self.logger.debug(' size: %s' % theSize) self.logger.debug(' style: 0x%X' % style) self.logger.debug(' name: %s' % name) self.logger.debug(' myRect: %s' % str(myRect)) self.logger.debug(' myClientRect: %s' % str(myClientRect)) self.ts_Name = name self.ts_Parent = parent self.ts_DescendantOrderOfShow = [self.ts_AssignedId] theTopLevelClass = self self.SetTopLevelAncestor(theTopLevelClass) if parent is None: self.ts_GrandParent = None else: self.ts_GrandParent = parent.Parent if self.TermName in BlackOnWhiteDefault: self.ts_ForegroundColour = wx.COLOR_BLACK self.ts_BackgroundColour = wx.COLOR_WHITE else: self.ts_ForegroundColour = wx.COLOR_WHITE self.ts_BackgroundColour = wx.COLOR_BLACK ## self.ts_FocusEnabled = True self.SetFocus() self.ts_Label = title self.ts_Style = style self.ts_Title = title try: self.ts_Handle = self.display.TheTerminalScreen msg = 'tsWxScreen.__init__: ts_handle=%s' % self.ts_Handle self.logger.debug(msg) except Exception as handleError: self.ts_Handle = None msg = 'tsWxScreen.__init__: handleError=%s' % str(handleError) self.logger.warning(msg) try: # Screen is a window that represents the nCurses stdscr. self.tsRegisterClassWindow() except Exception as registerError: msg = 'tsWxScreen.__init__: registerError=%s' % str(registerError) self.logger.warning(msg) # raise tse.ProgramException(tse.APPLICATION_TRAP, msg) # Automatically Bind all mouse events ASAP (now). # Will register event in the SystemEventTable. event = EVT_SET_FOCUS handler = self.SetFocusFromKbd source = self self.Bind(event, handler, source, useSystemEventTable=True) self.tsEndClassRegistration(theClass)
def __init__(self, parent, id=wx.ID_ANY, title=wx.EmptyString, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.DEFAULT_DIALOG_STYLE, name=wx.DialogNameStr): ''' ''' theClass = 'Dialog' # Capture initial caller parametsrs before they are changed self.caller_parent = parent self.caller_id = id self.caller_title = title self.caller_pos = pos self.caller_size = size self.caller_style = style self.caller_name = name wx.RegisterFirstCallerClassName(self, theClass) TopLevelWindow.__init__(self) self.tsBeginClassRegistration(theClass, id) self.ts_oldFocus = None self.ts_isShown = False self.ts_modalData = None self.ts_endModalCalled = False self.ts_dialogToolBar = None self.ts_ButtonSizerFlags = 32926 self.ts_returnCode = 0 self.ts_sizeSet = False self.ts_modalShowing = False self.ts_themeEnabled = True myRect, myClientRect = self.tsDialogWindowLayout( parent, pos, size, style, name) self.ts_Rect = myRect self.ts_ClientRect = myClientRect thePosition = self.Position theSize = self.Size if DEBUG: self.logger.debug(' self: %s' % self) self.logger.debug(' parent: %s' % parent) self.logger.debug(' id: %s' % self.ts_Id) self.logger.debug(' AssignedId: %s' % self.ts_AssignedId) self.logger.debug(' title: %s' % title) self.logger.debug(' pos: %s' % thePosition) self.logger.debug(' size: %s' % theSize) self.logger.debug(' style: 0x%X' % style) self.logger.debug(' name: %s' % name) self.ts_Name = name self.ts_Parent = parent self.ts_IdleTimeQueue = wxDoubleLinkedList(lifoMode=False) self.ts_RealTimeQueue = wxDoubleLinkedList(lifoMode=False) self.ts_DescendantOrderOfShow = [self.ts_AssignedId] theTopLevelClass = self self.SetTopLevelAncestor(theTopLevelClass) if parent is None: self.ts_GrandParent = None else: self.ts_GrandParent = parent.Parent if True: self.ts_BackgroundColour = wx.ThemeToUse[ 'Dialog']['BackgroundColour'].lower() self.ts_ForegroundColour = wx.ThemeToUse[ 'Dialog']['ForegroundColour'].lower() else: self.ts_BackgroundColour = wx.ThemeToUse[ 'ForegroundColour'].lower() self.ts_ForegroundColour = wx.ThemeToUse[ 'BackgroundColour'].lower() ## self.ts_FocusEnabled = True self.SetFocus() self.ts_Label = title self.ts_Style = style self.ts_Title = title self.ts_defaultDialogAcceleratorEntries = { '?': {'name': 'OnHelp', 'flags': wx.ACCEL_ALT, 'keyCode': ord('?'), 'cmdID': wx.ID_ANY}, 'X': {'name': 'OnClose', 'flags': wx.ACCEL_ALT, 'keyCode': ord('X'), 'cmdID': wx.ID_ANY} } # Automatically Bind all mouse events ASAP (now). # Will register event in the SystemEventTable. event = EVT_SET_FOCUS handler = self.SetFocusFromKbd source = self self.Bind(event, handler, source, useSystemEventTable=True) self.tsEndClassRegistration(theClass)
def __init__(self, parent, id=wx.ID_ANY, title=wx.EmptyString, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.DEFAULT_FRAME_STYLE, name=wx.FrameNameStr): ''' Construct class. ''' theClass = 'Frame' # Capture initial caller parametsrs before they are changed self.caller_parent = parent self.caller_id = id self.caller_title = title self.caller_pos = pos self.caller_size = size self.caller_style = style self.caller_name = name wx.RegisterFirstCallerClassName(self, theClass) TopLevelWindow.__init__(self) self.tsBeginClassRegistration(theClass, id) (myRect, myClientRect) = self.tsFrameWindowLayout( parent, pos, size, style, name) self.ts_Rect = myRect self.ts_ClientRect = myClientRect thePosition = self.Position theSize = self.Size if DEBUG: self.logger.debug(' self: %s' % self) self.logger.debug(' parent: %s' % parent) self.logger.debug(' id: %s' % self.ts_Id) self.logger.debug(' AssignedId: %s' % self.ts_AssignedId) self.logger.debug(' title: %s' % title) self.logger.debug(' pos: %s' % thePosition) self.logger.debug(' size: %s' % theSize) self.logger.debug(' style: 0x%X' % style) self.logger.debug(' name: %s' % name) self.logger.debug(' stdio: %s' % \ self.FindWindowByName(wx.StdioNameStr)) self.ts_Name = name self.ts_Parent = parent self.ts_DescendantOrderOfShow = [self.ts_AssignedId] theTopLevelClass = self self.SetTopLevelAncestor(theTopLevelClass) if parent is None: self.ts_GrandParent = None self.ts_ReserveTaskBarArea == False self.ts_ReserveRedirectArea = False else: self.ts_GrandParent = parent.Parent self.ts_ReserveTaskBarArea == parent.ts_ReserveTaskBarArea self.ts_ReserveRedirectArea = parent.ts_ReserveRedirectArea if name == wx.TaskBarNameStr: self.ts_BackgroundColour = wx.ThemeToUse[ 'TaskBar']['BackgroundColour'].lower() self.ts_ForegroundColour = wx.ThemeToUse[ 'TaskBar']['ForegroundColour'].lower() self.ts_ReserveTaskBarArea == True elif name == wx.StdioNameStr: self.ts_BackgroundColour = wx.ThemeToUse[ 'Stdio']['BackgroundColour'].lower() self.ts_ForegroundColour = wx.ThemeToUse[ 'Stdio']['ForegroundColour'].lower() self.ts_ReserveRedirectArea = True else: self.ts_BackgroundColour = wx.ThemeToUse[ 'BackgroundColour'].lower() self.ts_ForegroundColour = wx.ThemeToUse[ 'ForegroundColour'].lower() ## self.ts_FocusEnabled = True self.SetFocus() self.ts_Label = title self.ts_MenuBar = None self.ts_StatusBar = None self.ts_StatusBarPane = None self.ts_Style = style self.ts_Title = title self.ts_ToolBar = None self.ts_defaultFrameAcceleratorEntries = { '_': {'name': 'OnIconize', 'flags': wx.ACCEL_ALT, 'keyCode': ord('_'), 'cmdID': wx.ID_ANY}, 'z': {'name': 'OnRestoreDown', 'flags': wx.ACCEL_ALT, 'keyCode': ord('z'), 'cmdID': wx.ID_ANY}, 'Z': {'name': 'OnMaximize', 'flags': wx.ACCEL_ALT, 'keyCode': ord('Z'), 'cmdID': wx.ID_ANY}, 'X': {'name': 'OnClose', 'flags': wx.ACCEL_ALT, 'keyCode': ord('X'), 'cmdID': wx.ID_ANY} } self.ts_OnFrameCloseButton = None self.ts_OnFrameMaximizeButton = None self.ts_OnFrameIconizeButton = None self.ts_OnFrameRestoreDownButton = None # Automatically Bind all mouse events ASAP (now). # Will register event in the SystemEventTable. event = EVT_SET_FOCUS handler = self.SetFocusFromKbd source = self self.Bind(event, handler, source, useSystemEventTable=True) ## if self.ts_OnFrameCloseButton is None: ## pass ## else: ## event = EVT_COMMAND_LEFT_CLICK # EVT_CLOSE ## handler = self.tsFrameOnClose ## source = self.ts_OnFrameCloseButton ## self.Bind(event, ## handler, ## source, ## useSystemEventTable=True) ## if self.ts_OnFrameMaximizeButton is None: ## pass ## else: ## event = EVT_COMMAND_LEFT_CLICK # EVT_MAXIMIZE ## handler = self.tsFrameOnMaximize ## source = self.ts_OnFrameMaximizeButton ## self.Bind(event, ## handler, ## source, ## useSystemEventTable=True) ## if self.ts_OnFrameIconizeButton is None: ## pass ## else: ## event = EVT_COMMAND_LEFT_CLICK # EVT_ICONIZE ## handler = self.tsFrameOnIconize ## source = self.ts_OnFrameIconizeButton ## self.Bind(event, ## handler, ## source, ## useSystemEventTable=True) ## if self.ts_OnFrameRestoreDownButton is None: ## pass ## else: ## event = EVT_COMMAND_LEFT_CLICK # EVT_RESTOREDOWN ## handler = self.tsFrameOnRestoreDown ## source = self.ts_OnFrameRestoreDownButton ## self.Bind(event, ## handler, ## source, ## useSystemEventTable=True) self.tsEndClassRegistration(theClass)