Open main menu

CDOT Wiki β

Changes

OOP344 Assignment One

1,799 bytes added, 07:59, 28 September 2009
no edit summary
**If “radio” is true, then the *status is set to one, checkbox is displayed and function is terminated returning space.
**If “radio” is false, then the value of *status is toggled between 0 and 1, the checkbox is displayed and function is exited returning space.
 
====int io_displayMenuItem(..........)====
 
<big>int io_displayMenuItem(const char *format, const char *menuItem, int row, int col, int status);</big>
 
Allows the user to display a menu-item at row and col on the screen. Depending on the value of status; being zero or non-zero, the menu-item will be surrounded by format characters or space respectively.
 
The menuItem argument will be always shown surrounded by two characters.
* If status is zero, then at row and col a space will be shown, then the menuItem and finally another space.
 
* If status is non-zero, then at row and col format[0] will be shown then the menuItem and finally format[1].
 
After the Menu item is displayed, the cursor is always placed under the first character of mentItem. (position row and col+1)
 
====int io_menuItem(..........)====
 
<big>int io_menuItem(const char *format, const char *menuItem, int row, int col, int* status);</big>
 
io_menuItem() allows the user to make a single item selection. "status" points to the status of the selection, that can be zero or non-zero. If "status" is initially set to anything but zero, io_menuItem() corrects value to one. "format" holds the shape of the selection indicator as io_displayMenuItem() function.
 
io_menuItem() begins the selection by displaying the menu item according to its “*status”. (Remember that the value of "*status" is corrected before the editing begins). Then the function waits for the user input.
 
*If the user input is any of the printable keys (' ' < key <= '~') excluding space, it should be ignored (no action taken). If the user input is any of the function keys, the function is terminated returning the key.
*If the user input is SPACE, then the *status is set to one, menu item is displayed and function is terminated returning space.
==Platforms==
 
===Windows Visual C++===