Open main menu

CDOT Wiki β

Changes

Console UI Core Classes - OOP344 20111

1,251 bytes added, 21:48, 24 March 2011
Methods
void draw(int fn = C_FULL_FRAME);
</syntaxhighlight></big>
First if If '''fn''' is '''C_FULL_FRAME''', then it will call its parent draw. Then It will draw all the CFrame's draw()''Fields''' in the '''Dialog'''.<br />If '''fn ''' is zero not '''C_FULL_FRAME''', then it will just draw all the fields on '''Fields''' in the dialog'''Dialog'''.<br />If '''fn''' is a non-zero positive value, otherwise then it will only draw the field with sequence '''Field''' number '''fn'''in the dialog. (the first First added '''Field''' is field sequence number is 1one.)
<big><syntaxhighlight lang="cpp">
int edit(int fn = C_FULL_FRAME);
</syntaxhighlight></big>
If '''CDialog''' is not editable (all fields are non-editable), it will just display the Dialog and then waits for the user to enter a key and then terminates the function returning the key.<br />
If fn is '''0''' or less, then before editing, the draw method is called with '''fn''' as its argument and then editing begins from the first editable Field.
 
If fn is greater than '''0''' then editing begins from the first editable key on or after Field number '''fn'''.
 
Note that fn is the sequence number of field and not the index. (First field number is one)
 
Start editing from field number '''fn''';
 
Call the edit of each field and depending on the value returned, do the following:<br />
# For '''ENTER_KEY''', '''TAB_KEY''' and '''DOWN_KEY''', go to next editable Field , if this is the last editable Field then restart from Field number one.
# For '''UP_KEY''' go to the previous editable Field, if there is no previous editable Field, go to the last editable Field in the Dialog.
# For any other key, terminate the edit function returning the character which caused the termination.
<big><syntaxhighlight lang="cpp">