NoteEditor.qml Example File
notebook/assets/NoteEditor.qml
import bb.cascades 1.0
import com.example.bb10samples.pim.notebook 1.0
Page {
id: root
onCreationCompleted: {
if ( _noteBook.noteEditor.mode == NoteEditor.EditMode) {
titleField.text = _noteBook.noteEditor.title
descriptionField.text = _noteBook.noteEditor.description
dueDateTimeField.value = _noteBook.noteEditor.dueDateTime
completedField.checked = _noteBook.noteEditor.completed
}
}
titleBar: TitleBar {
id: pageTitleBar
acceptAction: ActionItem {
title: (_noteBook.noteEditor.mode == NoteEditor.CreateMode ? qsTr ("Create" ) : qsTr ("Save"))
onTriggered: {
_noteBook.noteEditor.saveNote()
navigationPane.pop()
}
}
dismissAction: ActionItem {
title: qsTr ("Cancel")
onTriggered: navigationPane.pop()
}
}
Container {
layout: DockLayout {}
ImageView {
horizontalAlignment: HorizontalAlignment.Fill
verticalAlignment: VerticalAlignment.Fill
imageSource: "asset:///images/background.png"
}
Container {
horizontalAlignment: HorizontalAlignment.Fill
verticalAlignment: VerticalAlignment.Fill
leftPadding: 30
topPadding: 30
rightPadding: 30
TextField {
id: titleField
hintText: qsTr ("Title")
onTextChanging: _noteBook.noteEditor.title = text
}
TextArea {
id: descriptionField
hintText: qsTr ("Description")
onTextChanging: _noteBook.noteEditor.description = text
}
DateTimePicker {
id: dueDateTimeField
title: qsTr ("Due")
onValueChanged: _noteBook.noteEditor.dueDateTime = value
}
CheckBox {
id: completedField
text: qsTr ("Completed")
onCheckedChanged: _noteBook.noteEditor.completed = checked
}
}
}
}