gui_manager

sans.guiframe.gui_manager

class sans.guiframe.gui_manager.DefaultPanel

Bases: wx._windows.Panel, sans.guiframe.panel_base.PanelBase

Defines the API for a panels to work with the GUI manager

AcceleratorTable

See GetAcceleratorTable and SetAcceleratorTable

AcceptsFocus(self) → bool

Can this window have focus?

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.

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.

AddPendingEvent(self, Event event)
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.

AssociateHandle(self, long handle)

Associate the window with a new native handle

AutoLayout

See GetAutoLayout and SetAutoLayout

BackgroundColour

See GetBackgroundColour and SetBackgroundColour

BackgroundStyle

See GetBackgroundStyle and SetBackgroundStyle

BestSize

See GetBestSize

BestVirtualSize

See GetBestVirtualSize

Bind()

Bind an event to an event handler.

Parameters:
  • event – One of the EVT_* objects that specifies the type of event to bind,
  • handler – A callable object to be invoked when the event is delivered to self. Pass None to disconnect an event handler.
  • 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.
  • id – Used to spcify the event source by ID instead of instance.
  • id2 – Used when it is desirable to bind a handler to a range of IDs, such as with EVT_MENU_RANGE.
Border

See GetBorder

CENTER_PANE = True
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.)

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.

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.

Caret

See GetCaret and SetCaret

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.

CenterOnParent(self, int dir=BOTH)

Center with respect to the the parent window

Centre()

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.

CentreOnParent()

CenterOnParent(self, int dir=BOTH)

Center with respect to the the parent window

CharHeight

See GetCharHeight

CharWidth

See GetCharWidth

Children

See GetChildren

ClassName

See GetClassName

ClearBackground(self)

Clears the window by filling it with the current background colour. Does not cause an erase background event to be generated.

ClientAreaOrigin

See GetClientAreaOrigin

ClientRect

See GetClientRect and SetClientRect

ClientSize

See GetClientSize and SetClientSize

ClientToScreen(self, Point pt) → Point

Converts to screen coordinates from coordinates relative to this window.

ClientToScreenXY(int x, int y) -> (x, y)

Converts to screen coordinates from coordinates relative to this window.

ClientToWindowSize(self, Size size) → Size
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.

Connect(self, int id, int lastId, int eventType, PyObject func)
Constraints

See GetConstraints and SetConstraints

ContainingSizer

See GetContainingSizer and SetContainingSizer

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.

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.

ConvertPixelPointToDialog(self, Point pt) → Point
ConvertPixelSizeToDialog(self, Size sz) → Size
Create()
Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
Size size=DefaultSize, long style=wxTAB_TRAVERSAL|wxNO_BORDER, String name=PanelNameStr) -> bool

Create the GUI part of the Window for 2-phase creation mode.

Cursor

See GetCursor and SetCursor

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.

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.

DefaultAttributes

See GetDefaultAttributes

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.

DestroyChildren(self) → bool

Destroys all children of a window. Called automatically by the destructor.

Disable(self) → bool

Disables the window, same as Enable(false).

Disconnect()

Disconnect(self, int id, int lastId=-1, EventType eventType=wxEVT_NULL, PyObject func=None) -> bool

DissociateHandle(self)

Dissociate the current native handle from the window

DragAcceptFiles(self, bool accept)

Enables or disables eligibility for drop file events, EVT_DROP_FILES.

DropTarget

See GetDropTarget and SetDropTarget

EffectiveMinSize

See GetEffectiveMinSize

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.

Enabled

See IsEnabled and Enable

EventHandler

See GetEventHandler and SetEventHandler

EvtHandlerEnabled

See GetEvtHandlerEnabled and SetEvtHandlerEnabled

ExtraStyle

See GetExtraStyle and SetExtraStyle

static FindFocus() → Window

Returns the window or control that currently has the keyboard focus, or None.

FindWindowById(self, long winid) → Window

Find a child of this window by window ID

FindWindowByLabel(self, String label) → Window

Find a child of this window by label

FindWindowByName(self, String name) → Window

Find a child of this window by name

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.

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.

Font

See GetFont and SetFont

ForegroundColour

See GetForegroundColour and SetForegroundColour

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.

GetAcceleratorTable(self) → AcceleratorTable

Gets the accelerator table for this window.

GetAdjustedBestSize()

Use GetEffectiveMinSize instead.

GetAutoLayout(self) → bool

Returns the current autoLayout setting

GetBackgroundColour(self) → Colour

Returns the background colour of the window.

GetBackgroundStyle(self) → int

Returns the background style of the window.

See :SetBackgroundStyle
GetBestFittingSize()

Use GetEffectiveMinSize instead.

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.

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.

GetBestVirtualSize(self) → Size

Return the largest of ClientSize and BestSize (as determined by a sizer, interior children, or other means)

GetBorder(self, long flags) → int

GetBorder(self) -> int

Get border for the flags of this window

static GetCapture() → Window

Returns the window which currently captures the mouse or None

GetCaret(self) → Caret

Returns the caret associated with the window.

GetCharHeight(self) → int

Get the (average) character size for the current font.

GetCharWidth(self) → int

Get the (average) character size for the current font.

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..

static 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.

GetClassName(self) → String

Returns the class name of the C++ class using wxRTTI.

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...)

GetClientRect(self) → Rect

Get the client area position and size as a wx.Rect object.

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.

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.

GetConstraints(self) → LayoutConstraints

Returns a pointer to the window’s layout constraints, or None if there are none.

GetContainingSizer(self) → Sizer

Return the sizer that this window is a member of, if any, otherwise None.

GetCursor(self) → Cursor

Return the cursor associated with this window.

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.

GetDropTarget(self) → DropTarget

Returns the associated drop target, which may be None.

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.

GetEventHandler(self) → EvtHandler

Returns the event handler for this window. By default, the window is its own event handler.

GetEvtHandlerEnabled(self) → bool
GetExtraStyle(self) → long

Returns the extra style bits for the window.

GetFont(self) → Font

Returns the default font used for this window.

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.

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.

GetGrandParent(self) → Window

Returns the parent of the parent of this window, or None if there isn’t one.

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.

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.

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.

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

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.

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.

GetLayoutDirection(self) → int

Get the layout direction (LTR or RTL) for this window. Returns wx.Layout_Default if layout direction is not supported.

GetMaxHeight(self) → int
GetMaxSize(self) → Size
GetMaxWidth(self) → int
GetMinHeight(self) → int
GetMinSize(self) → Size
GetMinWidth(self) → int
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.

GetNextHandler(self) → EvtHandler
GetParent(self) → Window

Returns the parent window of this window, or None if there isn’t one.

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.

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.

GetPreviousHandler(self) → EvtHandler
GetRect(self) → Rect

Returns the size and position of the window as a wx.Rect object.

GetScreenPosition(self) → Point

Get the position of the window in screen coordinantes.

GetScreenPositionTuple() -> (x, y)

Get the position of the window in screen coordinantes.

GetScreenRect(self) → Rect

Returns the size and position of the window in screen coordinantes as a wx.Rect object.

GetScrollPos(self, int orientation) → int

Returns the built-in scrollbar position.

GetScrollRange(self, int orientation) → int

Returns the built-in scrollbar range.

GetScrollThumb(self, int orientation) → int

Returns the built-in scrollbar thumb size.

GetSize(self) → Size

Get the window size.

GetSizeTuple() -> (width, height)

