dummyapp

sans.guiframe.dummyapp

Dummy application. Allows the user to set an external data manager

class sans.guiframe.dummyapp.DummyView

Bases: sans.guiframe.gui_manager.ViewApp

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 0x03DF2BB0>
__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.dummyapp'
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.dummyapp.SansView
__init__()

Initialization

__module__ = 'sans.guiframe.dummyapp'
class sans.guiframe.dummyapp.TestPlugin

Bases: sans.guiframe.plugin_base.PluginBase

__init__()

Abstract class for gui_manager Plugins.

__module__ = 'sans.guiframe.dummyapp'
add_color()

Adds color to a plugin

can_load_data()

if return True, then call handler to laod data

clear_panel()

clear all related panels

delete_data()

Delete all references of data which id are in data_list.

get_batch_capable()

Check if the plugin has a batch capability

get_context_menu()

This method is optional.

When the context menu of a plot is rendered, the get_context_menu method will be called to give you a chance to add a menu item to the context menu.

A ref to a Graph object is passed so that you can investigate the plot content and decide whether you need to add items to the context menu.

This method returns a list of menu items. Each item is itself a list defining the text to appear in the menu, a tool-tip help text, and a call-back method.

Parameters:graph – the Graph object to which we attach the context menu
Returns:a list of menu items with call-back function
get_extensions()

return state reader and its extensions

get_panels()

Create and return the list of wx.Panels for your plug-in. Define the plug-in perspective.

Panels should inherit from DefaultPanel defined below, or should present the same interface. They must define “window_caption” and “window_name”.

Parameters:parent – parent window
Returns:list of panels
get_perspective()

Get the list of panel names for this perspective

get_tools()

Returns a set of menu entries for tools

is_always_active()

return True is this plugin is always active and it is local to guiframe even if the user is switching between perspectives

is_in_use()
get a data id a list of data name if data data is
currently used by the plugin and the name of the plugin

data_name = ‘None’ in_use = False example [(data_name, self.sub_menu)]

load_data()

Load data

load_folder()

Load entire folder

on_batch_selection()

need to be overwritten by the derivated class

on_perspective()

Call back function for the perspective menu item. We notify the parent window that the perspective has changed.

Parameters:event – menu event
on_set_state_helper()

update state

populate_file_menu()

Append menu item under file menu item of the frame

populate_menu()

Create and return the list of application menu items for the plug-in. :param parent: parent window

Returns:plug-in menu
post_init()

Post initialization call back to close the loose ends

set_batch_selection()

the plugin to its batch state if flag is True

set_data()

receive a list of data and use it in the current perspective

set_default_perspective()

Call back method that True to notify the parent that the current plug-in can be set as default perspective. when returning False, the plug-in is not candidate for an automatic default perspective setting

set_is_active()
set_state()

update state

set_theory()
Parameters:theory_list – list of information

related to available theory state

use_data()

return True if these plugin use data

Table Of Contents

Previous topic

data_state

Next topic

events

This Page