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

RICHEDITBOX and TAB-KEY

Post by Karl »

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: 3165
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: RICHEDITBOX and TAB-KEY

Post by serge_girard »

Karl,

Maybe this will help:

Code: Select all

ON KEY TAB   [ OF <ParentWindow> ] ACTION nil 
Serge
There's nothing you can do that can't be done...
Karl
Posts: 39
Joined: Tue Mar 14, 2017 12:24 pm
DBs Used: DBF

Re: RICHEDITBOX and TAB-KEY

Post by Karl »

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: 911
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland

Re: RICHEDITBOX and TAB-KEY

Post by edk »

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

Re: RICHEDITBOX and TAB-KEY

Post by Karl »

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: 3165
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: RICHEDITBOX and TAB-KEY

Post by serge_girard »

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

Serge
There's nothing you can do that can't be done...
Karl
Posts: 39
Joined: Tue Mar 14, 2017 12:24 pm
DBs Used: DBF

Re: RICHEDITBOX and TAB-KEY

Post by Karl »

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: 243
Joined: Mon Sep 05, 2016 3:04 am
Location: Poland

Re: RICHEDITBOX and TAB-KEY

Post by KDJ »

Karl

It seems to me this function is not documented. Source code is in h_hotkey.prg.
edk
Posts: 911
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland

Re: RICHEDITBOX and TAB-KEY

Post by edk »

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

Re: RICHEDITBOX and TAB-KEY

Post by Karl »

Thanks to all. :)

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