This control displays a numbered 2d array of tiles, of some specified dimensions in X and Y.
Exactly one of these tiles is selected at any given time. The user can click on a different tile to select that tiles. The dimensions of the array can be changed programmatically, by calling SetWidth and SetHeight.
Public Member Functions |
|
clip () | |
Utility routine that ensures a value is
within a specified range. |
|
__init__ () | |
Initialize the class. |
|
SetWidth () | |
Change the number of columns in the
displayed array. |
|
SetHeight () | |
Change the number of rows in the displayed
array. |
|
SetCoord () | |
Specify which tile should be selected.
|
|
GetCoord () | |
Enable () | |
Set the enabled state of this control (bool)
|
|
Disable () | |
Same as Enable( False ) |
|
Public Attributes |
|
int | kMinElements = 1 |
int | kMaxElements = 10 |
int | kMinCellSize = 20 |
ArrayChoice.ArrayChoice.clip | ( | ) |
Utility routine that ensures a value is within a specified range.
ArrayChoice.ArrayChoice.__init__ | ( | ) |
Initialize the class.
parent: The window that is a parent of this control id: a unique id width: the number of columns in the array height: the number of rows in the array coord: the array element that should be first selected (0,0 is the top-left corner) pos: position (x,y) for the upper-left corner of the control size: tuple (w,h) for the size of the control
ArrayChoice.ArrayChoice.SetWidth | ( | ) |
Change the number of columns in the displayed array.
If the currently selected tile is not within that range, it is moved to the last available column.
ArrayChoice.ArrayChoice.SetHeight | ( | ) |
Change the number of rows in the displayed array.
If the currently selected tile is not within that range, it is moved to the last available row.
ArrayChoice.ArrayChoice.SetCoord | ( | ) |
Specify which tile should be selected.
Out-of-range values are clipped to be in range. Setting the current tile this way does not send an ArrayChangedEvent.
ArrayChoice.ArrayChoice.GetCoord | ( | ) |
ArrayChoice.ArrayChoice.Enable | ( | ) |
Set the enabled state of this control (bool)
ArrayChoice.ArrayChoice.Disable | ( | ) |
Same as Enable( False )
int ArrayChoice.ArrayChoice.kMaxElements = 10 |
int ArrayChoice.ArrayChoice.kMinCellSize = 20 |