From: Mattia B. <mb...@ds...> - 2001-09-15 21:20:25
|
You didn't say platform/wxPerl version I'll assume MSW/0.07 > I've got a test program that I'm messing around with to get the hang of the > wxPerl API. I'm trying to use EVT_TOOL_ENTER to captures mouse events over > a toolbar button. However, when I move my mouse over the button the > subroutine does not execute. I was wondering, if I am defining the > EVT_TOOL_ENTER definition wrong, or in the wrong spot. > > Could someone please see if I'm doing it right? Well, for some value of right... the code *is* right, but ( after some debugging ) *looks* like a bug in wxWindows > I've have attached my sample program code. Thanks for the sample code! for now, use EVT_TOOL_ENTER( $this, -1, \&Func ); and use $event->GetInt() in the event handler to discriminate between the tools ( of course it is an hack, but I need more investigation for a proper fix ) BTW, as you might have noticed, putting -1 as the id in the event macro, acts as a wildcard: matches all ids HTH Mattia |
From: Bradley M. H. <bh...@ja...> - 2001-09-16 03:30:38
|
Sorry about not specifying all the proper information. Platform: Win98 wxPerl: 0.07 (assumption was correct). wxWindows: 2.2.7 In the meantime, I will try your suggestion and let you know. Bradley M. Handy Senior Programmer/Owner Jack-of-all-trades Programming Services --www.jack-of-all-trades.net --mailto:bh...@ja... > -----Original Message----- > From: wxp...@li... > [mailto:wxp...@li...]On Behalf Of Mattia > Barbon > Sent: Saturday, September 15, 2001 5:19 PM > To: wxp...@li... > Subject: Re: [wxperl-users] Problems with EVT_TOOL_ENTER > > > You didn't say platform/wxPerl version > I'll assume MSW/0.07 > > > I've got a test program that I'm messing around with to get the > hang of the > > wxPerl API. I'm trying to use EVT_TOOL_ENTER to captures mouse > events over > > a toolbar button. However, when I move my mouse over the button the > > subroutine does not execute. I was wondering, if I am defining the > > EVT_TOOL_ENTER definition wrong, or in the wrong spot. > > > > Could someone please see if I'm doing it right? > Well, for some value of right... the code *is* right, > but ( after some debugging ) *looks* like a bug in wxWindows > > > I've have attached my sample program code. > Thanks for the sample code! > > for now, use > EVT_TOOL_ENTER( $this, -1, \&Func ); > > and use $event->GetInt() in the event handler > to discriminate between the tools > ( of course it is an hack, but I need more investigation > for a proper fix ) > > BTW, as you might have noticed, putting -1 as the id in the > event macro, acts as a wildcard: matches all ids > > HTH > Mattia > > _______________________________________________ > wxperl-users mailing list > wxp...@li... > https://lists.sourceforge.net/lists/listinfo/wxperl-users > |
From: Bradley M. H. <bh...@ja...> - 2001-09-17 00:50:11
|
I had tried this, but wasn't sure if that was the way to go. The only reason I was going to use this functionality is due to the fact that the "Long Help" message for a tool on the toolbar doesn't get removed from the status bar like it should. I was going to blank it out myself. Bradley M. Handy Senior Programmer/Owner Jack-of-all-trades Programming Services --www.jack-of-all-trades.net --mailto:bh...@ja... > -----Original Message----- > From: Mattia Barbon [mailto:mb...@ds...] > Sent: Sunday, September 16, 2001 3:46 PM > To: Bradley M. Handy > Subject: RE: [wxperl-users] Problems with EVT_TOOL_ENTER > > > > This did work for when the mouse moved over the control. However, the > > documentation says that the EVT_TOOL_ENTER event is also > supposed to handle > > when the mouse moves off of the control as well, and that is > not happening. > > > > I've included my code again for reference. > Mmh, looks quite broken. WRT your previous post, from the toolbar > docs: > > EVT_TOOL_ENTER(id, func) Process a wxEVT_COMMAND_TOOL_ENTER event. > ******Pass the id of the toolbar itself*******. The value of > wxCommandEvent::GetSelection is the tool id, or -1 if the mouse > cursor has moved off a tool. > > So in fact your previous code ( passing the tool id ) was wrong ( you > should have passed the toolbar id ); the fact that you don't get an > event for the leave, is wrong, anyway. > > Looking at the code, seems that nobody uses this feature, it got > broken someday, and no one noticed... > > Regards > Mattia > > |
From: Bradley M. H. <bh...@ja...> - 2001-09-16 17:48:47
Attachments:
test2.pl
|
This did work for when the mouse moved over the control. However, the documentation says that the EVT_TOOL_ENTER event is also supposed to handle when the mouse moves off of the control as well, and that is not happening. I've included my code again for reference. Bradley M. Handy Senior Programmer/Owner Jack-of-all-trades Programming Services --www.jack-of-all-trades.net --mailto:bh...@ja... > -----Original Message----- > From: wxp...@li... > [mailto:wxp...@li...]On Behalf Of Mattia > Barbon > Sent: Saturday, September 15, 2001 5:19 PM > To: wxp...@li... > Subject: Re: [wxperl-users] Problems with EVT_TOOL_ENTER > > > You didn't say platform/wxPerl version > I'll assume MSW/0.07 > > > I've got a test program that I'm messing around with to get the > hang of the > > wxPerl API. I'm trying to use EVT_TOOL_ENTER to captures mouse > events over > > a toolbar button. However, when I move my mouse over the button the > > subroutine does not execute. I was wondering, if I am defining the > > EVT_TOOL_ENTER definition wrong, or in the wrong spot. > > > > Could someone please see if I'm doing it right? > Well, for some value of right... the code *is* right, > but ( after some debugging ) *looks* like a bug in wxWindows > > > I've have attached my sample program code. > Thanks for the sample code! > > for now, use > EVT_TOOL_ENTER( $this, -1, \&Func ); > > and use $event->GetInt() in the event handler > to discriminate between the tools > ( of course it is an hack, but I need more investigation > for a proper fix ) > > BTW, as you might have noticed, putting -1 as the id in the > event macro, acts as a wildcard: matches all ids > > HTH > Mattia > > _______________________________________________ > wxperl-users mailing list > wxp...@li... > https://lists.sourceforge.net/lists/listinfo/wxperl-users > |