Get the window size.

GetSizer(self) → Sizer

Return the sizer associated with the window by a previous call to SetSizer or None if there isn’t one.

GetTextExtent(String string) -> (width, height)

Get the width and height of the text using the current font.

GetThemeEnabled(self) → bool

Return the themeEnabled flag.

GetToolTip(self) → ToolTip

get the associated tooltip or None if none

GetTopLevelParent(self) → Window

Returns the first frame or dialog in this window’s parental hierarchy.

GetUpdateClientRect(self) → Rect

Get the update rectangle region bounding box in client coords.

GetUpdateRegion(self) → Region

Returns the region specifying which parts of the window have been damaged. Should only be called within an EVT_PAINT handler.

GetValidator(self) → Validator

Returns a pointer to the current validator for the window, or None if there is none.

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.

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.

GetWindowBorderSize(self) → Size

Return the size of the left/right and top/bottom borders.

GetWindowStyle()

GetWindowStyleFlag(self) -> long

Gets the window style that was passed to the constructor or Create method.

GetWindowStyleFlag(self) → long

Gets the window style that was passed to the constructor or Create method.

GetWindowVariant(self) → int
GrandParent

See GetGrandParent

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.

Handle

See GetHandle

HasCapture(self) → bool

Returns true if this window has the current mouse capture.

HasFlag(self, int flag) → bool

Test if the given style is set for this window.

HasMultiplePages(self) → bool
HasScrollbar(self, int orient) → bool

Does the window have the scrollbar for this orientation?

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.

HelpText

See GetHelpText and SetHelpText

Hide(self) → bool

Equivalent to calling Show(False).

HitTest(self, Point pt) → int

Test where the given (in client coords) point lies

HitTestXY(self, int x, int y) → int

Test where the given (in client coords) point lies

Id

See GetId and SetId

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.

InheritsBackgroundColour(self) → bool
InitDialog(self)

Sends an EVT_INIT_DIALOG event, whose handler usually transfers data to the dialog via validators.

InvalidateBestSize(self)

Reset the cached best size value so it will be recalculated the next time it is needed.

IsBeingDeleted(self) → bool

Is the window in the process of being deleted?

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.

IsEnabled(self) → bool

Returns true if the window is enabled for input, false otherwise.

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.

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.

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.

IsFrozen(self) → bool

Returns True if the window has been frozen and not thawed yet.

See :Freeze and Thaw
IsRetained(self) → bool

Returns true if the window is retained, false otherwise. Retained windows are only available on X platforms.

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.

IsShown(self) → bool

Returns true if the window is shown, false if it has been hidden.

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.

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).

Label

See GetLabel and SetLabel

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.

LayoutDirection

See GetLayoutDirection and SetLayoutDirection

LineDown(self) → bool

This is just a wrapper for ScrollLines(1).

LineUp(self) → bool

This is just a wrapper for ScrollLines(-1).

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.

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.

MaxHeight

See GetMaxHeight

MaxSize

See GetMaxSize and SetMaxSize

MaxWidth

See GetMaxWidth

MinHeight

See GetMinHeight

MinSize

See GetMinSize and SetMinSize

MinWidth

See GetMinWidth

Move(self, Point pt, int flags=SIZE_USE_EXISTING)

Moves the window to the given position.

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.

MoveBeforeInTabOrder(self, Window win)

Same as MoveAfterInTabOrder except that it inserts this window just before win instead of putting it right after it.

MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)

Moves the window to the given position.

Name

See GetName and SetName

Navigate(self, int flags=NavigationKeyEvent.IsForward) → bool

Does keyboard navigation from this window to another, by sending a wx.NavigationKeyEvent.

static NewControlId() → int

Generate a control id for the controls which were not given one.

static NextControlId(int winid) → int

Get the id of the control following the one with the given autogenerated) id

NextHandler

See GetNextHandler and SetNextHandler

OnPaint(self, PaintEvent event)
PageDown(self) → bool

This is just a wrapper for ScrollPages(1).

PageUp(self) → bool

This is just a wrapper for ScrollPages(-1).

Parent

See GetParent

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.

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.

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.

Position

See GetPosition and SetPosition

PostCreate()

Phase 3 of the 2-phase create <wink!> Call this method after precreating the window with the 2-phase create method.

PrepareDC(self, DC dc)

Call this function to prepare the device context for drawing a scrolled image. It sets the device origin according to the current scroll position.

static PrevControlId(int winid) → int

Get the id of the control preceding the one with the given autogenerated) id

PreviousHandler

See GetPreviousHandler and SetPreviousHandler

ProcessEvent(self, Event event) → bool
ProcessPendingEvents(self)
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.

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.

Rect

See GetRect and SetRect

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.

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.

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.

ReleaseMouse(self)

Releases mouse input captured with wx.Window.CaptureMouse.

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.

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.)

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)

ScreenPosition

See GetScreenPosition

ScreenRect

See GetScreenRect

ScreenToClient(self, Point pt) → Point

Converts from screen to client window coordinates.

ScreenToClientXY(int x, int y) -> (x, y)

Converts from screen to client window coordinates.

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.

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.

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.

SendSizeEvent()
SetAcceleratorTable(self, AcceleratorTable accel)

Sets the accelerator table for this window.

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.

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.

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
SetBestFittingSize()

Use SetInitialSize

SetCaret(self, Caret caret)

Sets the caret associated with the window.

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.

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.

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.

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.

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.

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.

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.
SetDoubleBuffered(self, bool on)

Put the native window into double buffered or composited mode.

SetDropTarget(self, DropTarget dropTarget)

Associates a drop target with this window. If the window already has a drop target, it is deleted.

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.

SetEvtHandlerEnabled(self, bool enabled)
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()

SetFocus(self)

Set’s the focus to this window, allowing it to receive keyboard input.

SetFocusFromKbd(self)

Set focus to this window as the result of a keyboard action. Normally only called internally.

SetFocusIgnoringChildren(self)

In contrast to SetFocus (see above) this will set the focus to the panel even of there are child windows in the panel. This is only rarely needed.

SetFont(self, Font font) → bool

Sets the font for this window.

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.

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.

SetHelpTextForId(self, String text)

Associate this help text with all windows with the same id as this one.

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.

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.

SetLabel(self, String label)

Set the text which the window shows in its label if applicable.

SetLayoutDirection(self, int dir)

Set the layout direction (LTR or RTL) for this window.

SetMaxSize(self, Size maxSize)

A more convenient method than SetSizeHints for setting just the max size.

SetMinSize(self, Size minSize)

A more convenient method than SetSizeHints for setting just the min size.

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

SetNextHandler(self, EvtHandler handler)
SetOwnBackgroundColour(self, Colour colour)
SetOwnFont(self, Font font)
SetOwnForegroundColour(self, Colour colour)
SetPosition()

Move(self, Point pt, int flags=SIZE_USE_EXISTING)

Moves the window to the given position.

SetPreviousHandler(self, EvtHandler handler)
SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)

Sets the position and size of the window in pixels using a wx.Rect.

SetScrollPos(self, int orientation, int pos, bool refresh=True)

Sets the position of one of the built-in scrollbars.

SetScrollbar()
SetScrollbar(self, int orientation, int position, int thumbSize, int range,
bool refresh=True)

Sets the scrollbar properties of a built-in scrollbar.

SetSize(self, Size size)

Sets the size of the window in pixels.

SetSizeHints()
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.

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.

