GUI (version 1.13)

index
d:\cruisecontrol\game-client-system\game\common\scripts\gui.py

This is a module that handles the graphical user interface provided by Ogre through CEGUI.
http://www.cegui.org.uk/wiki/index.php/Falagard_System_base_widgets_reference

 
Modules

      

 

gameGUI

 

 

 

 

 
Classes

      

 

SystemGUI

exceptions.Exception(exceptions.BaseException)

GUIError

 

 
class SystemGUI

   

 

Methods defined here:

addEventSubscriber(self, windowName, eventName, funcName, funcArgs)

Assigns a event subscriber for the widget for a layout must have been successfully been loaded through call loadGUI()
where windowName is a window that exists in the loaded layout. eventName is a legal event name (see note bellow).
functionName is a python string that will be executed on call. This is must be a defined function or 
method. This must be accessable from the __init__.py file meaning that if the call is callable from the setup
script then it will be successfully called (raises an python error otherwise)
args is the python (functionName) method or function arguments passed to the function. Can be dictionary string.
Raises GUIError on failure.
The type of events are dependent on the widget called. Subscribing an event to a widget that does not support it will
crash the system. To get a list of events supported you can look at the following links. The public attributes has a list of events
that will be called. Usually you can use the name preciding 'Event'. For instance button has an name EventClicked, you call with event
name being 'Clicked'. 
button (http://www.cegui.org.uk/api_reference/classCEGUI_1_1PushButton.html#65d6b712c449f7a9244dcc9d40c0d825)
window (http://www.cegui.org.uk/api_reference/classCEGUI_1_1Window.html)
editbox (http://www.cegui.org.uk/api_reference/classCEGUI_1_1Editbox.html)
Bug: Subscribing an event to a widget that does not support it will crash the system

addItem(self, windowName, itemName)

Appends item last to a window. Widget exists and is of type TaharezLook/Combobox, TaharezLook/Listbox
Item is added to the widget, windowName is the name of the widget and itemName is the name 
of the item added (as displayed in window). Raises GUIError on failure

addLayout(self, fileName)

Loads a legal CEGUI formated layout where fileName is name of the file and  
must exist be accessable in resource paths.
Passing no fileName will unload the previusly loaded layout.

call(self, windowName, func, arg)

Used in Hikari interface to forward the call to the flash window. Returns None on failure.
Where func is the defined external function in the flash control and arg is a string.

clearItems(self, windowName)

Clears items from a window. Widget exists and is of type TaharezLook/Combobox, TaharezLook/Listbox
Item is added to the widget, windowName is the name of the widget. Raises GUIError on failure

delLayout(self, windowName)

Loads a legal CEGUI formated layout where fileName is name of the file and  
must exist be accessable in resource paths.
Passing no fileName will unload the previusly loaded layout.

getCheckboxSelected(self, windowName)

Returns selected items from a window. Widget exists and is of type TaharezLook/Checkbox
Returns True/False. Raises GUIError on failure

getProperty(self, windowName, PropertyName)

Direct access to gui widgets window property in a loaded layout. 
Refer to CEGUI reference at http://www.cegui.org.uk/api_reference/
or http://www.cegui.org.uk/api_reference/namespaceCEGUI_1_1WindowProperties.html
Raises GUIError if windowName does not exist in current layout or property is 
not present in this widget.

getSelectedItems(self, windowName)

Returns selected items from a window. Widget exists and is of type TaharezLook/Combobox, TaharezLook/Listbox
The selected items are returned in a list. Raises GUIError on failure

getText(self, windowName)

Gets a gui text value in a loaded layout having window with name windowName.
Raises GUIError if windowName does not exist in current layout.

loadImageSet(self, fileName)

Loads an image set from file. The fileName is the name of a file loaded through the ogre resource manager.
If the imageset is loaded we dont do anything. If it is not found we notify failure.
Raises GUIError on failure.

loadLayout(self, fileName, w=256, h=256)

Loads a legal CEGUI formated layout where fileName is name of the file and  
must exist be accessable in resource paths.
Passing no fileName will unload the previusly loaded layout.

setPosition(self, windowName, x, y)

setProperty(self, windowName, PropertyName, PropertyValue)

Direct access to gui widgets window property in a loaded layout. 
Refer to CEGUI reference at http://www.cegui.org.uk/api_reference/
or http://www.cegui.org.uk/api_reference/namespaceCEGUI_1_1WindowProperties.html
Raises GUIError if windowName does not exist in current layout or property is 
not present in this widget.
 
For Hikari
        play (start, stop, loop, rewind)
        transparent (bool) : uses alpha channel
        show (bool) : hides/shows window
        opacity (real) : sets window opacity

setText(self, windowName, text)

Sets a gui text value in a loaded layout having window with name windowName.
Raises GUIError if windowName does not exist in current layout.

 

 
Data

      

 

__author__ = 'Kjartan A Jonsson'
__copyright__ = 'Copyright (c) 2007 aGameCompany'
__license__ = 'aGameCompany'
__source__ = '$Source: /cvsroot/game-client-system/scripts/GUI.py,v $'
__version__ = '$Revision: 1.13 $'
systemGUI = <GUI.SystemGUI instance at 0x00B98CD8>

 

 
Author

      

 

Kjartan A Jonsson