Home » Community » Newbie corner » ButtonOption is a cute little Toggle button
ButtonOption is a cute little Toggle button [message #24931] |
Fri, 05 February 2010 04:03  |
alendar
Messages: 47 Registered: January 2010 Location: Idaho, USA
|
Member |
|
|
Anyone else try this? It's not in the layout manager as a widget or control, unless I missed it. No ones used it in the examples or the bazaar. I found one use in the ide, thank goodness.
Its a simple command button that behaves like an Option box, except its a command button. It doesn't take text, you have to set an image programmatically, or I guess you could chain it on the ITEM line in the .lay file.
It's very nifty. The only way I could get it into the layout was by editing the text of the layout instead of the GUI editor, though I probably could have used the User Class option? Doh!
But the text is very easy to edit.
For anyone newer than me:
LAYOUT(MainLayout, 304, 120)
ITEM(ButtonOption, playOrPause, LeftPosZ(48, 40).TopPosZ(4, 15))
END_LAYOUT
Then in a constructor you zap an image on it.
playOrPause = MyImages::play();
Will peek back in textprop.cpp to see how to capture the click event.
cd7651feeb698f6ac6cec1f6deda5e5b
|
|
|
|
|
|
Re: ButtonOption is a cute little Toggle button [message #24985 is a reply to message #24934] |
Sat, 06 February 2010 21:42  |
alendar
Messages: 47 Registered: January 2010 Location: Idaho, USA
|
Member |
|
|
Here's some different views. I like the ButtonOption so far because it seems to maintain look and feel and behavior with the Button object.

I didn't show hover over the depressed button since it doesn't change, but perhaps I should have.
cd7651feeb698f6ac6cec1f6deda5e5b
|
|
|
Goto Forum:
Current Time: Sat Apr 26 19:32:48 CEST 2025
Total time taken to generate the page: 0.00469 seconds
|