21
edits
Changes
→Adding readonly flag to bio_edit
Outputs the null-terminated string pointed to by "str", on the screen starting at row "row" and column "col", upto "len" characters. As with bio_move(), 0 is the top row, and 0 is the leftmost column. If the string is longer than "len", then only "len" characters are displayed, but if it is shorter than "len", then the entire string is displayed left-justified in the field. However, if "len" is 0 or less, then the field length is considered to be the actual length of the string (i.e. the entire string is displayed). Afterwards, the cursor is positioned after the last character of the field. (Note that on systems where output is buffered, this function should not flush the output buffer). The results are undefined if the specified values indicate a field that does not fit on the screen.
<big>int bio_edit(char* '''str''', int '''row''', int '''col''', <br />
int '''fieldlen''', int '''maxdatalen''', int '''*insertmode''', int '''*offset''',<br />
int '''*curpos''', int '''IsTextEditor''', int '''ReadOnly''')</big>
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 />
Note that the conditions of termination are changed if '''“IsTextEditor”''' flag is true (non-zero). See '''“IsTextEditor”''' section for detail.
If '''"ReadOnly"''' has a true value (non-zero) then any attempt to change the content of '''"str"''' should be ignored. Note that all other keys should work. (Function and Non-ASCII keys). This make the '''bio_edit()''' funciton "read only", but still user can scroll the text to left or right and etc....
The function returns an int identifying the key that was pressed to exit. (This function uses the same key codes as bio_getch())