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
helex
Posts: 286
Registered: ‎02-14-2012
My Device: Nokia N950 / BB Playbook
My Carrier: -

How to create a settings Menu using Cascades...

Hi!

 

If I swipe from the top of the screen down inside my Cascades application I'm able to see for a short moment a empty rectangle. I'm sure I should place my settings menu there like at the webbrowser on my Playbook.

 

Any Idea how to integrate it using Cascades?

 

Perhaps I'm simply to blind and google was not my friend...

Please use plain text.
Developer
soaman
Posts: 848
Registered: ‎03-03-2011
My Device: Z10

Re: How to create a settings Menu using Cascades...

Use Menu class.

Look at https://developer.blackberry.com/cascades/reference/bb__cascades__menu.html for info.
--------------------------------------------------------------------------------------
Leader of Ljubljana BlackBerry Developer Group
BlackBerry Certified Builder for Native Application Development
Please use plain text.
Developer
helex
Posts: 286
Registered: ‎02-14-2012
My Device: Nokia N950 / BB Playbook
My Carrier: -

Re: How to create a settings Menu using Cascades...

Sorry, I never thought it could be done using the Menu class. I thought it is only to create a actionMenu on the Bottom of the screen. And I still don't understand how it should be done using the Menu API.

 

If I add a SettingsActionItem (it is in the code proposals) to a Page I get a parsing error in the preview and no UI on the device:

 

actions: [ SettingsActionItem { } ] 

Could you post a example or point me to one which shows a SettingsMenu by swiping down from the top of the screen using Cascades?

 

Please use plain text.
Developer
soaman
Posts: 848
Registered: ‎03-03-2011
My Device: Z10

Re: How to create a settings Menu using Cascades...

In C++:

Menu *menu = Menu::create()
.add(ActionItem::create().title("Menu Item 1"))
.add(ActionItem::create().title("Menu Item 2"))
.help(HelpActionItem::create());
Application::setMenu(menu);
--------------------------------------------------------------------------------------
Leader of Ljubljana BlackBerry Developer Group
BlackBerry Certified Builder for Native Application Development
Please use plain text.
BlackBerry Development Advisor (Retired)
smacmartin
Posts: 499
Registered: ‎05-07-2012
My Device: developer
My Carrier: developer

Re: How to create a settings Menu using Cascades...

As for applicability, see the release notes: https://developer.blackberry.com/cascades/download/releasenotes/ under Application Menu.  You'll see it specifically suggests this as a good place to do your settings.

 

Stuart

Please use plain text.
Developer
helex
Posts: 286
Registered: ‎02-14-2012
My Device: Nokia N950 / BB Playbook
My Carrier: -

Re: How to create a settings Menu using Cascades...

[ Edited ]

soaman, this is a 1:1 copy from the top of the link from your first post without any kind of comment and it seems without reading my post. Are you only here to post as many messages as possible? I'm searching for a equivalent Cascades solution.

 


smacmartin wrote:

As for applicability, see the release notes: https://developer.blackberry.com/cascades/download/releasenotes/ under Application Menu.  You'll see it specifically suggests this as a good place to do your settings.

 

Stuart


Thank you smacmartin, 
 
So the setting is currently not integrated. This is perhaps not the answer I've searched for but it is a answer. So I need to wait until the next release (feature freeze at the end of september) before I add the setting Menu to my application. :-) 
 
Please use plain text.
BlackBerry Development Advisor (Retired)
smacmartin
Posts: 499
Registered: ‎05-07-2012
My Device: developer
My Carrier: developer

Re: How to create a settings Menu using Cascades...

[ Edited ]

No, everything you need should be there now, if I understand your question.

 

The release notes specifically say this is is a good place to do settings.

 

Soaman's posts read as applicable to me. The documentation for Menu matches the description of the Application Menu section in the release notes. If the documentation is unclear let us know how you're blocked.  I have occasionally seen posts that misunderstood the question and I have occasionally seen posts that mis-spoke, but I have yet to see any post that was not trying to be helpful.  Remember one of your goals: you want the community to willingly donate their time, so please post accordingly.  Can you perhaps rephrase your question?   I think he answered the question you asked.

 

See also https://developer.blackberry.com/cascades/reference/bb__cascades__settingsactionitem.html

 

How you manage and save your application settings is up to you.   You might want to look at the sample StarShipSettings.

 

Good luck!  Let us know how you fare.

 

Stuart

Please use plain text.
Developer
helex
Posts: 286
Registered: ‎02-14-2012
My Device: Nokia N950 / BB Playbook
My Carrier: -

Re: How to create a settings Menu using Cascades...

Thanks for your reply smacmartin.

 

Sorry I don't wanted to sound cruel. I was only somewhat frustrated about the short-spoken kind of answers. I'm searching ages for every small part and progressing only very slowly. :smileysad:

 

And sorry to be unclear in my first post. For me is Cascades the qml like User Interface language BlackBerry has introduced.

 

Personally I prefer portable code without much platformrelated code in #ifdef blocks and hence I prefer strickt and clear seperated UI and logic code. And do a part of the UI inside my C++ code and the rest in a qml file feels for me not correct. So I prefer to wait until the next Beta release of the SDK to do the settings menu.

 

There is already a lot to much Qt stuff missing at the SDK so I'm forced to add a lot of normally not needed BlackBerry10 specific code. And I wouldn't like to make the situation even worse by creating some UI parts inside of my C++ functions and some outside in the qml file. :smileysad:

Please use plain text.
BlackBerry Development Advisor (Retired)
smacmartin
Posts: 499
Registered: ‎05-07-2012
My Device: developer
My Carrier: developer

Re: How to create a settings Menu using Cascades...

I haven't had a chance to play with this feature yet, but usually components in C++ are also there in QML.

 

Stuart

Please use plain text.
Developer
helex
Posts: 286
Registered: ‎02-14-2012
My Device: Nokia N950 / BB Playbook
My Carrier: -

Re: How to create a settings Menu using Cascades...

[ Edited ]

The decisive answer was behind the link to the release note you've posted: https://developer.blackberry.com/cascades/download/releasenotes/

 

Application menu - This is a new control in this release, and appears at the top of your app's UI. With the ability to hold up to 5 visible items, you can use the application menu to provide access to help, settings, or other custom actions that your app provides. When it's enabled, users can swipe or drag down from the top of the screen to display the menu, and swipe or drag up to dismiss it. This control is currently available only in C++, but support for QML will be added in a later release.

 

So I added a placeholder in my code and wait for the next release of the SDK. No wonder I was unable to find a solution without using C++ code before.

 

Thanks so far. I'll update this Topic with the final solution as soon as it is integrated into Cascades and accessible from within a qml file.

Please use plain text.