Home » Community » Newbie corner » dropdown submenu into ToolBar
dropdown submenu into ToolBar [message #37791] |
Mon, 12 November 2012 17:43  |
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 #37825 is a reply to message #37794] |
Thu, 15 November 2012 17:01   |
|
Ìàêå 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
|
|
|
|
Goto Forum:
Current Time: Sat Apr 26 14:26:23 CEST 2025
Total time taken to generate the page: 0.02688 seconds
|