1. Trapping the TAB key
Does anyone know how, using Win32lib, to trap when the TAB key is
pressed in: edit control, combo, dropdownlist?
Also I think I know the answer here, but...I can trap the key up/down
events in a drop down list but no in a combo box. Is this because of
the editing feature in a combo box?
And has anyone else had problems with using the ES_NUMERIC style in an
edit control? This doesn't seem to work anymore.
Euman, I took your challenge. I'm fairly close to releasing a first
stab of a data grid control (like I was looking for earlier). This
control will support multiple columns, with column and row headers.
Each column can be a separate control type (text, numeric, file browse,
date, combo, drop down, toggle field, checkbox), have its own
background/text color, can be protected (user cannot change). If I get
a few more of these minor things ironed out I might have a initial
working version some time next week.
Jonas
2. Re: Trapping the TAB key
jonas, i received this from derek some time ago:
the standard is to trap the TAB kay and not pass it on to the keypress
handler.
There is a trick you can use though. It will mean that you will ahve to do
your own tab processing though.
If you do this ...
VOID = setTabCodes(0)
then no key will cause tabbing between the controls - plus the TAB key gets
passed through to the keypress handler.
Alternatively, you could do ...
VOID = setTabCodes(VK_F8)
to make the F8 key become the new tabbing key.
----- Original Message -----
From: "Judith" <camping at txcyber.com>
To: "EUforum" <EUforum at topica.com>
Sent: Wednesday, August 15, 2001 8:15 PM
Subject: Tab Key question and Win32lib
george
----- Original Message -----
From: "Jonas Temple" <jktemple at yhti.net>
To: "EUforum" <EUforum at topica.com>
Sent: Monday, May 06, 2002 4:34 PM
Subject: Trapping the TAB key
>
> Does anyone know how, using Win32lib, to trap when the TAB key is
> pressed in: edit control, combo, dropdownlist?
>
> Also I think I know the answer here, but...I can trap the key up/down
> events in a drop down list but no in a combo box. Is this because of
> the editing feature in a combo box?
>
> And has anyone else had problems with using the ES_NUMERIC style in an
> edit control? This doesn't seem to work anymore.
>
> Euman, I took your challenge. I'm fairly close to releasing a first
> stab of a data grid control (like I was looking for earlier). This
> control will support multiple columns, with column and row headers.
> Each column can be a separate control type (text, numeric, file browse,
> date, combo, drop down, toggle field, checkbox), have its own
> background/text color, can be protected (user cannot change). If I get
> a few more of these minor things ironed out I might have a initial
> working version some time next week.
>
> Jonas
>
>
>
>
3. Re: Trapping the TAB key
- Posted by euman at bellsouth.net
May 06, 2002
----- Original Message -----
From: "Jonas Temple" <jktemple at yhti.net>
>
> Does anyone know how, using Win32lib, to trap when the TAB key is
> pressed in: edit control, combo, dropdownlist?
I dont mind helping those who help theirself.....
Here's what you need to look for Jonas.....
global function shift_left (atom x, integer count)
return x * power (2, count)
end function
global function MAKELONG (atom a, atom b)
return or_bits (a, shift_left (b, 16))
end function
atom user32
user32 = open_dll("user32.dll")
constant
xPeekMessage = define_c_func(user32,
"PeekMessageA",{C_POINTER,C_LONG,C_UINT,C_UINT,C_UINT},C_LONG)
,xGetParent = define_c_func(user32, "GetParent",{C_LONG},C_LONG)
,xSendMessage = define_c_func(user32, "SendMessageA", {C_LONG, C_LONG, C_INT,
C_LONG}, C_LONG)
global function SendMessage(atom hwnd, atom msg, atom wParam, atom lParam)
return c_func(xSendMessage,{hwnd, msg, wParam, lParam})
end function
constant WM_CHAR = 258,
PM_REMOVE = 1
-- this should be consealed in your edit controls subclass in "if iMsg =
WM_KEYDOWN then"
if wParam = 9 then -- handle tabkey fo edit control
junk = c_func(xPeekMessage,{tagMSG, c_func(xGetParent,{handle}), 0, 0,
PM_REMOVE})
junk = SendMessage(handle, WM_CHAR, wParam, MAKELONG(1, 14))
end if
handle will be the control ID....should work the same for MLE's, Combo's etc,
etc..
This traps the tabkey by sending a message to itself for further processing.
WOW, Cool eh?
Euman
4. Re: Trapping the TAB key
- Posted by euman at bellsouth.net
May 06, 2002
BTW, tagMSG = allocate(24)
I realised I did it again and left something out of the message.
Its a habbit.
Euman
----- Original Message -----
From: <euman at bellsouth.net>
>
> ----- Original Message -----
> From: "Jonas Temple" <jktemple at yhti.net>
> >
> > Does anyone know how, using Win32lib, to trap when the TAB key is
> > pressed in: edit control, combo, dropdownlist?
>
> I dont mind helping those who help theirself.....
>
> Here's what you need to look for Jonas.....
>
> global function shift_left (atom x, integer count)
> return x * power (2, count)
> end function
>
> global function MAKELONG (atom a, atom b)
> return or_bits (a, shift_left (b, 16))
> end function
>
> atom user32
> user32 = open_dll("user32.dll")
>
> constant
> xPeekMessage = define_c_func(user32,
> "PeekMessageA",{C_POINTER,C_LONG,C_UINT,C_UINT,C_UINT},C_LONG)
> ,xGetParent = define_c_func(user32, "GetParent",{C_LONG},C_LONG)
> ,xSendMessage = define_c_func(user32, "SendMessageA", {C_LONG, C_LONG, C_INT,
> C_LONG}, C_LONG)
>
> global function SendMessage(atom hwnd, atom msg, atom wParam, atom lParam)
> return c_func(xSendMessage,{hwnd, msg, wParam, lParam})
> end function
>
> constant WM_CHAR = 258,
> PM_REMOVE = 1
>
> -- this should be consealed in your edit controls subclass in "if iMsg =
> WM_KEYDOWN then"
> if wParam = 9 then -- handle tabkey fo edit control
> junk = c_func(xPeekMessage,{tagMSG, c_func(xGetParent,{handle}), 0, 0,
> PM_REMOVE})
> junk = SendMessage(handle, WM_CHAR, wParam, MAKELONG(1, 14))
> end if
>
> handle will be the control ID....should work the same for MLE's, Combo's etc,
> etc..
>
> This traps the tabkey by sending a message to itself for further processing.
>
> WOW, Cool eh?
>
> Euman
5. Re: Trapping the TAB key
- Posted by euman at bellsouth.net
May 06, 2002
Derek and all,
I wasnt aware you had made this possible in Win32lib.
Just trying to be of use..
BTW, how much code does it take you to do the same thing I
presented (as a wrapper)?
Euman
----- Original Message -----
From: "Derek Parnell" <ddparnell at bigpond.com>
>
> Once again Euphoria Man, you're cleaver tricks are much more simpler
> than the Win32lib way
>
> euman at bellsouth.net wrote:
> > This traps the tabkey by sending a message to itself for further
> > processing.
> >
> > WOW, Cool eh?
>
>
> compared to setTabkeys(0)? Sure man, whatever.
>
> > Euman