1. RE: Trapping the TAB key
- Posted by Derek Parnell <ddparnell at bigpond.com> May 06, 2002
- 405 views
Once again Euphoria Man, you're cleaver tricks are much more simpler than the Win32lib way euman at bellsouth.net wrote: > ----- 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? compared to setTabkeys(0)? Sure man, whatever. > Euman > >
2. RE: Trapping the TAB key
- Posted by Derek Parnell <ddparnell at bigpond.com> May 06, 2002
- 404 views
I must apologise. My message was meant for euman alone. It is a bit of a private running joke we have. Sorry if any offense was caused. euman at bellsouth.net wrote: > 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)? > I have no idea. Its processing is so embedded in normal win32lib functionality it would be difficult to isolate the specific code elements that effect tabkey processing. > 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 > >
3. RE: Trapping the TAB key
- Posted by Derek Parnell <ddparnell at bigpond.com> May 06, 2002
- 403 views
Jonas Temple wrote: > > And has anyone else had problems with using the ES_NUMERIC style in an > edit control? This doesn't seem to work anymore. > I haven't access to Euphoria for a few days, so can you help out with this issue? include win32lib.ew constant w = create(Window, "Test", 0, 0, 0, 200, 200, 0), e = create(EditBox, "", w, 10,10, 100, 25, ES_NUMERIC) WinMain(w, Normal) Does this little program allow non-digits to be entered? ---------- Derek.
4. RE: Trapping the TAB key
- Posted by Jonas Temple <jktemple at yhti.net> May 06, 2002
- 417 views
Derek, I'm not sure I understand the intent of this fuction. Does this mean that there are NO tab key handling in win32lib or just that win32lib doesn't perform it's normal handling of the tab key? Just confused...sorry. Also, in reference to the ES_NUMERIC, it works fine on Win95/98 but doesn't seem to work on Win2000 Pro. Does that help? Jonas Derek Parnell wrote: setTabkeys(0)
5. RE: Trapping the TAB key
- Posted by Derek Parnell <ddparnell at bigpond.com> May 06, 2002
- 402 views
Jonas Temple wrote: > Derek, > > I'm not sure I understand the intent of this fuction. Does this mean > that there are NO tab key handling in win32lib or just that win32lib > doesn't perform it's normal handling of the tab key? > > Just confused...sorry. The routine setTabCodes() is designed to let the application define exactly which keys can be used to 'tab' between controls. By default it is the VK_TAB (ascii 9) key. The way the library works is that for each key press detected by win32lib, it checks it against the list of 'tabbing' keys, and if it matches one of them, win32lib then performs a 'tab' operation otherwise the key is passed onto the application. So by setting the list to 0, just means that no key will ever match so win32lib doesn't do any 'tabbing' operations and all keys will be passed onto the applications. For example, if you set the 'tab' key to F8, then the normal TAB key is passed to the application and F8 causes win32lib to do 'tabbing' operations. There is a related routine, setTabEnabled(id, flag), that allows the application to define how a control participates in the tabbing operation. In other words, you can set some controls to ignore the 'tab' key (but it still responds to Ctrl-'tab'). I've just noticed that these two routines have not been documented yet. I'll fix that up immediately. > Also, in reference to the ES_NUMERIC, it works fine on Win95/98 but > doesn't seem to work on Win2000 Pro. Does that help? Not really I run Win Me at home, Win2000 at the office and Win98 on the laptop. Unfortunately I'm not near any of these right now so I'll see what else I can discover about the style flag. --------- Derek.