Home » Community » Newbie corner » Menus and Toolbars
Menus and Toolbars [message #24961] |
Sat, 06 February 2010 02:59  |
gedumer
Messages: 21 Registered: March 2006
|
Promising Member |
|
|
I have successfully created both menus and a toolbar. I've added images to both. What I can't figure out is how to put a check mark on a menu. Could someone please give me a very small example of that.
Thanks.
[Updated on: Sat, 06 February 2010 04:32] Report message to a moderator
|
|
|
Re: Menus and Toolbars [message #24963 is a reply to message #24961] |
Sat, 06 February 2010 09:37   |
|
Hi,
There is a Item& Check(bool check) method for this. The usage is menu.Add("Be verbose", THISBACK(ToggleVerboseBuild))
.Check(console.verbosebuild)
where the THISBACK must do "all the work": void Ide::ToggleVerboseBuild() {
console.verbosebuild = !console.verbosebuild;
}
This example was taken from ide package.
Regards,
Honza
|
|
|
|
Re: Menus and Toolbars [message #24975 is a reply to message #24973] |
Sat, 06 February 2010 17:58   |
|
I'm glad to hear it helped you
Not everything can be in tutorials, they would be too complex then But it is all in documentation in the ide and also on the web (e.g. Check function is described here). It's just sometimes hard to ask the right questions...
Bye,
Honza
|
|
|
|
Re: Menus and Toolbars [message #24981 is a reply to message #24980] |
Sat, 06 February 2010 20:21   |
alendar
Messages: 47 Registered: January 2010 Location: Idaho, USA
|
Member |
|
|
I think there is an example with this. But I noticed that if the checked state defaults to true, it doesn't show it on the initial open of the window. You can uncheck and check, then it shows.
I don't use the check yet in the menus, so I haven't chased down what the problem might be.
cd7651feeb698f6ac6cec1f6deda5e5b
|
|
|
Re: Menus and Toolbars [message #24982 is a reply to message #24980] |
Sat, 06 February 2010 20:32  |
|
You can of course do Bar::Item& foo=bar.Add("Foo", THISBACK(DooFoo));
foo.Help(...);
foo.Tip(...);
foo.Text(...);
foo.Image(...);
foo.Check(...);
foo.Enable(...);
foo.Key(...);
But it's ugly and it requires much more typing The chaining concept is one of the big advantages of U++.
BTW: Another great source of information is reference assembly. Most of the packages there covers one topic only, but into greater detail then tutorials.
Quote: | I think there is an example with this.
|
Yes, it is in Reference/Menu.
Honza
[Updated on: Sat, 06 February 2010 20:34] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Sat Apr 26 14:40:12 CEST 2025
Total time taken to generate the page: 0.00669 seconds
|