Article # 67, added by Geoworks, historical record
| first | previous | index | next | last |

OmniGo JTableClass




Q. What is the difference between TableClass and 
JTableClass? 
 
A. JTableClass is a subclass of TableClass that contains 
OmniGo-specific functionality. If you are writing your 
application for the OmniGo, use JTableClass. 
 
 
Q. How can my application tell when a cell is being edited? 
 
A. You can check TI_privateFlags for TPF_EDIT_CELL_TEXT. 
 
 
Q. The right side of the table is cut off. This is true not 
just for the table itself, but also for the scrolling 
controls in the title bar, which I have no control over. 
 
A. The problem is that the table's column widths add up to 
240 or more. Change the widths to add up to about 238. You 
can play with the value to get it how you want it to look; 
235 leaves a bit too much room on the right. 
 
 
Q. How can I monitor when a user changes the selected cell 
in a Table? 
 
A. Unfortunately, there is no default mechanism which will 
send you MSG_TABLE_SELECT whenever the selection changes. 
 
You will have to subclass these messages and have them send 
you notification whenever the selection changes: 
  MSG_TABLE_CHANGE_ROW_RANGE_SELECTION - initiated by cursor 
keys 
  MSG_TABLE_SELECT - initiated by pen/pointer selection 
  MSG_TABLE_REDRAW_CURRENT_SELECTION - selection changed by 
scrolling action 
  MSG_SET_CURRENT_SELECTION - program initiated selection 
change. 
 
 
Q. How can I set a default selection row for a table? I have 
successfully managed to make a single cell be the default 
selection but never the row. 
 
A. Use MSG_TABLE_SELECT(tcl, (TRIT_ROW|TCF_START_SELECT)); 
"(TRIT_ROW|TCF_START_SELECT)" will tell it to select the 
entire row. 
 
 
Q. I have noticed that in a multi column table on the 
OmniGo, I can cursor up and down but not left and right. 
What do I have to do to allow the user to change columns? 
 
A. You can make the table scroll horizontally by making the 
GenView that contains the table scrollable in the horizontal 
dimension. BUT DON'T DO THIS! It violates the OmniGo UI 
Specification to have anything wider than the screen. 
Horizontal scrolling on the OmniGo is strongly discouraged. 
 
To make a table show different columns, you should provide 
UI to allow the user to signal the app that s/he wants to 
view a different set of columns. 
 
 
Q. How can I start to edit a table cell from the keyboard 
(i.e. not double-tapping the pen)? 
 
A. You can intercept MSG_META_KBD_CHAR at the Table object, 
and if it's the Enter key, then do the following: 
 
Make a local variable of type TableEditCellTextParams 
structure. Use MSG_TABLE_GET_CURRENT_SELECTION to get the 
current selected cell, then set the TableEditCellTextParams 
structure's TECT_cells field with that cell; set the 
TECT_text to NullHandle, and TECT_length to 0. Then call 
MSG_TABLE_START_EDIT_CELL_TEXT on yourself, passing in the 
TableEditCellTextParams structure. 
 
 
Q. How can I make a Table cell accept ink input? 
 
A. Add a line like this to your 
MSG_TABLE_START_EDIT_CELL_TEXT method: 
  @call 
MyTableView::MSG_GEN_VIEW_SET_INK_TYPE(GVIT_QUERY_OUTPUT); 
 
Then do something similar for MSG_TABLE_STOP_EDIT_CELL_TEXT: 
  @call 
MyTableView::MSG_GEN_VIEW_SET_INK_TYPE(GVIT_PRESSES_ARE_NOT_
INK); 
 
Make sure to @callsuper() before each of the above.