main.qml Example File
scratchpad/assets/main.qml
import bb.cascades 1.0
Page {
Container {
layout: DockLayout {}
ImageView {
horizontalAlignment: HorizontalAlignment.Fill
verticalAlignment: VerticalAlignment.Fill
imageSource: "asset:///images/background.png"
}
ScratchpadScrollView {
Container {
horizontalAlignment: HorizontalAlignment.Fill
verticalAlignment: VerticalAlignment.Fill
topPadding: 30
leftPadding: 30
rightPadding: 30
ImageView {
horizontalAlignment: HorizontalAlignment.Center
preferredHeight: 500
preferredWidth: 700
minWidth: 700
minHeight: 500
image: _scratchpad.image
}
Container {
topMargin: 50
layout: StackLayout {
orientation: LayoutOrientation.LeftToRight
}
Button {
imageSource: "asset:///images/Blue_20Nose_20Thumb.png"
onClicked: {
_scratchpad.object = "images/Blue_20Nose_20Thumb.png"
}
}
Button {
imageSource: "asset:///images/Zeppelin_Thumb.png"
onClicked: {
_scratchpad.object = "images/Zeppelin_Thumb.png"
}
}
Button {
imageSource: "asset:///images/warning.png"
onClicked: {
_scratchpad.object = "images/warning.png"
}
}
Button {
text: "\u25CB"
onClicked: {
_scratchpad.object = "circle"
}
}
Button {
text: "\u25A1"
onClicked: {
_scratchpad.object = "square"
}
}
}
TextField {
id: rowText
topMargin: 50
hintText: qsTr("Enter # rows (1 or more) of replicants")
inputMode: TextFieldInputMode.NumbersAndPunctuation
input {
submitKey: SubmitKey.EnterKey
onSubmitted: {
_scratchpad.rows = rowText.text
}
}
}
TextField {
id: columnText
hintText: qsTr("Enter # columns (1 or more) of replicants")
inputMode: TextFieldInputMode.NumbersAndPunctuation
input {
submitKey: SubmitKey.EnterKey
onSubmitted: {
_scratchpad.columns = columnText.text
}
}
}
}
}
}
}