pyMez.Code.FrontEnds.GeneralInterfaceFrame module
Advanced wx.Frame with standard containers for interface and control this is meant as a template for GUI design
Help
#----------------------------------------------------------------------------- # Name: GeneralInterfaceFrame.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: GeneralInterfaceFrame.py $ #----------------------------------------------------------------------------- #Boa:Frame:GeneralInterfaceFrame """ Advanced wx.Frame with standard containers for interface and control this is meant as a template for GUI design 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 * # 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: from Code.FrontEnds.IEPanel import * #from Code.FrontEnds.ShellPanel 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 --C:\Python25\Lib\site-packages""") raise #------------------------------------------------------------------------------- #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 #------------------------------------------------------------------------------- # Boa Code def create(parent): return GeneralInterfaceFrame(parent) [wxID_GENERALINTERFACEFRAME, wxID_GENERALINTERFACEFRAMEDISPLAY, wxID_GENERALINTERFACEFRAMEINTERFACESTATUSBAR, wxID_GENERALINTERFACEFRAMEINTERFACETOOLBAR, wxID_GENERALINTERFACEFRAMELEFTINTERFACEPANEL, wxID_GENERALINTERFACEFRAMELOWERCONTROLPANEL, wxID_GENERALINTERFACEFRAMELOWERINTERFACE, wxID_GENERALINTERFACEFRAMELOWERINTERFACEPANEL, wxID_GENERALINTERFACEFRAMEMAINPANEL, wxID_GENERALINTERFACEFRAMERIGHTCONTROLPANEL, wxID_GENERALINTERFACEFRAMESHELL, wxID_GENERALINTERFACEFRAMEUPPERINTERFACE, wxID_GENERALINTERFACEFRAMEUPPERINTERFACEPANEL, ] = [wx.NewId() for _init_ctrls in range(13)] [wxID_GENERALINTERFACEFRAMEFILEMENUOPEN] = [wx.NewId() for _init_coll_FileMenu_Items in range(1)] class GeneralInterfaceFrame(wx.Frame): _custom_classes = {'wx.Panel': ['ShellPanel','IEPanel']} 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, 8, border=2, flag=wx.ALL | wx.EXPAND) parent.AddWindow(self.LowerInterfacePanel, 2, border=2, flag=wx.ALL | wx.EXPAND) parent.AddWindow(self.LowerControlPanel, 0, border=2, flag=wx.ALL | wx.EXPAND) 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_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_FileMenu_Items(self, parent): # generated method, don't edit parent.Append(help='Open a file', id=wxID_GENERALINTERFACEFRAMEFILEMENUOPEN, kind=wx.ITEM_NORMAL, text='Open') self.Bind(wx.EVT_MENU, self.OnFileMenuOpenMenu, id=wxID_GENERALINTERFACEFRAMEFILEMENUOPEN) 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') def _init_coll_LowerInterface_Pages(self, parent): # generated method, don't edit parent.AddPage(imageId=-1, page=self.Shell, select=True, text='Shell') 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_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._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.SetSizer(self.boxSizer1) self.LowerInterfacePanel.SetSizer(self.boxSizer5) self.LeftInterfacePanel.SetSizer(self.boxSizer3) self.MainPanel.SetSizer(self.boxSizer2) self.UpperInterfacePanel.SetSizer(self.boxSizer4) 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) def _init_ctrls(self, prnt): # generated method, don't edit wx.Frame.__init__(self, id=wxID_GENERALINTERFACEFRAME, name='GeneralInterfaceFrame', parent=prnt, pos=wx.Point(504, 67), size=wx.Size(847, 721), style=wx.DEFAULT_FRAME_STYLE, title='General Interface') self._init_utils() self.SetClientSize(wx.Size(839, 687)) self.SetMenuBar(self.InterfaceMenuBar) self.InterfaceStatusBar = wx.StatusBar(id=wxID_GENERALINTERFACEFRAMEINTERFACESTATUSBAR, 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_GENERALINTERFACEFRAMEINTERFACETOOLBAR, name='InterfaceToolBar', parent=self, pos=wx.Point(0, 0), size=wx.Size(839, 28), style=wx.TB_HORIZONTAL | wx.NO_BORDER) self.SetToolBar(self.InterfaceToolBar) self.MainPanel = wx.Panel(id=wxID_GENERALINTERFACEFRAMEMAINPANEL, name='MainPanel', parent=self, pos=wx.Point(1, 1), size=wx.Size(837, 685), style=wx.TAB_TRAVERSAL) self.LeftInterfacePanel = wx.Panel(id=wxID_GENERALINTERFACEFRAMELEFTINTERFACEPANEL, name='LeftInterfacePanel', parent=self.MainPanel, pos=wx.Point(2, 2), size=wx.Size(688, 681), style=wx.TAB_TRAVERSAL) self.RightControlPanel = wx.Panel(id=wxID_GENERALINTERFACEFRAMERIGHTCONTROLPANEL, name='RightControlPanel', parent=self.MainPanel, pos=wx.Point(694, 2), size=wx.Size(141, 681), style=wx.TAB_TRAVERSAL) self.RightControlPanel.SetBackgroundColour(wx.Colour(255, 128, 128)) self.LowerControlPanel = wx.Panel(id=wxID_GENERALINTERFACEFRAMELOWERCONTROLPANEL, name='LowerControlPanel', parent=self.LeftInterfacePanel, pos=wx.Point(2, 652), size=wx.Size(684, 27), style=wx.TAB_TRAVERSAL) self.LowerControlPanel.SetBackgroundColour(wx.Colour(0, 255, 128)) self.UpperInterfacePanel = wx.Panel(id=wxID_GENERALINTERFACEFRAMEUPPERINTERFACEPANEL, name='UpperInterfacePanel', parent=self.LeftInterfacePanel, pos=wx.Point(2, 2), size=wx.Size(684, 516), style=wx.TAB_TRAVERSAL) self.UpperInterfacePanel.SetBackgroundColour(wx.Colour(128, 128, 128)) self.UpperInterfacePanel.SetHelpText('UpperInterfacePanel') self.LowerInterfacePanel = wx.Panel(id=wxID_GENERALINTERFACEFRAMELOWERINTERFACEPANEL, name='LowerInterfacePanel', parent=self.LeftInterfacePanel, pos=wx.Point(2, 522), size=wx.Size(684, 126), style=wx.TAB_TRAVERSAL) self.LowerInterfacePanel.SetBackgroundColour(wx.Colour(192, 192, 192)) self.UpperInterface = wx.Notebook(id=wxID_GENERALINTERFACEFRAMEUPPERINTERFACE, name='UpperInterface', parent=self.UpperInterfacePanel, pos=wx.Point(2, 2), size=wx.Size(680, 512), style=0) self.LowerInterface = wx.Treebook(id=wxID_GENERALINTERFACEFRAMELOWERINTERFACE, name='LowerInterface', parent=self.LowerInterfacePanel, pos=wx.Point(2, 2), size=wx.Size(680, 122), style=0) self.Display = IEPanel(id=wxID_GENERALINTERFACEFRAMEDISPLAY, name='Display', parent=self.UpperInterface, pos=wx.Point(0, 0), size=wx.Size(672, 486), style=wx.TAB_TRAVERSAL) self.Shell = ShellPanel(id=wxID_GENERALINTERFACEFRAMESHELL, name='Shell', parent=self.LowerInterface, pos=wx.Point(0, 0), size=wx.Size(622, 122), style=wx.TAB_TRAVERSAL) 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("shell=locals()['self']",'\n') def OnFileMenuOpenMenu(self, event): event.Skip() if __name__ == '__main__': app = wx.App(False) from Code.FrontEnds.ShellPanel import * frame = create(None) sys.stdout=frame.Shell.ShellEditor.stdout sys.stdin=frame.Shell.ShellEditor.stdin frame.Show() app.MainLoop()
Functions
def create(
parent)
def create(parent): return GeneralInterfaceFrame(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
Classes
class GeneralInterfaceFrame
Frame() Frame(parent, id=ID_ANY, title=EmptyString, pos=DefaultPosition, size=DefaultSize, style=DEFAULT_FRAME_STYLE, name=FrameNameStr)
A frame is a window whose size and position can (usually) be changed by the user.
class GeneralInterfaceFrame(wx.Frame): _custom_classes = {'wx.Panel': ['ShellPanel','IEPanel']} 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, 8, border=2, flag=wx.ALL | wx.EXPAND) parent.AddWindow(self.LowerInterfacePanel, 2, border=2, flag=wx.ALL | wx.EXPAND) parent.AddWindow(self.LowerControlPanel, 0, border=2, flag=wx.ALL | wx.EXPAND) 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_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_FileMenu_Items(self, parent): # generated method, don't edit parent.Append(help='Open a file', id=wxID_GENERALINTERFACEFRAMEFILEMENUOPEN, kind=wx.ITEM_NORMAL, text='Open') self.Bind(wx.EVT_MENU, self.OnFileMenuOpenMenu, id=wxID_GENERALINTERFACEFRAMEFILEMENUOPEN) 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') def _init_coll_LowerInterface_Pages(self, parent): # generated method, don't edit parent.AddPage(imageId=-1, page=self.Shell, select=True, text='Shell') 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_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._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.SetSizer(self.boxSizer1) self.LowerInterfacePanel.SetSizer(self.boxSizer5) self.LeftInterfacePanel.SetSizer(self.boxSizer3) self.MainPanel.SetSizer(self.boxSizer2) self.UpperInterfacePanel.SetSizer(self.boxSizer4) 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) def _init_ctrls(self, prnt): # generated method, don't edit wx.Frame.__init__(self, id=wxID_GENERALINTERFACEFRAME, name='GeneralInterfaceFrame', parent=prnt, pos=wx.Point(504, 67), size=wx.Size(847, 721), style=wx.DEFAULT_FRAME_STYLE, title='General Interface') self._init_utils() self.SetClientSize(wx.Size(839, 687)) self.SetMenuBar(self.InterfaceMenuBar) self.InterfaceStatusBar = wx.StatusBar(id=wxID_GENERALINTERFACEFRAMEINTERFACESTATUSBAR, 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_GENERALINTERFACEFRAMEINTERFACETOOLBAR, name='InterfaceToolBar', parent=self, pos=wx.Point(0, 0), size=wx.Size(839, 28), style=wx.TB_HORIZONTAL | wx.NO_BORDER) self.SetToolBar(self.InterfaceToolBar) self.MainPanel = wx.Panel(id=wxID_GENERALINTERFACEFRAMEMAINPANEL, name='MainPanel', parent=self, pos=wx.Point(1, 1), size=wx.Size(837, 685), style=wx.TAB_TRAVERSAL) self.LeftInterfacePanel = wx.Panel(id=wxID_GENERALINTERFACEFRAMELEFTINTERFACEPANEL, name='LeftInterfacePanel', parent=self.MainPanel, pos=wx.Point(2, 2), size=wx.Size(688, 681), style=wx.TAB_TRAVERSAL) self.RightControlPanel = wx.Panel(id=wxID_GENERALINTERFACEFRAMERIGHTCONTROLPANEL, name='RightControlPanel', parent=self.MainPanel, pos=wx.Point(694, 2), size=wx.Size(141, 681), style=wx.TAB_TRAVERSAL) self.RightControlPanel.SetBackgroundColour(wx.Colour(255, 128, 128)) self.LowerControlPanel = wx.Panel(id=wxID_GENERALINTERFACEFRAMELOWERCONTROLPANEL, name='LowerControlPanel', parent=self.LeftInterfacePanel, pos=wx.Point(2, 652), size=wx.Size(684, 27), style=wx.TAB_TRAVERSAL) self.LowerControlPanel.SetBackgroundColour(wx.Colour(0, 255, 128)) self.UpperInterfacePanel = wx.Panel(id=wxID_GENERALINTERFACEFRAMEUPPERINTERFACEPANEL, name='UpperInterfacePanel', parent=self.LeftInterfacePanel, pos=wx.Point(2, 2), size=wx.Size(684, 516), style=wx.TAB_TRAVERSAL) self.UpperInterfacePanel.SetBackgroundColour(wx.Colour(128, 128, 128)) self.UpperInterfacePanel.SetHelpText('UpperInterfacePanel') self.LowerInterfacePanel = wx.Panel(id=wxID_GENERALINTERFACEFRAMELOWERINTERFACEPANEL, name='LowerInterfacePanel', parent=self.LeftInterfacePanel, pos=wx.Point(2, 522), size=wx.Size(684, 126), style=wx.TAB_TRAVERSAL) self.LowerInterfacePanel.SetBackgroundColour(wx.Colour(192, 192, 192)) self.UpperInterface = wx.Notebook(id=wxID_GENERALINTERFACEFRAMEUPPERINTERFACE, name='UpperInterface', parent=self.UpperInterfacePanel, pos=wx.Point(2, 2), size=wx.Size(680, 512), style=0) self.LowerInterface = wx.Treebook(id=wxID_GENERALINTERFACEFRAMELOWERINTERFACE, name='LowerInterface', parent=self.LowerInterfacePanel, pos=wx.Point(2, 2), size=wx.Size(680, 122), style=0) self.Display = IEPanel(id=wxID_GENERALINTERFACEFRAMEDISPLAY, name='Display', parent=self.UpperInterface, pos=wx.Point(0, 0), size=wx.Size(672, 486), style=wx.TAB_TRAVERSAL) self.Shell = ShellPanel(id=wxID_GENERALINTERFACEFRAMESHELL, name='Shell', parent=self.LowerInterface, pos=wx.Point(0, 0), size=wx.Size(622, 122), style=wx.TAB_TRAVERSAL) 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("shell=locals()['self']",'\n') def OnFileMenuOpenMenu(self, event): event.Skip()
Ancestors (in MRO)
- GeneralInterfaceFrame
- wx._core.Frame
- wx._core.TopLevelWindow
- wx._core.NonOwnedWindow
- wx._core.Window
- wx._core.WindowBase
- wx._core.EvtHandler
- wx._core.Object
- wx._core.Trackable
- sip.wrapper
- sip.simplewrapper
- builtins.object
Class variables
var ChildrenRepositioningGuard
Static methods
def __init__(
self, parent)
Initialize self. See help(type(self)) for accurate signature.
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")
def Bind(
self, event, handler, source=None, id=-1, id2=-1)
Bind an event to an event handler.
:param event: One of the EVT_*
event binder 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 _EvtHandler_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_*`` event binder 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 callable(handler) or handler is None assert source is None or hasattr(source, 'GetId') if source is not None: id = source.GetId() event.Bind(self, id, id2, handler)
def ConvertDialogPointToPixels(
*args, **kw)
def deprecated_func(*args, **kw): warnings.warn("Call to deprecated item%s. %s" % (name, msg), wxPyDeprecationWarning, stacklevel=2) if not kw: return item(*args) return item(*args, **kw)
def ConvertDialogSizeToPixels(
*args, **kw)
def deprecated_func(*args, **kw): warnings.warn("Call to deprecated item%s. %s" % (name, msg), wxPyDeprecationWarning, stacklevel=2) if not kw: return item(*args) return item(*args, **kw)
def DLG_UNIT(
self, dlg_unit)
A convenience wrapper for :meth:ConvertDialogToPixels
.
def _Window_DLG_UNIT(self, dlg_unit): """ A convenience wrapper for :meth:`ConvertDialogToPixels`. """ is_wxType = isinstance(dlg_unit, (wx.Size, wx.Point)) pix = self.ConvertDialogToPixels(dlg_unit) if not is_wxType: pix = tuple(pix) return pix
def DestroyLater(
self)
Schedules the window to be destroyed in the near future.
This should be used whenever Destroy could happen too soon, such as when there may still be events for this window or its children waiting in the event queue.
def _Window_DestroyLater(self): """ Schedules the window to be destroyed in the near future. This should be used whenever Destroy could happen too soon, such as when there may still be events for this window or its children waiting in the event queue. """ self.Hide() wx.GetApp().ScheduleForDestruction(self)
def GetPositionTuple(
*args, **kw)
def deprecated_func(*args, **kw): warnings.warn("Call to deprecated item%s. %s" % (name, msg), wxPyDeprecationWarning, stacklevel=2) if not kw: return item(*args) return item(*args, **kw)
def GetSizeTuple(
*args, **kw)
def deprecated_func(*args, **kw): warnings.warn("Call to deprecated item%s. %s" % (name, msg), wxPyDeprecationWarning, stacklevel=2) if not kw: return item(*args) return item(*args, **kw)
def GetVirtualSizeTuple(
*args, **kw)
def deprecated_func(*args, **kw): warnings.warn("Call to deprecated item%s. %s" % (name, msg), wxPyDeprecationWarning, stacklevel=2) if not kw: return item(*args) return item(*args, **kw)
def MoveXY(
*args, **kw)
def deprecated_func(*args, **kw): warnings.warn("Call to deprecated item%s. %s" % (name, msg), wxPyDeprecationWarning, stacklevel=2) if not kw: return item(*args) return item(*args, **kw)
def OnFileMenuOpenMenu(
self, event)
def OnFileMenuOpenMenu(self, event): event.Skip()
def PostCreate(
*args, **kw)
def deprecated_func(*args, **kw): warnings.warn("Call to deprecated item%s. %s" % (name, msg), wxPyDeprecationWarning, stacklevel=2) if not kw: return item(*args) return item(*args, **kw)
def SetClientRect(
self, rect)
def _Window_SetClientRect(self, rect): return self.SetClientSize(rect)
def SetDimensions(
*args, **kw)
SetDimensions(x, y, width, height, sizeFlags=SIZE_AUTO)
def deprecated_func(*args, **kw): warnings.warn("Call to deprecated item%s. %s" % (name, msg), wxPyDeprecationWarning, stacklevel=2) if not kw: return item(*args) return item(*args, **kw)
def SetRect(
self, rect)
def _Window_SetRect(self, rect): return self.SetSize(rect)
def SetSizeHintsSz(
*args, **kw)
def deprecated_func(*args, **kw): warnings.warn("Call to deprecated item%s. %s" % (name, msg), wxPyDeprecationWarning, stacklevel=2) if not kw: return item(*args) return item(*args, **kw)
def SetSizeWH(
*args, **kw)
def deprecated_func(*args, **kw): warnings.warn("Call to deprecated item%s. %s" % (name, msg), wxPyDeprecationWarning, stacklevel=2) if not kw: return item(*args) return item(*args, **kw)
def SetToolTipString(
*args, **kw)
def deprecated_func(*args, **kw): warnings.warn("Call to deprecated item%s. %s" % (name, msg), wxPyDeprecationWarning, stacklevel=2) if not kw: return item(*args) return item(*args, **kw)
def SetVirtualSizeWH(
*args, **kw)
def deprecated_func(*args, **kw): warnings.warn("Call to deprecated item%s. %s" % (name, msg), wxPyDeprecationWarning, stacklevel=2) if not kw: return item(*args) return item(*args, **kw)
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 _EvtHandler_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)
Instance variables
var AcceleratorTable
GetAcceleratorTable() -> AcceleratorTable
Gets the accelerator table for this window.
var AutoLayout
GetAutoLayout() -> bool
Returns the sizer of which this window is a member, if any, otherwise NULL.
var BackgroundColour
GetBackgroundColour() -> Colour
Returns the background colour of the window.
var BackgroundStyle
GetBackgroundStyle() -> BackgroundStyle
Returns the background style of the window.
var BestSize
GetBestSize() -> Size
This functions returns the best acceptable minimal size for the window.
var BestVirtualSize
GetBestVirtualSize() -> Size
Return the largest of ClientSize and BestSize (as determined by a sizer, interior children, or other means)
var Border
GetBorder(flags) -> Border GetBorder() -> Border
Get the window border style from the given flags: this is different from simply doing flags & wxBORDER_MASK because it uses GetDefaultBorder() to translate wxBORDER_DEFAULT to something reasonable.
var Caret
GetCaret() -> Caret
Returns the caret() associated with the window.
var CharHeight
GetCharHeight() -> int
Returns the character height for this window.
var CharWidth
GetCharWidth() -> int
Returns the average character width for this window.
var Children
GetChildren() -> WindowList
Returns a reference to the list of the window's children.
var ClassInfo
GetClassInfo() -> ClassInfo
This virtual function is redefined for every class that requires run- time type information, when using the wxDECLARE_CLASS macro (or similar).
var ClassName
GetClassName() -> Char
Returns the class name of the C++ class using wxRTTI.
var ClientAreaOrigin
GetClientAreaOrigin() -> Point
Get the origin of the client area of the window relative to the window top left corner (the client area may be shifted because of the borders, scrollbars, other decorations...)
var ClientRect
GetClientRect() -> Rect
Get the client rectangle in window (i.e. client) coordinates.
var ClientSize
GetClientSize() -> Size
Returns the size of the window 'client area' in pixels.
var Constraints
GetConstraints() -> LayoutConstraints
Returns a pointer to the window's layout constraints, or NULL if there are none.
var ContainingSizer
GetContainingSizer() -> Sizer
Returns the sizer of which this window is a member, if any, otherwise NULL.
var Cursor
GetCursor() -> Cursor
Return the cursor associated with this window.
var DefaultAttributes
GetDefaultAttributes() -> VisualAttributes
Currently this is the same as calling wxWindow::GetClassDefaultAttributes(wxWindow::GetWindowVariant()).
var DefaultItem
GetDefaultItem() -> Window
Returns a pointer to the button which is the default for this window, or NULL.
var DropTarget
GetDropTarget() -> DropTarget
Returns the associated drop target, which may be NULL.
var EffectiveMinSize
GetEffectiveMinSize() -> Size
Merges the window's best size into the min size and returns the result.
var Enabled
IsEnabled() -> bool
Returns true if the window is enabled, i.e. if it accepts user input, false otherwise.
var EventHandler
GetEventHandler() -> EvtHandler
Returns the event handler for this window.
var EvtHandlerEnabled
GetEvtHandlerEnabled() -> bool
Returns true if the event handler is enabled, false otherwise.
var ExtraStyle
GetExtraStyle() -> long
Returns the extra style bits for the window.
var Font
GetFont() -> Font
Returns the font for this window.
var ForegroundColour
GetForegroundColour() -> Colour
Returns the foreground colour of the window.
var GrandParent
GetGrandParent() -> Window
Returns the grandparent of a window, or NULL if there isn't one.
var Handle
GetHandle() -> UIntPtr
Returns the platform-specific handle of the physical window.
var HelpText
GetHelpText() -> String
Gets the help text to be used as context-sensitive help for this window.
var Icon
GetIcon() -> Icon
Returns the standard icon of the window.
var Id
GetId() -> WindowID
Returns the identifier of the window.
var Label
GetLabel() -> String
Generic way of getting a label from any window, for identification purposes.
var LayoutDirection
GetLayoutDirection() -> LayoutDirection
Returns the layout direction for this window, Note that wxLayout_Default is returned if layout direction is not supported.
var MacMetalAppearance
MacGetMetalAppearance() -> bool
var MaxClientSize
GetMaxClientSize() -> Size
Returns the maximum size of window's client area.
var MaxHeight
GetMaxHeight() -> int
Returns the vertical component of window maximal size.
var MaxSize
GetMaxSize() -> Size
Returns the maximum size of the window.
var MaxWidth
GetMaxWidth() -> int
Returns the horizontal component of window maximal size.
var MenuBar
GetMenuBar() -> MenuBar
Returns a pointer to the menubar currently associated with the frame (if any).
var MinClientSize
GetMinClientSize() -> Size
Returns the minimum size of window's client area, an indication to the sizer layout mechanism that this is the minimum required size of its client area.
var MinHeight
GetMinHeight() -> int
Returns the vertical component of window minimal size.
var MinSize
GetMinSize() -> Size
Returns the minimum size of the window, an indication to the sizer layout mechanism that this is the minimum required size.
var MinWidth
GetMinWidth() -> int
Returns the horizontal component of window minimal size.
var Name
GetName() -> String
Returns the window's name.
var NextHandler
GetNextHandler() -> EvtHandler
Returns the pointer to the next handler in the chain.
var OSXModified
OSXIsModified() -> bool
Returns the current modified state of the wxTopLevelWindow on OS X.
var Parent
GetParent() -> Window
Returns the parent of the window, or NULL if there is no parent.
var Position
GetPosition() -> Point
This gets the position of the window in pixels, relative to the parent window for the child windows or relative to the display origin for the top level windows.
var PreviousHandler
GetPreviousHandler() -> EvtHandler
Returns the pointer to the previous handler in the chain.
var Rect
GetRect() -> Rect
Returns the position and size of the window as a wxRect object.
var RefData
GetRefData() -> ObjectRefData
Returns the wxObject::m_refData pointer, i.e. the data referenced by this object.
var ScreenPosition
GetScreenPosition() -> Point
Returns the window position in screen coordinates, whether the window is a child window or a top level one.
var ScreenRect
GetScreenRect() -> Rect
Returns the position and size of the window on the screen as a wxRect object.
var Shown
IsShown() -> bool
Returns true if the window is shown, false if it has been hidden.
var Size
GetSize() -> Size
Returns the size of the entire window in pixels, including title bar, border, scrollbars, etc.
var Sizer
GetSizer() -> Sizer
Returns the sizer associated with the window by a previous call to SetSizer(), or NULL.
var StatusBar
GetStatusBar() -> StatusBar
Returns a pointer to the status bar currently associated with the frame (if any).
var StatusBarPane
GetStatusBarPane() -> int
Returns the status bar pane used to display menu and toolbar help.
var ThemeEnabled
GetThemeEnabled() -> bool
Clears the window by filling it with the current background colour.
var Title
GetTitle() -> String
Gets a string containing the window title.
var TmpDefaultItem
GetTmpDefaultItem() -> Window
var ToolBar
GetToolBar() -> ToolBar
Returns a pointer to the toolbar currently associated with the frame (if any).
var ToolTip
GetToolTip() -> ToolTip
Get the associated tooltip or NULL if none.
var TopLevel
IsTopLevel() -> bool
Returns true if the given window is a top-level one.
var TopLevelParent
GetTopLevelParent() -> Window
Returns the first ancestor of this window which is a top-level window.
var UpdateClientRect
GetUpdateClientRect() -> Rect
Get the update rectangle bounding box in client coords.
var UpdateRegion
GetUpdateRegion() -> Region
Returns the region specifying which parts of the window have been damaged.
var Validator
GetValidator() -> Validator
Validator functions.
var VirtualSize
GetVirtualSize() -> Size
This gets the virtual size of the window in pixels.
var WindowStyle
GetWindowStyle() -> long
See GetWindowStyleFlag() for more info.
var WindowStyleFlag
GetWindowStyleFlag() -> long
Gets the window style that was passed to the constructor or Create() method.
var WindowVariant
GetWindowVariant() -> WindowVariant
Returns the value previously passed to SetWindowVariant().
Module variables
var overview
var wxID_CONTROL_PANEL
var wxID_GENERALINTERFACEFRAME
var wxID_GENERALINTERFACEFRAMEDISPLAY
var wxID_GENERALINTERFACEFRAMEFILEMENUOPEN
var wxID_GENERALINTERFACEFRAMEINTERFACESTATUSBAR
var wxID_GENERALINTERFACEFRAMEINTERFACETOOLBAR
var wxID_GENERALINTERFACEFRAMELEFTINTERFACEPANEL
var wxID_GENERALINTERFACEFRAMELOWERCONTROLPANEL
var wxID_GENERALINTERFACEFRAMELOWERINTERFACE
var wxID_GENERALINTERFACEFRAMELOWERINTERFACEPANEL
var wxID_GENERALINTERFACEFRAMEMAINPANEL
var wxID_GENERALINTERFACEFRAMERIGHTCONTROLPANEL
var wxID_GENERALINTERFACEFRAMESHELL
var wxID_GENERALINTERFACEFRAMEUPPERINTERFACE
var wxID_GENERALINTERFACEFRAMEUPPERINTERFACEPANEL