SetSizeWH(self, int width, int height)

Sets the size of the window in pixels.

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.

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.

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.

SetToolTip(self, ToolTip tip)

Attach a tooltip to the window.

SetToolTipString(self, String tip)

Attach a tooltip to the window.

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.

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.

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.

SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)

Allows specification of minimum and maximum virtual window sizes. 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 virtual area of the window outside the given bounds.

SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)

Allows specification of minimum and maximum virtual window sizes. 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 virtual area of the window outside the given bounds.

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.

SetWindowStyle()

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.

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.

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.

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.

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.

Shown

See IsShown and Show

Size

See GetSize and SetSize

Sizer

See GetSizer and SetSizer

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.

ThemeEnabled

See GetThemeEnabled and SetThemeEnabled

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.

ToolTip

See GetToolTip and SetToolTip

TopLevel

See IsTopLevel

TopLevelParent

See GetTopLevelParent

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.

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.

Unbind()

Disconnects the event handler binding for event from self. Returns True if successful.

UnregisterHotKey(self, int hotkeyId) → bool

Unregisters a system wide hotkey.

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.

UpdateClientRect

See GetUpdateClientRect

UpdateRegion

See GetUpdateRegion

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.

UseBgCol(self) → bool
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.

Validator

See GetValidator and SetValidator

VirtualSize

See GetVirtualSize and SetVirtualSize

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.

WindowStyle

See GetWindowStyle and SetWindowStyle

WindowStyleFlag

See GetWindowStyleFlag and SetWindowStyleFlag

WindowToClientSize(self, Size size) → Size
WindowVariant

See GetWindowVariant and SetWindowVariant

__class__

alias of type

__delattr__

x.__delattr__(‘name’) <==> del x.name

__dict__ = <dictproxy object at 0x04F013F0>
__getattribute__

x.__getattribute__(‘name’) <==> x.name

__hash__

x.__hash__() <==> hash(x)

__init__()
__module__ = 'sans.guiframe.gui_manager'
static __new__(S, ...) → a new object with type S, a subtype of T
__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__()
__setattr__

x.__setattr__(‘name’, value) <==> x.name = value

__str__

x.__str__() <==> str(x)

__weakref__

list of weak references to the object (if defined)

_setOORInfo(self, PyObject _self, bool incref=True)
_set_bookmark_flag()

The derivative class sets the bookmark flag value to indicate that it can be bookmarked

_set_copy_flag()

The derivative class sets the copy flag value to indicate that the action done can be recovered

_set_drag_flag()

The derivative class sets the drag flag value to indicate that dragging motion is possible

_set_paste_flag()

The derivative class sets the paste flag value to indicate that the action done can be recovered

_set_preview_flag()

The derivative class sets the preview flag value to indicate that it can be previewed

_set_print_flag()

The derivative class sets the print flag value to indicate that it can be printed

_set_redo_flag()

The derivative class sets the redo flag value to indicate that the action done can be recovered

_set_reset_flag()

The derivative class sets the reset flag value to indicate that it can be reset

_set_save_flag()

The derivative class sets the drag flag value to indicate that it can be saved

_set_undo_flag()

The derivative class sets the undo flag value to indicate that the current action done can be canceled

_set_zoom_flag()

The derivative class sets the zoom flag value to indicate that it can be zoomed

_set_zoomed_in_flag()

The derivative class sets the zoom in flag value to indicate that it can be zoomed in

_set_zoomed_out_flag()

The derivative class sets the zoom out flag value to indicate that it can be zoomed out

get_bookmark_flag()

Get the bookmark flag to update appropriately the tool bar

get_copy_flag()

Get the copy flag to update appropriately the tool bar

get_data()

return list of current data

get_drag_flag()

Get the drag flag to update appropriately the tool bar

get_manager()
get_paste_flag()

Get the copy flag to update appropriately the tool bar

get_preview_flag()

Get the preview flag to update appropriately the tool bar

get_print_flag()

Get the print flag to update appropriately the tool bar

get_redo_flag()

Get the redo flag to update appropriately the tool bar

get_reset_flag()

Get the reset flag to update appropriately the tool bar

get_save_flag()

Get the save flag to update appropriately the tool bar

get_state()

return the current state

get_undo_flag()

Get the undo flag to update appropriately the tool bar

get_zoom_flag()

Get the zoom flag to update appropriately the tool bar

get_zoom_in_flag()

Get the zoom in flag to update appropriately the tool bar

get_zoom_out_flag()

Get the zoom out flag to update appropriately the tool bar

group_id = None
has_changed()
on_batch_selection()
Parameters:event – contains parameter enable . when enable is set to True

the application is in Batch mode else the application is default mode(single mode)

on_bookmark()

The derivative class is on bookmark mode if implemented

on_copy()

The copy action if possible

on_drag()

The derivative class allows dragging motion if implemented

on_kill_focus()

The derivative class is on unfocus if implemented

on_paste()

The paste action if possible

on_preview()

Display a printable version of the class derivative

on_redo()

The previous action is restored if possible

on_reset()

The derivative class state is restored

on_save()

The state of the derivative class is restored

on_set_focus()

The derivative class is on focus if implemented

on_tap_focus()

Update menu on clicking the panel tap

on_undo()

The current action is canceled

on_zoom()

The derivative class is on zoom mode (using pane) if zoom mode is implemented

on_zoom_in()

The derivative class is on zoom in mode if implemented

on_zoom_out()

The derivative class is on zoom out mode if implemented

save_project()

return an xml node containing state of the panel that guiframe can write to file

set_manager()
thisown

The membership flag

uid = None
window_caption = 'Welcome panel'
window_name = 'default'
class sans.guiframe.gui_manager.ViewApp

Bases: wx._core.App

Active

IsActive(self) -> bool

Return True if our app has focus.

AddPendingEvent(self, Event event)
AppName

See GetAppName and SetAppName

AssertMode

See GetAssertMode and SetAssertMode

Bind()

Bind an event to an event handler.

Parameters:
  • event – One of the EVT_* objects that specifies the type of event to bind,
  • handler – A callable object to be invoked when the event is delivered to self. Pass None to disconnect an event handler.
  • 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.
  • id – Used to spcify the event source by ID instead of instance.
  • id2 – Used when it is desirable to bind a handler to a range of IDs, such as with EVT_MENU_RANGE.
ClassName

See GetClassName and SetClassName

Connect(self, int id, int lastId, int eventType, PyObject func)
Destroy()
Disconnect()

Disconnect(self, int id, int lastId=-1, EventType eventType=wxEVT_NULL, PyObject func=None) -> bool

Dispatch(self) → bool

Process the first event in the event queue (blocks until an event appears if there are none currently)

EvtHandlerEnabled

See GetEvtHandlerEnabled and SetEvtHandlerEnabled

Exit(self)

Exit the main loop thus terminating the application. :see: wx.Exit

ExitMainLoop(self)

Exit the main GUI loop during the next iteration of the main loop, (i.e. it does not stop the program immediately!)

ExitOnFrameDelete

See GetExitOnFrameDelete and SetExitOnFrameDelete

FilterEvent(self, Event event) → int

Filters all events. SetCallFilterEvent controls whether or not your override is called.

GetAppName(self) → String

Get the application name.

GetAssertMode(self) → int

Get the current OnAssert behaviour setting.

GetCallFilterEvent(self) → bool

Returns the state of the Call FilterEvent flag.

GetClassName(self) → String

Get the application’s class name.

