RICHEDITBOX and TAB-KEY

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Karl
Posts: 39
Joined: Tue Mar 14, 2017 12:24 pm
DBs Used: DBF
Has thanked: 10 times
Been thanked: 2 times

RICHEDITBOX and TAB-KEY

Post by Karl » Wed May 10, 2017 8:44 am

Hello to all,

as a newcomer in HMG I don´t know if my problem was solved in another topic? I´m working with RICHEDITBOX and load a blank file but with TAPSTOPPS (Left-Tab, Right-Tab, Deci-Tab). To jump from one TABSTOPP to the next you must press the Shortcut-Key Ctrl+Tab. But everybody is used to take the TAB-KEY and not the Ctrl+Tab. If someone accidentially presses the TAB-KEY, he is out of the program and in the following control. Can I change this behavior. It would be a great help for me and my customers to solve this problem.

Thanks in advance from Ulm-Germany
Karl
WIN 10 64-bit, WIN 7 32-bit, HMG 3.4.4, 32-bit

User avatar
serge_girard
Posts: 1836
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Has thanked: 275 times
Been thanked: 63 times
Contact:

Post by serge_girard » Wed May 10, 2017 11:29 am

Karl,

Maybe this will help:

Code: Select all

ON KEY TAB   [ OF <ParentWindow> ] ACTION nil 
Serge

Karl
Posts: 39
Joined: Tue Mar 14, 2017 12:24 pm
DBs Used: DBF
Has thanked: 10 times
Been thanked: 2 times

Post by Karl » Wed May 10, 2017 12:11 pm

Hi Serge,

Thanks for your tip. I tried immediately but it is only the half solution. Now pressing the TAB-KEY doesn´t push me out of the RICHEDITBOX-Control. But I want to do the TAB the same as the CTRL+TAB. Most users are not familiar with the shortcuts of Rich Edit but all know what TAB does normally. Do you think that there is a solution for this ?

Best regards Karl
WIN 10 64-bit, WIN 7 32-bit, HMG 3.4.4, 32-bit

edk
Posts: 164
Joined: Thu Oct 16, 2014 11:35 am
DBs Used: DBF
Location: Poland
Has thanked: 43 times
Been thanked: 96 times

Post by edk » Wed May 10, 2017 2:07 pm

Hi Karl.
For hmg version 3.4.3 and above try this (dirty way):

Code: Select all

ON KEY TAB ACTION HMG_PressKey( 17, 9)
For earlier versions of hmg try this:

Code: Select all

ON KEY TAB ACTION (Keybd_Event( 17, .F. ), Keybd_Event( 9, .F. ), Keybd_Event( 9, .T. ), Keybd_Event( 17, .T. ))

Karl
Posts: 39
Joined: Tue Mar 14, 2017 12:24 pm
DBs Used: DBF
Has thanked: 10 times
Been thanked: 2 times

Post by Karl » Wed May 10, 2017 3:44 pm

Thanks a lot dear edk,

It works perfect. I am very happy and would like to know, where I can find the documentation of this command. :)

Kind regards
Karl
WIN 10 64-bit, WIN 7 32-bit, HMG 3.4.4, 32-bit

User avatar
serge_girard
Posts: 1836
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Has thanked: 275 times
Been thanked: 63 times
Contact:

Post by serge_girard » Wed May 10, 2017 4:04 pm

drive:/hmg.3.4.44/doc/data/index.htm
where drive is c or d...

Serge

Karl
Posts: 39
Joined: Tue Mar 14, 2017 12:24 pm
DBs Used: DBF
Has thanked: 10 times
Been thanked: 2 times

Post by Karl » Wed May 10, 2017 5:05 pm

Serge, of course I know where to find the commands ON KEY and RELEASE KEY but where do I find the HMG_PressKey(7, 19) ? :D
I want to learn more....

Karl
WIN 10 64-bit, WIN 7 32-bit, HMG 3.4.4, 32-bit

KDJ
Posts: 166
Joined: Mon Sep 05, 2016 3:04 am
Location: Poland
Been thanked: 149 times

Post by KDJ » Wed May 10, 2017 5:35 pm

Karl

It seems to me this function is not documented. Source code is in h_hotkey.prg.

edk
Posts: 164
Joined: Thu Oct 16, 2014 11:35 am
DBs Used: DBF
Location: Poland
Has thanked: 43 times
Been thanked: 96 times

Post by edk » Wed May 10, 2017 6:00 pm

Indeed Krzysztof :)
17 is vk_control code
9 is vk_tab code
Keybd_Event ( vk_code , lKeyMessage )
where lKeyMessage: False is for key pressed Down; True for key released Up.
Last edited by edk on Wed May 10, 2017 6:38 pm, edited 1 time in total.

Karl
Posts: 39
Joined: Tue Mar 14, 2017 12:24 pm
DBs Used: DBF
Has thanked: 10 times
Been thanked: 2 times

Post by Karl » Wed May 10, 2017 6:27 pm

Thanks to all. :)

Karl
WIN 10 64-bit, WIN 7 32-bit, HMG 3.4.4, 32-bit

Post Reply