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 » U++ Library support » Menus&Toolbars » query , update menu / submenu itens (build routine to query or change menu items at runtime)
query , update menu / submenu itens [message #58345] Tue, 03 May 2022 19:22 Go to previous message
BetoValle is currently offline  BetoValle
Messages: 203
Registered: September 2020
Location: Brasil Valinhos SP
Experienced Member

Hi,

Based on my constructor routine below**,
How do I create a routine to access each of these menu and sub-menu items to consult the texts of the options (allow changing these texts) and also to enable or disable the option (enable/disable) of each said item?
(how to do in a loop ?
would be something like:
for... dynamic_cast<MenuBar *>(q) ?
how i do ?
)

  // ** my constructor!
    CtrlLayout ( *this, "Window title" );
    //menup is MenuBar created with layoutfile! 
    menup.Set([=](Bar& bar) {
        bar.Sub("Cadastros", [=](Bar& bar) {
            bar.Sub("Contas",[=](Bar& bar){
                bar.Sub("Disponibilidades",[=](Bar& bar){
                bar.Add(false,"Caixa", THISFN(go1));     
                bar.Add("Bancos", THISFN(go2));     
              });
              bar.Add("Despesas", THISFN(go3));  
            });
            bar.Add("Clientes", THISFN(go4));
        });
        bar.Add("Sai", THISBACK(Close));
    });




note: I didn't find anything similar on the forum!

Thanks!
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: menu's small box when i18n
Next Topic: Accelerators stop after popup menu due to focus
Goto Forum:
  


Current Time: Sat Apr 27 04:01:26 CEST 2024

Total time taken to generate the page: 0.04821 seconds