static GetComCtl32Version() → int

Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if it wasn’t found at all. Raises an exception on non-Windows platforms.

GetEvtHandlerEnabled(self) → bool
GetExitOnFrameDelete(self) → bool

Get the current exit behaviour setting.

GetLayoutDirection(self) → int

Return the layout direction for the current locale.

static GetMacAboutMenuItemId() → long
static GetMacExitMenuItemId() → long
static GetMacHelpMenuTitleName() → String
static GetMacPreferencesMenuItemId() → long
static GetMacSupportPCMenuShortcuts() → bool
GetNextHandler(self) → EvtHandler
GetPreviousHandler(self) → EvtHandler
GetPrintMode(self) → int
GetTopWindow(self) → Window

Return the main top level window (if it hadn’t been set previously with SetTopWindow(), will return just some top level window and, if there not any, will return None)

GetTraits(self) → wxAppTraits

Return (and create if necessary) the app traits object to which we delegate for everything which either should be configurable by the user (then he can change the default behaviour simply by overriding CreateTraits() and returning his own traits object) or which is GUI/console dependent as then wx.AppTraits allows us to abstract the differences behind the common facade.

Todo :Add support for overriding CreateAppTraits in wxPython.
GetUseBestVisual(self) → bool

Get current UseBestVisual setting.

GetVendorName(self) → String

Get the application’s vendor name.

IsActive(self) → bool

Return True if our app has focus.

static IsDisplayAvailable() → bool

Tests if it is possible to create a GUI in the current environment. This will mean different things on the different platforms.

  • On X Windows systems this function will return False if it is not able to open a connection to the X display, which can happen if $DISPLAY is not set, or is not set correctly.
  • On Mac OS X a False return value will mean that wx is not able to access the window manager, which can happen if logged in remotely or if running from the normal version of python instead of the framework version, (i.e., pythonw.)
  • On MS Windows...
static IsMainLoopRunning() → bool

Returns True if we’re running the main loop, i.e. if the events can currently be dispatched.

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.

LayoutDirection

See GetLayoutDirection

MacHideApp(self)

Hide all application windows just as the user can do with the system Hide command. Mac only.

MacRequestUserAttention(self, int ?)
MainLoop()

Execute the main GUI event loop

NextHandler

See GetNextHandler and SetNextHandler

OnInit()
OnPreInit()

Things that must be done after _BootstrapApp has done its thing, but would be nice if they were already done by the time that OnInit is called.

Pending(self) → bool

Returns True if there are unprocessed events in the event queue.

PreviousHandler

See GetPreviousHandler and SetPreviousHandler

PrintMode

See GetPrintMode and SetPrintMode

ProcessEvent(self, Event event) → bool
ProcessIdle(self) → bool

Called from the MainLoop when the application becomes idle (there are no pending events) and sends a wx.IdleEvent to all interested parties. Returns True if more idle events are needed, False if not.

ProcessPendingEvents(self)

Process all events in the Pending Events list – it is necessary to call this function to process posted events. This normally happens during each event loop iteration.

RedirectStdio()

Redirect sys.stdout and sys.stderr to a file or a popup window.

RestoreStdio()
SendIdleEvents(self, Window win, IdleEvent event) → bool

Send idle event to window and all subwindows. Returns True if more idle time is requested.

SetAppName(self, String name)

Set the application name. This value may be used automatically by wx.Config and such.

SetAssertMode(self, int mode)

Set the OnAssert behaviour for debug and hybrid builds.

SetCallFilterEvent(self, bool callFilterEvent=True)

Set the Call FilterEvent flag. When set your override of FilterEvent will be called. SetCallFilterEvent’s purpose is to avoid any performance penalty when you have overriden FilterEvent, but don’t want it to be called, and also to reduce the runtime overhead when it is not overridden.

SetClassName(self, String name)

Set the application’s class name. This value may be used for X-resources if applicable for the platform

SetEvtHandlerEnabled(self, bool enabled)
SetExitOnFrameDelete(self, bool flag)

Control the exit behaviour: by default, the program will exit the main loop (and so, usually, terminate) when the last top-level program window is deleted. Beware that if you disable this behaviour (with SetExitOnFrameDelete(False)), you’ll have to call ExitMainLoop() explicitly from somewhere.

static SetMacAboutMenuItemId(long val)
static SetMacExitMenuItemId(long val)
static SetMacHelpMenuTitleName(String val)
static SetMacPreferencesMenuItemId(long val)
static SetMacSupportPCMenuShortcuts(bool val)
SetNextHandler(self, EvtHandler handler)
SetOutputWindowAttributes()

Set the title, position and/or size of the output window if the stdio has been redirected. This should be called before any output would cause the output window to be created.

SetPreviousHandler(self, EvtHandler handler)
SetPrintMode(self, int mode)
SetTopWindow()

Set the “main” top level window

SetUseBestVisual(self, bool flag, bool forceTrueColour=False)

Set whether the app should try to use the best available visual on systems where more than one is available, (Sun, SGI, XFree86 4, etc.)

SetVendorName(self, String name)

Set the application’s vendor name. This value may be used automatically by wx.Config and such.

TopWindow

See GetTopWindow and SetTopWindow

Traits

See GetTraits

Unbind()

Disconnects the event handler binding for event from self. Returns True if successful.

UseBestVisual

See GetUseBestVisual and SetUseBestVisual

VendorName

See GetVendorName and SetVendorName

WakeUpIdle(self)

Make sure that idle events are sent again. :see: wx.WakeUpIdle

Yield(self, bool onlyIfNeeded=False) → bool

Process all currently pending events right now, instead of waiting until return to the event loop. It is an error to call Yield recursively unless the value of onlyIfNeeded is True.

Warning :This function is dangerous as it can lead to unexpected reentrancies (i.e. when called from an event handler it may result in calling the same event handler again), use with extreme care or, better, don’t use at all!
See :wx.Yield, wx.YieldIfNeeded, wx.SafeYield
_BootstrapApp(self)

For internal use only

__class__

alias of type

__del__()
__delattr__

x.__delattr__(‘name’) <==> del x.name

__dict__ = <dictproxy object at 0x04DAC4B0>
__getattribute__

x.__getattribute__(‘name’) <==> x.name

__hash__

x.__hash__() <==> hash(x)

__init__()

Construct a wx.App object.

Parameters:
  • redirect – Should sys.stdout and sys.stderr be redirected? Defaults to True on Windows and Mac, False otherwise. If filename is None then output will be redirected to a window that pops up as needed. (You can control what kind of window is created for the output by resetting the class variable outputWindowClass to a class of your choosing.)
  • filename – The name of a file to redirect output to, if redirect is True.
  • useBestVisual – Should the app try to use the best available visual provided by the system (only relevant on systems that have more than one visual.) This parameter must be used instead of calling SetUseBestVisual later on because it must be set before the underlying GUI toolkit is initialized.
  • clearSigInt – Should SIGINT be cleared? This allows the app to terminate upon a Ctrl-C in the console like other GUI apps will.
Note :

You should override OnInit to do applicaition initialization to ensure that the system, toolkit and wxWidgets are fully initialized.

__module__ = 'sans.guiframe.gui_manager'
static __new__(S, ...) → a new object with type S, a subtype of T
__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__()
__setattr__

x.__setattr__(‘name’, value) <==> x.name = value

__str__

x.__str__() <==> str(x)

__swig_destroy__()
__weakref__

