ENTER key

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

User avatar
serge_girard
Posts: 3161
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

ENTER key

Post by serge_girard »

Hello,

Is there a simple way to force a form to focus on the next textbox/combo/.. control when one hits the ENTER like(TAB) key?

Now I use this:

Code: Select all

      @ 400,430 TEXTBOX t1   ;
         WIDTH 120 ;
         HEIGHT 25 ;
         FONT "Arial" SIZE 8 ;
         VALUE 'some value';
         NUMERIC ;
         INPUTMASK '999999.99' ;
         ON GOTFOCUS   Form_1.t1.BackColor := WHITE ;
         ON LOSTFOCUS {Form_1.t1.BackColor := SILVER   } ;
      	ON ENTER     {Form_1.t2.SetFocus }   // next textbox
What I want is to to the force to behave on every ENTER to move to the next control (just like in old Clipper..)
The code above works but with many controls it becomes rather confusing.

Thx, Serge(like
There's nothing you can do that can't be done...
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

ENTER key

Post by Pablo César »

Hi Serge,

Give a look at viewtopic.php?p=33041#p33041

If is with this that you can solve your case.

In this example uses SetConfOFF() but you can disable it.

SET NAVIGATION EXTENDED is very used for navigating as you require and when you want to force, there are: _SetNextFocus function which is using InsertTab() for navigation.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: ENTER key

Post by Rathinagiri »

I use 'SET NAVIGATION EXTENDED'. It works except for tree, listbox and Grid.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
serge_girard
Posts: 3161
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: ENTER key

Post by serge_girard »

Thx Pablo, I will try !

One thing: when SET NAVIGATION EXTENDED is set in main will it be applicable in all forms or do I have to set it on/off in every form?

Serge
There's nothing you can do that can't be done...
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

ENTER key

Post by Pablo César »

It will work in all forms upto the time you change back for: SET NAVIGATION STANDARD

Because:
#xtranslate SET NAVIGATION STANDARD ;
=> ;
_HMG_SYSDATA \[ 255 \] := .F.
There is also how to change behaviour for navigation at GRID with: SET CELLNAVIGATIONMODE EXCEL

This last change for moviment to DOWN + ENTER in Grids.

This must be documented at our Grid.htm (DOC) because is not (I guess).
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
serge_girard
Posts: 3161
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: ENTER key

Post by serge_girard »

So much to learn... !

Thanks very much Pablo !

Serge
There's nothing you can do that can't be done...
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

ENTER key

Post by Pablo César »

serge_girard wrote: Sat Mar 18, 2017 1:31 pm So much to learn... !
You are welcome friend.

Do not worry, always all of us we have !
Pablo César wrote: Sat Mar 18, 2017 12:18 pm There is also how to change behaviour for navigation at GRID with: SET CELLNAVIGATIONMODE EXCEL

This last change for moviment to DOWN + ENTER in Grids.

This must be documented at our Grid.htm (DOC) because is not (I guess).
Please Dr, Claudio, would please be so kind to replace it ?
 
Grid.rar
..\DOC\data
(13.58 KiB) Downloaded 144 times
 
Please also note in this attached file I removed:
Screen131.png
Screen131.png (10.41 KiB) Viewed 3359 times
And added:
Screen132.png
Screen132.png (21.76 KiB) Viewed 3359 times
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
serge_girard
Posts: 3161
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: ENTER key

Post by serge_girard »

And to REMEMBER ....!

Anyway now it works like I want. Thanks again!

Serge
There's nothing you can do that can't be done...
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

ENTER key

Post by Pablo César »

Just for information and guidance:
Rathinagiri wrote: Sat Mar 18, 2017 11:03 am I use 'SET NAVIGATION EXTENDED'. It works except for tree, listbox and Grid.
I guess for some more neither: Buttons, EditBoxes, HyperLinks, Images, Labels, RadioGroups, Sliders, Tabs and Spinners. Not works at all.

For the rest, I tested it works basically in TextBoxes, ComboBoxes, DatePickers and CheckBoxes. Only.
 
serge_girard wrote: Sat Mar 18, 2017 5:58 pm Anyway now it works like I want. Thanks again!
Nice one, Serge. :)
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
quartz565
Posts: 667
Joined: Mon Oct 01, 2012 12:37 pm
Location: Thessaloniki, Greece
Contact:

Re: ENTER key

Post by quartz565 »

Thank you Pablo !!
Best Regards,
Nikos.

os: Windows Server 2019 - 64
Post Reply