FreeOrion

Forums for the FreeOrion project
It is currently Thu Jun 20, 2013 1:13 am

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: GG DropList Button Press Signal
PostPosted: Tue Jun 29, 2010 8:07 pm 
Offline
Space Squid
User avatar

Joined: Mon May 24, 2010 10:22 am
Posts: 75
Location: Poland
Moved by Geoff. Was in reply to this thread

Ok i will remember no graphic library in AI and server code ;]
btw i have question about gigi. How should I intercept/get press button signal from eg: CUIDropDownList ? no i don't want changed status signal.


Top
 Profile  
 
 Post subject: Re: GG DropList Button Press Signal
PostPosted: Tue Jun 29, 2010 8:23 pm 
Offline
Programming, Design, and De Facto Lead
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 8062
Location: Vancouver, BC
What do you mean by "button signal" if not a change in the selected item in the list? Just whenever the user clicks anywhere on the droplist, or just clicks on the down arrow button to open/close the actual dropping list below the main part of the control? What about clicks on an item in the dropped list (which would also select an item if the item clicked wasn't already selected)?

There doesn't currently appear to be a signal for any of those... The way the user interacts with a droplist is by changing the selected item, so that's what it has signals to connect to. If you want a clickable button, then use a GG::Button or something derived from it.

Edit: However if you want to write code within a class, derived from GG::DropDownList, to respond to clicks, you can override the virtual function LClick(). That function will be called whenever the object is clicked on.

Signals are generally used whenever something else needs to respond to a user action on a widget, while code in the widget itself handles internal changes in response to a user action (which might include firing a signal). /Edit


Top
 Profile  
 
 Post subject: Re: GG DropList Button Press Signal
PostPosted: Tue Jun 29, 2010 8:34 pm 
Offline
Space Squid
User avatar

Joined: Mon May 24, 2010 10:22 am
Posts: 75
Location: Poland
No i don't want GG::Button i want to know when user press mouse button on the widget space(anywhere on droplist). That click:
Code:
virtual void   LClick(const Pt& pt, Flags<ModKey> mod_keys);

Edit: uh laggy:/


Top
 Profile  
 
 Post subject: Re: GG DropList Button Press Signal
PostPosted: Tue Jun 29, 2010 9:00 pm 
Offline
Programming, Design, and De Facto Lead
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 8062
Location: Vancouver, BC
I believe you'll need to make a custom derived class that overrides LClick and optionally emits a signal when LClick is called. You can do whatever in LClick, or connect the signal to some other function.


Top
 Profile  
 
 Post subject: Re: GG DropList Button Press Signal
PostPosted: Tue Jun 29, 2010 9:05 pm 
Offline
Space Squid
User avatar

Joined: Mon May 24, 2010 10:22 am
Posts: 75
Location: Poland
Or do whatever i want in LClick w/o any signals callback etc..thx


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group