list of weak references to the object (if defined)

_setCallbackInfo(self, PyObject self, PyObject _class, bool incref=False)
_setOORInfo(self, PyObject _self, bool incref=True)
add_perspective()

Manually add a perspective to the application GUI

build_gui()

Build the GUI

display_splash_screen()

Displays the splash screen. It will exactly cover the main frame.

on_close_splash_screen()
open_file()

open a state file at the start of the application

outputWindowClass

alias of PyOnDemandOutputWindow

set_manager()

Sets a reference to the application manager of the GUI manager (Frame)

set_welcome_panel()

Set the welcome panel

Parameters:panel_class – class of the welcome panel to be instantiated
thisown

The membership flag

window_placement()

Determines the position and size of the application frame such that it fits on the user’s screen without obstructing (or being obstructed by) the Windows task bar. The maximum initial size in pixels is bounded by WIDTH x HEIGHT. For most monitors, the application will be centered on the screen; for very large monitors it will be placed on the left side of the screen.

class sans.guiframe.gui_manager.ViewerFrame

Bases: wx._windows.Frame

Main application frame

AcceleratorTable

See GetAcceleratorTable and SetAcceleratorTable

AcceptsFocus(self) → bool

Can this window have focus?

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.

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.

AddPendingEvent(self, Event event)
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.

AssociateHandle(self, long handle)

Associate the window with a new native handle

AutoLayout

See GetAutoLayout and SetAutoLayout

BackgroundColour

See GetBackgroundColour and SetBackgroundColour

BackgroundStyle

See GetBackgroundStyle and SetBackgroundStyle

BestSize

See GetBestSize

BestVirtualSize

See GetBestVirtualSize

Bind()

Bind an event to an event handler.

Parameters:
  • event – One of the EVT_* objects that specifies the type of event to bind,
  • handler – A callable object to be invoked when the event is delivered to self. Pass None to disconnect an event handler.
  • 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.
  • id – Used to spcify the event source by ID instead of instance.
  • id2 – Used when it is desirable to bind a handler to a range of IDs, such as with EVT_MENU_RANGE.
Border

See GetBorder

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.)

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.

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.

Caret

See GetCaret and SetCaret

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.

CenterOnParent(self, int dir=BOTH)

Center with respect to the the parent window

CenterOnScreen(self, int dir=BOTH)

Center the window on screen

Centre()

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.

CentreOnParent()

CenterOnParent(self, int dir=BOTH)

Center with respect to the the parent window

CentreOnScreen()

CenterOnScreen(self, int dir=BOTH)

Center the window on screen

CharHeight

See GetCharHeight

CharWidth

See GetCharWidth

Children

See GetChildren

ClassName

See GetClassName

ClearBackground(self)

Clears the window by filling it with the current background colour. Does not cause an erase background event to be generated.

ClientAreaOrigin

See GetClientAreaOrigin

ClientRect

See GetClientRect and SetClientRect

ClientSize

See GetClientSize and SetClientSize

ClientToScreen(self, Point pt) → Point

Converts to screen coordinates from coordinates relative to this window.

ClientToScreenXY(int x, int y) -> (x, y)

Converts to screen coordinates from coordinates relative to this window.

ClientToWindowSize(self, Size size) → Size
Close()

Quit the application

Command()

ProcessCommand(self, int winid) -> bool

Connect(self, int id, int lastId, int eventType, PyObject func)
Constraints

See GetConstraints and SetConstraints

ContainingSizer

See GetContainingSizer and SetContainingSizer

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.

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.

ConvertPixelPointToDialog(self, Point pt) → Point
ConvertPixelSizeToDialog(self, Size sz) → Size
Create()

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

CreateStatusBar()

CreateStatusBar(self, int number=1, long style=DEFAULT_STATUSBAR_STYLE, int winid=0, String name=StatusLineNameStr) -> StatusBar

CreateToolBar(self, long style=-1, int winid=-1, String name=ToolBarNameStr) → wxToolBar
Cursor

See GetCursor and SetCursor

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.

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.

DefaultAttributes

See GetDefaultAttributes

DefaultItem

See GetDefaultItem and SetDefaultItem

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.

DestroyChildren(self) → bool

Destroys all children of a window. Called automatically by the destructor.

Disable(self) → bool

Disables the window, same as Enable(false).

Disconnect()

Disconnect(self, int id, int lastId=-1, EventType eventType=wxEVT_NULL, PyObject func=None) -> bool

DissociateHandle(self)

Dissociate the current native handle from the window

DoGiveHelp(self, String text, bool show)
DoMenuUpdates(self, Menu menu=None)
DragAcceptFiles(self, bool accept)

Enables or disables eligibility for drop file events, EVT_DROP_FILES.

DropTarget

See GetDropTarget and SetDropTarget

EffectiveMinSize

See GetEffectiveMinSize

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.

EnableCloseButton(self, bool enable) → bool
Enabled

See IsEnabled and Enable

EventHandler

See GetEventHandler and SetEventHandler

EvtHandlerEnabled

See GetEvtHandlerEnabled and SetEvtHandlerEnabled

ExtraStyle

See GetExtraStyle and SetExtraStyle

static FindFocus() → Window

Returns the window or control that currently has the keyboard focus, or None.

FindWindowById(self, long winid) → Window

Find a child of this window by window ID

FindWindowByLabel(self, String label) → Window

Find a child of this window by label

FindWindowByName(self, String name) → Window

Find a child of this window by name

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.

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.

Font

See GetFont and SetFont

ForegroundColour

See GetForegroundColour and SetForegroundColour

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.

GetAcceleratorTable(self) → AcceleratorTable

Gets the accelerator table for this window.

GetAdjustedBestSize()

Use GetEffectiveMinSize instead.

GetAutoLayout(self) → bool

Returns the current autoLayout setting

GetBackgroundColour(self) → Colour

Returns the background colour of the window.

GetBackgroundStyle(self) → int

Returns the background style of the window.

See :SetBackgroundStyle
GetBestFittingSize()

Use GetEffectiveMinSize instead.

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.

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.

GetBestVirtualSize(self) → Size

Return the largest of ClientSize and BestSize (as determined by a sizer, interior children, or other means)

GetBorder(self, long flags) → int

GetBorder(self) -> int

Get border for the flags of this window

static GetCapture() → Window

Returns the window which currently captures the mouse or None

GetCaret(self) → Caret

Returns the caret associated with the window.

GetCharHeight(self) → int

Get the (average) character size for the current font.

GetCharWidth(self) → int

Get the (average) character size for the current font.

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..

static 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.

GetClassName(self) → String

Returns the class name of the C++ class using wxRTTI.

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...)

GetClientRect(self) → Rect

Get the client area position and size as a wx.Rect object.

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.

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.

GetConstraints(self) → LayoutConstraints

Returns a pointer to the window’s layout constraints, or None if there are none.

GetContainingSizer(self) → Sizer

Return the sizer that this window is a member of, if any, otherwise None.

GetCursor(self) → Cursor

Return the cursor associated with this window.

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.

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.

GetDropTarget(self) → DropTarget

Returns the associated drop target, which may be None.

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.

GetEventHandler(self) → EvtHandler

Returns the event handler for this window. By default, the window is its own event handler.

GetEvtHandlerEnabled(self) → bool
GetExtraStyle(self) → long

Returns the extra style bits for the window.

GetFont(self) → Font

Returns the default font used for this window.

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.

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.

GetGrandParent(self) → Window

