main.qml Example File
calendar/assets/main.qml
import bb.cascades 1.0
NavigationPane {
id: navigationPane
onPopTransitionEnded: page.destroy()
Page {
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
bottomPadding: 30
SegmentedControl {
Option {
text: qsTr ("Today")
value: "today"
selected: true
}
Option {
text: qsTr ("Week")
value: "week"
}
Option {
text: qsTr ("Month")
value: "month"
}
onSelectedIndexChanged: {
_calendar.filter = selectedValue
}
}
ListView {
dataModel: _calendar.model
listItemComponents: ListItemComponent {
type: "item"
StandardListItem {
title: ListItemData.subject
description: qsTr ("%1 - %2").arg(ListItemData.startTime).arg(ListItemData.endTime)
}
}
onTriggered: {
clearSelection()
select(indexPath)
_calendar.setCurrentEvent(indexPath)
_calendar.viewEvent()
navigationPane.push(eventViewer.createObject())
}
}
}
}
actions: [
ActionItem {
title: qsTr ("New")
imageSource: "asset:///images/action_addevent.png"
ActionBar.placement: ActionBarPlacement.OnBar
onTriggered: {
_calendar.createEvent()
navigationPane.push(eventEditor.createObject())
}
}
]
}
attachedObjects: [
ComponentDefinition {
id: eventEditor
source: "EventEditor.qml"
},
ComponentDefinition {
id: eventViewer
source: "EventViewer.qml"
}
]
}