How to make buttons unclickable?
Moderators: CEGUI MVP, CEGUI Team
-
- Not too shy to talk
- Posts: 23
- Joined: Sat Mar 03, 2007 22:54
How to make buttons unclickable?
Hi there, I was wondering if anybody knows how to make a button unclickable, but without setting it to not enabled, so it looks like an enabled button, but simply cannot be clicked.
I was thinking I could perhaps disable event capture for it, but have had no luck.
Any help would be great, thanks a lot
I was thinking I could perhaps disable event capture for it, but have had no luck.
Any help would be great, thanks a lot
-
- Not too shy to talk
- Posts: 23
- Joined: Sat Mar 03, 2007 22:54
-
- Not too shy to talk
- Posts: 23
- Joined: Sat Mar 03, 2007 22:54
-
- Not too shy to talk
- Posts: 23
- Joined: Sat Mar 03, 2007 22:54
- Levia
- Quite a regular
- Posts: 83
- Joined: Mon May 22, 2006 18:25
- Location: Bergen op zoom, The Netherlands
- Contact:
Yes that should work, but as you stated it doesnt, I would just not subscribe to the onclick event. Other option is, ofcourse, disable it, but you didn't want to do that
Alternatively, you could edit the looknfeel, and create something new, but it requires alot of work if you are not already into Falagard mapping. I wouldnt do this if you only plan to have a 'disabled' button.
Alternatively, you could edit the looknfeel, and create something new, but it requires alot of work if you are not already into Falagard mapping. I wouldnt do this if you only plan to have a 'disabled' button.
- scriptkid
- Home away from home
- Posts: 1178
- Joined: Wed Jan 12, 2005 12:06
- Location: The Hague, The Netherlands
- Contact:
Protagonist wrote:Okay, in that case it doesn't work. The first thing I did was try muting it when creating it..
I tested this with the "quit" button in Sample7 and when i mute the button, i can click it without the application to shut down... this is the code:
Code: Select all
WindowManager ::getSingleton().getWindow("Demo7/Window1/Quit")->setMutedState(true);
WindowManager ::getSingleton().getWindow("Demo7/Window1/Quit")->
subscribeEvent(PushButton::EventClicked, Event::Subscriber(&Demo7Sample::handleQuit, this));
Clicks are denied... can you post your code if it still doesn't work?
-
- Not too shy to talk
- Posts: 23
- Joined: Sat Mar 03, 2007 22:54
Ahh well you see, I want to make it non clickable. So mutedState prevents events?
I was looking for something that has the effect of setEnabled(false), but without dimming the button, so it looks active and pretty, not greyed out.
So effectively, I have something that looks like a normal button, but isn't a button (at least it doesn't behave like one - can't be clicked)
Does that make sense?
Thanks a lot.
I was looking for something that has the effect of setEnabled(false), but without dimming the button, so it looks active and pretty, not greyed out.
So effectively, I have something that looks like a normal button, but isn't a button (at least it doesn't behave like one - can't be clicked)
Does that make sense?
Thanks a lot.
- Levia
- Quite a regular
- Posts: 83
- Joined: Mon May 22, 2006 18:25
- Location: Bergen op zoom, The Netherlands
- Contact:
I understand what you want, but not why. You could easily do this with a statictext with a background and a frame. But if you really want the button, you will need to either use setEnabled or change the looknfeel. If you want, I can write the looknfeel entry for you, you just simply paste it in your looknfeel file, and use setLooknFeel on the button (I think that'll work, never tested though).
-
- Not too shy to talk
- Posts: 23
- Joined: Sat Mar 03, 2007 22:54
-
- Not too shy to talk
- Posts: 23
- Joined: Sat Mar 03, 2007 22:54
Who is online
Users browsing this forum: No registered users and 22 guests