1. Win32lib Buttons
- Posted by (not specified)
Apr 10, 2004
How can I simulate the normal windows behavior with buttons while tabbing
through them?
In Win32lib, buttons do not respond if enter key is pressed unless the button is
DEFPUSHBUTTON; but the last is static.
I want buttons (any button) to be able to be pushed pressing enter key if they
get focus, that is, making DefPushButtons dinamic.
Any suggestions? Thank you,
Julio C. Galaret Viera
2. Re: Win32lib Buttons
Guest Wrote:
> I want buttons (any button) to be able to be pushed pressing enter
key if they get focus, that is,
> making DefPushButtons dinamic.
This part is a easy one.
without warning
include win32lib.ew
constant mywin = create(Window,"Test Button",0,Default,Default,300,200,0),
myButtA = create(PushButton,"Button A",mywin,0,0,80,20,0),
myButtB = create(PushButton,"Button B",mywin,0,20,80,20,0)
object void
procedure onKeyDown_myButtAB(integer id, integer event, sequence param)
if param[1] = VK_RETURN then
void = invokeHandler(id,w32HClick,{})
end if
end procedure
setHandler({myButtA,myButtB},w32HKeyDown,routine_id("onKeyDown_myButtAB"))
procedure onClick_myButtA(integer id, integer event, sequence param)
void = message_box("Ouch, that hurts!","Button A",0)
end procedure
setHandler(myButtA,w32HClick,routine_id("onClick_myButtA"))
procedure onClick_myButtB(integer id, integer event, sequence param)
void = message_box("*giggle* That tickles!","Button B",0)
end procedure
setHandler(myButtB,w32HClick,routine_id("onClick_myButtB"))
WinMain(mywin,Normal)
Hope this helps,
EuMario