Returns the parent of the parent of this window, or None if there isn’t one.

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.

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.

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.

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

GetIcon(self) → Icon
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.

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.

GetLayoutDirection(self) → int

Get the layout direction (LTR or RTL) for this window. Returns wx.Layout_Default if layout direction is not supported.

GetMaxHeight(self) → int
GetMaxSize(self) → Size
GetMaxWidth(self) → int
GetMenuBar(self) → MenuBar
GetMinHeight(self) → int
GetMinSize(self) → Size
GetMinWidth(self) → int
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.

GetNextHandler(self) → EvtHandler
GetParent(self) → Window

Returns the parent window of this window, or None if there isn’t one.

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.

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.

GetPreviousHandler(self) → EvtHandler
GetRect(self) → Rect

Returns the size and position of the window as a wx.Rect object.

GetScreenPosition(self) → Point

Get the position of the window in screen coordinantes.

GetScreenPositionTuple() -> (x, y)

Get the position of the window in screen coordinantes.

GetScreenRect(self) → Rect

Returns the size and position of the window in screen coordinantes as a wx.Rect object.

GetScrollPos(self, int orientation) → int

Returns the built-in scrollbar position.

GetScrollRange(self, int orientation) → int

Returns the built-in scrollbar range.

GetScrollThumb(self, int orientation) → int

Returns the built-in scrollbar thumb size.

GetSize(self) → Size

Get the window size.

GetSizeTuple() -> (width, height)

Get the window size.

GetSizer(self) → Sizer

Return the sizer associated with the window by a previous call to SetSizer or None if there isn’t one.

GetStatusBar(self) → StatusBar
GetStatusBarPane(self) → int
GetTextExtent(String string) -> (width, height)

Get the width and height of the text using the current font.

GetThemeEnabled(self) → bool

Return the themeEnabled flag.

GetTitle(self) → String
GetTmpDefaultItem(self) → Window

Return the temporary default item, which can be None.

GetToolBar(self) → wxToolBar
GetToolTip(self) → ToolTip

get the associated tooltip or None if none

GetTopLevelParent(self) → Window

Returns the first frame or dialog in this window’s parental hierarchy.

GetUpdateClientRect(self) → Rect

Get the update rectangle region bounding box in client coords.

GetUpdateRegion(self) → Region

Returns the region specifying which parts of the window have been damaged. Should only be called within an EVT_PAINT handler.

GetValidator(self) → Validator

Returns a pointer to the current validator for the window, or None if there is none.

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.

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.

GetWindowBorderSize(self) → Size

Return the size of the left/right and top/bottom borders.

GetWindowStyle()

GetWindowStyleFlag(self) -> long

Gets the window style that was passed to the constructor or Create method.

GetWindowStyleFlag(self) → long

Gets the window style that was passed to the constructor or Create method.

GetWindowVariant(self) → int
GrandParent

See GetGrandParent

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.

Handle

See GetHandle

HasCapture(self) → bool

Returns true if this window has the current mouse capture.

HasFlag(self, int flag) → bool

Test if the given style is set for this window.

HasMultiplePages(self) → bool
HasScrollbar(self, int orient) → bool

Does the window have the scrollbar for this orientation?

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.

HelpText

See GetHelpText and SetHelpText

Hide(self) → bool

Equivalent to calling Show(False).

HitTest(self, Point pt) → int

Test where the given (in client coords) point lies

HitTestXY(self, int x, int y) → int

Test where the given (in client coords) point lies

Icon

See GetIcon and SetIcon

Iconize(self, bool iconize=True)
Id

See GetId and SetId

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.

InheritsBackgroundColour(self) → bool
InitDialog(self)

Sends an EVT_INIT_DIALOG event, whose handler usually transfers data to the dialog via validators.

InvalidateBestSize(self)

Reset the cached best size value so it will be recalculated the next time it is needed.

IsActive(self) → bool
IsAlwaysMaximized(self) → bool
IsBeingDeleted(self) → bool

Is the window in the process of being deleted?

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.

IsEnabled(self) → bool

Returns true if the window is enabled for input, false otherwise.

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.

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.

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.

IsFrozen(self) → bool

Returns True if the window has been frozen and not thawed yet.

See :Freeze and Thaw
IsFullScreen(self) → bool
IsIconized(self) → bool
IsMaximized(self) → bool
IsRetained(self) → bool

Returns true if the window is retained, false otherwise. Retained windows are only available on X platforms.

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.

IsShown(self) → bool

Returns true if the window is shown, false if it has been hidden.

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.

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).

Label

See GetLabel and SetLabel

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.

LayoutDirection

See GetLayoutDirection and SetLayoutDirection

LineDown(self) → bool

This is just a wrapper for ScrollLines(1).

LineUp(self) → bool

This is just a wrapper for ScrollLines(-1).

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.

MacGetMetalAppearance(self) → bool
MacGetTopLevelWindowRef(self) → long
MacGetUnifiedAppearance(self) → bool
MacSetMetalAppearance(self, bool on)
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.

MaxHeight

See GetMaxHeight

MaxSize

See GetMaxSize and SetMaxSize

MaxWidth

See GetMaxWidth

Maximize(self, bool maximize=True)
MenuBar

See GetMenuBar and SetMenuBar

MinHeight

See GetMinHeight

MinSize

See GetMinSize and SetMinSize

MinWidth

See GetMinWidth

Move(self, Point pt, int flags=SIZE_USE_EXISTING)

Moves the window to the given position.

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.

MoveBeforeInTabOrder(self, Window win)

Same as MoveAfterInTabOrder except that it inserts this window just before win instead of putting it right after it.

MoveXY(self, int x, int y, int flags=SIZE_USE_EXISTING)

Moves the window to the given position.

Name

See GetName and SetName

Navigate(self, int flags=NavigationKeyEvent.IsForward) → bool

Does keyboard navigation from this window to another, by sending a wx.NavigationKeyEvent.

static NewControlId() → int

Generate a control id for the controls which were not given one.

static NextControlId(int winid) → int

Get the id of the control following the one with the given autogenerated) id

NextHandler

See GetNextHandler and SetNextHandler

OnPaint(self, PaintEvent event)
PageDown(self) → bool

This is just a wrapper for ScrollPages(1).

PageUp(self) → bool

This is just a wrapper for ScrollPages(-1).

Parent

See GetParent

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.

PopStatusText()
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.

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.

Position

See GetPosition and SetPosition

PostCreate()

Phase 3 of the 2-phase create <wink!> Call this method after precreating the window with the 2-phase create method.

PrepareDC(self, DC dc)

Call this function to prepare the device context for drawing a scrolled image. It sets the device origin according to the current scroll position.

static PrevControlId(int winid) → int

Get the id of the control preceding the one with the given autogenerated) id

PreviousHandler

See GetPreviousHandler and SetPreviousHandler

ProcessCommand(self, int winid) → bool
ProcessEvent(self, Event event) → bool
ProcessPendingEvents(self)
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.

PushStatusText()
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.

Rect

See GetRect and SetRect

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.

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.

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.

ReleaseMouse(self)

Releases mouse input captured with wx.Window.CaptureMouse.

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.

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.)

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)

RequestUserAttention(self, int flags=USER_ATTENTION_INFO)
Restore(self)
ScreenPosition

See GetScreenPosition

ScreenRect

See GetScreenRect

ScreenToClient(self, Point pt) → Point

Converts from screen to client window coordinates.

