Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » Menus and Toolbars
Menus and Toolbars [message #24961] Sat, 06 February 2010 02:59 Go to next message
gedumer is currently offline  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 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

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": Smile
void Ide::ToggleVerboseBuild() {
	console.verbosebuild = !console.verbosebuild;
}

This example was taken from ide package.

Regards,
Honza
Re: Menus and Toolbars [message #24973 is a reply to message #24963] Sat, 06 February 2010 16:22 Go to previous messageGo to next message
gedumer is currently offline  gedumer
Messages: 21
Registered: March 2006
Promising Member
Wow Honza... that's interesting. I'd never have figured that out on my own in a million years! That should be added to the tutorial.

Thanks a lot!

[Updated on: Sat, 06 February 2010 16:22]

Report message to a moderator

Re: Menus and Toolbars [message #24975 is a reply to message #24973] Sat, 06 February 2010 17:58 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

I'm glad to hear it helped you Smile

Not everything can be in tutorials, they would be too complex then Wink 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 #24980 is a reply to message #24975] Sat, 06 February 2010 20:12 Go to previous messageGo to next message
gedumer is currently offline  gedumer
Messages: 21
Registered: March 2006
Promising Member
I read that... I just didn't know where to put it. I didn't expect to put it at the end of the Add.
Re: Menus and Toolbars [message #24981 is a reply to message #24980] Sat, 06 February 2010 20:21 Go to previous messageGo to next message
alendar is currently offline  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 Go to previous message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

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 Smile 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

Previous Topic: Form Designer
Next Topic: ButtonOption is a cute little Toggle button
Goto Forum:
  


Current Time: Thu Mar 28 13:22:58 CET 2024

Total time taken to generate the page: 0.01485 seconds