Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Widgets - General questions or Mixed problems » DoubleClick or RightClick [SOLVED]
DoubleClick or RightClick [SOLVED] [message #1633] Sat, 11 March 2006 00:01 Go to next message
Justin is currently offline  Justin
Messages: 57
Registered: March 2006
Location: Orange County California
Member
How do I respond to actions other than the left mouse button?

Currently I am using code like this to handle single left-click actions:


	btnTest <<= THISBACK(Compute);





Would I have to manually handle the Win32 messages within the 'Compute()' function? or is there an easier way of doing this?

[Updated on: Sun, 09 April 2006 04:35] by Moderator

Report message to a moderator

Re: DoubleClick or RightClick [message #1634 is a reply to message #1633] Sat, 11 March 2006 00:35 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14105
Registered: November 2005
Ultimate Member
Justin wrote on Fri, 10 March 2006 18:01

How do I respond to actions other than the left mouse button?

Currently I am using code like this to handle single left-click actions:


	btnTest <<= THISBACK(Compute);





Would I have to manually handle the Win32 messages within the 'Compute()' function? or is there an easier way of doing this?



Depends. To handle events inside your view area, us LeftDown, LeftUp, LeftDouble, RightDown etc... virtuals.

However, this seems like you are interested in events going to your widget (Button?), so in fact Button is to handle these events. Standard Button does not react to right mouse clicks - you would need to derive and add virtuals (quite easy to do).

OTOH, some Ctrls do react to rightclicks. E.g. ArrayCtrl pops up the menu (which you can define). Anyway, widget reaction to input events is widget specif.

Mirek
Re: DoubleClick or RightClick [message #1636 is a reply to message #1634] Sat, 11 March 2006 01:03 Go to previous messageGo to next message
Justin is currently offline  Justin
Messages: 57
Registered: March 2006
Location: Orange County California
Member
Thanks, I was looking at the ArrayCtrl in particular. However, I ran accross the WhenLeftDouble method in use for callbacks. So what I tried was this:


rma.array.WhenLeftDouble <<= THISBACK(About);


This obviously didn't work and returned this:


main.cpp
C:\MyApps\NCase\main.cpp(134) : error C3767: '<<=': candidate function(s) not accessible
        could be the friend function at 'C:\upp\uppsrc\Core/Topt.h(245)' : '<<=' [may be found via argu
	ment-dependent lookup]
        or the friend function at 'C:\upp\uppsrc\Core/Topt.h(245)' : '<<=' [may be found via argument-d
	ependent lookup]


C:\MyApps\NCase\main.cpp(134) : error C2676: binary '<<=' : 'Callback' does not define this operator or
	 a conversion to a type acceptable to the predefined operator
1 file(s) compiled in (0:01.01) 1016 msec/file

There were errors. (0:01.14)



??
Re: DoubleClick or RightClick [message #1639 is a reply to message #1636] Sat, 11 March 2006 07:38 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14105
Registered: November 2005
Ultimate Member
Use "=" instead of "<<=".

Admitedly a bit confusing. The deal is that "<<=" is operator to assign WhenAction "basic" callback, defined in Ctrl (other overload BTW calls SetData, if the right side is Value or Value convertible).

Mirek
Re: DoubleClick or RightClick [message #1660 is a reply to message #1634] Sun, 12 March 2006 02:19 Go to previous messageGo to next message
Justin is currently offline  Justin
Messages: 57
Registered: March 2006
Location: Orange County California
Member
luzr wrote on Fri, 10 March 2006 18:35


However, this seems like you are interested in events going to your widget (Button?), so in fact Button is to handle these events. Standard Button does not react to right mouse clicks - you would need to derive and add virtuals (quite easy to do).



Do you have a tutorial or any documentation regarding virtuals? If not, is there a good reference or example with U++ that might point me in the right direction?

Thanks again

Re: DoubleClick or RightClick [message #1661 is a reply to message #1660] Sun, 12 March 2006 04:56 Go to previous messageGo to next message
Justin is currently offline  Justin
Messages: 57
Registered: March 2006
Location: Orange County California
Member
Nevermind. Figured it out.
Re: DoubleClick or RightClick [message #1662 is a reply to message #1660] Sun, 12 March 2006 08:01 Go to previous message
mirek is currently offline  mirek
Messages: 14105
Registered: November 2005
Ultimate Member
Justin wrote on Sat, 11 March 2006 20:19

luzr wrote on Fri, 10 March 2006 18:35


However, this seems like you are interested in events going to your widget (Button?), so in fact Button is to handle these events. Standard Button does not react to right mouse clicks - you would need to derive and add virtuals (quite easy to do).



Do you have a tutorial or any documentation regarding virtuals? If not, is there a good reference or example with U++ that might point me in the right direction?

Thanks again




reference/Events

Mirek
Previous Topic: Method to Open a New Layout Window
Next Topic: PromptOK from CONSOLE_APP_MAIN, how?[SOLVED]
Goto Forum:
  


Current Time: Thu Oct 31 23:45:59 CET 2024

Total time taken to generate the page: 0.00478 seconds