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 » dropdown submenu into ToolBar
dropdown submenu into ToolBar [message #37791] Mon, 12 November 2012 17:43 Go to next message
idkfa46 is currently offline  idkfa46
Messages: 155
Registered: December 2011
Experienced Member
Can i add a dropdown submenu in a ToolBar?
Sure it works in MainMenu!

This's what I found looking at manual:
Item& Add(bool enable, const char *text, Callback1<Bar&> proc)
Item& Add(const char *text, Callback1<Bar&> proc)
Item& Add(bool enable, const char *text, const UPP::Image& image, Callback1<Bar&> proc)
Item& Add(const char *text, const UPP::Image& image, Callback1<Bar&> proc)
Adds a submenu. For toolbar, simply adds all items of proc. enable sets the item status.


I cant understand how does it work

Regards,
Matteo
Re: dropdown submenu into ToolBar [message #37793 is a reply to message #37791] Mon, 12 November 2012 18:32 Go to previous messageGo to next message
nlneilson is currently offline  nlneilson
Messages: 644
Registered: January 2010
Location: U.S. California. Mojave &...
Contributor
You can add dropdown menus from dropdown menus.

	void MainMenu(Bar& bar) {
		bar.Add("File", THISBACK(FileMenu));
		bar.Add("Layers", THISBACK(LayersMenu));
		bar.Add("FAA", THISBACK(FAAMenu));


	void FAAMenu(Bar& bar) {

		bar.Add("TAC", THISBACK(TacMenu));
		bar.Add("WAC", THISBACK(WACsepMenu));


You just need to add the additional sub menu bar under the bar you want it under.

Try the examples that come with upp, things like this are in there.
Re: dropdown submenu into ToolBar [message #37794 is a reply to message #37791] Mon, 12 November 2012 18:47 Go to previous messageGo to next message
idkfa46 is currently offline  idkfa46
Messages: 155
Registered: December 2011
Experienced Member

mmm.... it works only with MainMenu!
If I make the same with ToolBar, all items (from ToolBar and Sub menu) appear on the same line divided by a separator but without any submenu!

what's the difference between MainBar and ToolBar?

Regards,
Matteo
Re: dropdown submenu into ToolBar [message #37825 is a reply to message #37794] Thu, 15 November 2012 17:01 Go to previous messageGo to next message
sergeynikitin is currently offline  sergeynikitin
Messages: 748
Registered: January 2008
Location: Moscow, Russia
Contributor

Ìàêå procedure callback with direct call Popup menu.

Toolbar code:
 bar.Add(t_("Print"),Icons::Print32(), THISBACK(PrintMenu)).Label(t_("Print"));


Dropdown Execution code:
void AnketaListDlg::PrintMenu()
{
	MenuBar bar;
	
	Sql sql;
	sql * Select(REP_ID,REP_NAME).From(REPORTS).Where(REP_TYPE == "resume").OrderBy(REP_TYPE,REP_NAME,REP_ID);
	while (sql.Fetch()){
		bar.Add((String)(sql[REP_NAME]),THISBACK2(PrintProc,sql[REP_ID],listanketa(ANK_ID)));
	}
	bar.Execute();
}


This procedure use to add Dropdown menu items from Sql table REPORTS
or you can simple add standard menu item like
bar.Add(t_("Search"),SVIcons::Find(), THISBACK(SetupQuery)).Label(t_("Search"));


SergeyNikitin<U++>( linux, wine )
{
    under( Ubuntu || Debian || Raspbian );
}

[Updated on: Thu, 15 November 2012 17:03]

Report message to a moderator

Re: dropdown submenu into ToolBar [message #37832 is a reply to message #37791] Fri, 16 November 2012 08:44 Go to previous message
idkfa46 is currently offline  idkfa46
Messages: 155
Registered: December 2011
Experienced Member
Lovely!! That's what I was looking for.
Thanks both for ur time

Regards,
Matteo
Previous Topic: broken pick semantics
Next Topic: Frameless(true); bug, my error or ???
Goto Forum:
  


Current Time: Thu Mar 28 11:00:42 CET 2024

Total time taken to generate the page: 0.01678 seconds