ScreenToClientXY(int x, int y) -> (x, y)

Converts from screen to client window coordinates.

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.

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.

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.

SendSizeEvent(self)
SetAcceleratorTable(self, AcceleratorTable accel)

Sets the accelerator table for this window.

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.

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.

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
SetBestFittingSize()

Use SetInitialSize

SetCaret(self, Caret caret)

Sets the caret associated with the window.

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.

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.

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.

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.

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.

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.

SetDefaultItem(self, Window child) → Window

Set this child as default, return the old default.

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.
SetDoubleBuffered(self, bool on)

Put the native window into double buffered or composited mode.

SetDropTarget(self, DropTarget dropTarget)

Associates a drop target with this window. If the window already has a drop target, it is deleted.

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.

SetEvtHandlerEnabled(self, bool enabled)
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()

SetFocus(self)

Set’s the focus to this window, allowing it to receive keyboard input.

SetFocusFromKbd(self)

Set focus to this window as the result of a keyboard action. Normally only called internally.

SetFont(self, Font font) → bool

Sets the font for this window.

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.

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.

SetHelpTextForId(self, String text)

Associate this help text with all windows with the same id as this one.

SetIcon(self, Icon icon)
SetIcons(self, wxIconBundle icons)
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.

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.

SetLabel(self, String label)

Set the text which the window shows in its label if applicable.

SetLayoutDirection(self, int dir)

Set the layout direction (LTR or RTL) for this window.

SetMaxSize(self, Size maxSize)

A more convenient method than SetSizeHints for setting just the max size.

SetMenuBar(self, MenuBar menubar)
SetMinSize(self, Size minSize)

A more convenient method than SetSizeHints for setting just the min size.

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

SetNextHandler(self, EvtHandler handler)
SetOwnBackgroundColour(self, Colour colour)
SetOwnFont(self, Font font)
SetOwnForegroundColour(self, Colour colour)
SetPosition()

Move(self, Point pt, int flags=SIZE_USE_EXISTING)

Moves the window to the given position.

SetPreviousHandler(self, EvtHandler handler)
SetRect(self, Rect rect, int sizeFlags=SIZE_AUTO)

Sets the position and size of the window in pixels using a wx.Rect.

SetScrollPos(self, int orientation, int pos, bool refresh=True)

Sets the position of one of the built-in scrollbars.

SetScrollbar()
SetScrollbar(self, int orientation, int position, int thumbSize, int range,
bool refresh=True)

Sets the scrollbar properties of a built-in scrollbar.

SetShape(self, Region region) → bool
SetSize(self, Size size)

Sets the size of the window in pixels.

SetSizeHints()
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.

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.

SetSizeWH(self, int width, int height)

Sets the size of the window in pixels.

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.

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.

SetStatusBar(self, StatusBar statBar)
SetStatusBarPane(self, int n)
SetStatusText()
SetStatusWidths(self, int widths)
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.

SetTitle(self, String title)
SetTmpDefaultItem(self, Window win)

Set this child as temporary default

SetToolBar(self, wxToolBar toolbar)
SetToolTip(self, ToolTip tip)

Attach a tooltip to the window.

SetToolTipString(self, String tip)

Attach a tooltip to the window.

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.

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.

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.

SetVirtualSizeHints(self, int minW, int minH, int maxW=-1, int maxH=-1)

Allows specification of minimum and maximum virtual window sizes. 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 virtual area of the window outside the given bounds.

SetVirtualSizeHintsSz(self, Size minSize, Size maxSize=DefaultSize)

Allows specification of minimum and maximum virtual window sizes. 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 virtual area of the window outside the given bounds.

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.

SetWindowStyle()

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.

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.

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.

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.

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.

ShowFullScreen(self, bool show, long style=FULLSCREEN_ALL) → bool
Shown

See IsShown and Show

Size

See GetSize and SetSize

Sizer

See GetSizer and SetSizer

StatusBar

See GetStatusBar and SetStatusBar

StatusBarPane

See GetStatusBarPane and SetStatusBarPane

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.

ThemeEnabled

See GetThemeEnabled and SetThemeEnabled

Title

See GetTitle and SetTitle

TmpDefaultItem

See GetTmpDefaultItem and SetTmpDefaultItem

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.

ToolBar

See GetToolBar and SetToolBar

ToolTip

See GetToolTip and SetToolTip

TopLevel

See IsTopLevel

TopLevelParent

See GetTopLevelParent

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.

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.

Unbind()

Disconnects the event handler binding for event from self. Returns True if successful.

UnregisterHotKey(self, int hotkeyId) → bool

Unregisters a system wide hotkey.

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.

UpdateClientRect

See GetUpdateClientRect

UpdateRegion

See GetUpdateRegion

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.

UseBgCol(self) → bool
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.

Validator

See GetValidator and SetValidator

VirtualSize

See GetVirtualSize and SetVirtualSize

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.

WindowStyle

See GetWindowStyle and SetWindowStyle

WindowStyleFlag

See GetWindowStyleFlag and SetWindowStyleFlag

WindowToClientSize(self, Size size) → Size
WindowVariant

See GetWindowVariant and SetWindowVariant

__class__

alias of type

__delattr__

x.__delattr__(‘name’) <==> del x.name

__dict__ = <dictproxy object at 0x04D9B2F0>
__getattribute__

x.__getattribute__(‘name’) <==> x.name

__hash__

x.__hash__() <==> hash(x)

__init__()

Initialize the Frame object

__module__ = 'sans.guiframe.gui_manager'
static __new__(S, ...) → a new object with type S, a subtype of T
__reduce__()

helper for pickle

__reduce_ex__()

helper for pickle

__repr__()
__setattr__

x.__setattr__(‘name’, value) <==> x.name = value

__str__

x.__str__() <==> str(x)

__weakref__

list of weak references to the object (if defined)

_add_current_plugin_menu()

add current plugin menu Look for plug-in menus Add available plug-in sub-menus.

_add_help_menu()

add help menu

_add_menu_application()

# Attach a menu item for each defined perspective or application. # Only add the perspective menu if there are more than one perspectives add menu application

_add_menu_data()

Add menu item item data to menu bar

_add_menu_edit()

add menu edit

_add_menu_file()

add menu file

_add_menu_tool()

Tools menu Go through plug-ins and find tools to populate the tools menu

_add_menu_view()

add menu items under view menu

_add_menu_window()

add a menu window to the menu bar Window menu Attach a menu item for each panel in our panel list that also appears in a plug-in.

Only add the panel menu if there is only one perspective and it has more than two panels. Note: the first plug-in is always the plotting plug-in. The first application #plug-in is always the second one in the list.

_check_applications_menu()

check the menu of the current application

_check_update()

Check with the deployment server whether a new version of the application is available. A thread is started for the connecting with the server. The thread calls a call-back method when the current version number has been obtained.

_find_plugins()

Find available perspective plug-ins

Parameters:dir – directory in which to look for plug-ins
Returns:list of plug-ins
_get_local_plugins()

get plugins local to guiframe and others

_get_panels_size()

find the proper size of the current panel get the proper panel width and height

_get_plotpanel_captions()

Get all the plotpanel cations

: return: list of captions

_load_panels()

Load all panels in the panels directory

_onAbout()

Pop up the about dialog

Parameters:evt – menu event
_onDrawIdle()

ReDraw with axes

_onTutorial()

Pop up the tutorial dialog

