Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
d3v3l0p3r
Posts: 162
Registered: ‎07-19-2012
My Device: Q5, Q10, Z10, Z30, PlayBook
My Carrier: Carrier

How would you implement Application Menu pages where root is TabbedPane

In the documentation the best practice is to attach application menu under root element.

 

My root element is TabbedPane. All documentation examples assume root element is NavigationPane or Page in which you just push the settings page or display elements which represent settings page.

 

How would you implement actual help / settings pages where application menu is under NavigationPane and there is no way to push new pages in (unless its under a tab).

---
If you find my post helpful please "like" it and "accept as a solution"
Please use plain text.
Developer
Zmey
Posts: 1,510
Registered: ‎12-18-2012
My Device: PlayBook, Z10, DAC

Re: How would you implement Application Menu pages where root is TabbedPane

It's no longer possible to wrap TabbedPane into a NavigationPane. So you can't push the Settings page to the stack. :smileysad:

 

Known options are:

 

- Disable the Application Menu and implement Settings as a tab.

 

- Show Settings in a Sheet.

 

- A complex workaround: ensure all your Tab pages contain Navigation Panes. When Settings or Help action is activated, get top level TabbedPane: (TabbedPane *)Application::instance()->scene(). Then push SettingsPage into active Tab's NavigationPane.

 


Andrey Fidrya, @zmeyc on twitter
Please use plain text.
Developer
Developer
lew
Posts: 174
Registered: ‎03-05-2009
My Device: Dev Alpha
My Carrier: -

Re: How would you implement Application Menu pages where root is TabbedPane

[ Edited ]

i would suggest using a Sheet. The biggest benefit of using 'Sheet' for menu items is that you can't keep stacking menu item pages...so it garantees that only one instance of your menu page is opened at any time.

 

You can put a navigationpane inside the sheet, then have a page pushed when the sheet is created to fake the back button.

 

but the only drawback is that 'annoying' sheet animation that i couldn't get rid of :smileysad:

 

Please use plain text.
Developer
ekke
Posts: 1,428
Registered: ‎04-08-2010
My Device: Z10 (red Limited Edition), Q10, Z30
My Carrier: Telekom.de, O2, Vodafone

Re: How would you implement Application Menu pages where root is TabbedPane

My root is also a TabbedPane,

each Tab is a NavigationPane, so I can have a stack of Pages on each Tab

ApplicationMenu are Sheets, where Sheet can cover a WebView (Help) or NavigationPane (Settings, ...)

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
International Development Mobile Apps BlackBerry 10 Cascades
Cascades - Workshops / Trainings / Bootcamps

Open Source Enthusiast
blog: http://ekkes-corner.org videos: http://www.youtube.com/user/ekkescorner
bb10-development: http://appbus.org Twitter: @ekkescorner
Please use plain text.
Developer
Zmey
Posts: 1,510
Registered: ‎12-18-2012
My Device: PlayBook, Z10, DAC

Re: How would you implement Application Menu pages where root is TabbedPane

i would suggest using a Sheet. The biggest benefit of using 'Sheet' for menu items is that you can't keep stacking menu item pages...so it garantees that only one instance of your menu page is opened at any time.

 

This can be worked around for NavigationPane too:

 

Application::Application(QObject *parent)
        : QObject(parent)
        , helpPage_(NULL)
        , settingsPage_(NULL)

---

void Application::settingsAction_triggered()
{
        if (settingsPage_)
                return;
        settingsPage_ = new SettingsPage;            
        Application::instance()->setMenuEnabled(false);
        pane_->push(settingsPage_);
}

---

Same for helpPage_

---

void Application::popTransitionEnded(bb::cascades::Page* page)
{
        if (page == helpPage_)
        {
                helpPage_ = NULL;
                Application::instance()->setMenuEnabled(true);
        }
        else if (page == settingsPage_)
        {
                settingsPage_ = NULL;
                Application::instance()->setMenuEnabled(true);
        }
        delete page;
}

 

but the only drawback is that 'annoying' sheet animation that i couldn't get rid of

 

Another drawback is the Sheet can't be closed using peek gesture. :smileysad:

 


Andrey Fidrya, @zmeyc on twitter
Please use plain text.