Recent

Author Topic: WinCE and TAB  (Read 6101 times)

JohnvdWaeter

  • Full Member
  • ***
  • Posts: 168
    • http://www.jvdw.nl
WinCE and TAB
« on: January 07, 2008, 02:59:36 pm »
Hi All,

How to Tab from Edit1 to Edit2 using the keys on Smartphone or Pocketpc?

Or, using the KOL-CE-objects, how to Tab from Editbox1 to Editbox2?

Not all devices have touchscreens...

tia!
John

arnoldb

  • Jr. Member
  • **
  • Posts: 96
RE: WinCE and TAB
« Reply #1 on: January 08, 2008, 07:01:39 am »
John, what I do is to use the Enter key - Set the form's keypreview to true, then assign the form's keypress event, and check for the nominated key to move focus to the next control - example for using Enter:

procedure TForm1.FormKeyPress(Sender:TObject; var Key:char)
begin
  if Key = #13 then  //Enter is #13
  begin
     form1.SelectNext(form1.ActiveControl,true,true);
     key:=#0;
  end;
end;

You can also change the key used; example down-arrow etc.

JohnvdWaeter

  • Full Member
  • ***
  • Posts: 168
    • http://www.jvdw.nl
RE: WinCE and TAB
« Reply #2 on: January 08, 2008, 08:27:00 am »
Arnold,
Yes, tried that approach, a bit expanded with different handling depending on the sending object. #13 is sometimes needed in comboboxes and memo's, same for up's and downs... and the selectnext does not test for visibility (I have offscreen-controls that become selected). I guess there is no other way then handling such keys per control.
Thanks anyway! :-)

John

yuriy_sydorov

  • Full Member
  • ***
  • Posts: 152
RE: WinCE and TAB
« Reply #3 on: January 08, 2008, 07:29:30 pm »
JohnvdWaeter: Set Tabulate or TabulateEx for a form and keyboard navigation will be enabled (or call Tabulate or TabulateEx methods if you do not use MCK).

JohnvdWaeter

  • Full Member
  • ***
  • Posts: 168
    • http://www.jvdw.nl
RE: WinCE and TAB
« Reply #4 on: January 09, 2008, 10:17:14 am »
Hi Yury,

Right, thats works... except if there is TKolMemo. I guess I have to handle that one myself...

Thanks!
John

yuriy_sydorov

  • Full Member
  • ***
  • Posts: 152
RE: WinCE and TAB
« Reply #5 on: January 09, 2008, 05:27:20 pm »
Yes. TKolMemo does not work yet. I'll fix it later.