Home » Community » Newbie corner » Toolbuttons
Toolbuttons [message #24974] |
Sat, 06 February 2010 17:58  |
gedumer
Messages: 21 Registered: March 2006
|
Promising Member |
|
|
There doesn't appear to any documentation on Toolbuttons, so... I have two questions:
1. I need to know how to make a Toolbutton work like a Buttonoption Class with a pushed state and up state.
2. I also need to know how to change a "Tip" on a Toolbutton in that buttons' event code. I set the initial tip when I add the toolbutton, but I want to change it in the event code.
|
|
|
|
Re: Toolbuttons [message #24989 is a reply to message #24987] |
Sat, 06 February 2010 22:42   |
alendar
Messages: 47 Registered: January 2010 Location: Idaho, USA
|
Member |
|
|
I think the tip is named something different in the object than "tip". You should just be able to set it to a string.
I'm going to have to add a tool bar to my app, so I'll take a look. Isn't there an example anywhere in the examples or bazaar folder?
cd7651feeb698f6ac6cec1f6deda5e5b
|
|
|
|
Re: Toolbuttons [message #25003 is a reply to message #24993] |
Sun, 07 February 2010 04:50   |
alendar
Messages: 47 Registered: January 2010 Location: Idaho, USA
|
Member |
|
|
Ok, finally got it to work. I'm a bad typist. The main thing is if you use the example in the help file, you won't have an object to reference, or you will, but you'll have to pull it off the vector and I don't know if it is exposed.
I find it easier to create the ToolButton explicitly, set its attributes and add it to the ToolBar, like this:
1) Create the toolbar and button on my class spec:
ToolBar toolbarFrame;
ToolButton repeat;
2) In the callback, configure and add the button:
void toolbarFrameCallback(Bar &bar) {
repeat.WhenAction = THISBACK(RepeatSongs);
repeat.Tip("Boo!");
repeat.Image(MyImages::misc());
bar.AddMenu("Function",
MyImages::misc(),
THISBACK(MenuFn));
bar.Add(repeat);
}
3) Where ever you like, change the tip:
repeat.Tip("Hoo!");
Works fine.
I haven't got the toggle state yet, but I need it for my project.
cd7651feeb698f6ac6cec1f6deda5e5b
|
|
|
|
|
|
Goto Forum:
Current Time: Sat Apr 26 19:36:47 CEST 2025
Total time taken to generate the page: 0.00950 seconds
|