FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Going to a field directly.
Posts: 723
Joined: Tue Sep 04, 2007 08:45 AM
Going to a field directly.
Posted: Mon Apr 14, 2014 07:23 AM
Guys:

I got a dialog that input different values in a range form:
Code (fw): Select all Collapse
                                                From                         To
  Field 1 Label:                        [    get 1          ]      [    get 2           ]
  Field 2 Label:                        [    get 3          ]      [    get 4           ]
  Field 3 Label:                        [                   ]      [                    ]
  Field 4 Label:                        [                   ]      [                    ]
  Field 5 Label:                        [                   ]      [                    ]
.
.
.
  Field n Label:                        [                   ]      [                    ]

How do I go to one of the 2 possible fields for each row with an accelerator key ?

Thank you very much.
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Going to a field directly.
Posted: Mon Apr 14, 2014 02:18 PM

Hunter,

I'm not clear on exactly what you want. If you just want to go to one of the two fields in the same row, then Tab or Shift-Tab will do it. But, I expect you already knew that.

If you are looking to be able to jump to any field from any other field, then you are looking at an awful lot of key combinations which I don't think would be very useful to the user.

So can you please explain in more detail what you want?

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 723
Joined: Tue Sep 04, 2007 08:45 AM
Re: Going to a field directly.
Posted: Tue Apr 15, 2014 06:31 PM

James:

Thank for your reply. What I'm trying to do is to move to one of the two fields directly. the dialog consists of two column and 10 row field sets. If the user wants to go to field #2 in row 7 he presses an accelerator key to get to that field instead of pressing the tab key 13 times. I hope this explains more clearly what I'm trying to do. Thank you.

Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Going to a field directly.
Posted: Wed Apr 16, 2014 01:42 PM

Hunter,

Well that is clear, but I wouldn't advise it. The user would have to memorize 20 key combinations, and I can't see that happening. The reason phone numbers are 7 digits long is due to a study a long time back that showed that 7 items was the most numbers that most people could memorize easily.

They can just hold the Tab or Shift-Tab down, to move through multiple fields, although it is very hard to stop on the field you want.

Why can't they just use the mouse?

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 723
Joined: Tue Sep 04, 2007 08:45 AM
Re: Going to a field directly.
Posted: Thu Apr 17, 2014 01:31 AM

James:

Thank you for your excellent answer !

Posts: 90
Joined: Wed Nov 07, 2007 08:56 AM
Re: Going to a field directly.
Posted: Thu Apr 17, 2014 08:15 AM

Well, we can suppose the user know and remember the alphabet.

Hunter, you must use a say before every get with the accelerator key. A for Get1, B for Get2, etc.

Posts: 2170
Joined: Fri Jul 18, 2008 01:24 AM
Re: Going to a field directly.
Posted: Thu Apr 17, 2014 08:08 PM
Hi,
I just created this code. Maybe it's useful for you.
Please try it and let us know. (Example: CTRL + D = oGet[4])
Code (fw): Select all Collapse
//---------------------------------------------------------
//IR A UN DETERMINADO GET  (Francisco Alegria P. 17/04/2014)
//----------------------------
Function GoAnyGet()
local oDlg, aGet:=Array(10), oGet:=Array(10), n
local aLet := {"A","B","C","D","E","F","G","H","I","J"}, nPos

for n := 1 to len(aGet)
   aGet[n] := "I'M NUMBER "+Str(n,2)
next

DEFINE DIALOG oDlg RESOURCE "BUSCADOR10"

REDEFINE GET oGet[1]  VAR aGet[1]  ID 201 OF oDlg
REDEFINE GET oGet[2]  VAR aGet[2]  ID 202 OF oDlg
REDEFINE GET oGet[3]  VAR aGet[3]  ID 203 OF oDlg
REDEFINE GET oGet[4]  VAR aGet[4]  ID 204 OF oDlg
REDEFINE GET oGet[5]  VAR aGet[5]  ID 205 OF oDlg
REDEFINE GET oGet[6]  VAR aGet[6]  ID 206 OF oDlg
REDEFINE GET oGet[7]  VAR aGet[7]  ID 207 OF oDlg
REDEFINE GET oGet[8]  VAR aGet[8]  ID 208 OF oDlg
REDEFINE GET oGet[9]  VAR aGet[9]  ID 209 OF oDlg
REDEFINE GET oGet[10] VAR aGet[10] ID 210 OF oDlg
REDEFINE BUTTON ID 313 OF oDlg ACTION oDlg:End() CANCEL

oDlg:bKeyDown := {|nKey| iif( (nPos := AScan(aLet,CHR(nKey))) != 0 ;
                 .and.  GetKeyState(VK_CONTROL),;
                 oGet[nPos]:SetFocus(), ) }

ACTIVATE DIALOG oDlg CENTERED
RETURN NIL

Regards.
Francisco J. Alegría P.

Chinandega, Nicaragua.



Fwxh-MySql-TMySql

Continue the discussion