01-30-2013 03:21 PM - edited 01-30-2013 03:36 PM
After I added the menu definition, whatever I operated the screen with menu, the menu could not be shown. Can someone point me out? Thank you.
TabbedPane {
Menu.definition: MenuDefinition {
// Specify the actions that should be included in the menu
actions: [
ActionItem {
title: "Action 1"
onTriggered: {
console.log("Menu - Action1Triggered()")
}
},
ActionItem {
title: "Action 2"
onTriggered: {
console.log("Menu - Action2Triggered()")
}
},
ActionItem {
title: "Action 3"
onTriggered: {
console.log("Menu - Action3Triggered()")
}
}
] // end of actions list
}
...
or
NavigationPane {
id: nav
Menu.definition: MenuDefinition {
// Specify the actions that should be included in the menu
actions: [
ActionItem {
title: "Action 1"
// imageSource: ""
onTriggered: {
console.log("Menu - Action1Triggered()")
}
},
ActionItem {
title: "Action 2"
// imageSource: ""
onTriggered: {
console.log("Menu - Action2Triggered()")
}
},
ActionItem {
title: "Action 3"
onTriggered: {
console.log("Menu - Action3Triggered()")
}
}
] // end of actions list
}
Solved! Go to Solution.
01-31-2013 10:24 AM
Does anyone know the answer? ![]()
01-31-2013 10:36 AM
Your code is fine. Just swipe down from the top of the screen to reveal the Menu.
01-31-2013 10:46 AM
Thank you. I tried with your solution. Only the NavigationPane can show the menu, the TabbedPane could not show the menu either. Is the way different between NavigationPane to show the menu from the TabbedPane?
01-31-2013 10:52 AM
No, it's exactly the same for both NavigationPane and TabbedPane.
01-31-2013 11:02 AM
Yes, i think so. But it doesn't work. Weird.
01-31-2013 11:23 AM
Hi! I've created a new Tabbed pane project in Momentics and pasted the code from the first post to the beginning of TabbedPane declaration:
TabbedPane {
Menu.definition: MenuDefinition {
// Specify the actions that should be included in the menu
actions: [
ActionItem {
title: "Action 1"
onTriggered: {
console.log("Menu - Action1Triggered()")
}
},
ActionItem {
title: "Action 2"
onTriggered: {
console.log("Menu - Action2Triggered()")
}
},
ActionItem {
title: "Action 3"
onTriggered: {
console.log("Menu - Action3Triggered()")
}
}
] // end of actions list
}
showTabsOnActionBar: true
Tab {
...
When I drag from the top of the screen the menu appears so it seems that the code is correct.
When you try to open the menu do you see a black empty bar? If not, can you please check that you aren't disabling the menu application wide (Application.menuEnabled property)?
01-31-2013 12:44 PM - edited 01-31-2013 12:48 PM
I have one NavigationPane screen with a TabbedPane sheet in my application. The NavigationPane can show the menu but the TabbedPane sheet could not show. Maybe I got the reason, the sheet can not have its separate menu.
BTW, I also noticed that all the screens which are pushed by the Navigation Pane will share one application menu except the sheet.
01-31-2013 01:33 PM