Changes

Jump to: navigation, search

BIO Functions oop344 20111

604 bytes added, 10:09, 17 February 2011
int bio_flag(..........)
== Tester Program and demo ==
* R0.91:
*:[svn://zenit.senecac.on.ca/oop344/trunk/Testers/biotestR0_2.c svn://zenit.senecac.on.ca/oop344/trunk/Testers/biotestR0_2.c]
===Demo===
On Matrix login and:
<big><pre>
$ ~fardad.soleimanloo/biotest
</pre></big>
 
===Bugs===
===DemoFixes===- R0.91 added IsTextEditor and Readonly Selection to test 10 upon asotoude's (irc nick) request- R0.911 fixed line 264, <pre>if(key != F5_KEY & key != F6_KEY)</pre> to <pre>if(key != F5_KEY && key != F6_KEY)</pre>
== File Names ==
'''''Mac OS X Key-Codes'''''
* #define '''UP_KEY''' 259
 
* #define ''' DOWN_KEY''' 258
 
* #define ''' LEFT_KEY''' 260
 
* #define ''' RIGHT_KEY''' 261
 
* #define ''' PGUP_KEY''' 6 ''/* Control + f */''
 
* #define ''' PGDN_KEY''' 2 ''/* Control + b */''
 
* #define ''' ENTER_KEY''' 10
 * #define ''' TAB_KEY''' 9 
* #define ''' BACKSPACE_KEY''' 127
 
* #define ''' DEL_KEY''' 330 ''/* FN + Delete */''
 
* #define ''' HOME_KEY''' 1 ''/* Control + a */''
 
* #define ''' END_KEY''' 5 ''/* Control + e */''
 
* #define ''' ESCAPE_KEY''' 27
 * #define ''' INSERT_KEY''' 16 ''/* Unconfirmed Control + p*/'' 
* #define ''' SPACE_KEY''' 32
* #define ''' F1_KEY''' 270
 
* #define ''' F2_KEY''' 271
 
* #define ''' F3_KEY''' 272
 
* #define ''' F4_KEY''' 273
 
* #define ''' F5_KEY''' 274
 
* #define ''' F6_KEY''' 275
 
* #define ''' F7_KEY''' 276
 
* #define ''' F8_KEY''' 277
 
* #define ''' F9_KEY''' 278
 
* #define ''' F10_KEY''' 279
 
* #define ''' F11_KEY''' 280
 
* #define ''' F12_KEY''' 281
int* '''curpos''', int '''IsTextEditor''', int '''ReadOnly''')</big>
<br />
<table align="center">
<tr align="center">
<td>[[Image:bio_edit_variables.png|||]]</td>
</tr>
</table>
Allows the user to perform full screen editing of the null-terminated string pointed to by '''"str"'''. The parameter '''"row"''' identifies the row of the screen for the field (0 is the top row), while '''"col"''' indicates the starting column of the field (0 is the left-most column). The parameter '''"maxdatalen"''' specifies the maximum length of the string '''"str"'''. The parameter '''"fieldlen"''' specifies the length of the field in which editing is to be performed (visible area of '''“str”'''). The pointer '''"offset"''' points to an integer holding the index of the first character of'''"str"''' shown in the field. The pointer '''"curpos"''' points to an integer holding the position of the cursor in the field (0 is the first position). '''"insertmode"''' is a pointer pointing to an integer flag that is true (1) for insert mode being on, or false (0) for insert mode being off.<br />
bio_flag() begins the selection by displaying the checkbox 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 excluding space (' ' < key <= i.e. greater than space or less than or equal '~') excluding space, it should be ignored (no action taken or maybe you can beep!! ). If the user input is any of the function keys, the function is terminated returning the key.
* If the user input is SPACE:
** If '''“radio”''' is true, then the '''"*status"''' is set to one, checkbox is displayed and function is terminated returning space.
bio_menuItem() begins the selection by displaying the menu item according to its '''“*status”'''using [[#void io displayMenuItem.28...........29|bio_displayMenuItem()]]. (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 excluding space (' ' < key <= i.e. greater than space or less than or equal '~') excluding space, it should be ignored (no action taken), and wait the user to input again.
* If the user input is any of the non-ASCII 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 the ASCII value of space character.

Navigation menu