1. paulwallace1234's Avatar
    Is the pulldown MenuDefinition supposed to show on every page?
    I use it to open my Apps Settings but it also shows in the Settings page, which seems rather pointless, creating another one on the Settings page makes no difference, is this the proper behaviour or has something glitched?

    Thanks,
    Paul
    07-21-14 03:24 PM
  2. thurask's Avatar
    Hmm, is your Settings screen a Page or a Sheet? I don't get the MenuDefinition on Sheets, just Pages.
    07-21-14 03:51 PM
  3. paulwallace1234's Avatar
    Hmm, is your Settings screen a Page or a Sheet? I don't get the MenuDefinition on Sheets, just Pages.
    It's a Page, main.qml is a Navigation Pane with Page as a child and Settings just a Page.

    Also I just tried to add padding to a Label and am getting " QML Label: WARNING: Padding is not supported for this control" and Margin ain't doing jack all, I'm guessing something is going wrong here?
    07-21-14 03:57 PM
  4. thurask's Avatar
    It's a Page, main.qml is a Navigation Pane with Page as a child and Settings just a Page.

    Also I just tried to add padding to a Label and am getting " QML Label: WARNING: Padding is not supported for this control" and Margin ain't doing jack all, I'm guessing something is going wrong here?
    Try changing Settings to a Sheet and see if that fixes it. Might need to add a dismissAction to the Sheet's TitleBar (a Close button).

    And, if I remember correctly, padding is a Container property, not a Label property. So just add one around the Label in question.
    07-21-14 04:07 PM
  5. paulwallace1234's Avatar
    Try changing Settings to a Sheet and see if that fixes it. Might need to add a dismissAction to the Sheet's TitleBar (a Close button).

    And, if I remember correctly, padding is a Container property, not a Label property. So just add one around the Label in question.
    The Sheet appears to be working, thanks, I'm guessing it's not possible for a Sheet to be inside a separate qml file? Or does it have to be a attached object in the main? Was thinking on Startup Times, don't want my Settings page effecting the startup time (I had that trouble on Symbian, they where picky as hell)

    Sorry, how do I add one around the Label? Only being at this for a couple of days, went head first
    07-21-14 04:30 PM
  6. thurask's Avatar
    The Sheet appears to be working, thanks, I'm guessing it's not possible for a Sheet to be inside a separate qml file? Or does it have to be a attached object in the main? Was thinking on Startup Times, don't want my Settings page effecting the startup time (I had that trouble on Symbian, they where picky as hell)

    Sorry, how do I add one around the Label? Only being at this for a couple of days, went head first
    It's certainly possible to have a separate QML file as a Sheet:

    main.qml
    Code:
    import bb.cascades 1.2
    
    NavigationPane {
        attachedObjects: [
            ComponentDefinition {
                id: settingsSheetDefinition
                SettingsSheet { //SettingsSheet.qml
                }
            }
        ]
        Menu.definition: MenuDefinition {
            settingsAction: SettingsActionItem {
                onTriggered: {
                    var settings = settingsSheetDefinition.createObject()
                    settings.open();
                }
            }
        }
      //stuff
    }
    SettingsSheet.qml
    Code:
    import bb.cascades 1.2
    
    Sheet {
        id: settingsSheet
        content: Page {
            titleBar: TitleBar {
                title: qsTr("Settings") + Retranslate.onLanguageChanged
                dismissAction: ActionItem {
                    title: qsTr("Close") + Retranslate.onLanguageChanged
                    onTriggered: {
                        settingsSheet.close()
                        if (settingsSheet) settingsSheet.destroy();
                    }
                }
            }
            Container {
                //stuff
            }
        }
    }
    And as for the Label, instead of:

    Code:
    Label {
        //stuff
    }
    do

    Code:
    Container{
        topPadding: someNumber
        Label {
            //stuff
        }
    }
    paulwallace1234 likes this.
    07-21-14 04:42 PM
  7. paulwallace1234's Avatar
    It's certainly possible to have a separate QML file as a Sheet:

    main.qml
    Code:
    import bb.cascades 1.2
    
    NavigationPane {
        attachedObjects: [
            ComponentDefinition {
                id: settingsSheetDefinition
                SettingsSheet { //SettingsSheet.qml
                }
            }
        ]
        Menu.definition: MenuDefinition {
            settingsAction: SettingsActionItem {
                onTriggered: {
                    var settings = settingsSheetDefinition.createObject()
                    settings.open();
                }
            }
        }
      //stuff
    }
    SettingsSheet.qml
    Code:
    import bb.cascades 1.2
    
    Sheet {
        id: settingsSheet
        content: Page {
            titleBar: TitleBar {
                title: qsTr("Settings") + Retranslate.onLanguageChanged
                dismissAction: ActionItem {
                    title: qsTr("Close") + Retranslate.onLanguageChanged
                    onTriggered: {
                        settingsSheet.close()
                        if (settingsSheet) settingsSheet.destroy();
                    }
                }
            }
            Container {
                //stuff
            }
        }
    }
    And as for the Label, instead of:

    Code:
    Label {
        //stuff
    }
    do

    Code:
    Container{
        topPadding: someNumber
        Label {
            //stuff
        }
    }
    Sorted, thanks again, you've really helped me out
    07-23-14 05:07 PM
  8. NZCoderGuy's Avatar
    is it possible to use the MenuDefinition on a sheet instead of a page?

    or if not,

    If I change my current Sheet to a Page or TabbedPane, when I have it defined as a "ComponentDefinition", I try to open by the following:

    ComponentDefiniton {
    id: NewSheet;
    source: "newsheet.qml";
    }

    var mainSheet = NewSheet.createObject();
    mainSheet.open();

    /\ that works if the source is a sheet in the qml as the root element. but if I change the root element to "Page" or "TabbedPane" then it fails on the call to ".open();"

    any ideas?
    08-11-14 08:16 AM

Similar Threads

  1. PicsArt on my Z10 doesn't load pictures
    By Uchebosso in forum Ask a Question
    Replies: 2
    Last Post: 07-22-14, 03:15 AM
  2. Z10 Ocean Swim and it still works (mostly)
    By Jaralle in forum BlackBerry Z10
    Replies: 4
    Last Post: 07-21-14, 11:06 PM
  3. Dropped phone and now camera is acting funky
    By brzsa in forum Ask a Question
    Replies: 5
    Last Post: 07-21-14, 03:49 PM
  4. Upgrading radio on Blackberry STL 100-1
    By Uchebosso in forum Ask a Question
    Replies: 2
    Last Post: 07-21-14, 02:26 PM
  5. What is this icon?
    By Pavol Malovec in forum Ask a Question
    Replies: 4
    Last Post: 07-21-14, 02:06 PM
LINK TO POST COPIED TO CLIPBOARD