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  |
BetoValle
Messages: 204 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!
|
|
|
Goto Forum:
Current Time: Fri May 09 20:46:11 CEST 2025
Total time taken to generate the page: 0.00607 seconds
|