Double click

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

User avatar
kitt3n
Just popping in
Just popping in
Posts: 17
Joined: Wed Jan 12, 2005 12:06

Double click

Postby kitt3n » Tue Mar 01, 2005 11:46

I'm playing around with double-clicks and took a window
(which will go to minimized state after double-click)

Now I will do the following

double-click, 2 sec pause, double-click
-> everything works perfect, window is closed
on the first double-click and opened on the 2nd.

double-click, 1/2 sec pause, double-click
-> now the second double-click is ignored...

I tried playing around with setSingleClickTimeout
and setMultiClickTimeout, but I couldn't get it
to behave like I would expect...

note: The same "ignore second double-click" also goes for buttons

Any ideas on this?

Regards
Roger

User avatar
kitt3n
Just popping in
Just popping in
Posts: 17
Joined: Wed Jan 12, 2005 12:06

Re: Double click

Postby kitt3n » Tue Mar 01, 2005 13:05

Ah, I figured it out - it can be done by setting
setWantsMultiClickEvents to false for the button.

One minor thing, I also set setWantsMultiClickEvents
to false for the window, but the closeButton
ignored this setting.
Obviously you can set it when you create the close-button
and get the pointer to it, but maybe the window should
pass the setting to the close-button automatically?

especially since apparently it's impossible to get
the pointer to this button later, unless you store it
somewhere yourself...

Regards

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Double click

Postby CrazyEddie » Tue Mar 01, 2005 14:16

What I really want to do is to have the multi-clicks disabled by deafult (since most widgets do not need it), though I get the feeling I'll break a lot of peoples code if I do that.

The issue about timings for the multi-clicks is a small bug, I have a fix but can't put it into HEAD at the moment due to so many other outstanding changes I have in my working copy. I'll commit the fix to 0.2.0 branch later on tonight.

CE.

User avatar
kitt3n
Just popping in
Just popping in
Posts: 17
Joined: Wed Jan 12, 2005 12:06

Re: Double click

Postby kitt3n » Tue Mar 01, 2005 14:30

Thanks for the quick reply!

What I really want to do is to have the multi-clicks disabled by deafult (since most widgets do not need it), though I get the feeling I'll break a lot of peoples code if I do that.


Just an idea, maybe there should be a function System::setDefaultMultiClickAware() and controls will get
this value (default would be true to not break existing code) - so we don't have to set this seperately for every control we want to create.

I'd also like to know if it's possible to get to the
titlebar & closebutton-pointers, so we can call
whatever setXXX-functions on them...

Regards,
Roger

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Double click

Postby CrazyEddie » Tue Mar 01, 2005 19:39

kitt3n wrote:
Just an idea, maybe there should be a function System::setDefaultMultiClickAware() and controls will get
this value (default would be true to not break existing code) - so we don't have to set this seperately for every control we want to create.

Thanks for the suggestion. This actually inspires something on a more grand scale which would also satisfy an item on my TODO list. Basically what I envision is a DefaultPropertyManager (or something) which can have property names registered along with a default, these can be updated at any time and also loaded as part of a scheme xml file. Whenever a new window/widget gets created, it would go to the DefaultPropertyManager and say, "hello, I'm a <widget type> window. Initialise me!". Obviously there's a few things that would have to be sorted out, but I think this would be a really useful thing to have in the system.

I'd also like to know if it's possible to get to the
titlebar & closebutton-pointers, so we can call
whatever setXXX-functions on them...

Doing that is potentially dangerous and you may blow yourself out of the water (and things may break later on), however, this is possible by using the WindowManager to get the widgets by name. The following examples assume a FrameWindow named "MyWindow":

For the close button:

Code: Select all

WindowManager::getSingleton().getWindow("MyWindow__auto_closebutton__");


For the title bar:

Code: Select all

WindowManager::getSingleton().getWindow("MyWindow__auto_titlebar__");


HTH

CE.


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 10 guests