pyMez.Code.FrontEnds.AdvancedInterfaceFrame module
Advanced wx.Frame with standard containers for interface and control this is meant as a template for GUI design and a test bed for pyMez
Help
#----------------------------------------------------------------------------- # Name: AdvancedInterfaceFrame.py # Purpose: An advanced frame design that includes control and interface areas # and all of the standard menu,tool and status bars. # # Author: Aric Sanders # # Created: 2010/04/20 # RCS-ID: $Id: AdvancedInterfaceFrame.py $ #----------------------------------------------------------------------------- #Boa:Frame:AdvancedInterfaceFrame """ Advanced wx.Frame with standard containers for interface and control this is meant as a template for GUI design and a test bed for pyMez Help --------------- <a href="./index.html">`pyMez.Code.FrontEnds`</a> <div> <a href="../../../pyMez_Documentation.html">Documentation Home</a> | <a href="../../index.html">API Documentation Home</a> | <a href="../../../Examples/html/Examples_Home.html">Examples Home</a> | <a href="../../../Reference_Index.html">Index</a> </div>""" import sys import os import wx from types import * import re import copy # Add pyMez to sys.path (this allows imports that don't go through pyMez/__init__.py sys.path.append(os.path.join(os.path.dirname( __file__ ), '..','..')) try: #import pyMez from Code.FrontEnds.IEPanel import * from Code.FrontEnds.EndOfDayDialog import * #from Code.FrontEnds.ShellPanel import * from Code.FrontEnds.SimpleLogLowerInterfacePanel import * from Code.FrontEnds.SimpleArbDBLowerInterfacePanel import * from Code.FrontEnds.VisaDialog import * from Code.FrontEnds.MatplotlibWxPanel import * from Code.FrontEnds.KeithleyIVPanel import * except: print("""Cannot load Shell Panel or IEPanel add The folder above pyMeaure to sys.path Also check that the Boa Constructor Source is on sys.path """) raise #------------------------------------------------------------------------------- #Constants PYMEASURE_ROOT=os.path.join(os.path.dirname( __file__ ), '..','..') FRONTENDS_DIRECTORY=os.path.join(PYMEASURE_ROOT,'Code','FrontEnds') IMAGE_DIRECTORY=os.path.join(PYMEASURE_ROOT,'Code','FrontEnds','img') JAVASCRIPT_STRING="""<html> <head> <script type="text/javascript"> function disp_prompt() { var fname=prompt("Please enter your name:","Your name") document.getElementById("msg").innerHTML="Greetings " + fname } </script> </head> <body> <input type="button" onclick="disp_prompt()" value="Display a prompt box" /> <br /><br /> <div id="msg"></div> </body> </html> """ PANELS=['ShellPanel','IEPanel', 'SimpleLogLowerInterfacePanel','SimpleArbDBLowerInterfacePanel','MatplotlibWxPanel','KeithleyIVPanel'] #------------------------------------------------------------------------------- #Functions def get_top_parent(window): """Returns the topmost parent window""" try: parent=window.Parent print(parent) if parent in [None,''] or not isinstance(parent, InstanceType): raise get_top_parent(parent) except: return window def convert_datetime(ISO_datetime_string,format_string='%m/%d/%Y at %H:%M:%S GMT') : "Converts from long ISO format 2010-05-13T21:54:25.755000 to something reasonable" #strip any thing smaller than a second time_seconds=ISO_datetime_string.split('.')[0] #then get it into a datetime format time_datetime=datetime.datetime.strptime(time_seconds,"%Y-%m-%dT%H:%M:%S") return time_datetime.strftime(format_string) #------------------------------------------------------------------------------- # Boa Code def create(parent): return AdvancedInterfaceFrame(parent) [wxID_BASICINTERFACEFRAME, wxID_BASICINTERFACEFRAMEARBDBPANEL, wxID_BASICINTERFACEFRAMEBUTTON1, wxID_BASICINTERFACEFRAMEBUTTON2, wxID_BASICINTERFACEFRAMEBUTTON3, wxID_BASICINTERFACEFRAMEDISPLAY, wxID_BASICINTERFACEFRAMEENDOFTHEDAYBUTTON, wxID_BASICINTERFACEFRAMEEXECUTEBUTTON, wxID_BASICINTERFACEFRAMEINSTRUMENTSBUTTON, wxID_BASICINTERFACEFRAMEINTERFACESTATUSBAR, wxID_BASICINTERFACEFRAMEINTERFACETOOLBAR, wxID_BASICINTERFACEFRAMELEFTINTERFACEPANEL, wxID_BASICINTERFACEFRAMELOGSPANEL, wxID_BASICINTERFACEFRAMELOWERCONTROLPANEL, wxID_BASICINTERFACEFRAMELOWERINTERFACE, wxID_BASICINTERFACEFRAMELOWERINTERFACEPANEL, wxID_BASICINTERFACEFRAMEMAINPANEL, wxID_BASICINTERFACEFRAMEPANEL1, wxID_BASICINTERFACEFRAMEPLOTPANEL, wxID_BASICINTERFACEFRAMEREPLACERIGHTCONTROLBUTTTON, wxID_BASICINTERFACEFRAMERIGHTCONTROLPANEL, wxID_BASICINTERFACEFRAMESHELL, wxID_BASICINTERFACEFRAMESTATESBUTTON, wxID_BASICINTERFACEFRAMEUPPERINTERFACE, wxID_BASICINTERFACEFRAMEUPPERINTERFACEPANEL, wxID_BASICINTERFACEFRAMEVISADIALOGBUTTON, ] = [wx.NewId() for _init_ctrls in range(26)] [wxID_BASICINTERFACEFRAMEINTERFACETOOLBARLAUNCHBOA, wxID_BASICINTERFACEFRAMEINTERFACETOOLBARSAGE, ] = [wx.NewId() for _init_coll_InterfaceToolBar_Tools in range(2)] [wxID_BASICINTERFACEFRAMETOOLMENULOADSCRIPTS, wxID_BASICINTERFACEFRAMETOOLMENURUN_PYTHON, ] = [wx.NewId() for _init_coll_ToolMenu_Items in range(2)] [wxID_BASICINTERFACEFRAMEFILEMENUNEW, wxID_BASICINTERFACEFRAMEFILEMENUOPEN, ] = [wx.NewId() for _init_coll_FileMenu_Items in range(2)] class AdvancedInterfaceFrame(wx.Frame): # Needs to have an explicit list for the designer to work _custom_classes = {'wx.Panel':['ShellPanel','IEPanel', 'SimpleLogLowerInterfacePanel','SimpleArbDBLowerInterfacePanel','MatplotlibWxPanel','KeithleyIVPanel'],'wx.Dialog':'EndOfDayDialog'} def _init_coll_boxSizer7_Items(self, parent): # generated method, don't edit parent.AddWindow(self.StatesButton, 0, border=0, flag=0) parent.AddWindow(self.InstrumentsButton, 0, border=0, flag=0) def _init_coll_boxSizer6_Items(self, parent): # generated method, don't edit parent.AddWindow(self.button1, 0, border=0, flag=0) parent.AddWindow(self.button2, 0, border=0, flag=0) parent.AddWindow(self.button3, 0, border=0, flag=0) parent.AddWindow(self.ExecuteButton, 0, border=0, flag=0) parent.AddWindow(self.ReplaceRightControlButtton, 0, border=0, flag=0) parent.AddWindow(self.EndOfTheDayButton, 0, border=0, flag=0) parent.AddWindow(self.VisaDialogButton, 0, border=0, flag=0) def _init_coll_boxSizer4_Items(self, parent): # generated method, don't edit parent.AddWindow(self.UpperInterface, 1, border=2, flag=wx.EXPAND | wx.ALL) def _init_coll_boxSizer5_Items(self, parent): # generated method, don't edit parent.AddWindow(self.LowerInterface, 1, border=2, flag=wx.ALL | wx.EXPAND) def _init_coll_boxSizer3_Items(self, parent): # generated method, don't edit parent.AddWindow(self.UpperInterfacePanel, 4, border=2, flag=wx.ALL | wx.EXPAND) parent.AddWindow(self.LowerInterfacePanel, 0, border=2, flag=wx.ALL | wx.EXPAND) parent.AddWindow(self.LowerControlPanel,0, border=2, flag=wx.ALL | wx.EXPAND) def _init_coll_boxSizer1_Items(self, parent): # generated method, don't edit parent.AddWindow(self.MainPanel, 1, border=1, flag=wx.ALL | wx.EXPAND) def _init_coll_boxSizer2_Items(self, parent): # generated method, don't edit parent.AddWindow(self.LeftInterfacePanel, 1, border=2, flag=wx.EXPAND | wx.ALL) parent.AddWindow(self.RightControlPanel, 0, border=2, flag=wx.ALIGN_RIGHT | wx.ALL | wx.EXPAND) def _init_coll_ToolMenu_Items(self, parent): # generated method, don't edit parent.Append(help='Runs a python program as a script', id=wxID_BASICINTERFACEFRAMETOOLMENURUN_PYTHON, kind=wx.ITEM_NORMAL, text='Run Python Module As a Script') parent.Append(help='Load Scripts from a python Module', id=wxID_BASICINTERFACEFRAMETOOLMENULOADSCRIPTS, kind=wx.ITEM_NORMAL, text='Load Scripts from Module') self.Bind(wx.EVT_MENU, self.OnToolMenuRun_pythonMenu, id=wxID_BASICINTERFACEFRAMETOOLMENURUN_PYTHON) self.Bind(wx.EVT_MENU, self.OnToolMenuLoadscriptsMenu, id=wxID_BASICINTERFACEFRAMETOOLMENULOADSCRIPTS) def _init_coll_FileMenu_Items(self, parent): # generated method, don't edit parent.Append(help='Open a file', id=wxID_BASICINTERFACEFRAMEFILEMENUOPEN, kind=wx.ITEM_NORMAL, text='Open') parent.Append(help='Adds a new panel to main notebook', id=wxID_BASICINTERFACEFRAMEFILEMENUNEW, kind=wx.ITEM_NORMAL, text='New Panel') self.Bind(wx.EVT_MENU, self.OnFileMenuOpenMenu, id=wxID_BASICINTERFACEFRAMEFILEMENUOPEN) self.Bind(wx.EVT_MENU, self.OnFileMenuNewMenu, id=wxID_BASICINTERFACEFRAMEFILEMENUNEW) def _init_coll_InterfaceMenuBar_Menus(self, parent): # generated method, don't edit parent.Append(menu=self.FileMenu, title='File') parent.Append(menu=self.HelpMenu, title='Help') parent.Append(menu=self.ToolMenu, title='Tools') def _init_coll_UpperInterface_Pages(self, parent): # generated method, don't edit parent.AddPage(imageId=-1, page=self.Display, select=True, text='Display') parent.AddPage(imageId=-1, page=self.PlotPanel, select=False, text='Plot') parent.AddPage(imageId=-1, page=self.panel1, select=False, text='Keithley IV') def _init_coll_LowerInterface_Pages(self, parent): # generated method, don't edit parent.AddPage(imageId=-1, page=self.Shell, select=True, text='Shell') parent.AddPage(imageId=-1, page=self.LogsPanel, select=False, text='Logs') parent.AddPage(imageId=-1, page=self.ArbDBPanel, select=False, text='Files') def _init_coll_InterfaceStatusBar_Fields(self, parent): # generated method, don't edit parent.SetFieldsCount(1) parent.SetStatusText(number=0, text='Status') parent.SetStatusWidths([-1]) def _init_coll_InterfaceToolBar_Tools(self, parent): # generated method, don't edit parent.DoAddTool(bitmap=wx.Bitmap(str(os.path.join(IMAGE_DIRECTORY,'Component.png')), wx.BITMAP_TYPE_PNG), bmpDisabled=wx.NullBitmap, id=wxID_BASICINTERFACEFRAMEINTERFACETOOLBARLAUNCHBOA, kind=wx.ITEM_NORMAL, label='Boa', longHelp='Launch Boa Constructor', shortHelp='Launch Boa Constructor') parent.DoAddTool(bitmap=wx.Bitmap(str(os.path.join(IMAGE_DIRECTORY,'jupyter-logo.png')), wx.BITMAP_TYPE_PNG), bmpDisabled=wx.NullBitmap, id=wxID_BASICINTERFACEFRAMEINTERFACETOOLBARSAGE, kind=wx.ITEM_NORMAL, label='', longHelp='Launch SAGE and display ', shortHelp='Launch SAGE') self.Bind(wx.EVT_TOOL, self.OnInterfaceToolBarLaunchboaTool, id=wxID_BASICINTERFACEFRAMEINTERFACETOOLBARLAUNCHBOA) self.Bind(wx.EVT_TOOL, self.OnInterfaceToolBarTools1Tool, id=wxID_BASICINTERFACEFRAMEINTERFACETOOLBARSAGE) parent.Realize() def _init_sizers(self): # generated method, don't edit self.boxSizer1 = wx.BoxSizer(orient=wx.VERTICAL) self.boxSizer2 = wx.BoxSizer(orient=wx.HORIZONTAL) self.boxSizer3 = wx.BoxSizer(orient=wx.VERTICAL) self.boxSizer4 = wx.BoxSizer(orient=wx.VERTICAL) self.boxSizer5 = wx.BoxSizer(orient=wx.VERTICAL) self.boxSizer6 = wx.BoxSizer(orient=wx.HORIZONTAL) self.boxSizer7 = wx.BoxSizer(orient=wx.VERTICAL) self._init_coll_boxSizer1_Items(self.boxSizer1) self._init_coll_boxSizer2_Items(self.boxSizer2) self._init_coll_boxSizer3_Items(self.boxSizer3) self._init_coll_boxSizer4_Items(self.boxSizer4) self._init_coll_boxSizer5_Items(self.boxSizer5) self._init_coll_boxSizer6_Items(self.boxSizer6) self._init_coll_boxSizer7_Items(self.boxSizer7) self.SetSizer(self.boxSizer1) self.RightControlPanel.SetSizer(self.boxSizer7) self.LowerInterfacePanel.SetSizer(self.boxSizer5) self.LeftInterfacePanel.SetSizer(self.boxSizer3) self.UpperInterfacePanel.SetSizer(self.boxSizer4) self.LowerControlPanel.SetSizer(self.boxSizer6) self.MainPanel.SetSizer(self.boxSizer2) def _init_utils(self): # generated method, don't edit self.FileMenu = wx.Menu(title='') self.HelpMenu = wx.Menu(title='') self.InterfaceMenuBar = wx.MenuBar() self.ToolMenu = wx.Menu(title='Tools') self._init_coll_FileMenu_Items(self.FileMenu) self._init_coll_InterfaceMenuBar_Menus(self.InterfaceMenuBar) self._init_coll_ToolMenu_Items(self.ToolMenu) def _init_ctrls(self, prnt): # generated method, don't edit wx.Frame.__init__(self, id=wxID_BASICINTERFACEFRAME, name='AdvancedInterfaceFrame', parent=prnt, pos=wx.Point(-5, 106), size=wx.Size(1448, 874), style=wx.DEFAULT_FRAME_STYLE, title='Advanced Interface') self._init_utils() self.SetClientSize(wx.Size(1440, 840)) self.SetMenuBar(self.InterfaceMenuBar) self.Bind(wx.EVT_CLOSE, self.OnBasicInterfaceFrameClose) self.InterfaceStatusBar = wx.StatusBar(id=wxID_BASICINTERFACEFRAMEINTERFACESTATUSBAR, name='InterfaceStatusBar', parent=self, style=0) self.InterfaceStatusBar.SetHelpText('Status') self.InterfaceStatusBar.SetLabel('') self._init_coll_InterfaceStatusBar_Fields(self.InterfaceStatusBar) self.SetStatusBar(self.InterfaceStatusBar) self.InterfaceToolBar = wx.ToolBar(id=wxID_BASICINTERFACEFRAMEINTERFACETOOLBAR, name='InterfaceToolBar', parent=self, pos=wx.Point(0, 0), size=wx.Size(1440, 40), style=wx.TAB_TRAVERSAL | wx.TB_3DBUTTONS | wx.TB_HORIZONTAL | wx.MAXIMIZE_BOX | wx.NO_BORDER) self.InterfaceToolBar.SetHelpText('Launch Boa Contstructor') self.InterfaceToolBar.SetToolTipString('InterfaceToolBar') self.InterfaceToolBar.SetToolBitmapSize(wx.Size(30, 30)) self.InterfaceToolBar.SetToolPacking(0) self.InterfaceToolBar.SetToolSeparation(1) self.SetToolBar(self.InterfaceToolBar) self.MainPanel = wx.Panel(id=wxID_BASICINTERFACEFRAMEMAINPANEL, name='MainPanel', parent=self, pos=wx.Point(1, 1), size=wx.Size(1438, 838), style=wx.TAB_TRAVERSAL) self.LeftInterfacePanel = wx.Panel(id=wxID_BASICINTERFACEFRAMELEFTINTERFACEPANEL, name='LeftInterfacePanel', parent=self.MainPanel, pos=wx.Point(2, 2), size=wx.Size(1355, 834), style=wx.TAB_TRAVERSAL) self.RightControlPanel = wx.Panel(id=wxID_BASICINTERFACEFRAMERIGHTCONTROLPANEL, name='RightControlPanel', parent=self.MainPanel, pos=wx.Point(1361, 2), size=wx.Size(75, 834), style=wx.TAB_TRAVERSAL) self.RightControlPanel.SetBackgroundColour(wx.Colour(192, 192, 192)) self.LowerControlPanel = wx.Panel(id=wxID_BASICINTERFACEFRAMELOWERCONTROLPANEL, name='LowerControlPanel', parent=self.LeftInterfacePanel, pos=wx.Point(2, 808), size=wx.Size(1351, 24), style=wx.TAB_TRAVERSAL) self.LowerControlPanel.SetBackgroundColour(wx.Colour(0, 255, 128)) self.UpperInterfacePanel = wx.Panel(id=wxID_BASICINTERFACEFRAMEUPPERINTERFACEPANEL, name='UpperInterfacePanel', parent=self.LeftInterfacePanel, pos=wx.Point(2, 2), size=wx.Size(1351, 640), style=wx.TAB_TRAVERSAL) self.UpperInterfacePanel.SetBackgroundColour(wx.Colour(128, 128, 128)) self.UpperInterfacePanel.SetHelpText('UpperInterfacePanel') self.LowerInterfacePanel = wx.Panel(id=wxID_BASICINTERFACEFRAMELOWERINTERFACEPANEL, name='LowerInterfacePanel', parent=self.LeftInterfacePanel, pos=wx.Point(2, 646), size=wx.Size(1351, 158), style=wx.TAB_TRAVERSAL) self.LowerInterfacePanel.SetBackgroundColour(wx.Colour(192, 192, 192)) self.UpperInterface = wx.Notebook(id=wxID_BASICINTERFACEFRAMEUPPERINTERFACE, name='UpperInterface', parent=self.UpperInterfacePanel, pos=wx.Point(2, 2), size=wx.Size(1347, 636), style=0) self.LowerInterface = wx.Treebook(id=wxID_BASICINTERFACEFRAMELOWERINTERFACE, name='LowerInterface', parent=self.LowerInterfacePanel, pos=wx.Point(2, 2), size=wx.Size(1347, 154), style=0) self.LowerInterface.Bind(wx.EVT_TREEBOOK_PAGE_CHANGED, self.OnLowerInterfaceTreebookPageChanged, id=wxID_BASICINTERFACEFRAMELOWERINTERFACE) self.Display = IEPanel(id=wxID_BASICINTERFACEFRAMEDISPLAY, name='Display', parent=self.UpperInterface, pos=wx.Point(0, 0), size=wx.Size(1339, 610), style=wx.TAB_TRAVERSAL) self.Shell = ShellPanel(id=wxID_BASICINTERFACEFRAMESHELL, name='Shell', parent=self.LowerInterface, pos=wx.Point(0, 0), size=wx.Size(1281, 154), style=wx.TAB_TRAVERSAL) self.button1 = wx.Button(id=wxID_BASICINTERFACEFRAMEBUTTON1, label='Java Script Example', name='button1', parent=self.LowerControlPanel, pos=wx.Point(0, 0), size=wx.Size(136, 23), style=0) self.button1.Bind(wx.EVT_BUTTON, self.OnButton1Button, id=wxID_BASICINTERFACEFRAMEBUTTON1) self.button2 = wx.Button(id=wxID_BASICINTERFACEFRAMEBUTTON2, label='button2', name='button2', parent=self.LowerControlPanel, pos=wx.Point(136, 0), size=wx.Size(75, 23), style=0) self.button2.Bind(wx.EVT_BUTTON, self.OnButton2Button, id=wxID_BASICINTERFACEFRAMEBUTTON2) self.button3 = wx.Button(id=wxID_BASICINTERFACEFRAMEBUTTON3, label='button3', name='button3', parent=self.LowerControlPanel, pos=wx.Point(211, 0), size=wx.Size(75, 23), style=0) self.ExecuteButton = wx.Button(id=wxID_BASICINTERFACEFRAMEEXECUTEBUTTON, label='Execute IEPanel.py', name='ExecuteButton', parent=self.LowerControlPanel, pos=wx.Point(286, 0), size=wx.Size(111, 23), style=0) self.ExecuteButton.Bind(wx.EVT_BUTTON, self.OnExecuteButtonButton, id=wxID_BASICINTERFACEFRAMEEXECUTEBUTTON) self.ReplaceRightControlButtton = wx.Button(id=wxID_BASICINTERFACEFRAMEREPLACERIGHTCONTROLBUTTTON, label='Replace Right Control Panel', name='ReplaceRightControlButtton', parent=self.LowerControlPanel, pos=wx.Point(397, 0), size=wx.Size(180, 24), style=0) self.ReplaceRightControlButtton.Bind(wx.EVT_BUTTON, self.OnReplaceRightControlButttonButton, id=wxID_BASICINTERFACEFRAMEREPLACERIGHTCONTROLBUTTTON) self.StatesButton = wx.Button(id=wxID_BASICINTERFACEFRAMESTATESBUTTON, label='States', name='StatesButton', parent=self.RightControlPanel, pos=wx.Point(0, 0), size=wx.Size(75, 23), style=0) self.StatesButton.Bind(wx.EVT_BUTTON, self.OnStatesButtonButton, id=wxID_BASICINTERFACEFRAMESTATESBUTTON) self.InstrumentsButton = wx.Button(id=wxID_BASICINTERFACEFRAMEINSTRUMENTSBUTTON, label='Instruments', name='InstrumentsButton', parent=self.RightControlPanel, pos=wx.Point(0, 23), size=wx.Size(75, 23), style=0) self.InstrumentsButton.Bind(wx.EVT_BUTTON, self.OnInstrumentsButtonButton, id=wxID_BASICINTERFACEFRAMEINSTRUMENTSBUTTON) self.LogsPanel = SimpleLogLowerInterfacePanel(id=wxID_BASICINTERFACEFRAMELOGSPANEL, name='LogsPanel', parent=self.LowerInterface, pos=wx.Point(0, 0), size=wx.Size(1281, 154), style=wx.TAB_TRAVERSAL) self.ArbDBPanel = SimpleArbDBLowerInterfacePanel(id=wxID_BASICINTERFACEFRAMEARBDBPANEL, name='ArbDBPanel', parent=self.LowerInterface, pos=wx.Point(0, 0), size=wx.Size(1281, 154), style=wx.TAB_TRAVERSAL) self.EndOfTheDayButton = wx.Button(id=wxID_BASICINTERFACEFRAMEENDOFTHEDAYBUTTON, label='End of The Day Log', name='EndOfTheDayButton', parent=self.LowerControlPanel, pos=wx.Point(577, 0), size=wx.Size(103, 23), style=0) self.EndOfTheDayButton.Bind(wx.EVT_BUTTON, self.OnEndOfTheDayButtonButton, id=wxID_BASICINTERFACEFRAMEENDOFTHEDAYBUTTON) self.VisaDialogButton = wx.Button(id=wxID_BASICINTERFACEFRAMEVISADIALOGBUTTON, label='VISA Communicator', name='VisaDialogButton', parent=self.LowerControlPanel, pos=wx.Point(680, 0), size=wx.Size(184, 23), style=0) self.VisaDialogButton.Bind(wx.EVT_BUTTON, self.OnVisaDialogButtonButton, id=wxID_BASICINTERFACEFRAMEVISADIALOGBUTTON) self.PlotPanel = MatplotlibWxPanel(id=wxID_BASICINTERFACEFRAMEPLOTPANEL, name='PlotPanel', parent=self.UpperInterface, pos=wx.Point(0, 0), size=wx.Size(1339, 610), style=wx.TAB_TRAVERSAL) self.panel1 = KeithleyIVPanel(id=wxID_BASICINTERFACEFRAMEPANEL1, name='panel1', parent=self.UpperInterface, pos=wx.Point(0, 0), size=wx.Size(1339, 610), style=wx.TAB_TRAVERSAL) self._init_coll_InterfaceToolBar_Tools(self.InterfaceToolBar) self._init_coll_UpperInterface_Pages(self.UpperInterface) self._init_coll_LowerInterface_Pages(self.LowerInterface) self._init_sizers() def __init__(self, parent): self._init_ctrls(parent) #make the shell self aware--requires that ShellEditor.interp.locals=locals() self.Shell.ShellEditor.pushLine("shell=locals()['self']") #This assumes the main frame is exactly 6 levels above self.Shell.ShellEditor.pushLine("frame=shell.Parent.Parent.Parent.Parent.Parent.Parent") self.Shell.ShellEditor.pushLine("print('\# The object corresponding to the main frame is called frame')") #self.Shell.ShellEditor.pushLine("shell=locals()['self']",'\n') self.right_control_panels=[self.RightControlPanel] self.current_right_control_panel=self.right_control_panels[0] # TODO Delete this out it is a test self.NewPanel=wx.Panel(self.MainPanel,name='Green') self.NewPanel.SetBackgroundColour(wx.Colour(0,255,0)) self.right_control_panels.append(self.NewPanel) self.NewPanel2=wx.Panel(self.MainPanel,name='Blue') self.NewPanel2.SetBackgroundColour(wx.Colour(0,0,255)) self.right_control_panels.append(self.NewPanel2) self.NewPanel3=wx.Panel(self.MainPanel,name='Red') self.NewPanel3.SetBackgroundColour(wx.Colour(255,0,0)) self.right_control_panels.append(self.NewPanel3) self.NewPanel.Show(False) self.NewPanel2.Show(False) self.NewPanel3.Show(False) # This initializes the locals dictionary, needed to get output from # execfile command. This attribute needs to be asigned to locals() at # the time that the frame is created. See Module Runner self.locals={} # This passes the button event from the log panel to the main frame self.LogsPanel.Bind(wx.EVT_BUTTON,self.update_display) self.ScriptsMenu=wx.Menu() self.ToolMenu.AppendMenu(-1,'Scripts',self.ScriptsMenu) #Added these for script handling self.loaded_script_menu_items=[] self.event_handlers={} self.tool_menu_number=0 #This adds panels to the FileMenu->Add Panel item self.panels_menu() def panels_menu(self): """ Creates the Add Panels Menu""" # First we select only files of the for *Panel.py FrontEnds_files=os.listdir(FRONTENDS_DIRECTORY) self.panel_files=[] for file in FrontEnds_files: if re.search('Panel.py',file) and not re.search('.pyc|pyo',file): self.panel_files.append(file) #This adds panels to the FileMenu->Add Panel item self.add_panel_menu=wx.Menu() self.panel_dictionary={} for panel in self.panel_files: new_id=wx.NewId() self.panel_dictionary[new_id]=panel self.add_panel_menu.Append(new_id,panel,'Add the Panel %s'%panel) self.Bind(wx.EVT_MENU, lambda evt: self.OnAddPanel(evt,new_id),id=new_id) #print(new_id,panel) #print(self.panel_dictionary) self.FileMenu.AppendMenu(0,'Add a Panel',self.add_panel_menu) def OnAddPanel(self,event,id): """ Adds a panel""" sys.path.append(FRONTENDS_DIRECTORY) #print(dir(event),event.Id) panel_name=self.panel_dictionary[event.Id].replace('.py','') exec('from %s import *'%panel_name) exec('self.%s_%s=%s(id=%s,name="%s_%s", parent=self.UpperInterface, pos=wx.Point(0, 0),size=wx.Size(1339, 610), style=wx.TAB_TRAVERSAL)'%(panel_name,id,panel_name,id,panel_name,id)) exec("self.UpperInterface.AddPage(imageId=-1, page=self.%s_%s, select=True,text='%s')"%(panel_name,id,panel_name)) def OnFileMenuOpenMenu(self, event): event.Skip() def OnReplaceRightControlButttonButton(self, event): try: new=self.right_control_panels.index( self.current_right_control_panel)%len(self.right_control_panels)+1 new_panel=self.right_control_panels[new] except: new=0 new_panel=self.right_control_panels[new] self.swap_panel(self.current_right_control_panel,new_panel,self.boxSizer2) def swap_panel(self,old_panel,new_panel,sizer): "Swaps a panel and places the new one in the sizer" new_panel.SetPosition(old_panel.Position) new_panel.SetSize(old_panel.Size) old_panel.Show(False) sizer.Replace(old_panel,new_panel) new_panel.Show(True) self.current_right_control_panel=new_panel self.Update() def OnInterfaceToolBarLaunchboaTool(self, event): os.system(r'start python C:\Anaconda2\Lib\site-packages\boa\Boa.py') event.Skip() def OnExecuteButtonButton(self, event): path=str(os.path.join(PYMEASURE_ROOT,'Code/FrontEnds/IEPanel.py')) exec(compile(open(path).read(), path, 'exec')) def OnLowerInterfaceTreebookPageChanged(self, event): self.update_display() event.Skip() def update_display(self,event=None): "Updates the display" if self.LowerInterface.GetCurrentPage() is self.LogsPanel: self.Display.ie.Navigate(self.LogsPanel.current_log.path) else: self.Display.Refresh() def OnInterfaceToolBarTools1Tool(self, event): #sage_script=r'C:\"Program Files"\AutoIt3\Examples\SAGE_NOIE2.exe' #os.system('jupyter notebook') self.Display.ie.Navigate('http://localhost:8888/tree') pass def OnBasicInterfaceFrameClose(self, event): """ What to do when the frame is closed, needed to avoid memory leaks""" try: app=wx.GetApp() app.stdioWin.close() except:pass self.Destroy() event.Skip() def OnButton1Button(self, event): self.Display.write(JAVASCRIPT_STRING) event.Skip() def OnToolMenuRun_pythonMenu(self, event): dlg = wx.FileDialog(self, 'Choose a file', '.', '', '*.py', wx.OPEN) try: if dlg.ShowModal() == wx.ID_OK: filename = dlg.GetPath() try: exec(compile(open(filename).read(), filename, 'exec'),self.locals) except: pass finally: dlg.Destroy() event.Skip() def OnToolMenuLoadscriptsMenu(self, event): " Loads Scripts to run" dlg = wx.FileDialog(self, 'Choose a Python Module', '.', '', '*.py', wx.OPEN) try: if dlg.ShowModal() == wx.ID_OK: filename = dlg.GetPath() module_scripts=self.import_scripts(filename) module=module_scripts['module'] try: for index,script in enumerate(module_scripts['scripts']): new_id=wx.NewId() menu_item=wx.MenuItem(self.ToolMenu,id=new_id, kind=wx.ITEM_NORMAL, text='Run %s '%script, help='Run %s from the %s module'%(script,module)) self.ScriptsMenu.AppendItem(menu_item) self.loaded_script_menu_items.append(menu_item) #event_handler=(lambda event: self.execute_script(event)) #eval('def event\_handler%s(event):return self.execute_script(event,module\_scripts["%s"],"%s")'%(index,script,script),locals()) #event_handler.func_name='%s'%index self.event_handlers[menu_item.GetId()]=module_scripts[script] #print(self.event_handlers) self.Bind(wx.EVT_MENU,self.execute_script,id=menu_item.GetId()) #print(self.event_handlers) #self.bind_menu() except: print(('Could Not Import {0}'.format(module))) raise finally: dlg.Destroy() event.Skip() #print(self.event_handlers) ## def bind_menu(self): ## for index,menu_item in enumerate(self.loaded_script_menu_items): ## print(self.event_handlers[menu_item.GetId()],menu_item,menu_item.GetId()) ## self.Bind(wx.EVT_MENU,self.event_handlers[menu_item.GetId()],id=menu_item.GetId()) def import_scripts(self,file_name): "Loads a module given a path and returns a dictionary of things recognized as scripts""" #added file path to sys.path output={} scripts=[] module_directory=os.path.split(file_name)[0] module_name=os.path.split(file_name)[1].replace('.py','') sys.path.append(module_directory) exec('import {0}'.format(module_name)) attributes=eval('dir({0})'.format(module_name)) for item in attributes: if re.search('test_|_robot|_script',item,re.IGNORECASE): scripts.append(item) output[item]=eval('{0}.{1}'.format(module_name,item)) output['module']=module_name output['scripts']=scripts return output def execute_script(self,event): #print(self.event_handlers) #print(event.Id) return self.event_handlers[event.Id]() def add_notebook_page(self): """ Adds a page to the InterfaceNotebook""" pass def OnButton2Button(self, event): self.tool_menu_number=self.tool_menu_number+1 if self.tool_menu_number is 1: self.ScriptsMenu=wx.Menu() self.ToolMenu.AppendMenu(-1,'Scripts',self.ScriptsMenu) self.ScriptsMenu.Append(help='Runs the {0} script'.format(self.tool_menu_number), id=-1,kind=wx.ITEM_NORMAL, text='Run the {0} script'.format(self.tool_menu_number)) event.Skip() def OnStatesButtonButton(self, event): states_directory=os.path.join(PYMEASURE_ROOT,'Data/States') self.Display.ie.Navigate(states_directory) event.Skip() def OnInstrumentsButtonButton(self, event): instruments_directory=os.path.join(PYMEASURE_ROOT,'Instruments') self.Display.ie.Navigate(instruments_directory) event.Skip() def OnEndOfTheDayButtonButton(self, event): dlg = EndOfDayDialog(self) try: result = dlg.ShowModal() finally: dlg.Destroy() event.Skip def OnVisaDialogButtonButton(self, event): dlg = VisaDialog(self) try: result = dlg.Show() finally: pass event.Skip def OnFileMenuNewMenu(self, event): ## dlg = wx.FileDialog(self, 'Choose a file', '.', '', '*.*', wx.OPEN) ## try: ## if dlg.ShowModal() == wx.ID_OK: ## filename = dlg.GetPath() ## # Your code ## finally: ## dlg.Destroy() ## self.upper_Interface.AddPage( ## event.Skip() pass ## def OnAddPanel(self, event): ## exec('self.%s'+'_%s'+'=%s(self.UpperInterface)'%(panel_name,panel_number,panel_name)) def test_AdvancedInterfaceFrame(): """ Tests the AdvancedInterfaceFrame Class""" app = wx.App(False) app.RedirectStdio() frame = create(None) frame.Show() # This is needed for the execfile command to output properly--can't redirect frame.locals=locals() app.MainLoop() if __name__ == '__main__': app = wx.App(False) app.RedirectStdio() # The import here stops the Error wx Debug Alert from Code.FrontEnds.ShellPanel import * frame = create(None) frame.Show() # This is needed for the execfile command to output properly--can't redirect frame.locals=locals() app.MainLoop()
Functions
def convert_datetime(
ISO_datetime_string, format_string='%m/%d/%Y at %H:%M:%S GMT')
Converts from long ISO format 2010-05-13T21:54:25.755000 to something reasonable
def convert_datetime(ISO_datetime_string,format_string='%m/%d/%Y at %H:%M:%S GMT') : "Converts from long ISO format 2010-05-13T21:54:25.755000 to something reasonable" #strip any thing smaller than a second time_seconds=ISO_datetime_string.split('.')[0] #then get it into a datetime format time_datetime=datetime.datetime.strptime(time_seconds,"%Y-%m-%dT%H:%M:%S") return time_datetime.strftime(format_string)
def create(
parent)
def create(parent): return AdvancedInterfaceFrame(parent)
def get_top_parent(
window)
Returns the topmost parent window
def get_top_parent(window): """Returns the topmost parent window""" try: parent=window.Parent print(parent) if parent in [None,''] or not isinstance(parent, InstanceType): raise get_top_parent(parent) except: return window
def rand(
...)
rand(d0, d1, ..., dn)
Random values in a given shape.
Create an array of the given shape and populate it with
random samples from a uniform distribution
over [0, 1)
.
Parameters
d0, d1, ..., dn : int, optional The dimensions of the returned array, should all be positive. If no argument is given a single Python float is returned.
Returns
out : ndarray, shape (d0, d1, ..., dn)
Random values.
See Also
random
Notes
This is a convenience function. If you want an interface that takes a shape-tuple as the first argument, refer to np.random.random_sample .
Examples
np.random.rand(3,2) array([[ 0.14022471, 0.96360618], #random [ 0.37601032, 0.25528411], #random [ 0.49313049, 0.94909878]]) #random
def test_AdvancedInterfaceFrame(
)
Tests the AdvancedInterfaceFrame Class
def test_AdvancedInterfaceFrame(): """ Tests the AdvancedInterfaceFrame Class""" app = wx.App(False) app.RedirectStdio() frame = create(None) frame.Show() # This is needed for the execfile command to output properly--can't redirect frame.locals=locals() app.MainLoop()
Classes
class AdvancedInterfaceFrame
class AdvancedInterfaceFrame(wx.Frame): # Needs to have an explicit list for the designer to work _custom_classes = {'wx.Panel':['ShellPanel','IEPanel', 'SimpleLogLowerInterfacePanel','SimpleArbDBLowerInterfacePanel','MatplotlibWxPanel','KeithleyIVPanel'],'wx.Dialog':'EndOfDayDialog'} def _init_coll_boxSizer7_Items(self, parent): # generated method, don't edit parent.AddWindow(self.StatesButton, 0, border=0, flag=0) parent.AddWindow(self.InstrumentsButton, 0, border=0, flag=0) def _init_coll_boxSizer6_Items(self, parent): # generated method, don't edit parent.AddWindow(self.button1, 0, border=0, flag=0) parent.AddWindow(self.button2, 0, border=0, flag=0) parent.AddWindow(self.button3, 0, border=0, flag=0) parent.AddWindow(self.ExecuteButton, 0, border=0, flag=0) parent.AddWindow(self.ReplaceRightControlButtton, 0, border=0, flag=0) parent.AddWindow(self.EndOfTheDayButton, 0, border=0, flag=0) parent.AddWindow(self.VisaDialogButton, 0, border=0, flag=0) def _init_coll_boxSizer4_Items(self, parent): # generated method, don't edit parent.AddWindow(self.UpperInterface, 1, border=2, flag=wx.EXPAND | wx.ALL) def _init_coll_boxSizer5_Items(self, parent): # generated method, don't edit parent.AddWindow(self.LowerInterface, 1, border=2, flag=wx.ALL | wx.EXPAND) def _init_coll_boxSizer3_Items(self, parent): # generated method, don't edit parent.AddWindow(self.UpperInterfacePanel, 4, border=2, flag=wx.ALL | wx.EXPAND) parent.AddWindow(self.LowerInterfacePanel, 0, border=2, flag=wx.ALL | wx.EXPAND) parent.AddWindow(self.LowerControlPanel,0, border=2, flag=wx.ALL | wx.EXPAND) def _init_coll_boxSizer1_Items(self, parent): # generated method, don't edit parent.AddWindow(self.MainPanel, 1, border=1, flag=wx.ALL | wx.EXPAND) def _init_coll_boxSizer2_Items(self, parent): # generated method, don't edit parent.AddWindow(self.LeftInterfacePanel, 1, border=2, flag=wx.EXPAND | wx.ALL) parent.AddWindow(self.RightControlPanel, 0, border=2, flag=wx.ALIGN_RIGHT | wx.ALL | wx.EXPAND) def _init_coll_ToolMenu_Items(self, parent): # generated method, don't edit parent.Append(help='Runs a python program as a script', id=wxID_BASICINTERFACEFRAMETOOLMENURUN_PYTHON, kind=wx.ITEM_NORMAL, text='Run Python Module As a Script') parent.Append(help='Load Scripts from a python Module', id=wxID_BASICINTERFACEFRAMETOOLMENULOADSCRIPTS, kind=wx.ITEM_NORMAL, text='Load Scripts from Module') self.Bind(wx.EVT_MENU, self.OnToolMenuRun_pythonMenu, id=wxID_BASICINTERFACEFRAMETOOLMENURUN_PYTHON) self.Bind(wx.EVT_MENU, self.OnToolMenuLoadscriptsMenu, id=wxID_BASICINTERFACEFRAMETOOLMENULOADSCRIPTS) def _init_coll_FileMenu_Items(self, parent): # generated method, don't edit parent.Append(help='Open a file', id=wxID_BASICINTERFACEFRAMEFILEMENUOPEN, kind=wx.ITEM_NORMAL, text='Open') parent.Append(help='Adds a new panel to main notebook', id=wxID_BASICINTERFACEFRAMEFILEMENUNEW, kind=wx.ITEM_NORMAL, text='New Panel') self.Bind(wx.EVT_MENU, self.OnFileMenuOpenMenu, id=wxID_BASICINTERFACEFRAMEFILEMENUOPEN) self.Bind(wx.EVT_MENU, self.OnFileMenuNewMenu, id=wxID_BASICINTERFACEFRAMEFILEMENUNEW) def _init_coll_InterfaceMenuBar_Menus(self, parent): # generated method, don't edit parent.Append(menu=self.FileMenu, title='File') parent.Append(menu=self.HelpMenu, title='Help') parent.Append(menu=self.ToolMenu, title='Tools') def _init_coll_UpperInterface_Pages(self, parent): # generated method, don't edit parent.AddPage(imageId=-1, page=self.Display, select=True, text='Display') parent.AddPage(imageId=-1, page=self.PlotPanel, select=False, text='Plot') parent.AddPage(imageId=-1, page=self.panel1, select=False, text='Keithley IV') def _init_coll_LowerInterface_Pages(self, parent): # generated method, don't edit parent.AddPage(imageId=-1, page=self.Shell, select=True, text='Shell') parent.AddPage(imageId=-1, page=self.LogsPanel, select=False, text='Logs') parent.AddPage(imageId=-1, page=self.ArbDBPanel, select=False, text='Files') def _init_coll_InterfaceStatusBar_Fields(self, parent): # generated method, don't edit parent.SetFieldsCount(1) parent.SetStatusText(number=0, text='Status') parent.SetStatusWidths([-1]) def _init_coll_InterfaceToolBar_Tools(self, parent): # generated method, don't edit parent.DoAddTool(bitmap=wx.Bitmap(str(os.path.join(IMAGE_DIRECTORY,'Component.png')), wx.BITMAP_TYPE_PNG), bmpDisabled=wx.NullBitmap, id=wxID_BASICINTERFACEFRAMEINTERFACETOOLBARLAUNCHBOA, kind=wx.ITEM_NORMAL, label='Boa', longHelp='Launch Boa Constructor', shortHelp='Launch Boa Constructor') parent.DoAddTool(bitmap=wx.Bitmap(str(os.path.join(IMAGE_DIRECTORY,'jupyter-logo.png')), wx.BITMAP_TYPE_PNG), bmpDisabled=wx.NullBitmap, id=wxID_BASICINTERFACEFRAMEINTERFACETOOLBARSAGE, kind=wx.ITEM_NORMAL, label='', longHelp='Launch SAGE and display ', shortHelp='Launch SAGE') self.Bind(wx.EVT_TOOL, self.OnInterfaceToolBarLaunchboaTool, id=wxID_BASICINTERFACEFRAMEINTERFACETOOLBARLAUNCHBOA) self.Bind(wx.EVT_TOOL, self.OnInterfaceToolBarTools1Tool, id=wxID_BASICINTERFACEFRAMEINTERFACETOOLBARSAGE) parent.Realize() def _init_sizers(self): # generated method, don't edit self.boxSizer1 = wx.BoxSizer(orient=wx.VERTICAL) self.boxSizer2 = wx.BoxSizer(orient=wx.HORIZONTAL) self.boxSizer3 = wx.BoxSizer(orient=wx.VERTICAL) self.boxSizer4 = wx.BoxSizer(orient=wx.VERTICAL) self.boxSizer5 = wx.BoxSizer(orient=wx.VERTICAL) self.boxSizer6 = wx.BoxSizer(orient=wx.HORIZONTAL) self.boxSizer7 = wx.BoxSizer(orient=wx.VERTICAL) self._init_coll_boxSizer1_Items(self.boxSizer1) self._init_coll_boxSizer2_Items(self.boxSizer2) self._init_coll_boxSizer3_Items(self.boxSizer3) self._init_coll_boxSizer4_Items(self.boxSizer4) self._init_coll_boxSizer5_Items(self.boxSizer5) self._init_coll_boxSizer6_Items(self.boxSizer6) self._init_coll_boxSizer7_Items(self.boxSizer7) self.SetSizer(self.boxSizer1) self.RightControlPanel.SetSizer(self.boxSizer7) self.LowerInterfacePanel.SetSizer(self.boxSizer5) self.LeftInterfacePanel.SetSizer(self.boxSizer3) self.UpperInterfacePanel.SetSizer(self.boxSizer4) self.LowerControlPanel.SetSizer(self.boxSizer6) self.MainPanel.SetSizer(self.boxSizer2) def _init_utils(self): # generated method, don't edit self.FileMenu = wx.Menu(title='') self.HelpMenu = wx.Menu(title='') self.InterfaceMenuBar = wx.MenuBar() self.ToolMenu = wx.Menu(title='Tools') self._init_coll_FileMenu_Items(self.FileMenu) self._init_coll_InterfaceMenuBar_Menus(self.InterfaceMenuBar) self._init_coll_ToolMenu_Items(self.ToolMenu) def _init_ctrls(self, prnt): # generated method, don't edit wx.Frame.__init__(self, id=wxID_BASICINTERFACEFRAME, name='AdvancedInterfaceFrame', parent=prnt, pos=wx.Point(-5, 106), size=wx.Size(1448, 874), style=wx.DEFAULT_FRAME_STYLE, title='Advanced Interface') self._init_utils() self.SetClientSize(wx.Size(1440, 840)) self.SetMenuBar(self.InterfaceMenuBar) self.Bind(wx.EVT_CLOSE, self.OnBasicInterfaceFrameClose) self.InterfaceStatusBar = wx.StatusBar(id=wxID_BASICINTERFACEFRAMEINTERFACESTATUSBAR, name='InterfaceStatusBar', parent=self, style=0) self.InterfaceStatusBar.SetHelpText('Status') self.InterfaceStatusBar.SetLabel('') self._init_coll_InterfaceStatusBar_Fields(self.InterfaceStatusBar) self.SetStatusBar(self.InterfaceStatusBar) self.InterfaceToolBar = wx.ToolBar(id=wxID_BASICINTERFACEFRAMEINTERFACETOOLBAR, name='InterfaceToolBar', parent=self, pos=wx.Point(0, 0), size=wx.Size(1440, 40), style=wx.TAB_TRAVERSAL | wx.TB_3DBUTTONS | wx.TB_HORIZONTAL | wx.MAXIMIZE_BOX | wx.NO_BORDER) self.InterfaceToolBar.SetHelpText('Launch Boa Contstructor') self.InterfaceToolBar.SetToolTipString('InterfaceToolBar') self.InterfaceToolBar.SetToolBitmapSize(wx.Size(30, 30)) self.InterfaceToolBar.SetToolPacking(0) self.InterfaceToolBar.SetToolSeparation(1) self.SetToolBar(self.InterfaceToolBar) self.MainPanel = wx.Panel(id=wxID_BASICINTERFACEFRAMEMAINPANEL, name='MainPanel', parent=self, pos=wx.Point(1, 1), size=wx.Size(1438, 838), style=wx.TAB_TRAVERSAL) self.LeftInterfacePanel = wx.Panel(id=wxID_BASICINTERFACEFRAMELEFTINTERFACEPANEL, name='LeftInterfacePanel', parent=self.MainPanel, pos=wx.Point(2, 2), size=wx.Size(1355, 834), style=wx.TAB_TRAVERSAL) self.RightControlPanel = wx.Panel(id=wxID_BASICINTERFACEFRAMERIGHTCONTROLPANEL, name='RightControlPanel', parent=self.MainPanel, pos=wx.Point(1361, 2), size=wx.Size(75, 834), style=wx.TAB_TRAVERSAL) self.RightControlPanel.SetBackgroundColour(wx.Colour(192, 192, 192)) self.LowerControlPanel = wx.Panel(id=wxID_BASICINTERFACEFRAMELOWERCONTROLPANEL, name='LowerControlPanel', parent=self.LeftInterfacePanel, pos=wx.Point(2, 808), size=wx.Size(1351, 24), style=wx.TAB_TRAVERSAL) self.LowerControlPanel.SetBackgroundColour(wx.Colour(0, 255, 128)) self.UpperInterfacePanel = wx.Panel(id=wxID_BASICINTERFACEFRAMEUPPERINTERFACEPANEL, name='UpperInterfacePanel', parent=self.LeftInterfacePanel, pos=wx.Point(2, 2), size=wx.Size(1351, 640), style=wx.TAB_TRAVERSAL) self.UpperInterfacePanel.SetBackgroundColour(wx.Colour(128, 128, 128)) self.UpperInterfacePanel.SetHelpText('UpperInterfacePanel') self.LowerInterfacePanel = wx.Panel(id=wxID_BASICINTERFACEFRAMELOWERINTERFACEPANEL, name='LowerInterfacePanel', parent=self.LeftInterfacePanel, pos=wx.Point(2, 646), size=wx.Size(1351, 158), style=wx.TAB_TRAVERSAL) self.LowerInterfacePanel.SetBackgroundColour(wx.Colour(192, 192, 192)) self.UpperInterface = wx.Notebook(id=wxID_BASICINTERFACEFRAMEUPPERINTERFACE, name='UpperInterface', parent=self.UpperInterfacePanel, pos=wx.Point(2, 2), size=wx.Size(1347, 636), style=0) self.LowerInterface = wx.Treebook(id=wxID_BASICINTERFACEFRAMELOWERINTERFACE, name='LowerInterface', parent=self.LowerInterfacePanel, pos=wx.Point(2, 2), size=wx.Size(1347, 154), style=0) self.LowerInterface.Bind(wx.EVT_TREEBOOK_PAGE_CHANGED, self.OnLowerInterfaceTreebookPageChanged, id=wxID_BASICINTERFACEFRAMELOWERINTERFACE) self.Display = IEPanel(id=wxID_BASICINTERFACEFRAMEDISPLAY, name='Display', parent=self.UpperInterface, pos=wx.Point(0, 0), size=wx.Size(1339, 610), style=wx.TAB_TRAVERSAL) self.Shell = ShellPanel(id=wxID_BASICINTERFACEFRAMESHELL, name='Shell', parent=self.LowerInterface, pos=wx.Point(0, 0), size=wx.Size(1281, 154), style=wx.TAB_TRAVERSAL) self.button1 = wx.Button(id=wxID_BASICINTERFACEFRAMEBUTTON1, label='Java Script Example', name='button1', parent=self.LowerControlPanel, pos=wx.Point(0, 0), size=wx.Size(136, 23), style=0) self.button1.Bind(wx.EVT_BUTTON, self.OnButton1Button, id=wxID_BASICINTERFACEFRAMEBUTTON1) self.button2 = wx.Button(id=wxID_BASICINTERFACEFRAMEBUTTON2, label='button2', name='button2', parent=self.LowerControlPanel, pos=wx.Point(136, 0), size=wx.Size(75, 23), style=0) self.button2.Bind(wx.EVT_BUTTON, self.OnButton2Button, id=wxID_BASICINTERFACEFRAMEBUTTON2) self.button3 = wx.Button(id=wxID_BASICINTERFACEFRAMEBUTTON3, label='button3', name='button3', parent=self.LowerControlPanel, pos=wx.Point(211, 0), size=wx.Size(75, 23), style=0) self.ExecuteButton = wx.Button(id=wxID_BASICINTERFACEFRAMEEXECUTEBUTTON, label='Execute IEPanel.py', name='ExecuteButton', parent=self.LowerControlPanel, pos=wx.Point(286, 0), size=wx.Size(111, 23), style=0) self.ExecuteButton.Bind(wx.EVT_BUTTON, self.OnExecuteButtonButton, id=wxID_BASICINTERFACEFRAMEEXECUTEBUTTON) self.ReplaceRightControlButtton = wx.Button(id=wxID_BASICINTERFACEFRAMEREPLACERIGHTCONTROLBUTTTON, label='Replace Right Control Panel', name='ReplaceRightControlButtton', parent=self.LowerControlPanel, pos=wx.Point(397, 0), size=wx.Size(180, 24), style=0) self.ReplaceRightControlButtton.Bind(wx.EVT_BUTTON, self.OnReplaceRightControlButttonButton, id=wxID_BASICINTERFACEFRAMEREPLACERIGHTCONTROLBUTTTON) self.StatesButton = wx.Button(id=wxID_BASICINTERFACEFRAMESTATESBUTTON, label='States', name='StatesButton', parent=self.RightControlPanel, pos=wx.Point(0, 0), size=wx.Size(75, 23), style=0) self.StatesButton.Bind(wx.EVT_BUTTON, self.OnStatesButtonButton, id=wxID_BASICINTERFACEFRAMESTATESBUTTON) self.InstrumentsButton = wx.Button(id=wxID_BASICINTERFACEFRAMEINSTRUMENTSBUTTON, label='Instruments', name='InstrumentsButton', parent=self.RightControlPanel, pos=wx.Point(0, 23), size=wx.Size(75, 23), style=0) self.InstrumentsButton.Bind(wx.EVT_BUTTON, self.OnInstrumentsButtonButton, id=wxID_BASICINTERFACEFRAMEINSTRUMENTSBUTTON) self.LogsPanel = SimpleLogLowerInterfacePanel(id=wxID_BASICINTERFACEFRAMELOGSPANEL, name='LogsPanel', parent=self.LowerInterface, pos=wx.Point(0, 0), size=wx.Size(1281, 154), style=wx.TAB_TRAVERSAL) self.ArbDBPanel = SimpleArbDBLowerInterfacePanel(id=wxID_BASICINTERFACEFRAMEARBDBPANEL, name='ArbDBPanel', parent=self.LowerInterface, pos=wx.Point(0, 0), size=wx.Size(1281, 154), style=wx.TAB_TRAVERSAL) self.EndOfTheDayButton = wx.Button(id=wxID_BASICINTERFACEFRAMEENDOFTHEDAYBUTTON, label='End of The Day Log', name='EndOfTheDayButton', parent=self.LowerControlPanel, pos=wx.Point(577, 0), size=wx.Size(103, 23), style=0) self.EndOfTheDayButton.Bind(wx.EVT_BUTTON, self.OnEndOfTheDayButtonButton, id=wxID_BASICINTERFACEFRAMEENDOFTHEDAYBUTTON) self.VisaDialogButton = wx.Button(id=wxID_BASICINTERFACEFRAMEVISADIALOGBUTTON, label='VISA Communicator', name='VisaDialogButton', parent=self.LowerControlPanel, pos=wx.Point(680, 0), size=wx.Size(184, 23), style=0) self.VisaDialogButton.Bind(wx.EVT_BUTTON, self.OnVisaDialogButtonButton, id=wxID_BASICINTERFACEFRAMEVISADIALOGBUTTON) self.PlotPanel = MatplotlibWxPanel(id=wxID_BASICINTERFACEFRAMEPLOTPANEL, name='PlotPanel', parent=self.UpperInterface, pos=wx.Point(0, 0), size=wx.Size(1339, 610), style=wx.TAB_TRAVERSAL) self.panel1 = KeithleyIVPanel(id=wxID_BASICINTERFACEFRAMEPANEL1, name='panel1', parent=self.UpperInterface, pos=wx.Point(0, 0), size=wx.Size(1339, 610), style=wx.TAB_TRAVERSAL) self._init_coll_InterfaceToolBar_Tools(self.InterfaceToolBar) self._init_coll_UpperInterface_Pages(self.UpperInterface) self._init_coll_LowerInterface_Pages(self.LowerInterface) self._init_sizers() def __init__(self, parent): self._init_ctrls(parent) #make the shell self aware--requires that ShellEditor.interp.locals=locals() self.Shell.ShellEditor.pushLine("shell=locals()['self']") #This assumes the main frame is exactly 6 levels above self.Shell.ShellEditor.pushLine("frame=shell.Parent.Parent.Parent.Parent.Parent.Parent") self.Shell.ShellEditor.pushLine("print('\# The object corresponding to the main frame is called frame')") #self.Shell.ShellEditor.pushLine("shell=locals()['self']",'\n') self.right_control_panels=[self.RightControlPanel] self.current_right_control_panel=self.right_control_panels[0] # TODO Delete this out it is a test self.NewPanel=wx.Panel(self.MainPanel,name='Green') self.NewPanel.SetBackgroundColour(wx.Colour(0,255,0)) self.right_control_panels.append(self.NewPanel) self.NewPanel2=wx.Panel(self.MainPanel,name='Blue') self.NewPanel2.SetBackgroundColour(wx.Colour(0,0,255)) self.right_control_panels.append(self.NewPanel2) self.NewPanel3=wx.Panel(self.MainPanel,name='Red') self.NewPanel3.SetBackgroundColour(wx.Colour(255,0,0)) self.right_control_panels.append(self.NewPanel3) self.NewPanel.Show(False) self.NewPanel2.Show(False) self.NewPanel3.Show(False) # This initializes the locals dictionary, needed to get output from # execfile command. This attribute needs to be asigned to locals() at # the time that the frame is created. See Module Runner self.locals={} # This passes the button event from the log panel to the main frame self.LogsPanel.Bind(wx.EVT_BUTTON,self.update_display) self.ScriptsMenu=wx.Menu() self.ToolMenu.AppendMenu(-1,'Scripts',self.ScriptsMenu) #Added these for script handling self.loaded_script_menu_items=[] self.event_handlers={} self.tool_menu_number=0 #This adds panels to the FileMenu->Add Panel item self.panels_menu() def panels_menu(self): """ Creates the Add Panels Menu""" # First we select only files of the for *Panel.py FrontEnds_files=os.listdir(FRONTENDS_DIRECTORY) self.panel_files=[] for file in FrontEnds_files: if re.search('Panel.py',file) and not re.search('.pyc|pyo',file): self.panel_files.append(file) #This adds panels to the FileMenu->Add Panel item self.add_panel_menu=wx.Menu() self.panel_dictionary={} for panel in self.panel_files: new_id=wx.NewId() self.panel_dictionary[new_id]=panel self.add_panel_menu.Append(new_id,panel,'Add the Panel %s'%panel) self.Bind(wx.EVT_MENU, lambda evt: self.OnAddPanel(evt,new_id),id=new_id) #print(new_id,panel) #print(self.panel_dictionary) self.FileMenu.AppendMenu(0,'Add a Panel',self.add_panel_menu) def OnAddPanel(self,event,id): """ Adds a panel""" sys.path.append(FRONTENDS_DIRECTORY) #print(dir(event),event.Id) panel_name=self.panel_dictionary[event.Id].replace('.py','') exec('from %s import *'%panel_name) exec('self.%s_%s=%s(id=%s,name="%s_%s", parent=self.UpperInterface, pos=wx.Point(0, 0),size=wx.Size(1339, 610), style=wx.TAB_TRAVERSAL)'%(panel_name,id,panel_name,id,panel_name,id)) exec("self.UpperInterface.AddPage(imageId=-1, page=self.%s_%s, select=True,text='%s')"%(panel_name,id,panel_name)) def OnFileMenuOpenMenu(self, event): event.Skip() def OnReplaceRightControlButttonButton(self, event): try: new=self.right_control_panels.index( self.current_right_control_panel)%len(self.right_control_panels)+1 new_panel=self.right_control_panels[new] except: new=0 new_panel=self.right_control_panels[new] self.swap_panel(self.current_right_control_panel,new_panel,self.boxSizer2) def swap_panel(self,old_panel,new_panel,sizer): "Swaps a panel and places the new one in the sizer" new_panel.SetPosition(old_panel.Position) new_panel.SetSize(old_panel.Size) old_panel.Show(False) sizer.Replace(old_panel,new_panel) new_panel.Show(True) self.current_right_control_panel=new_panel self.Update() def OnInterfaceToolBarLaunchboaTool(self, event): os.system(r'start python C:\Anaconda2\Lib\site-packages\boa\Boa.py') event.Skip() def OnExecuteButtonButton(self, event): path=str(os.path.join(PYMEASURE_ROOT,'Code/FrontEnds/IEPanel.py')) exec(compile(open(path).read(), path, 'exec')) def OnLowerInterfaceTreebookPageChanged(self, event): self.update_display() event.Skip() def update_display(self,event=None): "Updates the display" if self.LowerInterface.GetCurrentPage() is self.LogsPanel: self.Display.ie.Navigate(self.LogsPanel.current_log.path) else: self.Display.Refresh() def OnInterfaceToolBarTools1Tool(self, event): #sage_script=r'C:\"Program Files"\AutoIt3\Examples\SAGE_NOIE2.exe' #os.system('jupyter notebook') self.Display.ie.Navigate('http://localhost:8888/tree') pass def OnBasicInterfaceFrameClose(self, event): """ What to do when the frame is closed, needed to avoid memory leaks""" try: app=wx.GetApp() app.stdioWin.close() except:pass self.Destroy() event.Skip() def OnButton1Button(self, event): self.Display.write(JAVASCRIPT_STRING) event.Skip() def OnToolMenuRun_pythonMenu(self, event): dlg = wx.FileDialog(self, 'Choose a file', '.', '', '*.py', wx.OPEN) try: if dlg.ShowModal() == wx.ID_OK: filename = dlg.GetPath() try: exec(compile(open(filename).read(), filename, 'exec'),self.locals) except: pass finally: dlg.Destroy() event.Skip() def OnToolMenuLoadscriptsMenu(self, event): " Loads Scripts to run" dlg = wx.FileDialog(self, 'Choose a Python Module', '.', '', '*.py', wx.OPEN) try: if dlg.ShowModal() == wx.ID_OK: filename = dlg.GetPath() module_scripts=self.import_scripts(filename) module=module_scripts['module'] try: for index,script in enumerate(module_scripts['scripts']): new_id=wx.NewId() menu_item=wx.MenuItem(self.ToolMenu,id=new_id, kind=wx.ITEM_NORMAL, text='Run %s '%script, help='Run %s from the %s module'%(script,module)) self.ScriptsMenu.AppendItem(menu_item) self.loaded_script_menu_items.append(menu_item) #event_handler=(lambda event: self.execute_script(event)) #eval('def event\_handler%s(event):return self.execute_script(event,module\_scripts["%s"],"%s")'%(index,script,script),locals()) #event_handler.func_name='%s'%index self.event_handlers[menu_item.GetId()]=module_scripts[script] #print(self.event_handlers) self.Bind(wx.EVT_MENU,self.execute_script,id=menu_item.GetId()) #print(self.event_handlers) #self.bind_menu() except: print(('Could Not Import {0}'.format(module))) raise finally: dlg.Destroy() event.Skip() #print(self.event_handlers) ## def bind_menu(self): ## for index,menu_item in enumerate(self.loaded_script_menu_items): ## print(self.event_handlers[menu_item.GetId()],menu_item,menu_item.GetId()) ## self.Bind(wx.EVT_MENU,self.event_handlers[menu_item.GetId()],id=menu_item.GetId()) def import_scripts(self,file_name): "Loads a module given a path and returns a dictionary of things recognized as scripts""" #added file path to sys.path output={} scripts=[] module_directory=os.path.split(file_name)[0] module_name=os.path.split(file_name)[1].replace('.py','') sys.path.append(module_directory) exec('import {0}'.format(module_name)) attributes=eval('dir({0})'.format(module_name)) for item in attributes: if re.search('test_|_robot|_script',item,re.IGNORECASE): scripts.append(item) output[item]=eval('{0}.{1}'.format(module_name,item)) output['module']=module_name output['scripts']=scripts return output def execute_script(self,event): #print(self.event_handlers) #print(event.Id) return self.event_handlers[event.Id]() def add_notebook_page(self): """ Adds a page to the InterfaceNotebook""" pass def OnButton2Button(self, event): self.tool_menu_number=self.tool_menu_number+1 if self.tool_menu_number is 1: self.ScriptsMenu=wx.Menu() self.ToolMenu.AppendMenu(-1,'Scripts',self.ScriptsMenu) self.ScriptsMenu.Append(help='Runs the {0} script'.format(self.tool_menu_number), id=-1,kind=wx.ITEM_NORMAL, text='Run the {0} script'.format(self.tool_menu_number)) event.Skip() def OnStatesButtonButton(self, event): states_directory=os.path.join(PYMEASURE_ROOT,'Data/States') self.Display.ie.Navigate(states_directory) event.Skip() def OnInstrumentsButtonButton(self, event): instruments_directory=os.path.join(PYMEASURE_ROOT,'Instruments') self.Display.ie.Navigate(instruments_directory) event.Skip() def OnEndOfTheDayButtonButton(self, event): dlg = EndOfDayDialog(self) try: result = dlg.ShowModal() finally: dlg.Destroy() event.Skip def OnVisaDialogButtonButton(self, event): dlg = VisaDialog(self) try: result = dlg.Show() finally: pass event.Skip def OnFileMenuNewMenu(self, event): ## dlg = wx.FileDialog(self, 'Choose a file', '.', '', '*.*', wx.OPEN) ## try: ## if dlg.ShowModal() == wx.ID_OK: ## filename = dlg.GetPath() ## # Your code ## finally: ## dlg.Destroy() ## self.upper_Interface.AddPage( ## event.Skip() pass
Ancestors (in MRO)
- AdvancedInterfaceFrame
- wx._windows.Frame
- wx._windows.TopLevelWindow
- wx._core.Window
- wx._core.EvtHandler
- wx._core.Object
- __builtin__.object
Static methods
def FindFocus(
*args, **kwargs)
FindFocus() -> Window
Returns the window or control that currently has the keyboard focus, or None.
def FindFocus(*args, **kwargs): """ FindFocus() -> Window Returns the window or control that currently has the keyboard focus, or None. """ return _core_.Window_FindFocus(*args, **kwargs)
def GetCapture(
*args, **kwargs)
GetCapture() -> Window
Returns the window which currently captures the mouse or None
def GetCapture(*args, **kwargs): """ GetCapture() -> Window Returns the window which currently captures the mouse or None """ return _core_.Window_GetCapture(*args, **kwargs)
def GetClassDefaultAttributes(
*args, **kwargs)
GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes
Get the default attributes for this class. This is useful if you want to use the same font or colour in your own control as in a standard control -- which is a much better idea than hard coding specific colours or fonts which might look completely out of place on the user's system, especially if it uses themes.
The variant parameter is only relevant under Mac currently and is
ignore under other platforms. Under Mac, it will change the size of
the returned font. See wx.Window.SetWindowVariant
for more about
this.
def GetClassDefaultAttributes(*args, **kwargs): """ GetClassDefaultAttributes(int variant=WINDOW_VARIANT_NORMAL) -> VisualAttributes Get the default attributes for this class. This is useful if you want to use the same font or colour in your own control as in a standard control -- which is a much better idea than hard coding specific colours or fonts which might look completely out of place on the user's system, especially if it uses themes. The variant parameter is only relevant under Mac currently and is ignore under other platforms. Under Mac, it will change the size of the returned font. See `wx.Window.SetWindowVariant` for more about this. """ return _windows_.Frame_GetClassDefaultAttributes(*args, **kwargs)
def GetDefaultSize(
*args, **kwargs)
GetDefaultSize() -> Size
def GetDefaultSize(*args, **kwargs): """GetDefaultSize() -> Size""" return _windows_.TopLevelWindow_GetDefaultSize(*args, **kwargs)
def NewControlId(
*args, **kwargs)
NewControlId(int count=1) -> int
Generate a unique id (or count of them consecutively), returns a valid id in the auto-id range or wxID_NONE if failed. If using autoid management, it will mark the id as reserved until it is used (by assigning it to a wxWindowIDRef) or unreserved.
def NewControlId(*args, **kwargs): """ NewControlId(int count=1) -> int Generate a unique id (or count of them consecutively), returns a valid id in the auto-id range or wxID_NONE if failed. If using autoid management, it will mark the id as reserved until it is used (by assigning it to a wxWindowIDRef) or unreserved. """ return _core_.Window_NewControlId(*args, **kwargs)
def ReleaseControlId(
id)
def ReleaseControlId(id): UnreserveControlId(id)
def UnreserveControlId(
*args, **kwargs)
UnreserveControlId(int id, int count=1)
If an ID generated from NewControlId is not assigned to a wxWindowIDRef, it must be unreserved.
def UnreserveControlId(*args, **kwargs): """ UnreserveControlId(int id, int count=1) If an ID generated from NewControlId is not assigned to a wxWindowIDRef, it must be unreserved. """ return _core_.Window_UnreserveControlId(*args, **kwargs)
Instance variables
var AcceleratorTable
See GetAcceleratorTable
and SetAcceleratorTable
var AutoLayout
See GetAutoLayout
and SetAutoLayout
var BackgroundColour
See GetBackgroundColour
and SetBackgroundColour
var BackgroundStyle
See GetBackgroundStyle
and SetBackgroundStyle
var BestSize
See GetBestSize
var BestVirtualSize
See GetBestVirtualSize
var Border
See GetBorder
var Caret
See GetCaret
and SetCaret
var CharHeight
See GetCharHeight
var CharWidth
See GetCharWidth
var Children
See GetChildren
var ClassName
See GetClassName
var ClientAreaOrigin
See GetClientAreaOrigin
var ClientRect
See GetClientRect
and SetClientRect
var ClientSize
See GetClientSize
and SetClientSize
var Constraints
See GetConstraints
and SetConstraints
var ContainingSizer
See GetContainingSizer
and SetContainingSizer
var Cursor
See GetCursor
and SetCursor
var DefaultAttributes
See GetDefaultAttributes
var DefaultItem
See GetDefaultItem
and SetDefaultItem
var DropTarget
See GetDropTarget
and SetDropTarget
var EffectiveMinSize
See GetEffectiveMinSize
var Enabled
See IsEnabled
and Enable
var EventHandler
See GetEventHandler
and SetEventHandler
var EvtHandlerEnabled
See GetEvtHandlerEnabled
and SetEvtHandlerEnabled
var ExtraStyle
See GetExtraStyle
and SetExtraStyle
var Font
See GetFont
and SetFont
var ForegroundColour
See GetForegroundColour
and SetForegroundColour
var GrandParent
See GetGrandParent
var GtkWidget
GetGtkWidget(self) -> long
On wxGTK returns a pointer to the GtkWidget for this window as a long integer. On the other platforms this method returns zero.
var Handle
See GetHandle
var HelpText
See GetHelpText
and SetHelpText
var Icon
See GetIcon
and SetIcon
var Id
See GetId
and SetId
var Label
See GetLabel
and SetLabel
var LayoutDirection
See GetLayoutDirection
and SetLayoutDirection
var MaxClientSize
GetMaxClientSize(self) -> Size
var MaxHeight
See GetMaxHeight
var MaxSize
See GetMaxSize
and SetMaxSize
var MaxWidth
See GetMaxWidth
var MenuBar
See GetMenuBar
and SetMenuBar
var MinClientSize
GetMinClientSize(self) -> Size
var MinHeight
See GetMinHeight
var MinSize
See GetMinSize
and SetMinSize
var MinWidth
See GetMinWidth
var Name
See GetName
and SetName
var NewPanel
var NewPanel2
var NewPanel3
var NextHandler
See GetNextHandler
and SetNextHandler
var OSXModified
OSXIsModified(self) -> bool
var Parent
See GetParent
var Position
See GetPosition
and SetPosition
var PreviousHandler
See GetPreviousHandler
and SetPreviousHandler
var Rect
See GetRect
and SetRect
var ScreenPosition
See GetScreenPosition
var ScreenRect
See GetScreenRect
var ScriptsMenu
var Shown
See IsShown
and Show
var Size
See GetSize
and SetSize
var Sizer
See GetSizer
and SetSizer
var StatusBar
See GetStatusBar
and SetStatusBar
var StatusBarPane
See GetStatusBarPane
and SetStatusBarPane
var ThemeEnabled
See GetThemeEnabled
and SetThemeEnabled
var Title
See GetTitle
and SetTitle
var TmpDefaultItem
See GetTmpDefaultItem
and SetTmpDefaultItem
var ToolBar
See GetToolBar
and SetToolBar
var ToolTip
See GetToolTip
and SetToolTip
var ToolTipString
var TopLevel
See IsTopLevel
var TopLevelParent
See GetTopLevelParent
var UpdateClientRect
See GetUpdateClientRect
var UpdateRegion
See GetUpdateRegion
var Validator
See GetValidator
and SetValidator
var VirtualSize
See GetVirtualSize
and SetVirtualSize
var WindowStyle
See GetWindowStyle
and SetWindowStyle
var WindowStyleFlag
See GetWindowStyleFlag
and SetWindowStyleFlag
var WindowVariant
See GetWindowVariant
and SetWindowVariant
var current_right_control_panel
var event_handlers
var locals
var right_control_panels
var thisown
The membership flag
Methods
def __init__(
self, parent)
def __init__(self, parent): self._init_ctrls(parent) #make the shell self aware--requires that ShellEditor.interp.locals=locals() self.Shell.ShellEditor.pushLine("shell=locals()['self']") #This assumes the main frame is exactly 6 levels above self.Shell.ShellEditor.pushLine("frame=shell.Parent.Parent.Parent.Parent.Parent.Parent") self.Shell.ShellEditor.pushLine("print('\# The object corresponding to the main frame is called frame')") #self.Shell.ShellEditor.pushLine("shell=locals()['self']",'\n') self.right_control_panels=[self.RightControlPanel] self.current_right_control_panel=self.right_control_panels[0] # TODO Delete this out it is a test self.NewPanel=wx.Panel(self.MainPanel,name='Green') self.NewPanel.SetBackgroundColour(wx.Colour(0,255,0)) self.right_control_panels.append(self.NewPanel) self.NewPanel2=wx.Panel(self.MainPanel,name='Blue') self.NewPanel2.SetBackgroundColour(wx.Colour(0,0,255)) self.right_control_panels.append(self.NewPanel2) self.NewPanel3=wx.Panel(self.MainPanel,name='Red') self.NewPanel3.SetBackgroundColour(wx.Colour(255,0,0)) self.right_control_panels.append(self.NewPanel3) self.NewPanel.Show(False) self.NewPanel2.Show(False) self.NewPanel3.Show(False) # This initializes the locals dictionary, needed to get output from # execfile command. This attribute needs to be asigned to locals() at # the time that the frame is created. See Module Runner self.locals={} # This passes the button event from the log panel to the main frame self.LogsPanel.Bind(wx.EVT_BUTTON,self.update_display) self.ScriptsMenu=wx.Menu() self.ToolMenu.AppendMenu(-1,'Scripts',self.ScriptsMenu) #Added these for script handling self.loaded_script_menu_items=[] self.event_handlers={} self.tool_menu_number=0 #This adds panels to the FileMenu->Add Panel item self.panels_menu()
def AcceptsFocus(
*args, **kwargs)
AcceptsFocus(self) -> bool
Can this window have focus?
def AcceptsFocus(*args, **kwargs): """ AcceptsFocus(self) -> bool Can this window have focus? """ return _core_.Window_AcceptsFocus(*args, **kwargs)
def AcceptsFocusFromKeyboard(
*args, **kwargs)
AcceptsFocusFromKeyboard(self) -> bool
Can this window be given focus by keyboard navigation? if not, the only way to give it focus (provided it accepts it at all) is to click it.
def AcceptsFocusFromKeyboard(*args, **kwargs): """ AcceptsFocusFromKeyboard(self) -> bool Can this window be given focus by keyboard navigation? if not, the only way to give it focus (provided it accepts it at all) is to click it. """ return _core_.Window_AcceptsFocusFromKeyboard(*args, **kwargs)
def AddChild(
*args, **kwargs)
AddChild(self, Window child)
Adds a child window. This is called automatically by window creation functions so should not be required by the application programmer.
def AddChild(*args, **kwargs): """ AddChild(self, Window child) Adds a child window. This is called automatically by window creation functions so should not be required by the application programmer. """ return _core_.Window_AddChild(*args, **kwargs)
def AddPendingEvent(
*args, **kwargs)
AddPendingEvent(self, Event event)
def AddPendingEvent(*args, **kwargs): """AddPendingEvent(self, Event event)""" return _core_.EvtHandler_AddPendingEvent(*args, **kwargs)
def AdjustForLayoutDirection(
*args, **kwargs)
AdjustForLayoutDirection(self, int x, int width, int widthTotal) -> int
Mirror coordinates for RTL layout if this window uses it and if the mirroring is not done automatically like Win32.
def AdjustForLayoutDirection(*args, **kwargs): """ AdjustForLayoutDirection(self, int x, int width, int widthTotal) -> int Mirror coordinates for RTL layout if this window uses it and if the mirroring is not done automatically like Win32. """ return _core_.Window_AdjustForLayoutDirection(*args, **kwargs)
def AlwaysShowScrollbars(
*args, **kwargs)
AlwaysShowScrollbars(self, bool horz=True, bool vert=True)
def AlwaysShowScrollbars(*args, **kwargs): """AlwaysShowScrollbars(self, bool horz=True, bool vert=True)""" return _core_.Window_AlwaysShowScrollbars(*args, **kwargs)
def AssociateHandle(
*args, **kwargs)
AssociateHandle(self, long handle)
Associate the window with a new native handle
def AssociateHandle(*args, **kwargs): """ AssociateHandle(self, long handle) Associate the window with a new native handle """ return _core_.Window_AssociateHandle(*args, **kwargs)
def Bind(
self, event, handler, source=None, id=-1, id2=-1)
Bind an event to an event handler.
:param event: One of the EVT_* objects that specifies the type of event to bind,
:param handler: A callable object to be invoked when the event is delivered to self. Pass None to disconnect an event handler.
:param source: Sometimes the event originates from a different window than self, but you still want to catch it in self. (For example, a button event delivered to a frame.) By passing the source of the event, the event handling system is able to differentiate between the same event type from different controls.
:param id: Used to spcify the event source by ID instead of instance.
:param id2: Used when it is desirable to bind a handler to a range of IDs, such as with EVT_MENU_RANGE.
def Bind(self, event, handler, source=None, id=wx.ID_ANY, id2=wx.ID_ANY): """ Bind an event to an event handler. :param event: One of the EVT_* objects that specifies the type of event to bind, :param handler: A callable object to be invoked when the event is delivered to self. Pass None to disconnect an event handler. :param source: Sometimes the event originates from a different window than self, but you still want to catch it in self. (For example, a button event delivered to a frame.) By passing the source of the event, the event handling system is able to differentiate between the same event type from different controls. :param id: Used to spcify the event source by ID instead of instance. :param id2: Used when it is desirable to bind a handler to a range of IDs, such as with EVT_MENU_RANGE. """ assert isinstance(event, wx.PyEventBinder) assert handler is None or callable(handler) assert source is None or hasattr(source, 'GetId') if source is not None: id = source.GetId() event.Bind(self, id, id2, handler)
def CacheBestSize(
*args, **kwargs)
CacheBestSize(self, Size size)
Cache the best size so it doesn't need to be calculated again, (at least until some properties of the window change.)
def CacheBestSize(*args, **kwargs): """ CacheBestSize(self, Size size) Cache the best size so it doesn't need to be calculated again, (at least until some properties of the window change.) """ return _core_.Window_CacheBestSize(*args, **kwargs)
def CanAcceptFocus(
*args, **kwargs)
CanAcceptFocus(self) -> bool
Can this window have focus right now?
def CanAcceptFocus(*args, **kwargs): """ CanAcceptFocus(self) -> bool Can this window have focus right now? """ return _core_.Window_CanAcceptFocus(*args, **kwargs)
def CanAcceptFocusFromKeyboard(
*args, **kwargs)
CanAcceptFocusFromKeyboard(self) -> bool
Can this window be assigned focus from keyboard right now?
def CanAcceptFocusFromKeyboard(*args, **kwargs): """ CanAcceptFocusFromKeyboard(self) -> bool Can this window be assigned focus from keyboard right now? """ return _core_.Window_CanAcceptFocusFromKeyboard(*args, **kwargs)
def CanApplyThemeBorder(
*args, **kwargs)
CanApplyThemeBorder(self) -> bool
def CanApplyThemeBorder(*args, **kwargs): """CanApplyThemeBorder(self) -> bool""" return _core_.Window_CanApplyThemeBorder(*args, **kwargs)
def CanBeOutsideClientArea(
*args, **kwargs)
CanBeOutsideClientArea(self) -> bool
def CanBeOutsideClientArea(*args, **kwargs): """CanBeOutsideClientArea(self) -> bool""" return _core_.Window_CanBeOutsideClientArea(*args, **kwargs)
def CanScroll(
*args, **kwargs)
CanScroll(self, int orient) -> bool
Can the window have the scrollbar in this orientation?
def CanScroll(*args, **kwargs): """ CanScroll(self, int orient) -> bool Can the window have the scrollbar in this orientation? """ return _core_.Window_CanScroll(*args, **kwargs)
def CanSetTransparent(
*args, **kwargs)
CanSetTransparent(self) -> bool
Returns True
if the platform supports setting the transparency for
this window. Note that this method will err on the side of caution,
so it is possible that this will return False
when it is in fact
possible to set the transparency.
NOTE: On X-windows systems the X server must have the composite extension loaded, and there must be a composite manager program (such as xcompmgr) running.
def CanSetTransparent(*args, **kwargs): """ CanSetTransparent(self) -> bool Returns ``True`` if the platform supports setting the transparency for this window. Note that this method will err on the side of caution, so it is possible that this will return ``False`` when it is in fact possible to set the transparency. NOTE: On X-windows systems the X server must have the composite extension loaded, and there must be a composite manager program (such as xcompmgr) running. """ return _core_.Window_CanSetTransparent(*args, **kwargs)
def CaptureMouse(
*args, **kwargs)
CaptureMouse(self)
Directs all mouse input to this window. Call wx.Window.ReleaseMouse to release the capture.
Note that wxWindows maintains the stack of windows having captured the
mouse and when the mouse is released the capture returns to the window
which had had captured it previously and it is only really released if
there were no previous window. In particular, this means that you must
release the mouse as many times as you capture it, unless the window
receives the wx.MouseCaptureLostEvent
event.
Any application which captures the mouse in the beginning of some
operation must handle wx.MouseCaptureLostEvent
and cancel this
operation when it receives the event. The event handler must not
recapture mouse.
def CaptureMouse(*args, **kwargs): """ CaptureMouse(self) Directs all mouse input to this window. Call wx.Window.ReleaseMouse to release the capture. Note that wxWindows maintains the stack of windows having captured the mouse and when the mouse is released the capture returns to the window which had had captured it previously and it is only really released if there were no previous window. In particular, this means that you must release the mouse as many times as you capture it, unless the window receives the `wx.MouseCaptureLostEvent` event. Any application which captures the mouse in the beginning of some operation *must* handle `wx.MouseCaptureLostEvent` and cancel this operation when it receives the event. The event handler must not recapture mouse. """ return _core_.Window_CaptureMouse(*args, **kwargs)
def Center(
*args, **kwargs)
Center(self, int direction=BOTH)
Centers the window. The parameter specifies the direction for centering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may also include wx.CENTER_ON_SCREEN flag if you want to center the window on the entire screen and not on its parent window. If it is a top-level window and has no parent then it will always be centered relative to the screen.
def Center(*args, **kwargs): """ Center(self, int direction=BOTH) Centers the window. The parameter specifies the direction for centering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may also include wx.CENTER_ON_SCREEN flag if you want to center the window on the entire screen and not on its parent window. If it is a top-level window and has no parent then it will always be centered relative to the screen. """ return _core_.Window_Center(*args, **kwargs)
def CenterOnParent(
*args, **kwargs)
CenterOnParent(self, int dir=BOTH)
Center with respect to the the parent window
def CenterOnParent(*args, **kwargs): """ CenterOnParent(self, int dir=BOTH) Center with respect to the the parent window """ return _core_.Window_CenterOnParent(*args, **kwargs)
def CenterOnScreen(
*args, **kwargs)
CenterOnScreen(self, int dir=BOTH)
Center the window on screen
def CenterOnScreen(*args, **kwargs): """ CenterOnScreen(self, int dir=BOTH) Center the window on screen """ return _windows_.TopLevelWindow_CenterOnScreen(*args, **kwargs)
def Centre(
*args, **kwargs)
Center(self, int direction=BOTH)
Centers the window. The parameter specifies the direction for centering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may also include wx.CENTER_ON_SCREEN flag if you want to center the window on the entire screen and not on its parent window. If it is a top-level window and has no parent then it will always be centered relative to the screen.
def Center(*args, **kwargs): """ Center(self, int direction=BOTH) Centers the window. The parameter specifies the direction for centering, and may be wx.HORIZONTAL, wx.VERTICAL or wx.BOTH. It may also include wx.CENTER_ON_SCREEN flag if you want to center the window on the entire screen and not on its parent window. If it is a top-level window and has no parent then it will always be centered relative to the screen. """ return _core_.Window_Center(*args, **kwargs)
def CentreOnParent(
*args, **kwargs)
CenterOnParent(self, int dir=BOTH)
Center with respect to the the parent window
def CenterOnParent(*args, **kwargs): """ CenterOnParent(self, int dir=BOTH) Center with respect to the the parent window """ return _core_.Window_CenterOnParent(*args, **kwargs)
def CentreOnScreen(
*args, **kwargs)
CenterOnScreen(self, int dir=BOTH)
Center the window on screen
def CenterOnScreen(*args, **kwargs): """ CenterOnScreen(self, int dir=BOTH) Center the window on screen """ return _windows_.TopLevelWindow_CenterOnScreen(*args, **kwargs)
def ClearBackground(
*args, **kwargs)
ClearBackground(self)
Clears the window by filling it with the current background colour. Does not cause an erase background event to be generated.
def ClearBackground(*args, **kwargs): """ ClearBackground(self) Clears the window by filling it with the current background colour. Does not cause an erase background event to be generated. """ return _core_.Window_ClearBackground(*args, **kwargs)
def ClientToScreen(
*args, **kwargs)
ClientToScreen(self, Point pt) -> Point
Converts to screen coordinates from coordinates relative to this window.
def ClientToScreen(*args, **kwargs): """ ClientToScreen(self, Point pt) -> Point Converts to screen coordinates from coordinates relative to this window. """ return _core_.Window_ClientToScreen(*args, **kwargs)
def ClientToScreenXY(
*args, **kwargs)
ClientToScreenXY(int x, int y) -> (x,y)
Converts to screen coordinates from coordinates relative to this window.
def ClientToScreenXY(*args, **kwargs): """ ClientToScreenXY(int x, int y) -> (x,y) Converts to screen coordinates from coordinates relative to this window. """ return _core_.Window_ClientToScreenXY(*args, **kwargs)
def ClientToWindowSize(
*args, **kwargs)
ClientToWindowSize(self, Size size) -> Size
Converts client area size size to corresponding window size. In
other words, the returned value is what `GetSize` would return if this
window had client area of given size. Components with
wx.DefaultCoord`` (-1) value are left unchanged.
Note that the conversion is not always exact, it assumes that non-client area doesn't change and so doesn't take into account things like menu bar (un)wrapping or (dis)appearance of the scrollbars.
def ClientToWindowSize(*args, **kwargs): """ ClientToWindowSize(self, Size size) -> Size Converts client area size ``size to corresponding window size. In other words, the returned value is what `GetSize` would return if this window had client area of given size. Components with ``wx.DefaultCoord`` (-1) value are left unchanged. Note that the conversion is not always exact, it assumes that non-client area doesn't change and so doesn't take into account things like menu bar (un)wrapping or (dis)appearance of the scrollbars. """ return _core_.Window_ClientToWindowSize(*args, **kwargs)
def Close(
*args, **kwargs)
Close(self, bool force=False) -> bool
This function simply generates a EVT_CLOSE event whose handler usually tries to close the window. It doesn't close the window itself, however. If force is False (the default) then the window's close handler will be allowed to veto the destruction of the window.
def Close(*args, **kwargs): """ Close(self, bool force=False) -> bool This function simply generates a EVT_CLOSE event whose handler usually tries to close the window. It doesn't close the window itself, however. If force is False (the default) then the window's close handler will be allowed to veto the destruction of the window. """ return _core_.Window_Close(*args, **kwargs)
def Connect(
*args, **kwargs)
Connect(self, int id, int lastId, EventType eventType, PyObject func)
def Connect(*args, **kwargs): """Connect(self, int id, int lastId, EventType eventType, PyObject func)""" return _core_.EvtHandler_Connect(*args, **kwargs)
def ConvertDialogPointToPixels(
*args, **kwargs)
ConvertDialogPointToPixels(self, Point pt) -> Point
Converts a point or size from dialog units to pixels. Dialog units are used for maintaining a dialog's proportions even if the font changes. For the x dimension, the dialog units are multiplied by the average character width and then divided by 4. For the y dimension, the dialog units are multiplied by the average character height and then divided by 8.
def ConvertDialogPointToPixels(*args, **kwargs): """ ConvertDialogPointToPixels(self, Point pt) -> Point Converts a point or size from dialog units to pixels. Dialog units are used for maintaining a dialog's proportions even if the font changes. For the x dimension, the dialog units are multiplied by the average character width and then divided by 4. For the y dimension, the dialog units are multiplied by the average character height and then divided by 8. """ return _core_.Window_ConvertDialogPointToPixels(*args, **kwargs)
def ConvertDialogSizeToPixels(
*args, **kwargs)
ConvertDialogSizeToPixels(self, Size sz) -> Size
Converts a point or size from dialog units to pixels. Dialog units are used for maintaining a dialog's proportions even if the font changes. For the x dimension, the dialog units are multiplied by the average character width and then divided by 4. For the y dimension, the dialog units are multiplied by the average character height and then divided by 8.
def ConvertDialogSizeToPixels(*args, **kwargs): """ ConvertDialogSizeToPixels(self, Size sz) -> Size Converts a point or size from dialog units to pixels. Dialog units are used for maintaining a dialog's proportions even if the font changes. For the x dimension, the dialog units are multiplied by the average character width and then divided by 4. For the y dimension, the dialog units are multiplied by the average character height and then divided by 8. """ return _core_.Window_ConvertDialogSizeToPixels(*args, **kwargs)
def ConvertPixelPointToDialog(
*args, **kwargs)
ConvertPixelPointToDialog(self, Point pt) -> Point
def ConvertPixelPointToDialog(*args, **kwargs): """ConvertPixelPointToDialog(self, Point pt) -> Point""" return _core_.Window_ConvertPixelPointToDialog(*args, **kwargs)
def ConvertPixelSizeToDialog(
*args, **kwargs)
ConvertPixelSizeToDialog(self, Size sz) -> Size
def ConvertPixelSizeToDialog(*args, **kwargs): """ConvertPixelSizeToDialog(self, Size sz) -> Size""" return _core_.Window_ConvertPixelSizeToDialog(*args, **kwargs)
def Create(
*args, **kwargs)
Create(self, Window parent, int id=-1, String title=EmptyString, Point pos=DefaultPosition, Size size=DefaultSize, long style=DEFAULT_FRAME_STYLE, String name=FrameNameStr) -> bool
def Create(*args, **kwargs): """ Create(self, Window parent, int id=-1, String title=EmptyString, Point pos=DefaultPosition, Size size=DefaultSize, long style=DEFAULT_FRAME_STYLE, String name=FrameNameStr) -> bool """ return _windows_.Frame_Create(*args, **kwargs)
def CreateStatusBar(
*args, **kwargs)
CreateStatusBar(self, int number=1, long style=DEFAULT_STATUSBAR_STYLE, int winid=0, String name=StatusLineNameStr) -> StatusBar
def CreateStatusBar(*args, **kwargs): """ CreateStatusBar(self, int number=1, long style=DEFAULT_STATUSBAR_STYLE, int winid=0, String name=StatusLineNameStr) -> StatusBar """ return _windows_.Frame_CreateStatusBar(*args, **kwargs)
def CreateToolBar(
*args, **kwargs)
CreateToolBar(self, long style=-1, int winid=-1, String name=ToolBarNameStr) -> wxToolBar
def CreateToolBar(*args, **kwargs): """CreateToolBar(self, long style=-1, int winid=-1, String name=ToolBarNameStr) -> wxToolBar""" return _windows_.Frame_CreateToolBar(*args, **kwargs)
def DLG_PNT(
*args, **kwargs)
DLG_PNT(self, Point pt) -> Point
Converts a point or size from dialog units to pixels. Dialog units are used for maintaining a dialog's proportions even if the font changes. For the x dimension, the dialog units are multiplied by the average character width and then divided by 4. For the y dimension, the dialog units are multiplied by the average character height and then divided by 8.
def DLG_PNT(*args, **kwargs): """ DLG_PNT(self, Point pt) -> Point Converts a point or size from dialog units to pixels. Dialog units are used for maintaining a dialog's proportions even if the font changes. For the x dimension, the dialog units are multiplied by the average character width and then divided by 4. For the y dimension, the dialog units are multiplied by the average character height and then divided by 8. """ return _core_.Window_DLG_PNT(*args, **kwargs)
def DLG_SZE(
*args, **kwargs)
DLG_SZE(self, Size sz) -> Size
Converts a point or size from dialog units to pixels. Dialog units are used for maintaining a dialog's proportions even if the font changes. For the x dimension, the dialog units are multiplied by the average character width and then divided by 4. For the y dimension, the dialog units are multiplied by the average character height and then divided by 8.
def DLG_SZE(*args, **kwargs): """ DLG_SZE(self, Size sz) -> Size Converts a point or size from dialog units to pixels. Dialog units are used for maintaining a dialog's proportions even if the font changes. For the x dimension, the dialog units are multiplied by the average character width and then divided by 4. For the y dimension, the dialog units are multiplied by the average character height and then divided by 8. """ return _core_.Window_DLG_SZE(*args, **kwargs)
def DeletePendingEvents(
*args, **kwargs)
DeletePendingEvents(self)
def DeletePendingEvents(*args, **kwargs): """DeletePendingEvents(self)""" return _core_.EvtHandler_DeletePendingEvents(*args, **kwargs)
def Destroy(
*args, **kwargs)
Destroy(self) -> bool
Destroys the window safely. Frames and dialogs are not destroyed immediately when this function is called -- they are added to a list of windows to be deleted on idle time, when all the window's events have been processed. This prevents problems with events being sent to non-existent windows.
Returns True if the window has either been successfully deleted, or it has been added to the list of windows pending real deletion.
def Destroy(*args, **kwargs): """ Destroy(self) -> bool Destroys the window safely. Frames and dialogs are not destroyed immediately when this function is called -- they are added to a list of windows to be deleted on idle time, when all the window's events have been processed. This prevents problems with events being sent to non-existent windows. Returns True if the window has either been successfully deleted, or it has been added to the list of windows pending real deletion. """ args[0].this.own(False) return _core_.Window_Destroy(*args, **kwargs)
def DestroyChildren(
*args, **kwargs)
DestroyChildren(self) -> bool
Destroys all children of a window. Called automatically by the destructor.
def DestroyChildren(*args, **kwargs): """ DestroyChildren(self) -> bool Destroys all children of a window. Called automatically by the destructor. """ return _core_.Window_DestroyChildren(*args, **kwargs)
def Disable(
*args, **kwargs)
Disable(self) -> bool
Disables the window, same as Enable(false).
def Disable(*args, **kwargs): """ Disable(self) -> bool Disables the window, same as Enable(false). """ return _core_.Window_Disable(*args, **kwargs)
def Disconnect(
*args, **kwargs)
Disconnect(self, int id, int lastId=-1, EventType eventType=wxEVT_NULL, PyObject func=None) -> bool
def Disconnect(*args, **kwargs): """ Disconnect(self, int id, int lastId=-1, EventType eventType=wxEVT_NULL, PyObject func=None) -> bool """ return _core_.EvtHandler_Disconnect(*args, **kwargs)
def DissociateHandle(
*args, **kwargs)
DissociateHandle(self)
Dissociate the current native handle from the window
def DissociateHandle(*args, **kwargs): """ DissociateHandle(self) Dissociate the current native handle from the window """ return _core_.Window_DissociateHandle(*args, **kwargs)
def DoGiveHelp(
*args, **kwargs)
DoGiveHelp(self, String text, bool show)
def DoGiveHelp(*args, **kwargs): """DoGiveHelp(self, String text, bool show)""" return _windows_.Frame_DoGiveHelp(*args, **kwargs)
def DoMenuUpdates(
*args, **kwargs)
DoMenuUpdates(self, Menu menu=None)
def DoMenuUpdates(*args, **kwargs): """DoMenuUpdates(self, Menu menu=None)""" return _windows_.Frame_DoMenuUpdates(*args, **kwargs)
def DragAcceptFiles(
*args, **kwargs)
DragAcceptFiles(self, bool accept)
Enables or disables eligibility for drop file events, EVT_DROP_FILES.
def DragAcceptFiles(*args, **kwargs): """ DragAcceptFiles(self, bool accept) Enables or disables eligibility for drop file events, EVT_DROP_FILES. """ return _core_.Window_DragAcceptFiles(*args, **kwargs)
def Enable(
*args, **kwargs)
Enable(self, bool enable=True) -> bool
Enable or disable the window for user input. Note that when a parent window is disabled, all of its children are disabled as well and they are reenabled again when the parent is. Returns true if the window has been enabled or disabled, false if nothing was done, i.e. if the window had already been in the specified state.
def Enable(*args, **kwargs): """ Enable(self, bool enable=True) -> bool Enable or disable the window for user input. Note that when a parent window is disabled, all of its children are disabled as well and they are reenabled again when the parent is. Returns true if the window has been enabled or disabled, false if nothing was done, i.e. if the window had already been in the specified state. """ return _core_.Window_Enable(*args, **kwargs)
def EnableCloseButton(
*args, **kwargs)
EnableCloseButton(self, bool enable) -> bool
def EnableCloseButton(*args, **kwargs): """EnableCloseButton(self, bool enable) -> bool""" return _windows_.TopLevelWindow_EnableCloseButton(*args, **kwargs)
def FindItemInMenuBar(
*args, **kwargs)
FindItemInMenuBar(self, int menuId) -> MenuItem
def FindItemInMenuBar(*args, **kwargs): """FindItemInMenuBar(self, int menuId) -> MenuItem""" return _windows_.Frame_FindItemInMenuBar(*args, **kwargs)
def FindWindowById(
*args, **kwargs)
FindWindowById(self, long winid) -> Window
Find a child of this window by window ID
def FindWindowById(*args, **kwargs): """ FindWindowById(self, long winid) -> Window Find a child of this window by window ID """ return _core_.Window_FindWindowById(*args, **kwargs)
def FindWindowByLabel(
*args, **kwargs)
FindWindowByLabel(self, String label) -> Window
Find a child of this window by label
def FindWindowByLabel(*args, **kwargs): """ FindWindowByLabel(self, String label) -> Window Find a child of this window by label """ return _core_.Window_FindWindowByLabel(*args, **kwargs)
def FindWindowByName(
*args, **kwargs)
FindWindowByName(self, String name) -> Window
Find a child of this window by name
def FindWindowByName(*args, **kwargs): """ FindWindowByName(self, String name) -> Window Find a child of this window by name """ return _core_.Window_FindWindowByName(*args, **kwargs)
def Fit(
*args, **kwargs)
Fit(self)
Sizes the window so that it fits around its subwindows. This function won't do anything if there are no subwindows and will only really work correctly if sizers are used for the subwindows layout. Also, if the window has exactly one subwindow it is better (faster and the result is more precise as Fit adds some margin to account for fuzziness of its calculations) to call window.SetClientSize(child.GetSize()) instead of calling Fit.
def Fit(*args, **kwargs): """ Fit(self) Sizes the window so that it fits around its subwindows. This function won't do anything if there are no subwindows and will only really work correctly if sizers are used for the subwindows layout. Also, if the window has exactly one subwindow it is better (faster and the result is more precise as Fit adds some margin to account for fuzziness of its calculations) to call window.SetClientSize(child.GetSize()) instead of calling Fit. """ return _core_.Window_Fit(*args, **kwargs)
def FitInside(
*args, **kwargs)
FitInside(self)
Similar to Fit, but sizes the interior (virtual) size of a window. Mainly useful with scrolled windows to reset scrollbars after sizing changes that do not trigger a size event, and/or scrolled windows without an interior sizer. This function similarly won't do anything if there are no subwindows.
def FitInside(*args, **kwargs): """ FitInside(self) Similar to Fit, but sizes the interior (virtual) size of a window. Mainly useful with scrolled windows to reset scrollbars after sizing changes that do not trigger a size event, and/or scrolled windows without an interior sizer. This function similarly won't do anything if there are no subwindows. """ return _core_.Window_FitInside(*args, **kwargs)
def Freeze(
*args, **kwargs)
Freeze(self)
Freezes the window or, in other words, prevents any updates from taking place on screen, the window is not redrawn at all. Thaw must be called to reenable window redrawing. Calls to Freeze/Thaw may be nested, with the actual Thaw being delayed until all the nesting has been undone.
This method is useful for visual appearance optimization (for example, it is a good idea to use it before inserting large amount of text into a wxTextCtrl under wxGTK) but is not implemented on all platforms nor for all controls so it is mostly just a hint to wxWindows and not a mandatory directive.
def Freeze(*args, **kwargs): """ Freeze(self) Freezes the window or, in other words, prevents any updates from taking place on screen, the window is not redrawn at all. Thaw must be called to reenable window redrawing. Calls to Freeze/Thaw may be nested, with the actual Thaw being delayed until all the nesting has been undone. This method is useful for visual appearance optimization (for example, it is a good idea to use it before inserting large amount of text into a wxTextCtrl under wxGTK) but is not implemented on all platforms nor for all controls so it is mostly just a hint to wxWindows and not a mandatory directive. """ return _core_.Window_Freeze(*args, **kwargs)
def GetAcceleratorTable(
*args, **kwargs)
GetAcceleratorTable(self) -> AcceleratorTable
Gets the accelerator table for this window.
def GetAcceleratorTable(*args, **kwargs): """ GetAcceleratorTable(self) -> AcceleratorTable Gets the accelerator table for this window. """ return _core_.Window_GetAcceleratorTable(*args, **kwargs)
def GetAdjustedBestSize(
*args, **kw)
def deprecated_func(*args, **kw): warnings.warn("Call to deprecated item. %s" % msg, wxPyDeprecationWarning, stacklevel=2) return item(*args, **kw)
def GetAutoLayout(
*args, **kwargs)
GetAutoLayout(self) -> bool
Returns the current autoLayout setting
def GetAutoLayout(*args, **kwargs): """ GetAutoLayout(self) -> bool Returns the current autoLayout setting """ return _core_.Window_GetAutoLayout(*args, **kwargs)
def GetBackgroundColour(
*args, **kwargs)
GetBackgroundColour(self) -> Colour
Returns the background colour of the window.
def GetBackgroundColour(*args, **kwargs): """ GetBackgroundColour(self) -> Colour Returns the background colour of the window. """ return _core_.Window_GetBackgroundColour(*args, **kwargs)
def GetBackgroundStyle(
*args, **kwargs)
GetBackgroundStyle(self) -> int
Returns the background style of the window.
:see: SetBackgroundStyle
def GetBackgroundStyle(*args, **kwargs): """ GetBackgroundStyle(self) -> int Returns the background style of the window. :see: `SetBackgroundStyle` """ return _core_.Window_GetBackgroundStyle(*args, **kwargs)
def GetBestFittingSize(
*args, **kw)
GetEffectiveMinSize(self) -> Size
This function will merge the window's best size into the window's minimum size, giving priority to the min size components, and returns the results.
def deprecated_func(*args, **kw): warnings.warn("Call to deprecated item. %s" % msg, wxPyDeprecationWarning, stacklevel=2) return item(*args, **kw)
def GetBestSize(
*args, **kwargs)
GetBestSize(self) -> Size
This function returns the best acceptable minimal size for the window, if applicable. For example, for a static text control, it will be the minimal size such that the control label is not truncated. For windows containing subwindows (such as wx.Panel), the size returned by this function will be the same as the size the window would have had after calling Fit.
def GetBestSize(*args, **kwargs): """ GetBestSize(self) -> Size This function returns the best acceptable minimal size for the window, if applicable. For example, for a static text control, it will be the minimal size such that the control label is not truncated. For windows containing subwindows (such as wx.Panel), the size returned by this function will be the same as the size the window would have had after calling Fit. """ return _core_.Window_GetBestSize(*args, **kwargs)
def GetBestSizeTuple(
*args, **kwargs)
GetBestSizeTuple() -> (width, height)
This function returns the best acceptable minimal size for the window, if applicable. For example, for a static text control, it will be the minimal size such that the control label is not truncated. For windows containing subwindows (such as wx.Panel), the size returned by this function will be the same as the size the window would have had after calling Fit.
def GetBestSizeTuple(*args, **kwargs): """ GetBestSizeTuple() -> (width, height) This function returns the best acceptable minimal size for the window, if applicable. For example, for a static text control, it will be the minimal size such that the control label is not truncated. For windows containing subwindows (such as wx.Panel), the size returned by this function will be the same as the size the window would have had after calling Fit. """ return _core_.Window_GetBestSizeTuple(*args, **kwargs)
def GetBestVirtualSize(
*args, **kwargs)
GetBestVirtualSize(self) -> Size
Return the largest of ClientSize and BestSize (as determined by a sizer, interior children, or other means)
def GetBestVirtualSize(*args, **kwargs): """ GetBestVirtualSize(self) -> Size Return the largest of ClientSize and BestSize (as determined by a sizer, interior children, or other means) """ return _core_.Window_GetBestVirtualSize(*args, **kwargs)
def GetBorder(
*args)
GetBorder(self, long flags) -> int GetBorder(self) -> int
Get border for the flags of this window
def GetBorder(*args): """ GetBorder(self, long flags) -> int GetBorder(self) -> int Get border for the flags of this window """ return _core_.Window_GetBorder(*args)
def GetCaret(
*args, **kwargs)
GetCaret(self) -> Caret
Returns the caret associated with the window.
def GetCaret(*args, **kwargs): """ GetCaret(self) -> Caret Returns the caret associated with the window. """ return _core_.Window_GetCaret(*args, **kwargs)
def GetCharHeight(
*args, **kwargs)
GetCharHeight(self) -> int
Get the (average) character size for the current font.
def GetCharHeight(*args, **kwargs): """ GetCharHeight(self) -> int Get the (average) character size for the current font. """ return _core_.Window_GetCharHeight(*args, **kwargs)
def GetCharWidth(
*args, **kwargs)
GetCharWidth(self) -> int
Get the (average) character size for the current font.
def GetCharWidth(*args, **kwargs): """ GetCharWidth(self) -> int Get the (average) character size for the current font. """ return _core_.Window_GetCharWidth(*args, **kwargs)
def GetChildren(
*args, **kwargs)
GetChildren(self) -> WindowList
Returns an object containing a list of the window's children. The object provides a Python sequence-like interface over the internal list maintained by the window..
def GetChildren(*args, **kwargs): """ GetChildren(self) -> WindowList Returns an object containing a list of the window's children. The object provides a Python sequence-like interface over the internal list maintained by the window.. """ return _core_.Window_GetChildren(*args, **kwargs)
def GetClassName(
*args, **kwargs)
GetClassName(self) -> String
Returns the class name of the C++ class using wxRTTI.
def GetClassName(*args, **kwargs): """ GetClassName(self) -> String Returns the class name of the C++ class using wxRTTI. """ return _core_.Object_GetClassName(*args, **kwargs)
def GetClientAreaOrigin(
*args, **kwargs)
GetClientAreaOrigin(self) -> Point
Get the origin of the client area of the window relative to the window's top left corner (the client area may be shifted because of the borders, scrollbars, other decorations...)
def GetClientAreaOrigin(*args, **kwargs): """ GetClientAreaOrigin(self) -> Point Get the origin of the client area of the window relative to the window's top left corner (the client area may be shifted because of the borders, scrollbars, other decorations...) """ return _core_.Window_GetClientAreaOrigin(*args, **kwargs)
def GetClientRect(
*args, **kwargs)
GetClientRect(self) -> Rect
Get the client area position and size as a wx.Rect
object.
def GetClientRect(*args, **kwargs): """ GetClientRect(self) -> Rect Get the client area position and size as a `wx.Rect` object. """ return _core_.Window_GetClientRect(*args, **kwargs)
def GetClientSize(
*args, **kwargs)
GetClientSize(self) -> Size
This gets the size of the window's 'client area' in pixels. The client area is the area which may be drawn on by the programmer, excluding title bar, border, scrollbars, etc.
def GetClientSize(*args, **kwargs): """ GetClientSize(self) -> Size This gets the size of the window's 'client area' in pixels. The client area is the area which may be drawn on by the programmer, excluding title bar, border, scrollbars, etc. """ return _core_.Window_GetClientSize(*args, **kwargs)
def GetClientSizeTuple(
*args, **kwargs)
GetClientSizeTuple() -> (width, height)
This gets the size of the window's 'client area' in pixels. The client area is the area which may be drawn on by the programmer, excluding title bar, border, scrollbars, etc.
def GetClientSizeTuple(*args, **kwargs): """ GetClientSizeTuple() -> (width, height) This gets the size of the window's 'client area' in pixels. The client area is the area which may be drawn on by the programmer, excluding title bar, border, scrollbars, etc. """ return _core_.Window_GetClientSizeTuple(*args, **kwargs)
def GetConstraints(
*args, **kwargs)
GetConstraints(self) -> LayoutConstraints
Returns a pointer to the window's layout constraints, or None if there are none.
def GetConstraints(*args, **kwargs): """ GetConstraints(self) -> LayoutConstraints Returns a pointer to the window's layout constraints, or None if there are none. """ return _core_.Window_GetConstraints(*args, **kwargs)
def GetContainingSizer(
*args, **kwargs)
GetContainingSizer(self) -> Sizer
Return the sizer that this window is a member of, if any, otherwise None.
def GetContainingSizer(*args, **kwargs): """ GetContainingSizer(self) -> Sizer Return the sizer that this window is a member of, if any, otherwise None. """ return _core_.Window_GetContainingSizer(*args, **kwargs)
def GetCursor(
*args, **kwargs)
GetCursor(self) -> Cursor
Return the cursor associated with this window.
def GetCursor(*args, **kwargs): """ GetCursor(self) -> Cursor Return the cursor associated with this window. """ return _core_.Window_GetCursor(*args, **kwargs)
def GetDefaultAttributes(
*args, **kwargs)
GetDefaultAttributes(self) -> VisualAttributes
Get the default attributes for an instance of this class. This is useful if you want to use the same font or colour in your own control as in a standard control -- which is a much better idea than hard coding specific colours or fonts which might look completely out of place on the user's system, especially if it uses themes.
def GetDefaultAttributes(*args, **kwargs): """ GetDefaultAttributes(self) -> VisualAttributes Get the default attributes for an instance of this class. This is useful if you want to use the same font or colour in your own control as in a standard control -- which is a much better idea than hard coding specific colours or fonts which might look completely out of place on the user's system, especially if it uses themes. """ return _core_.Window_GetDefaultAttributes(*args, **kwargs)
def GetDefaultItem(
*args, **kwargs)
GetDefaultItem(self) -> Window
Get the default child of this parent, i.e. the one which is activated
by pressing
def GetDefaultItem(*args, **kwargs): """ GetDefaultItem(self) -> Window Get the default child of this parent, i.e. the one which is activated by pressing <Enter> such as the OK button on a wx.Dialog. """ return _windows_.TopLevelWindow_GetDefaultItem(*args, **kwargs)
def GetDropTarget(
*args, **kwargs)
GetDropTarget(self) -> DropTarget
Returns the associated drop target, which may be None.
def GetDropTarget(*args, **kwargs): """ GetDropTarget(self) -> DropTarget Returns the associated drop target, which may be None. """ return _core_.Window_GetDropTarget(*args, **kwargs)
def GetEffectiveMinSize(
*args, **kwargs)
GetEffectiveMinSize(self) -> Size
This function will merge the window's best size into the window's minimum size, giving priority to the min size components, and returns the results.
def GetEffectiveMinSize(*args, **kwargs): """ GetEffectiveMinSize(self) -> Size This function will merge the window's best size into the window's minimum size, giving priority to the min size components, and returns the results. """ return _core_.Window_GetEffectiveMinSize(*args, **kwargs)
def GetEventHandler(
*args, **kwargs)
GetEventHandler(self) -> EvtHandler
Returns the event handler for this window. By default, the window is its own event handler.
def GetEventHandler(*args, **kwargs): """ GetEventHandler(self) -> EvtHandler Returns the event handler for this window. By default, the window is its own event handler. """ return _core_.Window_GetEventHandler(*args, **kwargs)
def GetEvtHandlerEnabled(
*args, **kwargs)
GetEvtHandlerEnabled(self) -> bool
def GetEvtHandlerEnabled(*args, **kwargs): """GetEvtHandlerEnabled(self) -> bool""" return _core_.EvtHandler_GetEvtHandlerEnabled(*args, **kwargs)
def GetExtraStyle(
*args, **kwargs)
GetExtraStyle(self) -> long
Returns the extra style bits for the window.
def GetExtraStyle(*args, **kwargs): """ GetExtraStyle(self) -> long Returns the extra style bits for the window. """ return _core_.Window_GetExtraStyle(*args, **kwargs)
def GetFont(
*args, **kwargs)
GetFont(self) -> Font
Returns the default font used for this window.
def GetFont(*args, **kwargs): """ GetFont(self) -> Font Returns the default font used for this window. """ return _core_.Window_GetFont(*args, **kwargs)
def GetForegroundColour(
*args, **kwargs)
GetForegroundColour(self) -> Colour
Returns the foreground colour of the window. The interpretation of foreground colour is dependent on the window class; it may be the text colour or other colour, or it may not be used at all.
def GetForegroundColour(*args, **kwargs): """ GetForegroundColour(self) -> Colour Returns the foreground colour of the window. The interpretation of foreground colour is dependent on the window class; it may be the text colour or other colour, or it may not be used at all. """ return _core_.Window_GetForegroundColour(*args, **kwargs)
def GetFullTextExtent(
*args, **kwargs)
GetFullTextExtent(String string, Font font=None) -> (width, height, descent, externalLeading)
Get the width, height, decent and leading of the text using the current or specified font.
def GetFullTextExtent(*args, **kwargs): """ GetFullTextExtent(String string, Font font=None) -> (width, height, descent, externalLeading) Get the width, height, decent and leading of the text using the current or specified font. """ return _core_.Window_GetFullTextExtent(*args, **kwargs)
def GetGrandParent(
*args, **kwargs)
GetGrandParent(self) -> Window
Returns the parent of the parent of this window, or None if there isn't one.
def GetGrandParent(*args, **kwargs): """ GetGrandParent(self) -> Window Returns the parent of the parent of this window, or None if there isn't one. """ return _core_.Window_GetGrandParent(*args, **kwargs)
def GetGtkWidget(
*args, **kwargs)
GetGtkWidget(self) -> long
On wxGTK returns a pointer to the GtkWidget for this window as a long integer. On the other platforms this method returns zero.
def GetGtkWidget(*args, **kwargs): """ GetGtkWidget(self) -> long On wxGTK returns a pointer to the GtkWidget for this window as a long integer. On the other platforms this method returns zero. """ return _core_.Window_GetGtkWidget(*args, **kwargs)
def GetHandle(
*args, **kwargs)
GetHandle(self) -> long
Returns the platform-specific handle (as a long integer) of the physical window. On wxMSW this is the win32 window handle, on wxGTK it is the XWindow ID, and on wxMac it is the ControlRef.
def GetHandle(*args, **kwargs): """ GetHandle(self) -> long Returns the platform-specific handle (as a long integer) of the physical window. On wxMSW this is the win32 window handle, on wxGTK it is the XWindow ID, and on wxMac it is the ControlRef. """ return _core_.Window_GetHandle(*args, **kwargs)
def GetHelpText(
*args, **kwargs)
GetHelpText(self) -> String
Gets the help text to be used as context-sensitive help for this
window. Note that the text is actually stored by the current
wx.HelpProvider
implementation, and not in the window object itself.
def GetHelpText(*args, **kwargs): """ GetHelpText(self) -> String Gets the help text to be used as context-sensitive help for this window. Note that the text is actually stored by the current `wx.HelpProvider` implementation, and not in the window object itself. """ return _core_.Window_GetHelpText(*args, **kwargs)
def GetHelpTextAtPoint(
*args, **kwargs)
GetHelpTextAtPoint(self, Point pt, wxHelpEvent::Origin origin) -> String
Get the help string associated with the given position in this window.
Notice that pt may be invalid if event origin is keyboard or unknown and this method should return the global window help text then
def GetHelpTextAtPoint(*args, **kwargs): """ GetHelpTextAtPoint(self, Point pt, wxHelpEvent::Origin origin) -> String Get the help string associated with the given position in this window. Notice that pt may be invalid if event origin is keyboard or unknown and this method should return the global window help text then """ return _core_.Window_GetHelpTextAtPoint(*args, **kwargs)
def GetIcon(
*args, **kwargs)
GetIcon(self) -> Icon
def GetIcon(*args, **kwargs): """GetIcon(self) -> Icon""" return _windows_.TopLevelWindow_GetIcon(*args, **kwargs)
def GetId(
*args, **kwargs)
GetId(self) -> int
Returns the identifier of the window. Each window has an integer identifier. If the application has not provided one (or the default Id -1 is used) then an unique identifier with a negative value will be generated.
def GetId(*args, **kwargs): """ GetId(self) -> int Returns the identifier of the window. Each window has an integer identifier. If the application has not provided one (or the default Id -1 is used) then an unique identifier with a negative value will be generated. """ return _core_.Window_GetId(*args, **kwargs)
def GetLabel(
*args, **kwargs)
GetLabel(self) -> String
Generic way of getting a label from any window, for identification purposes. The interpretation of this function differs from class to class. For frames and dialogs, the value returned is the title. For buttons or static text controls, it is the button text. This function can be useful for meta-programs such as testing tools or special-needs access programs)which need to identify windows by name.
def GetLabel(*args, **kwargs): """ GetLabel(self) -> String Generic way of getting a label from any window, for identification purposes. The interpretation of this function differs from class to class. For frames and dialogs, the value returned is the title. For buttons or static text controls, it is the button text. This function can be useful for meta-programs such as testing tools or special-needs access programs)which need to identify windows by name. """ return _core_.Window_GetLabel(*args, **kwargs)
def GetLayoutDirection(
*args, **kwargs)
GetLayoutDirection(self) -> int
Get the layout direction (LTR or RTL) for this window. Returns
wx.Layout_Default
if layout direction is not supported.
def GetLayoutDirection(*args, **kwargs): """ GetLayoutDirection(self) -> int Get the layout direction (LTR or RTL) for this window. Returns ``wx.Layout_Default`` if layout direction is not supported. """ return _core_.Window_GetLayoutDirection(*args, **kwargs)
def GetMainWindowOfCompositeControl(
*args, **kwargs)
GetMainWindowOfCompositeControl(self) -> Window
def GetMainWindowOfCompositeControl(*args, **kwargs): """GetMainWindowOfCompositeControl(self) -> Window""" return _core_.Window_GetMainWindowOfCompositeControl(*args, **kwargs)
def GetMaxClientSize(
*args, **kwargs)
GetMaxClientSize(self) -> Size
def GetMaxClientSize(*args, **kwargs): """GetMaxClientSize(self) -> Size""" return _core_.Window_GetMaxClientSize(*args, **kwargs)
def GetMaxHeight(
*args, **kwargs)
GetMaxHeight(self) -> int
def GetMaxHeight(*args, **kwargs): """GetMaxHeight(self) -> int""" return _core_.Window_GetMaxHeight(*args, **kwargs)
def GetMaxSize(
*args, **kwargs)
GetMaxSize(self) -> Size
def GetMaxSize(*args, **kwargs): """GetMaxSize(self) -> Size""" return _core_.Window_GetMaxSize(*args, **kwargs)
def GetMaxWidth(
*args, **kwargs)
GetMaxWidth(self) -> int
def GetMaxWidth(*args, **kwargs): """GetMaxWidth(self) -> int""" return _core_.Window_GetMaxWidth(*args, **kwargs)
def GetMenuBar(
*args, **kwargs)
GetMenuBar(self) -> MenuBar
def GetMenuBar(*args, **kwargs): """GetMenuBar(self) -> MenuBar""" return _windows_.Frame_GetMenuBar(*args, **kwargs)
def GetMinClientSize(
*args, **kwargs)
GetMinClientSize(self) -> Size
def GetMinClientSize(*args, **kwargs): """GetMinClientSize(self) -> Size""" return _core_.Window_GetMinClientSize(*args, **kwargs)
def GetMinHeight(
*args, **kwargs)
GetMinHeight(self) -> int
def GetMinHeight(*args, **kwargs): """GetMinHeight(self) -> int""" return _core_.Window_GetMinHeight(*args, **kwargs)
def GetMinSize(
*args, **kwargs)
GetMinSize(self) -> Size
def GetMinSize(*args, **kwargs): """GetMinSize(self) -> Size""" return _core_.Window_GetMinSize(*args, **kwargs)
def GetMinWidth(
*args, **kwargs)
GetMinWidth(self) -> int
def GetMinWidth(*args, **kwargs): """GetMinWidth(self) -> int""" return _core_.Window_GetMinWidth(*args, **kwargs)
def GetName(
*args, **kwargs)
GetName(self) -> String
Returns the windows name. This name is not guaranteed to be unique; it is up to the programmer to supply an appropriate name in the window constructor or via wx.Window.SetName.
def GetName(*args, **kwargs): """ GetName(self) -> String Returns the windows name. This name is not guaranteed to be unique; it is up to the programmer to supply an appropriate name in the window constructor or via wx.Window.SetName. """ return _core_.Window_GetName(*args, **kwargs)
def GetNextHandler(
*args, **kwargs)
GetNextHandler(self) -> EvtHandler
def GetNextHandler(*args, **kwargs): """GetNextHandler(self) -> EvtHandler""" return _core_.EvtHandler_GetNextHandler(*args, **kwargs)
def GetNextSibling(
*args, **kwargs)
GetNextSibling(self) -> Window
def GetNextSibling(*args, **kwargs): """GetNextSibling(self) -> Window""" return _core_.Window_GetNextSibling(*args, **kwargs)
def GetParent(
*args, **kwargs)
GetParent(self) -> Window
Returns the parent window of this window, or None if there isn't one.
def GetParent(*args, **kwargs): """ GetParent(self) -> Window Returns the parent window of this window, or None if there isn't one. """ return _core_.Window_GetParent(*args, **kwargs)
def GetPopupMenuSelectionFromUser(
*args, **kwargs)
GetPopupMenuSelectionFromUser(self, Menu menu, Point pos=DefaultPosition) -> int
Simply return the id of the selected item or wxID_NONE without generating any events.
def GetPopupMenuSelectionFromUser(*args, **kwargs): """ GetPopupMenuSelectionFromUser(self, Menu menu, Point pos=DefaultPosition) -> int Simply return the id of the selected item or wxID_NONE without generating any events. """ return _core_.Window_GetPopupMenuSelectionFromUser(*args, **kwargs)
def GetPosition(
*args, **kwargs)
GetPosition(self) -> Point
Get the window's position. Notice that the position is in client
coordinates for child windows and screen coordinates for the top level
ones, use GetScreenPosition
if you need screen coordinates for all
kinds of windows.
def GetPosition(*args, **kwargs): """ GetPosition(self) -> Point Get the window's position. Notice that the position is in client coordinates for child windows and screen coordinates for the top level ones, use `GetScreenPosition` if you need screen coordinates for all kinds of windows. """ return _core_.Window_GetPosition(*args, **kwargs)
def GetPositionTuple(
*args, **kwargs)
GetPositionTuple() -> (x,y)
Get the window's position. Notice that the position is in client
coordinates for child windows and screen coordinates for the top level
ones, use GetScreenPosition
if you need screen coordinates for all
kinds of windows.
def GetPositionTuple(*args, **kwargs): """ GetPositionTuple() -> (x,y) Get the window's position. Notice that the position is in client coordinates for child windows and screen coordinates for the top level ones, use `GetScreenPosition` if you need screen coordinates for all kinds of windows. """ return _core_.Window_GetPositionTuple(*args, **kwargs)
def GetPrevSibling(
*args, **kwargs)
GetPrevSibling(self) -> Window
def GetPrevSibling(*args, **kwargs): """GetPrevSibling(self) -> Window""" return _core_.Window_GetPrevSibling(*args, **kwargs)
def GetPreviousHandler(
*args, **kwargs)
GetPreviousHandler(self) -> EvtHandler
def GetPreviousHandler(*args, **kwargs): """GetPreviousHandler(self) -> EvtHandler""" return _core_.EvtHandler_GetPreviousHandler(*args, **kwargs)
def GetRect(
*args, **kwargs)
GetRect(self) -> Rect
Returns the size and position of the window as a wx.Rect
object.
def GetRect(*args, **kwargs): """ GetRect(self) -> Rect Returns the size and position of the window as a `wx.Rect` object. """ return _core_.Window_GetRect(*args, **kwargs)
def GetScreenPosition(
*args, **kwargs)
GetScreenPosition(self) -> Point
Get the position of the window in screen coordinantes.
def GetScreenPosition(*args, **kwargs): """ GetScreenPosition(self) -> Point Get the position of the window in screen coordinantes. """ return _core_.Window_GetScreenPosition(*args, **kwargs)
def GetScreenPositionTuple(
*args, **kwargs)
GetScreenPositionTuple() -> (x,y)
Get the position of the window in screen coordinantes.
def GetScreenPositionTuple(*args, **kwargs): """ GetScreenPositionTuple() -> (x,y) Get the position of the window in screen coordinantes. """ return _core_.Window_GetScreenPositionTuple(*args, **kwargs)
def GetScreenRect(
*args, **kwargs)
GetScreenRect(self) -> Rect
Returns the size and position of the window in screen coordinantes as
a wx.Rect
object.
def GetScreenRect(*args, **kwargs): """ GetScreenRect(self) -> Rect Returns the size and position of the window in screen coordinantes as a `wx.Rect` object. """ return _core_.Window_GetScreenRect(*args, **kwargs)
def GetScrollPos(
*args, **kwargs)
GetScrollPos(self, int orientation) -> int
Returns the built-in scrollbar position.
def GetScrollPos(*args, **kwargs): """ GetScrollPos(self, int orientation) -> int Returns the built-in scrollbar position. """ return _core_.Window_GetScrollPos(*args, **kwargs)
def GetScrollRange(
*args, **kwargs)
GetScrollRange(self, int orientation) -> int
Returns the built-in scrollbar range.
def GetScrollRange(*args, **kwargs): """ GetScrollRange(self, int orientation) -> int Returns the built-in scrollbar range. """ return _core_.Window_GetScrollRange(*args, **kwargs)
def GetScrollThumb(
*args, **kwargs)
GetScrollThumb(self, int orientation) -> int
Returns the built-in scrollbar thumb size.
def GetScrollThumb(*args, **kwargs): """ GetScrollThumb(self, int orientation) -> int Returns the built-in scrollbar thumb size. """ return _core_.Window_GetScrollThumb(*args, **kwargs)
def GetSize(
*args, **kwargs)
GetSize(self) -> Size
Get the window size.
def GetSize(*args, **kwargs): """ GetSize(self) -> Size Get the window size. """ return _core_.Window_GetSize(*args, **kwargs)
def GetSizeTuple(
*args, **kwargs)
GetSizeTuple() -> (width, height)
Get the window size.
def GetSizeTuple(*args, **kwargs): """ GetSizeTuple() -> (width, height) Get the window size. """ return _core_.Window_GetSizeTuple(*args, **kwargs)
def GetSizer(
*args, **kwargs)
GetSizer(self) -> Sizer
Return the sizer associated with the window by a previous call to SetSizer or None if there isn't one.
def GetSizer(*args, **kwargs): """ GetSizer(self) -> Sizer Return the sizer associated with the window by a previous call to SetSizer or None if there isn't one. """ return _core_.Window_GetSizer(*args, **kwargs)
def GetStatusBar(
*args, **kwargs)
GetStatusBar(self) -> StatusBar
def GetStatusBar(*args, **kwargs): """GetStatusBar(self) -> StatusBar""" return _windows_.Frame_GetStatusBar(*args, **kwargs)
def GetStatusBarPane(
*args, **kwargs)
GetStatusBarPane(self) -> int
def GetStatusBarPane(*args, **kwargs): """GetStatusBarPane(self) -> int""" return _windows_.Frame_GetStatusBarPane(*args, **kwargs)
def GetTextExtent(
*args, **kwargs)
GetTextExtent(String string) -> (width, height)
Get the width and height of the text using the current font.
def GetTextExtent(*args, **kwargs): """ GetTextExtent(String string) -> (width, height) Get the width and height of the text using the current font. """ return _core_.Window_GetTextExtent(*args, **kwargs)
def GetThemeEnabled(
*args, **kwargs)
GetThemeEnabled(self) -> bool
Return the themeEnabled flag.
def GetThemeEnabled(*args, **kwargs): """ GetThemeEnabled(self) -> bool Return the themeEnabled flag. """ return _core_.Window_GetThemeEnabled(*args, **kwargs)
def GetTitle(
*args, **kwargs)
GetTitle(self) -> String
def GetTitle(*args, **kwargs): """GetTitle(self) -> String""" return _windows_.TopLevelWindow_GetTitle(*args, **kwargs)
def GetTmpDefaultItem(
*args, **kwargs)
GetTmpDefaultItem(self) -> Window
Return the temporary default item, which can be None.
def GetTmpDefaultItem(*args, **kwargs): """ GetTmpDefaultItem(self) -> Window Return the temporary default item, which can be None. """ return _windows_.TopLevelWindow_GetTmpDefaultItem(*args, **kwargs)
def GetToolBar(
*args, **kwargs)
GetToolBar(self) -> wxToolBar
def GetToolBar(*args, **kwargs): """GetToolBar(self) -> wxToolBar""" return _windows_.Frame_GetToolBar(*args, **kwargs)
def GetToolTip(
*args, **kwargs)
GetToolTip(self) -> ToolTip
get the associated tooltip or None if none
def GetToolTip(*args, **kwargs): """ GetToolTip(self) -> ToolTip get the associated tooltip or None if none """ return _core_.Window_GetToolTip(*args, **kwargs)
def GetToolTipString(
self)
def GetToolTipString(self): tip = self.GetToolTip() if tip: return tip.GetTip() else: return None
def GetTopLevelParent(
*args, **kwargs)
GetTopLevelParent(self) -> Window
Returns the first frame or dialog in this window's parental hierarchy.
def GetTopLevelParent(*args, **kwargs): """ GetTopLevelParent(self) -> Window Returns the first frame or dialog in this window's parental hierarchy. """ return _core_.Window_GetTopLevelParent(*args, **kwargs)
def GetUpdateClientRect(
*args, **kwargs)
GetUpdateClientRect(self) -> Rect
Get the update rectangle region bounding box in client coords.
def GetUpdateClientRect(*args, **kwargs): """ GetUpdateClientRect(self) -> Rect Get the update rectangle region bounding box in client coords. """ return _core_.Window_GetUpdateClientRect(*args, **kwargs)
def GetUpdateRegion(
*args, **kwargs)
GetUpdateRegion(self) -> Region
Returns the region specifying which parts of the window have been damaged. Should only be called within an EVT_PAINT handler.
def GetUpdateRegion(*args, **kwargs): """ GetUpdateRegion(self) -> Region Returns the region specifying which parts of the window have been damaged. Should only be called within an EVT_PAINT handler. """ return _core_.Window_GetUpdateRegion(*args, **kwargs)
def GetValidator(
*args, **kwargs)
GetValidator(self) -> Validator
Returns a pointer to the current validator for the window, or None if there is none.
def GetValidator(*args, **kwargs): """ GetValidator(self) -> Validator Returns a pointer to the current validator for the window, or None if there is none. """ return _core_.Window_GetValidator(*args, **kwargs)
def GetVirtualSize(
*args, **kwargs)
GetVirtualSize(self) -> Size
Get the the virtual size of the window in pixels. For most windows this is just the client area of the window, but for some like scrolled windows it is more or less independent of the screen window size.
def GetVirtualSize(*args, **kwargs): """ GetVirtualSize(self) -> Size Get the the virtual size of the window in pixels. For most windows this is just the client area of the window, but for some like scrolled windows it is more or less independent of the screen window size. """ return _core_.Window_GetVirtualSize(*args, **kwargs)
def GetVirtualSizeTuple(
*args, **kwargs)
GetVirtualSizeTuple() -> (width, height)
Get the the virtual size of the window in pixels. For most windows this is just the client area of the window, but for some like scrolled windows it is more or less independent of the screen window size.
def GetVirtualSizeTuple(*args, **kwargs): """ GetVirtualSizeTuple() -> (width, height) Get the the virtual size of the window in pixels. For most windows this is just the client area of the window, but for some like scrolled windows it is more or less independent of the screen window size. """ return _core_.Window_GetVirtualSizeTuple(*args, **kwargs)
def GetWindowBorderSize(
*args, **kwargs)
GetWindowBorderSize(self) -> Size
Return the size of the left/right and top/bottom borders.
def GetWindowBorderSize(*args, **kwargs): """ GetWindowBorderSize(self) -> Size Return the size of the left/right and top/bottom borders. """ return _core_.Window_GetWindowBorderSize(*args, **kwargs)
def GetWindowStyle(
*args, **kwargs)
GetWindowStyleFlag(self) -> long
Gets the window style that was passed to the constructor or Create method.
def GetWindowStyleFlag(*args, **kwargs): """ GetWindowStyleFlag(self) -> long Gets the window style that was passed to the constructor or Create method. """ return _core_.Window_GetWindowStyleFlag(*args, **kwargs)
def GetWindowStyleFlag(
*args, **kwargs)
GetWindowStyleFlag(self) -> long
Gets the window style that was passed to the constructor or Create method.
def GetWindowStyleFlag(*args, **kwargs): """ GetWindowStyleFlag(self) -> long Gets the window style that was passed to the constructor or Create method. """ return _core_.Window_GetWindowStyleFlag(*args, **kwargs)
def GetWindowVariant(
*args, **kwargs)
GetWindowVariant(self) -> int
def GetWindowVariant(*args, **kwargs): """GetWindowVariant(self) -> int""" return _core_.Window_GetWindowVariant(*args, **kwargs)
HandleAsNavigationKey(self, KeyEvent event) -> bool
This function will generate the appropriate call to Navigate
if the
key event is one normally used for keyboard navigation. Returns
True
if the key pressed was for navigation and was handled,
False
otherwise.
def HandleWindowEvent(
*args, **kwargs)
HandleWindowEvent(self, Event event) -> bool
Process an event by calling GetEventHandler()->ProcessEvent() and handling any exceptions thrown by event handlers. It's mostly useful when processing wx events when called from C code (e.g. in GTK+ callback) when the exception wouldn't correctly propagate to wx.EventLoop.
def HandleWindowEvent(*args, **kwargs): """ HandleWindowEvent(self, Event event) -> bool Process an event by calling GetEventHandler()->ProcessEvent() and handling any exceptions thrown by event handlers. It's mostly useful when processing wx events when called from C code (e.g. in GTK+ callback) when the exception wouldn't correctly propagate to wx.EventLoop. """ return _core_.Window_HandleWindowEvent(*args, **kwargs)
def HasCapture(
*args, **kwargs)
HasCapture(self) -> bool
Returns true if this window has the current mouse capture.
def HasCapture(*args, **kwargs): """ HasCapture(self) -> bool Returns true if this window has the current mouse capture. """ return _core_.Window_HasCapture(*args, **kwargs)
def HasExtraStyle(
*args, **kwargs)
HasExtraStyle(self, int exFlag) -> bool
Returns True
if the given extra flag is set.
def HasExtraStyle(*args, **kwargs): """ HasExtraStyle(self, int exFlag) -> bool Returns ``True`` if the given extra flag is set. """ return _core_.Window_HasExtraStyle(*args, **kwargs)
def HasFlag(
*args, **kwargs)
HasFlag(self, int flag) -> bool
Test if the given style is set for this window.
def HasFlag(*args, **kwargs): """ HasFlag(self, int flag) -> bool Test if the given style is set for this window. """ return _core_.Window_HasFlag(*args, **kwargs)
def HasFocus(
*args, **kwargs)
HasFocus(self) -> bool
Returns True
if the window has the keyboard focus.
def HasFocus(*args, **kwargs): """ HasFocus(self) -> bool Returns ``True`` if the window has the keyboard focus. """ return _core_.Window_HasFocus(*args, **kwargs)
def HasMultiplePages(
*args, **kwargs)
HasMultiplePages(self) -> bool
def HasMultiplePages(*args, **kwargs): """HasMultiplePages(self) -> bool""" return _core_.Window_HasMultiplePages(*args, **kwargs)
def HasScrollbar(
*args, **kwargs)
HasScrollbar(self, int orient) -> bool
Does the window have the scrollbar for this orientation?
def HasScrollbar(*args, **kwargs): """ HasScrollbar(self, int orient) -> bool Does the window have the scrollbar for this orientation? """ return _core_.Window_HasScrollbar(*args, **kwargs)
def HasTransparentBackground(
*args, **kwargs)
HasTransparentBackground(self) -> bool
Returns True if this window's background is transparent (as, for
example, for wx.StaticText
) and should show the parent window's
background.
This method is mostly used internally by the library itself and you normally shouldn't have to call it. You may, however, have to override it in your custom control classes to ensure that background is painted correctly.
def HasTransparentBackground(*args, **kwargs): """ HasTransparentBackground(self) -> bool Returns True if this window's background is transparent (as, for example, for `wx.StaticText`) and should show the parent window's background. This method is mostly used internally by the library itself and you normally shouldn't have to call it. You may, however, have to override it in your custom control classes to ensure that background is painted correctly. """ return _core_.Window_HasTransparentBackground(*args, **kwargs)
def Hide(
*args, **kwargs)
Hide(self) -> bool
Equivalent to calling Show(False).
def Hide(*args, **kwargs): """ Hide(self) -> bool Equivalent to calling Show(False). """ return _core_.Window_Hide(*args, **kwargs)
def HideWithEffect(
*args, **kwargs)
HideWithEffect(self, int effect, unsigned int timeout=0) -> bool
Hide the window with a special effect, not implemented on most platforms (where it is the same as Hide())
Timeout specifies how long the animation should take, in ms, the default value of 0 means to use the default (system-dependent) value.
def HideWithEffect(*args, **kwargs): """ HideWithEffect(self, int effect, unsigned int timeout=0) -> bool Hide the window with a special effect, not implemented on most platforms (where it is the same as Hide()) Timeout specifies how long the animation should take, in ms, the default value of 0 means to use the default (system-dependent) value. """ return _core_.Window_HideWithEffect(*args, **kwargs)
def HitTest(
*args, **kwargs)
HitTest(self, Point pt) -> int
Test where the given (in client coords) point lies
def HitTest(*args, **kwargs): """ HitTest(self, Point pt) -> int Test where the given (in client coords) point lies """ return _core_.Window_HitTest(*args, **kwargs)
def HitTestXY(
*args, **kwargs)
HitTestXY(self, int x, int y) -> int
Test where the given (in client coords) point lies
def HitTestXY(*args, **kwargs): """ HitTestXY(self, int x, int y) -> int Test where the given (in client coords) point lies """ return _core_.Window_HitTestXY(*args, **kwargs)
def Iconize(
*args, **kwargs)
Iconize(self, bool iconize=True)
def Iconize(*args, **kwargs): """Iconize(self, bool iconize=True)""" return _windows_.TopLevelWindow_Iconize(*args, **kwargs)
def InformFirstDirection(
*args, **kwargs)
InformFirstDirection(self, int direction, int size, int availableOtherDir) -> bool
wxSizer and friends use this to give a chance to a component to recalc its min size once one of the final size components is known. Override this function when that is useful (such as for wxStaticText which can stretch over several lines). Parameter availableOtherDir tells the item how much more space there is available in the opposite direction (-1 if unknown).
def InformFirstDirection(*args, **kwargs): """ InformFirstDirection(self, int direction, int size, int availableOtherDir) -> bool wxSizer and friends use this to give a chance to a component to recalc its min size once one of the final size components is known. Override this function when that is useful (such as for wxStaticText which can stretch over several lines). Parameter availableOtherDir tells the item how much more space there is available in the opposite direction (-1 if unknown). """ return _core_.Window_InformFirstDirection(*args, **kwargs)
def InheritAttributes(
*args, **kwargs)
InheritAttributes(self)
This function is (or should be, in case of custom controls) called during window creation to intelligently set up the window visual attributes, that is the font and the foreground and background colours.
By 'intelligently' the following is meant: by default, all windows use their own default attributes. However if some of the parent's attributes are explicitly changed (that is, using SetFont and not SetOwnFont) and if the corresponding attribute hadn't been explicitly set for this window itself, then this window takes the same value as used by the parent. In addition, if the window overrides ShouldInheritColours to return false, the colours will not be changed no matter what and only the font might.
This rather complicated logic is necessary in order to accommodate the different usage scenarios. The most common one is when all default attributes are used and in this case, nothing should be inherited as in modern GUIs different controls use different fonts (and colours) than their siblings so they can't inherit the same value from the parent. However it was also deemed desirable to allow to simply change the attributes of all children at once by just changing the font or colour of their common parent, hence in this case we do inherit the parents attributes.
def InheritAttributes(*args, **kwargs): """ InheritAttributes(self) This function is (or should be, in case of custom controls) called during window creation to intelligently set up the window visual attributes, that is the font and the foreground and background colours. By 'intelligently' the following is meant: by default, all windows use their own default attributes. However if some of the parent's attributes are explicitly changed (that is, using SetFont and not SetOwnFont) and if the corresponding attribute hadn't been explicitly set for this window itself, then this window takes the same value as used by the parent. In addition, if the window overrides ShouldInheritColours to return false, the colours will not be changed no matter what and only the font might. This rather complicated logic is necessary in order to accommodate the different usage scenarios. The most common one is when all default attributes are used and in this case, nothing should be inherited as in modern GUIs different controls use different fonts (and colours) than their siblings so they can't inherit the same value from the parent. However it was also deemed desirable to allow to simply change the attributes of all children at once by just changing the font or colour of their common parent, hence in this case we do inherit the parents attributes. """ return _core_.Window_InheritAttributes(*args, **kwargs)
def InheritsBackgroundColour(
*args, **kwargs)
InheritsBackgroundColour(self) -> bool
def InheritsBackgroundColour(*args, **kwargs): """InheritsBackgroundColour(self) -> bool""" return _core_.Window_InheritsBackgroundColour(*args, **kwargs)
def InitDialog(
*args, **kwargs)
InitDialog(self)
Sends an EVT_INIT_DIALOG event, whose handler usually transfers data to the dialog via validators.
def InitDialog(*args, **kwargs): """ InitDialog(self) Sends an EVT_INIT_DIALOG event, whose handler usually transfers data to the dialog via validators. """ return _core_.Window_InitDialog(*args, **kwargs)
def InvalidateBestSize(
*args, **kwargs)
InvalidateBestSize(self)
Reset the cached best size value so it will be recalculated the next time it is needed.
def InvalidateBestSize(*args, **kwargs): """ InvalidateBestSize(self) Reset the cached best size value so it will be recalculated the next time it is needed. """ return _core_.Window_InvalidateBestSize(*args, **kwargs)
def IsActive(
*args, **kwargs)
IsActive(self) -> bool
def IsActive(*args, **kwargs): """IsActive(self) -> bool""" return _windows_.TopLevelWindow_IsActive(*args, **kwargs)
def IsAlwaysMaximized(
*args, **kwargs)
IsAlwaysMaximized(self) -> bool
def IsAlwaysMaximized(*args, **kwargs): """IsAlwaysMaximized(self) -> bool""" return _windows_.TopLevelWindow_IsAlwaysMaximized(*args, **kwargs)
def IsBeingDeleted(
*args, **kwargs)
IsBeingDeleted(self) -> bool
Is the window in the process of being deleted?
def IsBeingDeleted(*args, **kwargs): """ IsBeingDeleted(self) -> bool Is the window in the process of being deleted? """ return _core_.Window_IsBeingDeleted(*args, **kwargs)
def IsDoubleBuffered(
*args, **kwargs)
IsDoubleBuffered(self) -> bool
Returns True
if the window contents is double-buffered by the
system, i.e. if any drawing done on the window is really done on a
temporary backing surface and transferred to the screen all at once
later.
def IsDoubleBuffered(*args, **kwargs): """ IsDoubleBuffered(self) -> bool Returns ``True`` if the window contents is double-buffered by the system, i.e. if any drawing done on the window is really done on a temporary backing surface and transferred to the screen all at once later. """ return _core_.Window_IsDoubleBuffered(*args, **kwargs)
def IsEnabled(
*args, **kwargs)
IsEnabled(self) -> bool
Returns true if the window is enabled for input, false otherwise. This method takes into account the enabled state of parent windows up to the top-level window.
def IsEnabled(*args, **kwargs): """ IsEnabled(self) -> bool Returns true if the window is enabled for input, false otherwise. This method takes into account the enabled state of parent windows up to the top-level window. """ return _core_.Window_IsEnabled(*args, **kwargs)
def IsExposed(
*args, **kwargs)
IsExposed(self, int x, int y, int w=1, int h=1) -> bool
Returns true if the given point or rectangle area has been exposed since the last repaint. Call this in an paint event handler to optimize redrawing by only redrawing those areas, which have been exposed.
def IsExposed(*args, **kwargs): """ IsExposed(self, int x, int y, int w=1, int h=1) -> bool Returns true if the given point or rectangle area has been exposed since the last repaint. Call this in an paint event handler to optimize redrawing by only redrawing those areas, which have been exposed. """ return _core_.Window_IsExposed(*args, **kwargs)
def IsExposedPoint(
*args, **kwargs)
IsExposedPoint(self, Point pt) -> bool
Returns true if the given point or rectangle area has been exposed since the last repaint. Call this in an paint event handler to optimize redrawing by only redrawing those areas, which have been exposed.
def IsExposedPoint(*args, **kwargs): """ IsExposedPoint(self, Point pt) -> bool Returns true if the given point or rectangle area has been exposed since the last repaint. Call this in an paint event handler to optimize redrawing by only redrawing those areas, which have been exposed. """ return _core_.Window_IsExposedPoint(*args, **kwargs)
def IsExposedRect(
*args, **kwargs)
IsExposedRect(self, Rect rect) -> bool
Returns true if the given point or rectangle area has been exposed since the last repaint. Call this in an paint event handler to optimize redrawing by only redrawing those areas, which have been exposed.
def IsExposedRect(*args, **kwargs): """ IsExposedRect(self, Rect rect) -> bool Returns true if the given point or rectangle area has been exposed since the last repaint. Call this in an paint event handler to optimize redrawing by only redrawing those areas, which have been exposed. """ return _core_.Window_IsExposedRect(*args, **kwargs)
def IsFrozen(
*args, **kwargs)
IsFrozen(self) -> bool
Returns True
if the window has been frozen and not thawed yet.
:see: Freeze
and Thaw
def IsFrozen(*args, **kwargs): """ IsFrozen(self) -> bool Returns ``True`` if the window has been frozen and not thawed yet. :see: `Freeze` and `Thaw` """ return _core_.Window_IsFrozen(*args, **kwargs)
def IsFullScreen(
*args, **kwargs)
IsFullScreen(self) -> bool
def IsFullScreen(*args, **kwargs): """IsFullScreen(self) -> bool""" return _windows_.TopLevelWindow_IsFullScreen(*args, **kwargs)
def IsIconized(
*args, **kwargs)
IsIconized(self) -> bool
def IsIconized(*args, **kwargs): """IsIconized(self) -> bool""" return _windows_.TopLevelWindow_IsIconized(*args, **kwargs)
def IsMaximized(
*args, **kwargs)
IsMaximized(self) -> bool
def IsMaximized(*args, **kwargs): """IsMaximized(self) -> bool""" return _windows_.TopLevelWindow_IsMaximized(*args, **kwargs)
def IsRetained(
*args, **kwargs)
IsRetained(self) -> bool
Returns true if the window is retained, false otherwise. Retained windows are only available on X platforms.
def IsRetained(*args, **kwargs): """ IsRetained(self) -> bool Returns true if the window is retained, false otherwise. Retained windows are only available on X platforms. """ return _core_.Window_IsRetained(*args, **kwargs)
def IsSameAs(
*args, **kwargs)
IsSameAs(self, Object p) -> bool
For wx.Objects that use C++ reference counting internally, this method can be used to determine if two objects are referencing the same data object.
def IsSameAs(*args, **kwargs): """ IsSameAs(self, Object p) -> bool For wx.Objects that use C++ reference counting internally, this method can be used to determine if two objects are referencing the same data object. """ return _core_.Object_IsSameAs(*args, **kwargs)
def IsScrollbarAlwaysShown(
*args, **kwargs)
IsScrollbarAlwaysShown(self, int orient) -> bool
def IsScrollbarAlwaysShown(*args, **kwargs): """IsScrollbarAlwaysShown(self, int orient) -> bool""" return _core_.Window_IsScrollbarAlwaysShown(*args, **kwargs)
def IsShown(
*args, **kwargs)
IsShown(self) -> bool
Returns true if the window is shown, false if it has been hidden.
def IsShown(*args, **kwargs): """ IsShown(self) -> bool Returns true if the window is shown, false if it has been hidden. """ return _core_.Window_IsShown(*args, **kwargs)
def IsShownOnScreen(
*args, **kwargs)
IsShownOnScreen(self) -> bool
Returns True
if the window is physically visible on the screen,
i.e. it is shown and all its parents up to the toplevel window are
shown as well.
def IsShownOnScreen(*args, **kwargs): """ IsShownOnScreen(self) -> bool Returns ``True`` if the window is physically visible on the screen, i.e. it is shown and all its parents up to the toplevel window are shown as well. """ return _core_.Window_IsShownOnScreen(*args, **kwargs)
def IsThisEnabled(
*args, **kwargs)
IsThisEnabled(self) -> bool
Returns the internal enabled state independent of the parent(s) state,
i.e. the state in which the window would be if all of its parents are
enabled. Use IsEnabled
to get the effective window state.
def IsThisEnabled(*args, **kwargs): """ IsThisEnabled(self) -> bool Returns the internal enabled state independent of the parent(s) state, i.e. the state in which the window would be if all of its parents are enabled. Use `IsEnabled` to get the effective window state. """ return _core_.Window_IsThisEnabled(*args, **kwargs)
def IsTopLevel(
*args, **kwargs)
IsTopLevel(self) -> bool
Returns true if the given window is a top-level one. Currently all frames and dialogs are always considered to be top-level windows (even if they have a parent window).
def IsTopLevel(*args, **kwargs): """ IsTopLevel(self) -> bool Returns true if the given window is a top-level one. Currently all frames and dialogs are always considered to be top-level windows (even if they have a parent window). """ return _core_.Window_IsTopLevel(*args, **kwargs)
def IsUnlinked(
*args, **kwargs)
IsUnlinked(self) -> bool
def IsUnlinked(*args, **kwargs): """IsUnlinked(self) -> bool""" return _core_.EvtHandler_IsUnlinked(*args, **kwargs)
def Layout(
*args, **kwargs)
Layout(self) -> bool
Invokes the constraint-based layout algorithm or the sizer-based algorithm for this window. See SetAutoLayout: when auto layout is on, this function gets called automatically by the default EVT_SIZE handler when the window is resized.
def Layout(*args, **kwargs): """ Layout(self) -> bool Invokes the constraint-based layout algorithm or the sizer-based algorithm for this window. See SetAutoLayout: when auto layout is on, this function gets called automatically by the default EVT_SIZE handler when the window is resized. """ return _core_.Window_Layout(*args, **kwargs)
def LineDown(
*args, **kwargs)
LineDown(self) -> bool
This is just a wrapper for ScrollLines(1).
def LineDown(*args, **kwargs): """ LineDown(self) -> bool This is just a wrapper for ScrollLines(1). """ return _core_.Window_LineDown(*args, **kwargs)
def LineUp(
*args, **kwargs)
LineUp(self) -> bool
This is just a wrapper for ScrollLines(-1).
def LineUp(*args, **kwargs): """ LineUp(self) -> bool This is just a wrapper for ScrollLines(-1). """ return _core_.Window_LineUp(*args, **kwargs)
def Lower(
*args, **kwargs)
Lower(self)
Lowers the window to the bottom of the window hierarchy. In current version of wxWidgets this works both for managed and child windows.
def Lower(*args, **kwargs): """ Lower(self) Lowers the window to the bottom of the window hierarchy. In current version of wxWidgets this works both for managed and child windows. """ return _core_.Window_Lower(*args, **kwargs)
def MacGetMetalAppearance(
*args, **kwargs)
MacGetMetalAppearance(self) -> bool
def MacGetMetalAppearance(*args, **kwargs): """MacGetMetalAppearance(self) -> bool""" return _windows_.TopLevelWindow_MacGetMetalAppearance(*args, **kwargs)
def MacGetTopLevelWindowRef(
*args, **kwargs)
MacGetTopLevelWindowRef(self) -> long
def MacGetTopLevelWindowRef(*args, **kwargs): """MacGetTopLevelWindowRef(self) -> long""" return _windows_.TopLevelWindow_MacGetTopLevelWindowRef(*args, **kwargs)
def MacGetUnifiedAppearance(
*args, **kwargs)
MacGetUnifiedAppearance(self) -> bool
def MacGetUnifiedAppearance(*args, **kwargs): """MacGetUnifiedAppearance(self) -> bool""" return _windows_.TopLevelWindow_MacGetUnifiedAppearance(*args, **kwargs)
def MacSetMetalAppearance(
*args, **kwargs)
MacSetMetalAppearance(self, bool on)
def MacSetMetalAppearance(*args, **kwargs): """MacSetMetalAppearance(self, bool on)""" return _windows_.TopLevelWindow_MacSetMetalAppearance(*args, **kwargs)
def MakeModal(
*args, **kwargs)
MakeModal(self, bool modal=True)
Disables all other windows in the application so that the user can only interact with this window. Passing False will reverse this effect.
def MakeModal(*args, **kwargs): """ MakeModal(self, bool modal=True) Disables all other windows in the application so that the user can only interact with this window. Passing False will reverse this effect. """ return _core_.Window_MakeModal(*args, **kwargs)
def Maximize(
*args, **kwargs)
Maximize(self, bool maximize=True)
def Maximize(*args, **kwargs): """Maximize(self, bool maximize=True)""" return _windows_.TopLevelWindow_Maximize(*args, **kwargs)
def Move(
*args, **kwargs)
Move(self, Point pt, int flags=SIZE_USE_EXISTING)
Moves the window to the given position.
def Move(*args, **kwargs): """ Move(self, Point pt, int flags=SIZE_USE_EXISTING) Moves the window to the given position. """ return _core_.Window_Move(*args, **kwargs)
def MoveAfterInTabOrder(
*args, **kwargs)
MoveAfterInTabOrder(self, Window win)
Moves this window in the tab navigation order after the specified sibling window. This means that when the user presses the TAB key on that other window, the focus switches to this window.
The default tab order is the same as creation order. This function
and MoveBeforeInTabOrder
allow to change it after creating all the
windows.
def MoveAfterInTabOrder(*args, **kwargs): """ MoveAfterInTabOrder(self, Window win) Moves this window in the tab navigation order after the specified sibling window. This means that when the user presses the TAB key on that other window, the focus switches to this window. The default tab order is the same as creation order. This function and `MoveBeforeInTabOrder` allow to change it after creating all the windows. """ return _core_.Window_MoveAfterInTabOrder(*args, **kwargs)
def MoveBeforeInTabOrder(
*args, **kwargs)
MoveBeforeInTabOrder(self, Window win)
Same as MoveAfterInTabOrder
except that it inserts this window just
before win instead of putting it right after it.
def MoveBeforeInTabOrder(*args, **kwargs): """ MoveBeforeInTabOrder(self, Window win) Same as `MoveAfterInTabOrder` except that it inserts this window just before win instead of putting it right after it. """ return _core_.Window_MoveBeforeInTabOrder(*args, **kwargs)
def MoveXY(
*args, **kwargs)
MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)
Moves the window to the given position.
def MoveXY(*args, **kwargs): """ MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING) Moves the window to the given position. """ return _core_.Window_MoveXY(*args, **kwargs)
Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool
Does keyboard navigation starting from this window to another. This is equivalient to self.GetParent().NavigateIn().
NavigateIn(self, int flags=NavigationKeyEvent.IsForward) -> bool
Navigates inside this window.
def OSXIsModified(
*args, **kwargs)
OSXIsModified(self) -> bool
def OSXIsModified(*args, **kwargs): """OSXIsModified(self) -> bool""" return _windows_.TopLevelWindow_OSXIsModified(*args, **kwargs)
def OSXSetModified(
*args, **kwargs)
OSXSetModified(self, bool modified)
def OSXSetModified(*args, **kwargs): """OSXSetModified(self, bool modified)""" return _windows_.TopLevelWindow_OSXSetModified(*args, **kwargs)
def OnAddPanel(
self, event, id)
Adds a panel
def OnAddPanel(self,event,id): """ Adds a panel""" sys.path.append(FRONTENDS_DIRECTORY) #print(dir(event),event.Id) panel_name=self.panel_dictionary[event.Id].replace('.py','') exec('from %s import *'%panel_name) exec('self.%s_%s=%s(id=%s,name="%s_%s", parent=self.UpperInterface, pos=wx.Point(0, 0),size=wx.Size(1339, 610), style=wx.TAB_TRAVERSAL)'%(panel_name,id,panel_name,id,panel_name,id)) exec("self.UpperInterface.AddPage(imageId=-1, page=self.%s_%s, select=True,text='%s')"%(panel_name,id,panel_name))
def OnBasicInterfaceFrameClose(
self, event)
What to do when the frame is closed, needed to avoid memory leaks
def OnBasicInterfaceFrameClose(self, event): """ What to do when the frame is closed, needed to avoid memory leaks""" try: app=wx.GetApp() app.stdioWin.close() except:pass self.Destroy() event.Skip()
def OnButton1Button(
self, event)
def OnButton1Button(self, event): self.Display.write(JAVASCRIPT_STRING) event.Skip()
def OnButton2Button(
self, event)
def OnButton2Button(self, event): self.tool_menu_number=self.tool_menu_number+1 if self.tool_menu_number is 1: self.ScriptsMenu=wx.Menu() self.ToolMenu.AppendMenu(-1,'Scripts',self.ScriptsMenu) self.ScriptsMenu.Append(help='Runs the {0} script'.format(self.tool_menu_number), id=-1,kind=wx.ITEM_NORMAL, text='Run the {0} script'.format(self.tool_menu_number)) event.Skip()
def OnEndOfTheDayButtonButton(
self, event)
def OnEndOfTheDayButtonButton(self, event): dlg = EndOfDayDialog(self) try: result = dlg.ShowModal() finally: dlg.Destroy() event.Skip
def OnExecuteButtonButton(
self, event)
def OnExecuteButtonButton(self, event): path=str(os.path.join(PYMEASURE_ROOT,'Code/FrontEnds/IEPanel.py')) exec(compile(open(path).read(), path, 'exec'))
def OnFileMenuNewMenu(
self, event)
def OnFileMenuNewMenu(self, event): dlg = wx.FileDialog(self, 'Choose a file', '.', '', '*.*', wx.OPEN) try: if dlg.ShowModal() == wx.ID_OK: filename = dlg.GetPath() # Your code finally: dlg.Destroy() self.upper_Interface.AddPage( event.Skip() pass
def OnFileMenuOpenMenu(
self, event)
def OnFileMenuOpenMenu(self, event): event.Skip()
def OnInstrumentsButtonButton(
self, event)
def OnInstrumentsButtonButton(self, event): instruments_directory=os.path.join(PYMEASURE_ROOT,'Instruments') self.Display.ie.Navigate(instruments_directory) event.Skip()
def OnInterfaceToolBarLaunchboaTool(
self, event)
def OnInterfaceToolBarLaunchboaTool(self, event): os.system(r'start python C:\Anaconda2\Lib\site-packages\boa\Boa.py') event.Skip()
def OnInterfaceToolBarTools1Tool(
self, event)
def OnInterfaceToolBarTools1Tool(self, event): #sage_script=r'C:\"Program Files"\AutoIt3\Examples\SAGE_NOIE2.exe' #os.system('jupyter notebook') self.Display.ie.Navigate('http://localhost:8888/tree') pass
def OnLowerInterfaceTreebookPageChanged(
self, event)
def OnLowerInterfaceTreebookPageChanged(self, event): self.update_display() event.Skip()
def OnPaint(
*args, **kwargs)
OnPaint(self, PaintEvent event)
def OnPaint(*args, **kwargs): """OnPaint(self, PaintEvent event)""" return _core_.Window_OnPaint(*args, **kwargs)
def OnReplaceRightControlButttonButton(
self, event)
def OnReplaceRightControlButttonButton(self, event): try: new=self.right_control_panels.index( self.current_right_control_panel)%len(self.right_control_panels)+1 new_panel=self.right_control_panels[new] except: new=0 new_panel=self.right_control_panels[new] self.swap_panel(self.current_right_control_panel,new_panel,self.boxSizer2)
def OnStatesButtonButton(
self, event)
def OnStatesButtonButton(self, event): states_directory=os.path.join(PYMEASURE_ROOT,'Data/States') self.Display.ie.Navigate(states_directory) event.Skip()
def OnToolMenuLoadscriptsMenu(
self, event)
Loads Scripts to run
def OnToolMenuLoadscriptsMenu(self, event): " Loads Scripts to run" dlg = wx.FileDialog(self, 'Choose a Python Module', '.', '', '*.py', wx.OPEN) try: if dlg.ShowModal() == wx.ID_OK: filename = dlg.GetPath() module_scripts=self.import_scripts(filename) module=module_scripts['module'] try: for index,script in enumerate(module_scripts['scripts']): new_id=wx.NewId() menu_item=wx.MenuItem(self.ToolMenu,id=new_id, kind=wx.ITEM_NORMAL, text='Run %s '%script, help='Run %s from the %s module'%(script,module)) self.ScriptsMenu.AppendItem(menu_item) self.loaded_script_menu_items.append(menu_item) #event_handler=(lambda event: self.execute_script(event)) #eval('def event\_handler%s(event):return self.execute_script(event,module\_scripts["%s"],"%s")'%(index,script,script),locals()) #event_handler.func_name='%s'%index self.event_handlers[menu_item.GetId()]=module_scripts[script] #print(self.event_handlers) self.Bind(wx.EVT_MENU,self.execute_script,id=menu_item.GetId()) #print(self.event_handlers) #self.bind_menu() except: print(('Could Not Import {0}'.format(module))) raise finally: dlg.Destroy() event.Skip()
def OnToolMenuRun_pythonMenu(
self, event)
def OnToolMenuRun_pythonMenu(self, event): dlg = wx.FileDialog(self, 'Choose a file', '.', '', '*.py', wx.OPEN) try: if dlg.ShowModal() == wx.ID_OK: filename = dlg.GetPath() try: exec(compile(open(filename).read(), filename, 'exec'),self.locals) except: pass finally: dlg.Destroy() event.Skip()
def OnVisaDialogButtonButton(
self, event)
def OnVisaDialogButtonButton(self, event): dlg = VisaDialog(self) try: result = dlg.Show() finally: pass event.Skip
def PageDown(
*args, **kwargs)
PageDown(self) -> bool
This is just a wrapper for ScrollPages(1).
def PageDown(*args, **kwargs): """ PageDown(self) -> bool This is just a wrapper for ScrollPages(1). """ return _core_.Window_PageDown(*args, **kwargs)
def PageUp(
*args, **kwargs)
PageUp(self) -> bool
This is just a wrapper for ScrollPages(-1).
def PageUp(*args, **kwargs): """ PageUp(self) -> bool This is just a wrapper for ScrollPages(-1). """ return _core_.Window_PageUp(*args, **kwargs)
def PopEventHandler(
*args, **kwargs)
PopEventHandler(self, bool deleteHandler=False) -> EvtHandler
Removes and returns the top-most event handler on the event handler
stack. If deleteHandler is True then the wx.EvtHandler object will be
destroyed after it is popped, and None
will be returned instead.
def PopEventHandler(*args, **kwargs): """ PopEventHandler(self, bool deleteHandler=False) -> EvtHandler Removes and returns the top-most event handler on the event handler stack. If deleteHandler is True then the wx.EvtHandler object will be destroyed after it is popped, and ``None`` will be returned instead. """ return _core_.Window_PopEventHandler(*args, **kwargs)
def PopStatusText(
*args, **kwargs)
PopStatusText(self, int number=0)
def PopStatusText(*args, **kwargs): """PopStatusText(self, int number=0)""" return _windows_.Frame_PopStatusText(*args, **kwargs)
def PopupMenu(
*args, **kwargs)
PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool
Pops up the given menu at the specified coordinates, relative to this window, and returns control when the user has dismissed the menu. If a menu item is selected, the corresponding menu event is generated and will be processed as usual. If the default position is given then the current position of the mouse cursor will be used.
def PopupMenu(*args, **kwargs): """ PopupMenu(self, Menu menu, Point pos=DefaultPosition) -> bool Pops up the given menu at the specified coordinates, relative to this window, and returns control when the user has dismissed the menu. If a menu item is selected, the corresponding menu event is generated and will be processed as usual. If the default position is given then the current position of the mouse cursor will be used. """ return _core_.Window_PopupMenu(*args, **kwargs)
def PopupMenuXY(
*args, **kwargs)
PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool
Pops up the given menu at the specified coordinates, relative to this window, and returns control when the user has dismissed the menu. If a menu item is selected, the corresponding menu event is generated and will be processed as usual. If the default position is given then the current position of the mouse cursor will be used.
def PopupMenuXY(*args, **kwargs): """ PopupMenuXY(self, Menu menu, int x=-1, int y=-1) -> bool Pops up the given menu at the specified coordinates, relative to this window, and returns control when the user has dismissed the menu. If a menu item is selected, the corresponding menu event is generated and will be processed as usual. If the default position is given then the current position of the mouse cursor will be used. """ return _core_.Window_PopupMenuXY(*args, **kwargs)
def PostCreate(
self, pre)
Phase 3 of the 2-phase create
def PostCreate(self, pre): """ Phase 3 of the 2-phase create <wink!> Call this method after precreating the window with the 2-phase create method. """ self.this = pre.this self.thisown = pre.thisown pre.thisown = 0 if hasattr(self, '_setOORInfo'): try: self._setOORInfo(self) except TypeError: pass if hasattr(self, '_setCallbackInfo'): try: self._setCallbackInfo(self, pre.__class__) except TypeError: pass
def PostSizeEvent(
*args, **kwargs)
PostSizeEvent(self)
This is a more readable synonym for SendSizeEvent(wx.SEND_EVENT_POST)
def PostSizeEvent(*args, **kwargs): """ PostSizeEvent(self) This is a more readable synonym for SendSizeEvent(wx.SEND_EVENT_POST) """ return _core_.Window_PostSizeEvent(*args, **kwargs)
def PostSizeEventToParent(
*args, **kwargs)
PostSizeEventToParent(self)
This is the same as SendSizeEventToParent() but using PostSizeEvent()
def PostSizeEventToParent(*args, **kwargs): """ PostSizeEventToParent(self) This is the same as SendSizeEventToParent() but using PostSizeEvent() """ return _core_.Window_PostSizeEventToParent(*args, **kwargs)
def ProcessCommand(
*args)
ProcessCommand(self, int winid) -> bool ProcessCommand(self, MenuItem item) -> bool
def ProcessCommand(*args): """ ProcessCommand(self, int winid) -> bool ProcessCommand(self, MenuItem item) -> bool """ return _windows_.Frame_ProcessCommand(*args)
def ProcessEvent(
*args, **kwargs)
ProcessEvent(self, Event event) -> bool
def ProcessEvent(*args, **kwargs): """ProcessEvent(self, Event event) -> bool""" return _core_.EvtHandler_ProcessEvent(*args, **kwargs)
def ProcessEventLocally(
*args, **kwargs)
ProcessEventLocally(self, Event event) -> bool
def ProcessEventLocally(*args, **kwargs): """ProcessEventLocally(self, Event event) -> bool""" return _core_.EvtHandler_ProcessEventLocally(*args, **kwargs)
def ProcessPendingEvents(
*args, **kwargs)
ProcessPendingEvents(self)
def ProcessPendingEvents(*args, **kwargs): """ProcessPendingEvents(self)""" return _core_.EvtHandler_ProcessPendingEvents(*args, **kwargs)
def ProcessWindowEvent(
*args, **kwargs)
ProcessWindowEvent(self, Event event) -> bool
Process an event by calling GetEventHandler().ProcessEvent(): this is a straightforward replacement for ProcessEvent() itself which shouldn't be used directly with windows as it doesn't take into account any event handlers associated with the window
def ProcessWindowEvent(*args, **kwargs): """ ProcessWindowEvent(self, Event event) -> bool Process an event by calling GetEventHandler().ProcessEvent(): this is a straightforward replacement for ProcessEvent() itself which shouldn't be used directly with windows as it doesn't take into account any event handlers associated with the window """ return _core_.Window_ProcessWindowEvent(*args, **kwargs)
def PushEventHandler(
*args, **kwargs)
PushEventHandler(self, EvtHandler handler)
Pushes this event handler onto the event handler stack for the window. An event handler is an object that is capable of processing the events sent to a window. (In other words, is able to dispatch the events to a handler function.) By default, the window is its own event handler, but an application may wish to substitute another, for example to allow central implementation of event-handling for a variety of different window classes.
wx.Window.PushEventHandler allows an application to set up a chain of
event handlers, where an event not handled by one event handler is
handed to the next one in the chain. Use wx.Window.PopEventHandler
to remove the event handler. Ownership of the handler is not given
to the window, so you should be sure to pop the handler before the
window is destroyed and either let PopEventHandler destroy it, or call
its Destroy method yourself.
def PushEventHandler(*args, **kwargs): """ PushEventHandler(self, EvtHandler handler) Pushes this event handler onto the event handler stack for the window. An event handler is an object that is capable of processing the events sent to a window. (In other words, is able to dispatch the events to a handler function.) By default, the window is its own event handler, but an application may wish to substitute another, for example to allow central implementation of event-handling for a variety of different window classes. wx.Window.PushEventHandler allows an application to set up a chain of event handlers, where an event not handled by one event handler is handed to the next one in the chain. Use `wx.Window.PopEventHandler` to remove the event handler. Ownership of the handler is *not* given to the window, so you should be sure to pop the handler before the window is destroyed and either let PopEventHandler destroy it, or call its Destroy method yourself. """ return _core_.Window_PushEventHandler(*args, **kwargs)
def PushStatusText(
*args, **kwargs)
PushStatusText(self, String text, int number=0)
def PushStatusText(*args, **kwargs): """PushStatusText(self, String text, int number=0)""" return _windows_.Frame_PushStatusText(*args, **kwargs)
def QueueEvent(
*args, **kwargs)
QueueEvent(self, Event event)
def QueueEvent(*args, **kwargs): """QueueEvent(self, Event event)""" return _core_.EvtHandler_QueueEvent(*args, **kwargs)
def Raise(
*args, **kwargs)
Raise(self)
Raises the window to the top of the window hierarchy. In current version of wxWidgets this works both for managed and child windows.
def Raise(*args, **kwargs): """ Raise(self) Raises the window to the top of the window hierarchy. In current version of wxWidgets this works both for managed and child windows. """ return _core_.Window_Raise(*args, **kwargs)
def Refresh(
*args, **kwargs)
Refresh(self, bool eraseBackground=True, Rect rect=None)
Mark the specified rectangle (or the whole window) as "dirty" so it will be repainted. Causes an EVT_PAINT event to be generated and sent to the window.
def Refresh(*args, **kwargs): """ Refresh(self, bool eraseBackground=True, Rect rect=None) Mark the specified rectangle (or the whole window) as "dirty" so it will be repainted. Causes an EVT_PAINT event to be generated and sent to the window. """ return _core_.Window_Refresh(*args, **kwargs)
def RefreshRect(
*args, **kwargs)
RefreshRect(self, Rect rect, bool eraseBackground=True)
Redraws the contents of the given rectangle: the area inside it will be repainted. This is the same as Refresh but has a nicer syntax.
def RefreshRect(*args, **kwargs): """ RefreshRect(self, Rect rect, bool eraseBackground=True) Redraws the contents of the given rectangle: the area inside it will be repainted. This is the same as Refresh but has a nicer syntax. """ return _core_.Window_RefreshRect(*args, **kwargs)
def RegisterHotKey(
*args, **kwargs)
RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool
Registers a system wide hotkey. Every time the user presses the hotkey registered here, this window will receive a hotkey event. It will receive the event even if the application is in the background and does not have the input focus because the user is working with some other application. To bind an event handler function to this hotkey use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the hotkey was registered successfully.
def RegisterHotKey(*args, **kwargs): """ RegisterHotKey(self, int hotkeyId, int modifiers, int keycode) -> bool Registers a system wide hotkey. Every time the user presses the hotkey registered here, this window will receive a hotkey event. It will receive the event even if the application is in the background and does not have the input focus because the user is working with some other application. To bind an event handler function to this hotkey use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the hotkey was registered successfully. """ return _core_.Window_RegisterHotKey(*args, **kwargs)
def ReleaseMouse(
*args, **kwargs)
ReleaseMouse(self)
Releases mouse input captured with wx.Window.CaptureMouse.
def ReleaseMouse(*args, **kwargs): """ ReleaseMouse(self) Releases mouse input captured with wx.Window.CaptureMouse. """ return _core_.Window_ReleaseMouse(*args, **kwargs)
def RemoveChild(
*args, **kwargs)
RemoveChild(self, Window child)
Removes a child window. This is called automatically by window deletion functions so should not be required by the application programmer.
def RemoveChild(*args, **kwargs): """ RemoveChild(self, Window child) Removes a child window. This is called automatically by window deletion functions so should not be required by the application programmer. """ return _core_.Window_RemoveChild(*args, **kwargs)
def RemoveEventHandler(
*args, **kwargs)
RemoveEventHandler(self, EvtHandler handler) -> bool
Find the given handler in the event handler chain and remove (but not delete) it from the event handler chain, returns True if it was found and False otherwise (this also results in an assert failure so this function should only be called when the handler is supposed to be there.)
def RemoveEventHandler(*args, **kwargs): """ RemoveEventHandler(self, EvtHandler handler) -> bool Find the given handler in the event handler chain and remove (but not delete) it from the event handler chain, returns True if it was found and False otherwise (this also results in an assert failure so this function should only be called when the handler is supposed to be there.) """ return _core_.Window_RemoveEventHandler(*args, **kwargs)
def Reparent(
*args, **kwargs)
Reparent(self, Window newParent) -> bool
Reparents the window, i.e the window will be removed from its current parent window (e.g. a non-standard toolbar in a wxFrame) and then re-inserted into another. Available on Windows and GTK. Returns True if the parent was changed, False otherwise (error or newParent == oldParent)
def Reparent(*args, **kwargs): """ Reparent(self, Window newParent) -> bool Reparents the window, i.e the window will be removed from its current parent window (e.g. a non-standard toolbar in a wxFrame) and then re-inserted into another. Available on Windows and GTK. Returns True if the parent was changed, False otherwise (error or newParent == oldParent) """ return _core_.Window_Reparent(*args, **kwargs)
def RequestUserAttention(
*args, **kwargs)
RequestUserAttention(self, int flags=USER_ATTENTION_INFO)
def RequestUserAttention(*args, **kwargs): """RequestUserAttention(self, int flags=USER_ATTENTION_INFO)""" return _windows_.TopLevelWindow_RequestUserAttention(*args, **kwargs)
def Restore(
*args, **kwargs)
Restore(self)
def Restore(*args, **kwargs): """Restore(self)""" return _windows_.TopLevelWindow_Restore(*args, **kwargs)
def SafelyProcessEvent(
*args, **kwargs)
SafelyProcessEvent(self, Event event) -> bool
def SafelyProcessEvent(*args, **kwargs): """SafelyProcessEvent(self, Event event) -> bool""" return _core_.EvtHandler_SafelyProcessEvent(*args, **kwargs)
def ScreenToClient(
*args, **kwargs)
ScreenToClient(self, Point pt) -> Point
Converts from screen to client window coordinates.
def ScreenToClient(*args, **kwargs): """ ScreenToClient(self, Point pt) -> Point Converts from screen to client window coordinates. """ return _core_.Window_ScreenToClient(*args, **kwargs)
def ScreenToClientXY(
*args, **kwargs)
ScreenToClientXY(int x, int y) -> (x,y)
Converts from screen to client window coordinates.
def ScreenToClientXY(*args, **kwargs): """ ScreenToClientXY(int x, int y) -> (x,y) Converts from screen to client window coordinates. """ return _core_.Window_ScreenToClientXY(*args, **kwargs)
def ScrollLines(
*args, **kwargs)
ScrollLines(self, int lines) -> bool
If the platform and window class supports it, scrolls the window by the given number of lines down, if lines is positive, or up if lines is negative. Returns True if the window was scrolled, False if it was already on top/bottom and nothing was done.
def ScrollLines(*args, **kwargs): """ ScrollLines(self, int lines) -> bool If the platform and window class supports it, scrolls the window by the given number of lines down, if lines is positive, or up if lines is negative. Returns True if the window was scrolled, False if it was already on top/bottom and nothing was done. """ return _core_.Window_ScrollLines(*args, **kwargs)
def ScrollPages(
*args, **kwargs)
ScrollPages(self, int pages) -> bool
If the platform and window class supports it, scrolls the window by the given number of pages down, if pages is positive, or up if pages is negative. Returns True if the window was scrolled, False if it was already on top/bottom and nothing was done.
def ScrollPages(*args, **kwargs): """ ScrollPages(self, int pages) -> bool If the platform and window class supports it, scrolls the window by the given number of pages down, if pages is positive, or up if pages is negative. Returns True if the window was scrolled, False if it was already on top/bottom and nothing was done. """ return _core_.Window_ScrollPages(*args, **kwargs)
def ScrollWindow(
*args, **kwargs)
ScrollWindow(self, int dx, int dy, Rect rect=None)
Physically scrolls the pixels in the window and move child windows accordingly. Use this function to optimise your scrolling implementations, to minimise the area that must be redrawn. Note that it is rarely required to call this function from a user program.
def ScrollWindow(*args, **kwargs): """ ScrollWindow(self, int dx, int dy, Rect rect=None) Physically scrolls the pixels in the window and move child windows accordingly. Use this function to optimise your scrolling implementations, to minimise the area that must be redrawn. Note that it is rarely required to call this function from a user program. """ return _core_.Window_ScrollWindow(*args, **kwargs)
def SendIdleEvents(
*args, **kwargs)
SendIdleEvents(self, IdleEvent event) -> bool
Send idle event to window and all subwindows. Returns True if more idle time is requested.
def SendIdleEvents(*args, **kwargs): """ SendIdleEvents(self, IdleEvent event) -> bool Send idle event to window and all subwindows. Returns True if more idle time is requested. """ return _core_.Window_SendIdleEvents(*args, **kwargs)
def SendSizeEvent(
*args, **kwargs)
SendSizeEvent(self, int flags=0)
Sends a size event to the window using its current size -- this has an effect of refreshing the window layout.
By default the event is sent, i.e. processed immediately, but if flags value includes wxSEND_EVENT_POST then it's posted, i.e. only schedule for later processing.
def SendSizeEvent(*args, **kwargs): """ SendSizeEvent(self, int flags=0) Sends a size event to the window using its current size -- this has an effect of refreshing the window layout. By default the event is sent, i.e. processed immediately, but if flags value includes wxSEND_EVENT_POST then it's posted, i.e. only schedule for later processing. """ return _core_.Window_SendSizeEvent(*args, **kwargs)
def SendSizeEventToParent(
*args, **kwargs)
SendSizeEventToParent(self, int flags=0)
This is a safe wrapper for GetParent().SendSizeEvent(): it checks that we have a parent window and it's not in process of being deleted.
def SendSizeEventToParent(*args, **kwargs): """ SendSizeEventToParent(self, int flags=0) This is a safe wrapper for GetParent().SendSizeEvent(): it checks that we have a parent window and it's not in process of being deleted. """ return _core_.Window_SendSizeEventToParent(*args, **kwargs)
def SetAcceleratorTable(
*args, **kwargs)
SetAcceleratorTable(self, AcceleratorTable accel)
Sets the accelerator table for this window.
def SetAcceleratorTable(*args, **kwargs): """ SetAcceleratorTable(self, AcceleratorTable accel) Sets the accelerator table for this window. """ return _core_.Window_SetAcceleratorTable(*args, **kwargs)
def SetAutoLayout(
*args, **kwargs)
SetAutoLayout(self, bool autoLayout)
Determines whether the Layout function will be called automatically
when the window is resized. lease note that this only happens for the
windows usually used to contain children, namely wx.Panel
and
wx.TopLevelWindow
(and the classes deriving from them).
This method is called implicitly by SetSizer
but if you use
SetConstraints
you should call it manually or otherwise the window
layout won't be correctly updated when its size changes.
def SetAutoLayout(*args, **kwargs): """ SetAutoLayout(self, bool autoLayout) Determines whether the Layout function will be called automatically when the window is resized. lease note that this only happens for the windows usually used to contain children, namely `wx.Panel` and `wx.TopLevelWindow` (and the classes deriving from them). This method is called implicitly by `SetSizer` but if you use `SetConstraints` you should call it manually or otherwise the window layout won't be correctly updated when its size changes. """ return _core_.Window_SetAutoLayout(*args, **kwargs)
def SetBackgroundColour(
*args, **kwargs)
SetBackgroundColour(self, Colour colour) -> bool
Sets the background colour of the window. Returns True if the colour
was changed. The background colour is usually painted by the default
EVT_ERASE_BACKGROUND event handler function under Windows and
automatically under GTK. Using wx.NullColour
will reset the window
to the default background colour.
Note that setting the background colour may not cause an immediate
refresh, so you may wish to call ClearBackground
or Refresh
after
calling this function.
Using this function will disable attempts to use themes for this window, if the system supports them. Use with care since usually the themes represent the appearance chosen by the user to be used for all applications on the system.
def SetBackgroundColour(*args, **kwargs): """ SetBackgroundColour(self, Colour colour) -> bool Sets the background colour of the window. Returns True if the colour was changed. The background colour is usually painted by the default EVT_ERASE_BACKGROUND event handler function under Windows and automatically under GTK. Using `wx.NullColour` will reset the window to the default background colour. Note that setting the background colour may not cause an immediate refresh, so you may wish to call `ClearBackground` or `Refresh` after calling this function. Using this function will disable attempts to use themes for this window, if the system supports them. Use with care since usually the themes represent the appearance chosen by the user to be used for all applications on the system. """ return _core_.Window_SetBackgroundColour(*args, **kwargs)
def SetBackgroundStyle(
*args, **kwargs)
SetBackgroundStyle(self, int style) -> bool
Returns the background style of the window. The background style indicates how the background of the window is drawn.
====================== ======================================== wx.BG_STYLE_SYSTEM The background colour or pattern should be determined by the system wx.BG_STYLE_COLOUR The background should be a solid colour wx.BG_STYLE_CUSTOM The background will be implemented by the application. ====================== ========================================
On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of a custom background, such as a tiled bitmap. Currently the style has no effect on other platforms.
:see: GetBackgroundStyle
, SetBackgroundColour
def SetBackgroundStyle(*args, **kwargs): """ SetBackgroundStyle(self, int style) -> bool Returns the background style of the window. The background style indicates how the background of the window is drawn. ====================== ======================================== wx.BG_STYLE_SYSTEM The background colour or pattern should be determined by the system wx.BG_STYLE_COLOUR The background should be a solid colour wx.BG_STYLE_CUSTOM The background will be implemented by the application. ====================== ======================================== On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of a custom background, such as a tiled bitmap. Currently the style has no effect on other platforms. :see: `GetBackgroundStyle`, `SetBackgroundColour` """ return _core_.Window_SetBackgroundStyle(*args, **kwargs)
def SetBestFittingSize(
*args, **kw)
SetInitialSize(self, Size size=DefaultSize)
A 'Smart' SetSize that will fill in default size components with the window's best size values. Also set's the minsize for use with sizers.
def deprecated_func(*args, **kw): warnings.warn("Call to deprecated item. %s" % msg, wxPyDeprecationWarning, stacklevel=2) return item(*args, **kw)
def SetCanFocus(
*args, **kwargs)
SetCanFocus(self, bool canFocus)
def SetCanFocus(*args, **kwargs): """SetCanFocus(self, bool canFocus)""" return _core_.Window_SetCanFocus(*args, **kwargs)
def SetCaret(
*args, **kwargs)
SetCaret(self, Caret caret)
Sets the caret associated with the window.
def SetCaret(*args, **kwargs): """ SetCaret(self, Caret caret) Sets the caret associated with the window. """ return _core_.Window_SetCaret(*args, **kwargs)
def SetClientRect(
*args, **kwargs)
SetClientRect(self, Rect rect)
This sets the size of the window client area in pixels. Using this function to size a window tends to be more device-independent than wx.Window.SetSize, since the application need not worry about what dimensions the border or title bar have when trying to fit the window around panel items, for example.
def SetClientRect(*args, **kwargs): """ SetClientRect(self, Rect rect) This sets the size of the window client area in pixels. Using this function to size a window tends to be more device-independent than wx.Window.SetSize, since the application need not worry about what dimensions the border or title bar have when trying to fit the window around panel items, for example. """ return _core_.Window_SetClientRect(*args, **kwargs)
def SetClientSize(
*args, **kwargs)
SetClientSize(self, Size size)
This sets the size of the window client area in pixels. Using this function to size a window tends to be more device-independent than wx.Window.SetSize, since the application need not worry about what dimensions the border or title bar have when trying to fit the window around panel items, for example.
def SetClientSize(*args, **kwargs): """ SetClientSize(self, Size size) This sets the size of the window client area in pixels. Using this function to size a window tends to be more device-independent than wx.Window.SetSize, since the application need not worry about what dimensions the border or title bar have when trying to fit the window around panel items, for example. """ return _core_.Window_SetClientSize(*args, **kwargs)
def SetClientSizeWH(
*args, **kwargs)
SetClientSizeWH(self, int width, int height)
This sets the size of the window client area in pixels. Using this function to size a window tends to be more device-independent than wx.Window.SetSize, since the application need not worry about what dimensions the border or title bar have when trying to fit the window around panel items, for example.
def SetClientSizeWH(*args, **kwargs): """ SetClientSizeWH(self, int width, int height) This sets the size of the window client area in pixels. Using this function to size a window tends to be more device-independent than wx.Window.SetSize, since the application need not worry about what dimensions the border or title bar have when trying to fit the window around panel items, for example. """ return _core_.Window_SetClientSizeWH(*args, **kwargs)
def SetConstraints(
*args, **kwargs)
SetConstraints(self, LayoutConstraints constraints)
Sets the window to have the given layout constraints. If an existing layout constraints object is already owned by the window, it will be deleted. Pass None to disassociate and delete the window's current constraints.
You must call SetAutoLayout to tell a window to use the constraints automatically in its default EVT_SIZE handler; otherwise, you must handle EVT_SIZE yourself and call Layout() explicitly. When setting both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have effect.
def SetConstraints(*args, **kwargs): """ SetConstraints(self, LayoutConstraints constraints) Sets the window to have the given layout constraints. If an existing layout constraints object is already owned by the window, it will be deleted. Pass None to disassociate and delete the window's current constraints. You must call SetAutoLayout to tell a window to use the constraints automatically in its default EVT_SIZE handler; otherwise, you must handle EVT_SIZE yourself and call Layout() explicitly. When setting both a wx.LayoutConstraints and a wx.Sizer, only the sizer will have effect. """ return _core_.Window_SetConstraints(*args, **kwargs)
def SetContainingSizer(
*args, **kwargs)
SetContainingSizer(self, Sizer sizer)
This normally does not need to be called by application code. It is called internally when a window is added to a sizer, and is used so the window can remove itself from the sizer when it is destroyed.
def SetContainingSizer(*args, **kwargs): """ SetContainingSizer(self, Sizer sizer) This normally does not need to be called by application code. It is called internally when a window is added to a sizer, and is used so the window can remove itself from the sizer when it is destroyed. """ return _core_.Window_SetContainingSizer(*args, **kwargs)
def SetCursor(
*args, **kwargs)
SetCursor(self, Cursor cursor) -> bool
Sets the window's cursor. Notice that the window cursor also sets it for the children of the window implicitly.
The cursor may be wx.NullCursor in which case the window cursor will be reset back to default.
def SetCursor(*args, **kwargs): """ SetCursor(self, Cursor cursor) -> bool Sets the window's cursor. Notice that the window cursor also sets it for the children of the window implicitly. The cursor may be wx.NullCursor in which case the window cursor will be reset back to default. """ return _core_.Window_SetCursor(*args, **kwargs)
def SetDefaultItem(
*args, **kwargs)
SetDefaultItem(self, Window child) -> Window
Set this child as default, return the old default.
def SetDefaultItem(*args, **kwargs): """ SetDefaultItem(self, Window child) -> Window Set this child as default, return the old default. """ return _windows_.TopLevelWindow_SetDefaultItem(*args, **kwargs)
def SetDimensions(
*args, **kwargs)
SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO)
Sets the position and size of the window in pixels. The sizeFlags parameter indicates the interpretation of the other params if they are equal to -1.
======================== ====================================== wx.SIZE_AUTO A -1 indicates that a class-specific default should be used. wx.SIZE_USE_EXISTING Existing dimensions should be used if -1 values are supplied. wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be interpreted as real dimensions, not default values. ======================== ======================================
def SetDimensions(*args, **kwargs): """ SetDimensions(self, int x, int y, int width, int height, int sizeFlags=SIZE_AUTO) Sets the position and size of the window in pixels. The sizeFlags parameter indicates the interpretation of the other params if they are equal to -1. ======================== ====================================== wx.SIZE_AUTO A -1 indicates that a class-specific default should be used. wx.SIZE_USE_EXISTING Existing dimensions should be used if -1 values are supplied. wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be interpreted as real dimensions, not default values. ======================== ====================================== """ return _core_.Window_SetDimensions(*args, **kwargs)
def SetDoubleBuffered(
*args, **kwargs)
SetDoubleBuffered(self, bool on)
Put the native window into double buffered or composited mode.
def SetDoubleBuffered(*args, **kwargs): """ SetDoubleBuffered(self, bool on) Put the native window into double buffered or composited mode. """ return _core_.Window_SetDoubleBuffered(*args, **kwargs)
def SetDropTarget(
*args, **kwargs)
SetDropTarget(self, DropTarget dropTarget)
Associates a drop target with this window. If the window already has a drop target, it is deleted.
def SetDropTarget(*args, **kwargs): """ SetDropTarget(self, DropTarget dropTarget) Associates a drop target with this window. If the window already has a drop target, it is deleted. """ return _core_.Window_SetDropTarget(*args, **kwargs)
def SetEventHandler(
*args, **kwargs)
SetEventHandler(self, EvtHandler handler)
Sets the event handler for this window. An event handler is an object that is capable of processing the events sent to a window. (In other words, is able to dispatch the events to handler function.) By default, the window is its own event handler, but an application may wish to substitute another, for example to allow central implementation of event-handling for a variety of different window classes.
It is usually better to use wx.Window.PushEventHandler
since this sets
up a chain of event handlers, where an event not handled by one event
handler is handed off to the next one in the chain.
def SetEventHandler(*args, **kwargs): """ SetEventHandler(self, EvtHandler handler) Sets the event handler for this window. An event handler is an object that is capable of processing the events sent to a window. (In other words, is able to dispatch the events to handler function.) By default, the window is its own event handler, but an application may wish to substitute another, for example to allow central implementation of event-handling for a variety of different window classes. It is usually better to use `wx.Window.PushEventHandler` since this sets up a chain of event handlers, where an event not handled by one event handler is handed off to the next one in the chain. """ return _core_.Window_SetEventHandler(*args, **kwargs)
def SetEvtHandlerEnabled(
*args, **kwargs)
SetEvtHandlerEnabled(self, bool enabled)
def SetEvtHandlerEnabled(*args, **kwargs): """SetEvtHandlerEnabled(self, bool enabled)""" return _core_.EvtHandler_SetEvtHandlerEnabled(*args, **kwargs)
def SetExtraStyle(
*args, **kwargs)
SetExtraStyle(self, long exStyle)
Sets the extra style bits for the window. Extra styles are the less often used style bits which can't be set with the constructor or with SetWindowStyleFlag()
def SetExtraStyle(*args, **kwargs): """ SetExtraStyle(self, long exStyle) Sets the extra style bits for the window. Extra styles are the less often used style bits which can't be set with the constructor or with SetWindowStyleFlag() """ return _core_.Window_SetExtraStyle(*args, **kwargs)
def SetFocus(
*args, **kwargs)
SetFocus(self)
Set's the focus to this window, allowing it to receive keyboard input.
def SetFocus(*args, **kwargs): """ SetFocus(self) Set's the focus to this window, allowing it to receive keyboard input. """ return _core_.Window_SetFocus(*args, **kwargs)
def SetFocusFromKbd(
*args, **kwargs)
SetFocusFromKbd(self)
Set focus to this window as the result of a keyboard action. Normally only called internally.
def SetFocusFromKbd(*args, **kwargs): """ SetFocusFromKbd(self) Set focus to this window as the result of a keyboard action. Normally only called internally. """ return _core_.Window_SetFocusFromKbd(*args, **kwargs)
def SetFont(
*args, **kwargs)
SetFont(self, Font font) -> bool
Sets the font for this window.
def SetFont(*args, **kwargs): """ SetFont(self, Font font) -> bool Sets the font for this window. """ return _core_.Window_SetFont(*args, **kwargs)
def SetForegroundColour(
*args, **kwargs)
SetForegroundColour(self, Colour colour) -> bool
Sets the foreground colour of the window. Returns True is the colour was changed. The interpretation of foreground colour is dependent on the window class; it may be the text colour or other colour, or it may not be used at all.
def SetForegroundColour(*args, **kwargs): """ SetForegroundColour(self, Colour colour) -> bool Sets the foreground colour of the window. Returns True is the colour was changed. The interpretation of foreground colour is dependent on the window class; it may be the text colour or other colour, or it may not be used at all. """ return _core_.Window_SetForegroundColour(*args, **kwargs)
def SetHelpText(
*args, **kwargs)
SetHelpText(self, String text)
Sets the help text to be used as context-sensitive help for this
window. Note that the text is actually stored by the current
wx.HelpProvider
implementation, and not in the window object itself.
def SetHelpText(*args, **kwargs): """ SetHelpText(self, String text) Sets the help text to be used as context-sensitive help for this window. Note that the text is actually stored by the current `wx.HelpProvider` implementation, and not in the window object itself. """ return _core_.Window_SetHelpText(*args, **kwargs)
def SetHelpTextForId(
*args, **kw)
SetHelpTextForId(self, String text)
Associate this help text with all windows with the same id as this one.
def deprecated_func(*args, **kw): warnings.warn("Call to deprecated item. %s" % msg, wxPyDeprecationWarning, stacklevel=2) return item(*args, **kw)
def SetIcon(
*args, **kwargs)
SetIcon(self, Icon icon)
def SetIcon(*args, **kwargs): """SetIcon(self, Icon icon)""" return _windows_.TopLevelWindow_SetIcon(*args, **kwargs)
def SetIcons(
*args, **kwargs)
SetIcons(self, wxIconBundle icons)
def SetIcons(*args, **kwargs): """SetIcons(self, wxIconBundle icons)""" return _windows_.TopLevelWindow_SetIcons(*args, **kwargs)
def SetId(
*args, **kwargs)
SetId(self, int winid)
Sets the identifier of the window. Each window has an integer identifier. If the application has not provided one, an identifier will be generated. Normally, the identifier should be provided on creation and should not be modified subsequently.
def SetId(*args, **kwargs): """ SetId(self, int winid) Sets the identifier of the window. Each window has an integer identifier. If the application has not provided one, an identifier will be generated. Normally, the identifier should be provided on creation and should not be modified subsequently. """ return _core_.Window_SetId(*args, **kwargs)
def SetInitialSize(
*args, **kwargs)
SetInitialSize(self, Size size=DefaultSize)
A 'Smart' SetSize that will fill in default size components with the window's best size values. Also set's the minsize for use with sizers.
def SetInitialSize(*args, **kwargs): """ SetInitialSize(self, Size size=DefaultSize) A 'Smart' SetSize that will fill in default size components with the window's *best size* values. Also set's the minsize for use with sizers. """ return _core_.Window_SetInitialSize(*args, **kwargs)
def SetLabel(
*args, **kwargs)
SetLabel(self, String label)
Set the text which the window shows in its label if applicable.
def SetLabel(*args, **kwargs): """ SetLabel(self, String label) Set the text which the window shows in its label if applicable. """ return _core_.Window_SetLabel(*args, **kwargs)
def SetLayoutDirection(
*args, **kwargs)
SetLayoutDirection(self, int dir)
Set the layout direction (LTR or RTL) for this window.
def SetLayoutDirection(*args, **kwargs): """ SetLayoutDirection(self, int dir) Set the layout direction (LTR or RTL) for this window. """ return _core_.Window_SetLayoutDirection(*args, **kwargs)
def SetMaxClientSize(
*args, **kwargs)
SetMaxClientSize(self, Size size)
def SetMaxClientSize(*args, **kwargs): """SetMaxClientSize(self, Size size)""" return _core_.Window_SetMaxClientSize(*args, **kwargs)
def SetMaxSize(
*args, **kwargs)
SetMaxSize(self, Size maxSize)
A more convenient method than SetSizeHints
for setting just the
max size.
def SetMaxSize(*args, **kwargs): """ SetMaxSize(self, Size maxSize) A more convenient method than `SetSizeHints` for setting just the max size. """ return _core_.Window_SetMaxSize(*args, **kwargs)
def SetMenuBar(
*args, **kwargs)
SetMenuBar(self, MenuBar menubar)
def SetMenuBar(*args, **kwargs): """SetMenuBar(self, MenuBar menubar)""" return _windows_.Frame_SetMenuBar(*args, **kwargs)
def SetMinClientSize(
*args, **kwargs)
SetMinClientSize(self, Size size)
def SetMinClientSize(*args, **kwargs): """SetMinClientSize(self, Size size)""" return _core_.Window_SetMinClientSize(*args, **kwargs)
def SetMinSize(
*args, **kwargs)
SetMinSize(self, Size minSize)
A more convenient method than SetSizeHints
for setting just the
min size.
def SetMinSize(*args, **kwargs): """ SetMinSize(self, Size minSize) A more convenient method than `SetSizeHints` for setting just the min size. """ return _core_.Window_SetMinSize(*args, **kwargs)
def SetName(
*args, **kwargs)
SetName(self, String name)
Sets the window's name. The window name is used for ressource setting in X, it is not the same as the window title/label
def SetName(*args, **kwargs): """ SetName(self, String name) Sets the window's name. The window name is used for ressource setting in X, it is not the same as the window title/label """ return _core_.Window_SetName(*args, **kwargs)
def SetNextHandler(
*args, **kwargs)
SetNextHandler(self, EvtHandler handler)
def SetNextHandler(*args, **kwargs): """SetNextHandler(self, EvtHandler handler)""" return _core_.EvtHandler_SetNextHandler(*args, **kwargs)
def SetOwnBackgroundColour(
*args, **kwargs)
SetOwnBackgroundColour(self, Colour colour)
def SetOwnBackgroundColour(*args, **kwargs): """SetOwnBackgroundColour(self, Colour colour)""" return _core_.Window_SetOwnBackgroundColour(*args, **kwargs)
def SetOwnFont(
*args, **kwargs)
SetOwnFont(self, Font font)
def SetOwnFont(*args, **kwargs): """SetOwnFont(self, Font font)""" return _core_.Window_SetOwnFont(*args, **kwargs)
def SetOwnForegroundColour(
*args, **kwargs)
SetOwnForegroundColour(self, Colour colour)
def SetOwnForegroundColour(*args, **kwargs): """SetOwnForegroundColour(self, Colour colour)""" return _core_.Window_SetOwnForegroundColour(*args, **kwargs)
def SetPosition(
*args, **kwargs)
Move(self, Point pt, int flags=SIZE_USE_EXISTING)
Moves the window to the given position.
def Move(*args, **kwargs): """ Move(self, Point pt, int flags=SIZE_USE_EXISTING) Moves the window to the given position. """ return _core_.Window_Move(*args, **kwargs)
def SetPreviousHandler(
*args, **kwargs)
SetPreviousHandler(self, EvtHandler handler)
def SetPreviousHandler(*args, **kwargs): """SetPreviousHandler(self, EvtHandler handler)""" return _core_.EvtHandler_SetPreviousHandler(*args, **kwargs)
def SetRect(
*args, **kwargs)
SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)
Sets the position and size of the window in pixels using a wx.Rect.
def SetRect(*args, **kwargs): """ SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO) Sets the position and size of the window in pixels using a wx.Rect. """ return _core_.Window_SetRect(*args, **kwargs)
def SetRepresentedFilename(
*args, **kwargs)
SetRepresentedFilename(self, String filename)
def SetRepresentedFilename(*args, **kwargs): """SetRepresentedFilename(self, String filename)""" return _windows_.TopLevelWindow_SetRepresentedFilename(*args, **kwargs)
def SetScrollPos(
*args, **kwargs)
SetScrollPos(self, int orientation, int pos, bool refresh=True)
Sets the position of one of the built-in scrollbars.
def SetScrollPos(*args, **kwargs): """ SetScrollPos(self, int orientation, int pos, bool refresh=True) Sets the position of one of the built-in scrollbars. """ return _core_.Window_SetScrollPos(*args, **kwargs)
def SetScrollbar(
*args, **kwargs)
SetScrollbar(self, int orientation, int position, int thumbSize, int range, bool refresh=True)
Sets the scrollbar properties of a built-in scrollbar.
def SetScrollbar(*args, **kwargs): """ SetScrollbar(self, int orientation, int position, int thumbSize, int range, bool refresh=True) Sets the scrollbar properties of a built-in scrollbar. """ return _core_.Window_SetScrollbar(*args, **kwargs)
def SetShape(
*args, **kwargs)
SetShape(self, Region region) -> bool
def SetShape(*args, **kwargs): """SetShape(self, Region region) -> bool""" return _windows_.TopLevelWindow_SetShape(*args, **kwargs)
def SetSize(
*args, **kwargs)
SetSize(self, Size size)
Sets the size of the window in pixels.
def SetSize(*args, **kwargs): """ SetSize(self, Size size) Sets the size of the window in pixels. """ return _core_.Window_SetSize(*args, **kwargs)
def SetSizeHints(
*args, **kwargs)
SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1, int incH=-1)
Allows specification of minimum and maximum window sizes, and window size increments. If a pair of values is not set (or set to -1), the default values will be used. If this function is called, the user will not be able to size the window outside the given bounds (if it is a top-level window.) Sizers will also inspect the minimum window size and will use that value if set when calculating layout.
The resizing increments are only significant under Motif or Xt.
def SetSizeHints(*args, **kwargs): """ SetSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1, int incW=-1, int incH=-1) Allows specification of minimum and maximum window sizes, and window size increments. If a pair of values is not set (or set to -1), the default values will be used. If this function is called, the user will not be able to size the window outside the given bounds (if it is a top-level window.) Sizers will also inspect the minimum window size and will use that value if set when calculating layout. The resizing increments are only significant under Motif or Xt. """ return _core_.Window_SetSizeHints(*args, **kwargs)
def SetSizeHintsSz(
*args, **kwargs)
SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize)
Allows specification of minimum and maximum window sizes, and window size increments. If a pair of values is not set (or set to -1), the default values will be used. If this function is called, the user will not be able to size the window outside the given bounds (if it is a top-level window.) Sizers will also inspect the minimum window size and will use that value if set when calculating layout.
The resizing increments are only significant under Motif or Xt.
def SetSizeHintsSz(*args, **kwargs): """ SetSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize, Size incSize=DefaultSize) Allows specification of minimum and maximum window sizes, and window size increments. If a pair of values is not set (or set to -1), the default values will be used. If this function is called, the user will not be able to size the window outside the given bounds (if it is a top-level window.) Sizers will also inspect the minimum window size and will use that value if set when calculating layout. The resizing increments are only significant under Motif or Xt. """ return _core_.Window_SetSizeHintsSz(*args, **kwargs)
def SetSizeWH(
*args, **kwargs)
SetSizeWH(self, int width, int height)
Sets the size of the window in pixels.
def SetSizeWH(*args, **kwargs): """ SetSizeWH(self, int width, int height) Sets the size of the window in pixels. """ return _core_.Window_SetSizeWH(*args, **kwargs)
def SetSizer(
*args, **kwargs)
SetSizer(self, Sizer sizer, bool deleteOld=True)
Sets the window to have the given layout sizer. The window will then own the object, and will take care of its deletion. If an existing layout sizer object is already owned by the window, it will be deleted if the deleteOld parameter is true. Note that this function will also call SetAutoLayout implicitly with a True parameter if the sizer is non-None, and False otherwise.
def SetSizer(*args, **kwargs): """ SetSizer(self, Sizer sizer, bool deleteOld=True) Sets the window to have the given layout sizer. The window will then own the object, and will take care of its deletion. If an existing layout sizer object is already owned by the window, it will be deleted if the deleteOld parameter is true. Note that this function will also call SetAutoLayout implicitly with a True parameter if the sizer is non-None, and False otherwise. """ return _core_.Window_SetSizer(*args, **kwargs)
def SetSizerAndFit(
*args, **kwargs)
SetSizerAndFit(self, Sizer sizer, bool deleteOld=True)
The same as SetSizer, except it also sets the size hints for the window based on the sizer's minimum size.
def SetSizerAndFit(*args, **kwargs): """ SetSizerAndFit(self, Sizer sizer, bool deleteOld=True) The same as SetSizer, except it also sets the size hints for the window based on the sizer's minimum size. """ return _core_.Window_SetSizerAndFit(*args, **kwargs)
def SetStatusBar(
*args, **kwargs)
SetStatusBar(self, StatusBar statBar)
def SetStatusBar(*args, **kwargs): """SetStatusBar(self, StatusBar statBar)""" return _windows_.Frame_SetStatusBar(*args, **kwargs)
def SetStatusBarPane(
*args, **kwargs)
SetStatusBarPane(self, int n)
def SetStatusBarPane(*args, **kwargs): """SetStatusBarPane(self, int n)""" return _windows_.Frame_SetStatusBarPane(*args, **kwargs)
def SetStatusText(
*args, **kwargs)
SetStatusText(self, String text, int number=0)
def SetStatusText(*args, **kwargs): """SetStatusText(self, String text, int number=0)""" return _windows_.Frame_SetStatusText(*args, **kwargs)
def SetStatusWidths(
*args, **kwargs)
SetStatusWidths(self, int widths)
def SetStatusWidths(*args, **kwargs): """SetStatusWidths(self, int widths)""" return _windows_.Frame_SetStatusWidths(*args, **kwargs)
def SetThemeEnabled(
*args, **kwargs)
SetThemeEnabled(self, bool enableTheme)
This function tells a window if it should use the system's "theme" code to draw the windows' background instead if its own background drawing code. This will only have an effect on platforms that support the notion of themes in user defined windows. One such platform is GTK+ where windows can have (very colourful) backgrounds defined by a user's selected theme.
Dialogs, notebook pages and the status bar have this flag set to true by default so that the default look and feel is simulated best.
def SetThemeEnabled(*args, **kwargs): """ SetThemeEnabled(self, bool enableTheme) This function tells a window if it should use the system's "theme" code to draw the windows' background instead if its own background drawing code. This will only have an effect on platforms that support the notion of themes in user defined windows. One such platform is GTK+ where windows can have (very colourful) backgrounds defined by a user's selected theme. Dialogs, notebook pages and the status bar have this flag set to true by default so that the default look and feel is simulated best. """ return _core_.Window_SetThemeEnabled(*args, **kwargs)
def SetTitle(
*args, **kwargs)
SetTitle(self, String title)
def SetTitle(*args, **kwargs): """SetTitle(self, String title)""" return _windows_.TopLevelWindow_SetTitle(*args, **kwargs)
def SetTmpDefaultItem(
*args, **kwargs)
SetTmpDefaultItem(self, Window win)
Set this child as temporary default
def SetTmpDefaultItem(*args, **kwargs): """ SetTmpDefaultItem(self, Window win) Set this child as temporary default """ return _windows_.TopLevelWindow_SetTmpDefaultItem(*args, **kwargs)
def SetToolBar(
*args, **kwargs)
SetToolBar(self, wxToolBar toolbar)
def SetToolBar(*args, **kwargs): """SetToolBar(self, wxToolBar toolbar)""" return _windows_.Frame_SetToolBar(*args, **kwargs)
def SetToolTip(
*args, **kwargs)
SetToolTip(self, ToolTip tip)
Attach a tooltip to the window.
def SetToolTip(*args, **kwargs): """ SetToolTip(self, ToolTip tip) Attach a tooltip to the window. """ return _core_.Window_SetToolTip(*args, **kwargs)
def SetToolTipString(
*args, **kwargs)
SetToolTipString(self, String tip)
Attach a tooltip to the window.
def SetToolTipString(*args, **kwargs): """ SetToolTipString(self, String tip) Attach a tooltip to the window. """ return _core_.Window_SetToolTipString(*args, **kwargs)
def SetTransparent(
*args, **kwargs)
SetTransparent(self, byte alpha) -> bool
Attempt to set the transparency of this window to the alpha
value,
returns True on success. The alpha
value is an integer in the
range of 0 to 255, where 0 is fully transparent and 255 is fully
opaque.
def SetTransparent(*args, **kwargs): """ SetTransparent(self, byte alpha) -> bool Attempt to set the transparency of this window to the ``alpha`` value, returns True on success. The ``alpha`` value is an integer in the range of 0 to 255, where 0 is fully transparent and 255 is fully opaque. """ return _core_.Window_SetTransparent(*args, **kwargs)
def SetValidator(
*args, **kwargs)
SetValidator(self, Validator validator)
Deletes the current validator (if any) and sets the window validator, having called wx.Validator.Clone to create a new validator of this type.
def SetValidator(*args, **kwargs): """ SetValidator(self, Validator validator) Deletes the current validator (if any) and sets the window validator, having called wx.Validator.Clone to create a new validator of this type. """ return _core_.Window_SetValidator(*args, **kwargs)
def SetVirtualSize(
*args, **kwargs)
SetVirtualSize(self, Size size)
Set the the virtual size of a window in pixels. For most windows this is just the client area of the window, but for some like scrolled windows it is more or less independent of the screen window size.
def SetVirtualSize(*args, **kwargs): """ SetVirtualSize(self, Size size) Set the the virtual size of a window in pixels. For most windows this is just the client area of the window, but for some like scrolled windows it is more or less independent of the screen window size. """ return _core_.Window_SetVirtualSize(*args, **kwargs)
def SetVirtualSizeHints(
*args, **kw)
SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)
def deprecated_func(*args, **kw): warnings.warn("Call to deprecated item. %s" % msg, wxPyDeprecationWarning, stacklevel=2) return item(*args, **kw)
def SetVirtualSizeHintsSz(
*args, **kw)
SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)
def deprecated_func(*args, **kw): warnings.warn("Call to deprecated item. %s" % msg, wxPyDeprecationWarning, stacklevel=2) return item(*args, **kw)
def SetVirtualSizeWH(
*args, **kwargs)
SetVirtualSizeWH(self, int w, int h)
Set the the virtual size of a window in pixels. For most windows this is just the client area of the window, but for some like scrolled windows it is more or less independent of the screen window size.
def SetVirtualSizeWH(*args, **kwargs): """ SetVirtualSizeWH(self, int w, int h) Set the the virtual size of a window in pixels. For most windows this is just the client area of the window, but for some like scrolled windows it is more or less independent of the screen window size. """ return _core_.Window_SetVirtualSizeWH(*args, **kwargs)
def SetWindowStyle(
*args, **kwargs)
SetWindowStyleFlag(self, long style)
Sets the style of the window. Please note that some styles cannot be changed after the window creation and that Refresh() might need to be called after changing the others for the change to take place immediately.
def SetWindowStyleFlag(*args, **kwargs): """ SetWindowStyleFlag(self, long style) Sets the style of the window. Please note that some styles cannot be changed after the window creation and that Refresh() might need to be called after changing the others for the change to take place immediately. """ return _core_.Window_SetWindowStyleFlag(*args, **kwargs)
def SetWindowStyleFlag(
*args, **kwargs)
SetWindowStyleFlag(self, long style)
Sets the style of the window. Please note that some styles cannot be changed after the window creation and that Refresh() might need to be called after changing the others for the change to take place immediately.
def SetWindowStyleFlag(*args, **kwargs): """ SetWindowStyleFlag(self, long style) Sets the style of the window. Please note that some styles cannot be changed after the window creation and that Refresh() might need to be called after changing the others for the change to take place immediately. """ return _core_.Window_SetWindowStyleFlag(*args, **kwargs)
def SetWindowVariant(
*args, **kwargs)
SetWindowVariant(self, int variant)
Sets the variant of the window/font size to use for this window, if the platform supports variants, for example, wxMac.
def SetWindowVariant(*args, **kwargs): """ SetWindowVariant(self, int variant) Sets the variant of the window/font size to use for this window, if the platform supports variants, for example, wxMac. """ return _core_.Window_SetWindowVariant(*args, **kwargs)
def ShouldInheritColours(
*args, **kwargs)
ShouldInheritColours(self) -> bool
Return true from here to allow the colours of this window to be changed by InheritAttributes, returning false forbids inheriting them from the parent window.
The base class version returns false, but this method is overridden in wxControl where it returns true.
def ShouldInheritColours(*args, **kwargs): """ ShouldInheritColours(self) -> bool Return true from here to allow the colours of this window to be changed by InheritAttributes, returning false forbids inheriting them from the parent window. The base class version returns false, but this method is overridden in wxControl where it returns true. """ return _core_.Window_ShouldInheritColours(*args, **kwargs)
def Show(
*args, **kwargs)
Show(self, bool show=True) -> bool
Shows or hides the window. You may need to call Raise for a top level window if you want to bring it to top, although this is not needed if Show is called immediately after the frame creation. Returns True if the window has been shown or hidden or False if nothing was done because it already was in the requested state.
def Show(*args, **kwargs): """ Show(self, bool show=True) -> bool Shows or hides the window. You may need to call Raise for a top level window if you want to bring it to top, although this is not needed if Show is called immediately after the frame creation. Returns True if the window has been shown or hidden or False if nothing was done because it already was in the requested state. """ return _core_.Window_Show(*args, **kwargs)
def ShowFullScreen(
*args, **kwargs)
ShowFullScreen(self, bool show, long style=FULLSCREEN_ALL) -> bool
def ShowFullScreen(*args, **kwargs): """ShowFullScreen(self, bool show, long style=FULLSCREEN_ALL) -> bool""" return _windows_.TopLevelWindow_ShowFullScreen(*args, **kwargs)
def ShowWithEffect(
*args, **kwargs)
ShowWithEffect(self, int effect, unsigned int timeout=0) -> bool
Show the window with a special effect, not implemented on most platforms (where it is the same as Show())
Timeout specifies how long the animation should take, in ms, the default value of 0 means to use the default (system-dependent) value.
def ShowWithEffect(*args, **kwargs): """ ShowWithEffect(self, int effect, unsigned int timeout=0) -> bool Show the window with a special effect, not implemented on most platforms (where it is the same as Show()) Timeout specifies how long the animation should take, in ms, the default value of 0 means to use the default (system-dependent) value. """ return _core_.Window_ShowWithEffect(*args, **kwargs)
def ShowWithoutActivating(
*args, **kwargs)
ShowWithoutActivating(self)
def ShowWithoutActivating(*args, **kwargs): """ShowWithoutActivating(self)""" return _windows_.TopLevelWindow_ShowWithoutActivating(*args, **kwargs)
def Thaw(
*args, **kwargs)
Thaw(self)
Reenables window updating after a previous call to Freeze. Calls to Freeze/Thaw may be nested, so Thaw must be called the same number of times that Freeze was before the window will be updated.
def Thaw(*args, **kwargs): """ Thaw(self) Reenables window updating after a previous call to Freeze. Calls to Freeze/Thaw may be nested, so Thaw must be called the same number of times that Freeze was before the window will be updated. """ return _core_.Window_Thaw(*args, **kwargs)
def ToggleWindowStyle(
*args, **kwargs)
ToggleWindowStyle(self, int flag) -> bool
Turn the flag on if it had been turned off before and vice versa, returns True if the flag is turned on by this function call.
def ToggleWindowStyle(*args, **kwargs): """ ToggleWindowStyle(self, int flag) -> bool Turn the flag on if it had been turned off before and vice versa, returns True if the flag is turned on by this function call. """ return _core_.Window_ToggleWindowStyle(*args, **kwargs)
def TransferDataFromWindow(
*args, **kwargs)
TransferDataFromWindow(self) -> bool
Transfers values from child controls to data areas specified by their validators. Returns false if a transfer failed. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will also call TransferDataFromWindow() of all child windows.
def TransferDataFromWindow(*args, **kwargs): """ TransferDataFromWindow(self) -> bool Transfers values from child controls to data areas specified by their validators. Returns false if a transfer failed. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will also call TransferDataFromWindow() of all child windows. """ return _core_.Window_TransferDataFromWindow(*args, **kwargs)
def TransferDataToWindow(
*args, **kwargs)
TransferDataToWindow(self) -> bool
Transfers values to child controls from data areas specified by their validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will also call TransferDataToWindow() of all child windows.
def TransferDataToWindow(*args, **kwargs): """ TransferDataToWindow(self) -> bool Transfers values to child controls from data areas specified by their validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will also call TransferDataToWindow() of all child windows. """ return _core_.Window_TransferDataToWindow(*args, **kwargs)
def Unbind(
self, event, source=None, id=-1, id2=-1, handler=None)
Disconnects the event handler binding for event from self. Returns True if successful.
def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY, handler=None): """ Disconnects the event handler binding for event from self. Returns True if successful. """ if source is not None: id = source.GetId() return event.Unbind(self, id, id2, handler)
def Unlink(
*args, **kwargs)
Unlink(self)
def Unlink(*args, **kwargs): """Unlink(self)""" return _core_.EvtHandler_Unlink(*args, **kwargs)
def UnregisterHotKey(
*args, **kwargs)
UnregisterHotKey(self, int hotkeyId) -> bool
Unregisters a system wide hotkey.
def UnregisterHotKey(*args, **kwargs): """ UnregisterHotKey(self, int hotkeyId) -> bool Unregisters a system wide hotkey. """ return _core_.Window_UnregisterHotKey(*args, **kwargs)
def UnsetToolTip(
*args, **kwargs)
UnsetToolTip(self)
def UnsetToolTip(*args, **kwargs): """UnsetToolTip(self)""" return _core_.Window_UnsetToolTip(*args, **kwargs)
def Update(
*args, **kwargs)
Update(self)
Calling this method immediately repaints the invalidated area of the
window instead of waiting for the EVT_PAINT event to happen, (normally
this would usually only happen when the flow of control returns to the
event loop.) Notice that this function doesn't refresh the window and
does nothing if the window has been already repainted. Use Refresh
first if you want to immediately redraw the window (or some portion of
it) unconditionally.
def Update(*args, **kwargs): """ Update(self) Calling this method immediately repaints the invalidated area of the window instead of waiting for the EVT_PAINT event to happen, (normally this would usually only happen when the flow of control returns to the event loop.) Notice that this function doesn't refresh the window and does nothing if the window has been already repainted. Use `Refresh` first if you want to immediately redraw the window (or some portion of it) unconditionally. """ return _core_.Window_Update(*args, **kwargs)
def UpdateWindowUI(
*args, **kwargs)
UpdateWindowUI(self, long flags=UPDATE_UI_NONE)
This function sends EVT_UPDATE_UI events to the window. The particular
implementation depends on the window; for example a wx.ToolBar will
send an update UI event for each toolbar button, and a wx.Frame will
send an update UI event for each menubar menu item. You can call this
function from your application to ensure that your UI is up-to-date at
a particular point in time (as far as your EVT_UPDATE_UI handlers are
concerned). This may be necessary if you have called
wx.UpdateUIEvent.SetMode
or wx.UpdateUIEvent.SetUpdateInterval
to
limit the overhead that wxWindows incurs by sending update UI events
in idle time.
def UpdateWindowUI(*args, **kwargs): """ UpdateWindowUI(self, long flags=UPDATE_UI_NONE) This function sends EVT_UPDATE_UI events to the window. The particular implementation depends on the window; for example a wx.ToolBar will send an update UI event for each toolbar button, and a wx.Frame will send an update UI event for each menubar menu item. You can call this function from your application to ensure that your UI is up-to-date at a particular point in time (as far as your EVT_UPDATE_UI handlers are concerned). This may be necessary if you have called `wx.UpdateUIEvent.SetMode` or `wx.UpdateUIEvent.SetUpdateInterval` to limit the overhead that wxWindows incurs by sending update UI events in idle time. """ return _core_.Window_UpdateWindowUI(*args, **kwargs)
def UseBgCol(
*args, **kwargs)
UseBgCol(self) -> bool
def UseBgCol(*args, **kwargs): """UseBgCol(self) -> bool""" return _core_.Window_UseBgCol(*args, **kwargs)
def Validate(
*args, **kwargs)
Validate(self) -> bool
Validates the current values of the child controls using their validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will also call Validate() of all child windows. Returns false if any of the validations failed.
def Validate(*args, **kwargs): """ Validate(self) -> bool Validates the current values of the child controls using their validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the method will also call Validate() of all child windows. Returns false if any of the validations failed. """ return _core_.Window_Validate(*args, **kwargs)
def WarpPointer(
*args, **kwargs)
WarpPointer(self, int x, int y)
Moves the pointer to the given position on the window.
NOTE: This function is not supported under Mac because Apple Human Interface Guidelines forbid moving the mouse cursor programmatically.
def WarpPointer(*args, **kwargs): """ WarpPointer(self, int x, int y) Moves the pointer to the given position on the window. NOTE: This function is not supported under Mac because Apple Human Interface Guidelines forbid moving the mouse cursor programmatically. """ return _core_.Window_WarpPointer(*args, **kwargs)
def WindowToClientSize(
*args, **kwargs)
WindowToClientSize(self, Size size) -> Size
Converts window size size
to corresponding client area size. In
other words, the returned value is what GetClientSize
would return
if this window had given window size. Components with
wxDefaultCoord
(-1) value are left unchanged.
Note that the conversion is not always exact, it assumes that non-client area doesn't change and so doesn't take into account things like menu bar (un)wrapping or (dis)appearance of the scrollbars.
def WindowToClientSize(*args, **kwargs): """ WindowToClientSize(self, Size size) -> Size Converts window size ``size`` to corresponding client area size. In other words, the returned value is what `GetClientSize` would return if this window had given window size. Components with ``wxDefaultCoord`` (-1) value are left unchanged. Note that the conversion is not always exact, it assumes that non-client area doesn't change and so doesn't take into account things like menu bar (un)wrapping or (dis)appearance of the scrollbars. """ return _core_.Window_WindowToClientSize(*args, **kwargs)
def add_notebook_page(
self)
Adds a page to the InterfaceNotebook
def add_notebook_page(self): """ Adds a page to the InterfaceNotebook""" pass
def execute_script(
self, event)
def execute_script(self,event): #print(self.event_handlers) #print(event.Id) return self.event_handlers[event.Id]()
def import_scripts(
self, file_name)
Loads a module given a path and returns a dictionary of things recognized as scripts
def import_scripts(self,file_name): "Loads a module given a path and returns a dictionary of things recognized as scripts""" #added file path to sys.path output={} scripts=[] module_directory=os.path.split(file_name)[0] module_name=os.path.split(file_name)[1].replace('.py','') sys.path.append(module_directory) exec('import {0}'.format(module_name)) attributes=eval('dir({0})'.format(module_name)) for item in attributes: if re.search('test_|_robot|_script',item,re.IGNORECASE): scripts.append(item) output[item]=eval('{0}.{1}'.format(module_name,item)) output['module']=module_name output['scripts']=scripts return output
Creates the Add Panels Menu
def swap_panel(
self, old_panel, new_panel, sizer)
Swaps a panel and places the new one in the sizer
def swap_panel(self,old_panel,new_panel,sizer): "Swaps a panel and places the new one in the sizer" new_panel.SetPosition(old_panel.Position) new_panel.SetSize(old_panel.Size) old_panel.Show(False) sizer.Replace(old_panel,new_panel) new_panel.Show(True) self.current_right_control_panel=new_panel self.Update()
def update_display(
self, event=None)
Updates the display
def update_display(self,event=None): "Updates the display" if self.LowerInterface.GetCurrentPage() is self.LogsPanel: self.Display.ie.Navigate(self.LogsPanel.current_log.path) else: self.Display.Refresh()
Module variables
var FRONTENDS_DIRECTORY
var IMAGE_DIRECTORY
var JAVASCRIPT_STRING
var KEITHLEY_INSTRUMENT_SHEET
var LOGS_DIRECTORY
var PANELS
var PYMEASURE_ROOT
var StringTypes
var TESTS_DIRECTORY
var overview
var pi
var sin
var wxID_BASICINTERFACEFRAME
var wxID_BASICINTERFACEFRAMEARBDBPANEL
var wxID_BASICINTERFACEFRAMEBUTTON1
var wxID_BASICINTERFACEFRAMEBUTTON2
var wxID_BASICINTERFACEFRAMEBUTTON3
var wxID_BASICINTERFACEFRAMEDISPLAY
var wxID_BASICINTERFACEFRAMEENDOFTHEDAYBUTTON
var wxID_BASICINTERFACEFRAMEEXECUTEBUTTON
var wxID_BASICINTERFACEFRAMEFILEMENUNEW
var wxID_BASICINTERFACEFRAMEFILEMENUOPEN
var wxID_BASICINTERFACEFRAMEINSTRUMENTSBUTTON
var wxID_BASICINTERFACEFRAMEINTERFACESTATUSBAR
var wxID_BASICINTERFACEFRAMEINTERFACETOOLBAR
var wxID_BASICINTERFACEFRAMEINTERFACETOOLBARLAUNCHBOA
var wxID_BASICINTERFACEFRAMEINTERFACETOOLBARSAGE
var wxID_BASICINTERFACEFRAMELEFTINTERFACEPANEL
var wxID_BASICINTERFACEFRAMELOGSPANEL
var wxID_BASICINTERFACEFRAMELOWERCONTROLPANEL
var wxID_BASICINTERFACEFRAMELOWERINTERFACE
var wxID_BASICINTERFACEFRAMELOWERINTERFACEPANEL
var wxID_BASICINTERFACEFRAMEMAINPANEL
var wxID_BASICINTERFACEFRAMEPANEL1
var wxID_BASICINTERFACEFRAMEPLOTPANEL
var wxID_BASICINTERFACEFRAMEREPLACERIGHTCONTROLBUTTTON
var wxID_BASICINTERFACEFRAMERIGHTCONTROLPANEL
var wxID_BASICINTERFACEFRAMESHELL
var wxID_BASICINTERFACEFRAMESTATESBUTTON
var wxID_BASICINTERFACEFRAMETOOLMENULOADSCRIPTS
var wxID_BASICINTERFACEFRAMETOOLMENURUN_PYTHON
var wxID_BASICINTERFACEFRAMEUPPERINTERFACE
var wxID_BASICINTERFACEFRAMEUPPERINTERFACEPANEL
var wxID_BASICINTERFACEFRAMEVISADIALOGBUTTON
var wxID_CONTROL_PANEL
var wxID_EndOfDayDialog
var wxID_EndOfDayDialogCLEAR_FILE
var wxID_EndOfDayDialogDATA_FLAG
var wxID_EndOfDayDialogFILE_CHOOSER
var wxID_EndOfDayDialogFILE_CHOOSER2
var wxID_EndOfDayDialogFILE_DISP
var wxID_EndOfDayDialogFILE_DISP2
var wxID_EndOfDayDialogQUEST1
var wxID_EndOfDayDialogQUEST2
var wxID_EndOfDayDialogQUEST3
var wxID_EndOfDayDialogQUEST4
var wxID_EndOfDayDialogQUEST5
var wxID_EndOfDayDialogQUEST6
var wxID_EndOfDayDialogRESP1
var wxID_EndOfDayDialogRESP2
var wxID_EndOfDayDialogRESP3
var wxID_EndOfDayDialogRESP4
var wxID_EndOfDayDialogRESP5
var wxID_EndOfDayDialogRESP6
var wxID_EndOfDayDialogSTATICBOX
var wxID_EndOfDayDialogSTATICLINE1
var wxID_EndOfDayDialogSUBMIT
var wxID_KEITHLEYIVPANEL
var wxID_KEITHLEYIVPANELACTIONPANEL
var wxID_KEITHLEYIVPANELAQUISTIONCONTROLPANEL
var wxID_KEITHLEYIVPANELAQUISTIONLABELPANEL
var wxID_KEITHLEYIVPANELAQUISTIONPARAMETERPANEL
var wxID_KEITHLEYIVPANELBOWTIECONTROL
var wxID_KEITHLEYIVPANELBOWTIELABEL
var wxID_KEITHLEYIVPANELINFORMATIONPANEL
var wxID_KEITHLEYIVPANELIVBUTTON
var wxID_KEITHLEYIVPANELNOTESCONTROL
var wxID_KEITHLEYIVPANELNOTESLABEL
var wxID_KEITHLEYIVPANELNOTESPANEL
var wxID_KEITHLEYIVPANELNUMBEROFPOINTSCONTROL
var wxID_KEITHLEYIVPANELNUMBEROFPOINTSLABEL
var wxID_KEITHLEYIVPANELPANEL1
var wxID_KEITHLEYIVPANELPLOTBUTTON
var wxID_KEITHLEYIVPANELRESISTANCECONTROL
var wxID_KEITHLEYIVPANELRESISTANCELABEL
var wxID_KEITHLEYIVPANELSAMPLENAMECONTROL
var wxID_KEITHLEYIVPANELSAMPLENAMELABEL
var wxID_KEITHLEYIVPANELSAVEBUTTON
var wxID_KEITHLEYIVPANELSETTLETIMECONTROL
var wxID_KEITHLEYIVPANELSETTLETIMELABEL
var wxID_KEITHLEYIVPANELSTARTCONTROL
var wxID_KEITHLEYIVPANELSTARTLABEL
var wxID_KEITHLEYIVPANELSTOPCONTROL
var wxID_KEITHLEYIVPANELSTOPLABEL
var wxID_SIMPLEARBDBLOWERINTERFACEPANEL
var wxID_SIMPLEARBDBLOWERINTERFACEPANELCONTROLSPANEL
var wxID_SIMPLEARBDBLOWERINTERFACEPANELCURRENTFILEREGISTERCONTROL
var wxID_SIMPLEARBDBLOWERINTERFACEPANELCURRENTLOGLABEL
var wxID_SIMPLEARBDBLOWERINTERFACEPANELCURRENTMETADATACONTROL
var wxID_SIMPLEARBDBLOWERINTERFACEPANELCURRENTMETADATLABEL
var wxID_SIMPLEARBDBLOWERINTERFACEPANELDATECONTROL
var wxID_SIMPLEARBDBLOWERINTERFACEPANELDATELABEL
var wxID_SIMPLEARBDBLOWERINTERFACEPANELDESCRIPTIONBUTTON
var wxID_SIMPLEARBDBLOWERINTERFACEPANELENTRY
var wxID_SIMPLEARBDBLOWERINTERFACEPANELENTRYCONTROLPANEL
var wxID_SIMPLEARBDBLOWERINTERFACEPANELIDCONTROL
var wxID_SIMPLEARBDBLOWERINTERFACEPANELIDLABEL
var wxID_SIMPLEARBDBLOWERINTERFACEPANELNEWENTRYBUTTON
var wxID_SIMPLEARBDBLOWERINTERFACEPANELNEXTENTRYBUTTON
var wxID_SIMPLEARBDBLOWERINTERFACEPANELOPENBUTTON
var wxID_SIMPLEARBDBLOWERINTERFACEPANELPREVIOUSENTRYBUTTON
var wxID_SIMPLEARBDBLOWERINTERFACEPANELREMOVEENTRYBUTTON
var wxID_SIMPLEARBDBLOWERINTERFACEPANELSAVEASBUTTON
var wxID_SIMPLEARBDBLOWERINTERFACEPANELSAVEBUTTON
var wxID_SIMPLEARBDBLOWERINTERFACEPANELTEXTENTRYPANEL
var wxID_SIMPLELOGLOWERINTERFACEPANEL
var wxID_SIMPLELOGLOWERINTERFACEPANELCONTROLSPANEL
var wxID_SIMPLELOGLOWERINTERFACEPANELCURRENTLOGCONTROL
var wxID_SIMPLELOGLOWERINTERFACEPANELCURRENTLOGLABEL
var wxID_SIMPLELOGLOWERINTERFACEPANELDATECONTROL
var wxID_SIMPLELOGLOWERINTERFACEPANELDATELABEL
var wxID_SIMPLELOGLOWERINTERFACEPANELDESCRIPTIONBUTTON
var wxID_SIMPLELOGLOWERINTERFACEPANELENTRY
var wxID_SIMPLELOGLOWERINTERFACEPANELENTRYCONTROLPANEL
var wxID_SIMPLELOGLOWERINTERFACEPANELIDCONTROL
var wxID_SIMPLELOGLOWERINTERFACEPANELIDLABEL
var wxID_SIMPLELOGLOWERINTERFACEPANELNEWENTRYBUTTON
var wxID_SIMPLELOGLOWERINTERFACEPANELNEXTENTRYBUTTON
var wxID_SIMPLELOGLOWERINTERFACEPANELOPENBUTTON
var wxID_SIMPLELOGLOWERINTERFACEPANELPREVIOUSENTRYBUTTON
var wxID_SIMPLELOGLOWERINTERFACEPANELREMOVEENTRYBUTTON
var wxID_SIMPLELOGLOWERINTERFACEPANELSAVEASBUTTON
var wxID_SIMPLELOGLOWERINTERFACEPANELSAVEBUTTON
var wxID_SIMPLELOGLOWERINTERFACEPANELTEXTENTRYPANEL
var wxID_VISADIALOG
var wxID_VISADIALOGASKBUTTON
var wxID_VISADIALOGCOMMANDPANEL
var wxID_VISADIALOGINPUTLABEL
var wxID_VISADIALOGINSTRUMENTCHOICE
var wxID_VISADIALOGINSTRUMENTCHOOSERPANEL
var wxID_VISADIALOGINSTRUMENTLABEL
var wxID_VISADIALOGREADBUTTON
var wxID_VISADIALOGRESPONSELABEL
var wxID_VISADIALOGRESPONSETEXT
var wxID_VISADIALOGTEXTINPUT
var wxID_VISADIALOGTEXTPANEL
var wxID_VISADIALOGWRITEBUTTON