Parameters:evt – menu event
_on_open_state_app_helper()

Helps ‘_on_open_state_application()’ to find the extension of the current perspective/application

_on_open_state_application()
_on_open_state_project()
_on_preference_menu()

Build a panel to allow to edit Mask

_on_save_application()

save the state of the current active application

_on_save_project()

save the state of the SansView as *.svs

_on_status_event()

Display status message

_on_toggle_toolbar()

hide or show toolbar

_populate_file_menu()

Insert menu item under file menu

_popup_fixed_panel()
_popup_floating_panel()
_process_version()

Call-back method for the process of checking for updates. This methods is called by a VersionThread object once the current version number has been obtained. If the check is being done in the background, the user will not be notified unless there’s an update.

Parameters:
  • version – version string
  • standalone – True of the update is being checked in the background, False otherwise.
_redraw_idle()

Restart Idle

_remove_res_plot()

Try to remove corresponding res plot

: param id: id of the data

_setOORInfo(self, PyObject _self, bool incref=True)
_set_title_name()

Set the SansView title w/ the current application name

: param name: application name [string]

_setup_extra_custom()

Set up toolbar and welcome view if needed

_setup_layout()

Set up the layout

_setup_menus()

Set up the application menus

_setup_tool_bar()

add toolbar to the frame

_update_toolbar_helper()
add_data()

receive a dictionary of data from loader store them its data manager if possible send to data the current active perspective if the data panel is not active. :param data_list: dictionary of data’s ID and value Data

add_data_helper()
add_icon()

get list of child and attempt to add the default icon

add_perspective()

Add a perspective if it doesn’t already exist.

append_bookmark()

Bookmark available information of the panel on focus

build_gui()
check_multimode()

Check the perspective have batch mode capablitity

clear_panel()
create_gui_data()
delete_data()
delete_panel()

delete panel given uid

enable_add_data()

Enable append data on a plot panel

enable_bookmark()

Bookmark

enable_copy()

enable copy related control

enable_drag()

drag

enable_edit_menu()

enable menu item under edit menu depending on the panel on focus

enable_paste()

enable paste

enable_preview()

preview

enable_print()

print

enable_redo()

enable redo

enable_reset()

reset the current panel

enable_save()

save

enable_undo()

enable undo related control

enable_zoom()

zoom

enable_zoom_in()

zoom in

enable_zoom_out()

zoom out

freeze()
full_draw()

Draw the panels with axes in the schedule to full dwar list

get_context_menu()

Get the context menu items made available by the different plug-ins. This function is used by the plotting module

get_current_perspective()

return the current perspective

get_data()
get_data_manager()
get_paneinfo()

Get pane Caption from window_name

Parameters:name – window_name in AuiPaneInfo

: return: AuiPaneInfo of the name

get_schedule()

Get schedule

get_style()
get_toolbar()
hide_all_plotpanels()

Hide all plotpanels shown

Parameters:event – menu event
hide_panel()

hide panel except default panel

load_data()

load data from command line

load_folder()

Load entire folder

load_from_cmd()

load data from cmd or application

load_state()

load data from command line or application

on_batch_selection()
Parameters:event – contains parameter enable . when enable is set to True

the application is in Batch mode else the application is default mode(single mode)

on_bookmark_panel()

bookmark panel

on_change_caption()

Change the panel caption

Parameters:
  • name – window_name of the pane
  • old_caption – current caption [string]
  • new_caption – new caption [string]
on_cleanup_dock()

Set Cleanup Dock option

on_close_welcome_panel()

Close the welcome panel

on_color_selection()
Parameters:event – contains parameters for id and color
on_copy_panel()

copy the last panel on focus if possible

on_drag_panel()

drag apply to the panel on focus

on_load_data()

received an event to trigger load from data plugin

on_paste_panel()

paste clipboard to the last panel on focus

on_preview_panel()

preview information on the panel on focus

on_print_panel()

print available information on the last panel on focus

on_read_batch_tofile()

Open a file dialog , extract the file to read and display values into a grid

on_redo_panel()

redo the last cancel action done on the last panel on focus

on_reset_panel()

reset the current panel

on_save_helper()

Save state into a file

on_save_panel()

save possible information on the current panel

on_set_batch_result()

Display data into a grid in batch mode and show the grid

on_set_plot_focus()

Set focus on a plot panel

on_undo_panel()

undo previous action of the last panel on focus if possible

on_view()

A panel was selected to be shown. If it’s not already shown, display it.

Parameters:evt – menu event
on_zoom_in_panel()

zoom in of the panel on focus

on_zoom_out_panel()

zoom out on the panel on focus

on_zoom_panel()

zoom on the current panel if possible

onfreeze()
open_with_externalapp()

Display data in the another application , by default Excel

open_with_localapp()

Display value of data into the application grid :param data: dictionary of string and list of items

plot_data()

send a list of data to plot

popup_panel()

Add a panel object to the AUI manager

Parameters:p – panel object to add to the AUI manager
Returns:ID of the event associated with the new panel [int]
post_init()

This initialization method is called after the GUI has been created and all plug-ins loaded. It calls the post_init() method of each plug-in (if it exists) so that final initialization can be done.

quit_guiframe()

Pop up message to make sure the user wants to quit the application

read_batch_tofile()

Extract value from file name and Display them into a grid

remove_data()

Delete data state if data_id is provide delete theory created with data of id data_id if theory_id is provide if delete all true: delete the all state else delete theory

reset_bookmark_menu()

Reset Bookmark menu list

: param panel: a control panel or tap where the bookmark is

set_current_perspective()

set the current active perspective

set_custom_default_perspective()

Set default starting perspective

set_data()

set data to current perspective

set_default_perspective()

Choose among the plugin the first plug-in that has “set_default_perspective” method and its return value is True will be as a default perspective when the welcome page is closed

set_input_file()
Parameters:input_file – file to read
set_manager()

Sets the application manager for this frame

Parameters:manager – frame manager
set_panel_on_focus()

Store reference to the last panel on focus update the toolbar if available update edit menu if available

set_panel_on_focus_helper()

Helper for panel on focus with data_panel

set_perspective()

Sets the perspective of the GUI. Opens all the panels in the list, and closes all the others.

Parameters:panels – list of panels
set_plot_unfocus()

Un focus all plot panels

set_plotpanel_fixed()

make the plot panel fixed

set_plotpanel_floating()

make the plot panel floatable

set_schedule()

Set schedule

set_schedule_full_draw()

Add/subtract the schedule full draw list with the panel given

Parameters:
  • panel – plot panel
  • func – append or del [string]
set_theory()
set_welcome_panel()

Sets the default panel as the given welcome panel

Parameters:panel_class – class of the welcome panel to be instantiated
setup_custom_conf()

Set up custom configuration if exists

show_all_plotpanels()

Show all plotpanels shown

Parameters:event – menu event
show_batch_frame()

show the grid of result

show_data_panel()

show the data panel

show_panel()

Shows the panel with the given id

Parameters:uid – unique ID number of the panel to show
show_welcome_panel()

Display the welcome panel

thisown

The membership flag

update_data()
update_theory()
write_batch_tofile()

Helper to write result from batch into cvs file

sans.guiframe.gui_manager._change_current_dir()

Get the path of the current ran file and change the application current directory to the directory of that file

sans.guiframe.gui_manager._find_local_config()

Find configuration file for the current application

Table Of Contents

Previous topic

events

Next topic

gui_statusbar

This Page