by Carl Ranson >> Sun, 7 Feb 1999 23:47:47 GMT
Hi All,
I've just worked out how to make editable text cells in tables become fully selected when the cell gets the focus. This allows the user to overtype existing cell contents.
I added the following method to our descendant of table.
rowColumnChg(table : Table input) updating;
constants
EM_SETSEL = #00B1;
vars
editHandle : Integer;
result : Integer;
begin
inheritMethod(table);
editHandle := call findWindowEx(table.hwnd, 0,'Edit'&0.Character, null); if editHandle <> null then
result := call postMessage(editHandle, EM_SETSEL, 0,-1);
endif;
end;
This accesses and sets the selection of a textbox "window" (in the windows sense) whenever the cell changes. A similar technique can be used to access the combobox jade uses for inputType_combo cells.
You may also need to setup the following two external functions
findWindowEx(hwndParent : Integer; hwndChildAfter : Integer; classname : String; windowname : String) : Integer is FindWindowExA in user32; postMessage(hwnd:Integer; msg:Integer; wparam:Integer; lparam:Integer):Integer is PostMessageA in user32;
Regards
Carl Ranson (Turing Solutions Ltd)