Changes between Initial Version and Version 1 of GUI_-_Classes


Ignore:
Timestamp:
Feb 23, 2008, 4:18:58 AM (16 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GUI_-_Classes

    v1 v1  
     1The GUIObject class provides a JavaScript wrapper around GUI objects, allowing their properties to be manipulated.
     2
     3= GUIObject Methods =
     4
     5== getByName ==
     6
     7'''Overview:'''
     8 * Returns another GUIObject, matching a specific name.
     9'''Syntax:'''
     10 * var newguiobject = oldguiobject.getByName("objectname");
     11'''Parameters:'''
     12 * objectname: A string that corresponds to the name given in the GUI XML file. Case sensitive.
     13'''Returns:'''
     14 * A new GUIObject, or null if no match was found.
     15'''Notes:'''
     16 * Has the same effect as the global getGUIObjectByName(name) function.
     17
     18== toString ==
     19(Implicit)
     20
     21'''Overview:'''
     22 * Overrides the default string conversion to include the name of this GUI object.
     23'''Syntax:'''
     24 * var name = "The name is " + guiobject;
     25'''Parameters:'''
     26 * None.
     27'''Returns:'''
     28 * A string of the form '[GUIObject: objectname]'
     29'''Notes:'''
     30 * This function is called implicitly by the JavaScript engine to convert this object to a string.
     31
     32= GUIObject Properties =
     33
     34== parent ==
     35
     36'''Overview:'''
     37 * The GUIObject corresponding to the parent of this object.
     38'''Type:'''
     39 * GUIObject
     40'''Notes:'''
     41 * Has the value null if the object has no parent. Read-only.
     42
     43== anything else ==
     44
     45'''Overview:'''
     46 * Read/write access to object-type specific settings.
     47'''Type:'''
     48 * boolean / integer / double / string / GUIColor / GUISize
     49'''Notes:'''
     50 * Unrecognised parameters are passed to the GUI system as object-specific settings. The valid settings are documented in the GUI TDD, with the addition of 'caption'. If the object does not recognise the setting, an error is reported and a JS exception is thrown.
     51
     52These data types are used to pass data in and out of GUI objects. All have constructors (with parameters in the same order as the properties described below) and toString methods.
     53
     54= GUIMouse Properties =
     55
     56== x, y ==
     57
     58'''Overview:'''
     59 * The coordinates of the mouse, measured in pixels from the top-left corner of the screen.
     60'''Type:'''
     61 * integer
     62'''Notes:'''
     63 * Read-only.
     64
     65== buttons ==
     66
     67'''Overview:'''
     68 * Indicates the state of the mouse buttons. Bit 0 = LMB, bit 1 = RMB, bit 2 = MMB.
     69'''Type:'''
     70 * integer
     71'''Notes:'''
     72 * If the mouse buttons are read by code inside a mouse-related event handler, mouse-down events set the appropriate bit of 'buttons' high before executing the code, while mouse-up events clear the appropriate bit of 'buttons' to zero after running the code.
     73
     74= GUISize Properties =
     75
     76== left, top, right, bottom ==
     77
     78'''Overview:'''
     79 * The absolute components of a rectangle, measured in pixels from the top-left corner of the parent object.
     80'''Type:'''
     81 * integer
     82
     83== rleft, rtop, rright, rbottom ==
     84
     85'''Overview:'''
     86 * The relative components of a rectangle, measured in percentages of the width/height of the parent object.
     87'''Type:'''
     88 * integer
     89'''Notes:'''
     90 * The absolute and relative components are added to compute the final size of a GUI object. Either can be negative.
     91
     92= GUIColor Properties =
     93
     94== r, g, b, a ==
     95
     96'''Overview:'''
     97 * The red/green/blue/alpha components of a colour, in the range 0.0 to 1.0.
     98'''Type:'''
     99 * double