Re: Can I just confirm Alt handling etc
Pete,
Maybe I'm not understanding, but as far as I can see you don't need to do
*anything* other than set the ampersand in the name of the button to make
alt-whatever activate the onclick event.
This example works fine for me, with NO onKey events specified:
-- code generated by Win32Lib IDE v0.10.6
include Win32Lib.ew
without warning
----
-- Window Window1
global constant Window1 = create( Window, "Window1", 0, Default, Default,
400, 300, 0 )
global constant StatusBar5 = create( StatusBar, "StatusBar5", Window1, 0, 0,
0, 0, 0 )
global constant PushButton2 = create( PushButton, "&PushButton2", Window1,
24, 36, 90, 30, 0 )
global constant PushButton3 = create( PushButton, "P&ushButton3", Window1,
196, 44, 90, 30, 0 )
global constant PushButton4 = create( PushButton, "Pu&shButton4", Window1,
52, 116, 90, 30, 0 )
----
procedure PushButton2_onClick ()
setText(StatusBar5, "Button2")
end procedure
onClick[PushButton2] = routine_id("PushButton2_onClick")
----
procedure PushButton3_onClick ()
setText(StatusBar5, "Button3")
end procedure
onClick[PushButton3] = routine_id("PushButton3_onClick")
----
procedure PushButton4_onClick ()
setText(StatusBar5, "Button4")
end procedure
onClick[PushButton4] = routine_id("PushButton4_onClick")
WinMain( Window1, Normal )
----- Original Message -----
From: <petelomax at blueyonder.co.uk>
To: "EUforum" <EUforum at topica.com>
Sent: Thursday, March 21, 2002 4:22 PM
Subject: Can I just confirm Alt handling etc
I have a button (or two):
constant Browse = create( PushButton, "&Browse", blah blah
...
procedure onclickBrowse()
blah blah
onClick[Browse]=routine_id("onclickBrowse")
works fine. Alt B correctly shifts focus to the button.
At the mo, Alt B does not invoke onclickBrowse().
(not exactly surprised, I guess I ain't told it to yet)
Question:: Do I need:
onKeyDown [ xxx ] = routine_id("xxx")
for *every* widget to point to the same routine,
then, via getSelf() figure out what to do for eg Return,
and trap/process Alt B (and all the other buttons) in one place?
Is that the "best" way to code it?
Can I rely on "onKeyDown[<not specified>]" looking up & invoking the
parent, or not?
Pete
|
Not Categorized, Please Help
|
|