1. RE: Can I just confirm Alt handling etc

Why does the accelerator activate the onClick event?

I tried your example Pete, and it works fine.
ALT-B = "Browse button pressed"
ALT-C = "Compare button pressed"

Although, windows chimes when I press ALT-key, and the buttons aren't 
depressed when ALT-key is pressed.


Chris

petelomax at blueyonder.co.uk wrote:
> On Fri, 22 Mar 2002 06:56:42 -0800, Dan Moyer
> <DANIELMOYER at prodigy.net> wrote:
> 
> >This example works fine for me, with NO onKey events specified:
> 
> Thanks, your example worked fine for me, but my code just don't
> I have studied it & studied it till I'm blue in the face and I just
> can't for the life of me see the difference between that & this:
> 
> include win32lib.ew
> 
> constant 
> 	COMPARE = create( Window, "Compare", 0, 100, 100, 500, 180, 0),
> 	Browse = create( PushButton, "&Browse", COMPARE, 405, 40, 80, 25,
> 0 ),
> 	Compare = create( PushButton, "&Compare", COMPARE, 405, 75, 80,
> 25, 0 ),
> 	StatusBar5 = create( StatusBar, "No button pressed yet", COMPARE,
> 0, 0, 0, 0, 0 )
> 
> procedure onclickBrowse()
>   setText(StatusBar5, "Browse button pressed")
> end procedure
> onClick[Browse]=routine_id("onclickBrowse")
> 
> procedure onclickCompare()
>   setText(StatusBar5, "Compare button pressed")
> end procedure
> onClick[Compare]=routine_id("onclickCompare")
> 
> WinMain(COMPARE,Normal)
> 
> Yours, even more confused than ever,
> Pete
> 
>

new topic     » topic index » view message » categorize

2. RE: Can I just confirm Alt handling etc

Derek Parnell wrote:
> ----- Original Message -----
> From: "Chris Bensler" <bensler at mail.com>
> To: "EUforum" <EUforum at topica.com>
> Sent: Saturday, March 23, 2002 5:27 AM
> Subject: RE: Can I just confirm Alt handling etc
> 
> 
> > Why does the accelerator activate the onClick event?
> >
> Because this is Window convention. The Alt-<x> for button-type controls 
> is
> supposed to set focus to it, and invoke the click event.
> 
> > I tried your example Pete, and it works fine.
> > ALT-B = "Browse button pressed"
> > ALT-C = "Compare button pressed"
> >
> > Although, windows chimes when I press ALT-key, and the buttons aren't
> > depressed when ALT-key is pressed.
> 
> Maybe you are using a corrected version of the library already.
> 
> -----------
> Derek.

Both programs work.

first line of win32lib.ew reads:
-- "Stamped" version of win32lib.ew version 55.1

Maybe 'your' using a modified version? :)

Chris

<PETE'S CODE>
include win32lib.ew

constant
COMPARE = create( Window, "Compare", 0, 100, 100, 500, 180, 0),
Browse = create( PushButton, "&Browse", COMPARE, 405, 40, 80, 25,
0 ),
Compare = create( PushButton, "&Compare", COMPARE, 405, 75, 80,
25, 0 ),
StatusBar5 = create( StatusBar, "No button pressed yet", COMPARE,
0, 0, 0, 0, 0 )

procedure onclickBrowse()
setText(StatusBar5, "Browse button pressed")
end procedure
onClick[Browse]=routine_id("onclickBrowse")

procedure onclickCompare()
setText(StatusBar5, "Compare button pressed")
end procedure
onClick[Compare]=routine_id("onclickCompare")

WinMain(COMPARE,Normal)
<END PETE'S CODE>


<DAN'S CODE>
-- 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 )
<END DAN'S CODE>

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu