Hi,
I have a text box, which I am using as a terminal. Therefore, it is set as an indicator only and I send what is typed into it over the serial port and then add the responce to the box myself using SetCtrlVal.
The problem that I am having is that when I recieve a backspace I would like to remove one charactor out of the box. I do this by reading the last line, deleting the last character out of it and then replacing that line with the modified one. I also move the cursor back one space as well:
GetNumTextBoxLines (thru_panel, COM_THRU_TEXT, &line);
GetCtrlAttribute (thru_panel, COM_THRU_TEXT, ATTR_TEXT_SELECTION_START, &cursor);
GetTextBoxLine (thru_panel, COM_THRU_TEXT, line-1, lbuf);
lbuf[strlen(lbuf)-1] = '\0';
ReplaceTextBoxLine (thru_panel, COM_THRU_TEXT, line-1, lbuf);
SetCtrlAttribute (thru_panel, COM_THRU_TEXT, ATTR_TEXT_SELECTION_START, cursor-1);
However, when I do a replace It adds a new line at the end of the of the text buffer, and any new text that I append goes on this new blank line rather than at the end of the previous line where the cursor is. I try to delete this line, but it will not delete. Any ideas?
thanks
jackson