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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Developer
Posts: 181
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"
Developer
Posts: 1,524
Registered: ‎12-18-2012
My Device: Z30, Z10 LE, DevAlpha C, PlayBook

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. Smiley Sad

 

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
Developer
Developer
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 Smiley Sad

 

Developer
Posts: 1,750
Registered: ‎04-08-2010
My Device: Passport Silver, PRIV, DTEK
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
BlackBerry Platinum Enterprise Partner
QtChampion
International Development native Mobile Business Apps
BlackBerry 10 | Qt Mobile (Android, iOS, W10)
Workshops / Trainings / Bootcamps

blog: http://ekkes-corner.org
mobile-development: http://appbus.org Twitter: @ekkescorner
Developer
Posts: 1,524
Registered: ‎12-18-2012
My Device: Z30, Z10 LE, DevAlpha C, PlayBook

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. Smiley Sad

 


Andrey Fidrya, @zmeyc on twitter