RE: Win32lib Buttons

new topic     » topic index » view thread      » older message » newer message

There is a much esier way to do this:
add "if setAutoFocusLabels(1) then end if" to the top of the program and 
button with a name like "a&bcd" will respond to 'b' (the letter after 
'&').

Mario Steele wrote:
> 
> 
> 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.  blink
> 
> 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
>

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu