Permalink
Browse files

Beta3 version of the Cascades Sample Apps

  • Loading branch information...
1 parent 1fe5b2d commit af4ec1c1d13a2e2f06655e55c36ae0b321d192c7 @jlarsby jlarsby committed Sep 19, 2012
Showing 353 changed files with 9,708 additions and 9,539 deletions.
View
@@ -11,8 +11,8 @@ clean:
Makefile: FORCE
- $(QMAKE) -spec unsupported/blackberry-armv7le-g++ -o arm/Makefile $(QMAKE_TARGET).pro CONFIG+=device
- $(QMAKE) -spec unsupported/blackberry-x86-g++ -o x86/Makefile $(QMAKE_TARGET).pro CONFIG+=simulator
+ $(QMAKE) -spec unsupported/blackberry-armv7le-qcc -o arm/Makefile $(QMAKE_TARGET).pro CONFIG+=device
+ $(QMAKE) -spec unsupported/blackberry-x86-qcc -o x86/Makefile $(QMAKE_TARGET).pro CONFIG+=simulator
FORCE:
@@ -1,21 +1,22 @@
/* Copyright (c) 2012 Research In Motion Limited.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
import bb.cascades 1.0
-// Details Page for a bucket item, shows the entire task contained in a bucket
+// This details Page for a bucket item that shows the entire task contained in a bucket
// item and adds functionality for editing the item.
+
Page {
id: bucketPage
property variant item
@@ -31,25 +32,17 @@ Page {
Container {
layout: DockLayout {
}
-
+
Container {
- layout: StackLayout {
- leftPadding: 50
+ leftPadding: 22
rightPadding: leftPadding
-
- }
-
- layoutProperties: DockLayoutProperties {
- horizontalAlignment: HorizontalAlignment.Center
- verticalAlignment: VerticalAlignment.Center
- }
+ horizontalAlignment: HorizontalAlignment.Left
- TextArea {
+ Label {
id: bucketText
- editable: false
- text: bucketPage.item.title;
+ multiline: true
+ text: bucketPage.item.title
textStyle.base: SystemDefaults.TextStyles.TitleText
- textStyle.alignment: TextAlignment.Center
}
}
}
@@ -59,28 +52,25 @@ Page {
title: "Edit"
imageSource: "asset:///images/edit.png"
ActionBar.placement: ActionBarPlacement.OnBar
-
onTriggered: {
- editSheet.visible = true;
+ editSheet.open();
editSheet.text = bucketText.text;
}
}
]
-
attachedObjects: [
EditSheet {
id: editSheet
title: "Edit"
hintText: "Update bucket item description"
-
onSaveBucketItem: {
// Call the function to update the item data.
bucketModel.editBucketItem(bucketPage.item, text);
// Update the current item property data used in this Page to do this
// one has to copy all values to 'tempItem'.
var tempItem = bucketPage.item
- // Update the item property.
+ // Update the item property
tempItem.title = text
// Then copy all values back to 'bucketPage.item'
bucketPage.item = tempItem
@@ -14,16 +14,16 @@
*/
import bb.cascades 1.0
-// A sheet that is used for editing and adding new items to the Bucket List application.
+// This QML sheet is used for editing and adding new items to the Bucket List application.
Sheet {
id: editSheet
- // Custom properties.
+ // Custom properties
property alias title: addBar.title
property alias hintText: itemText.hintText
property alias text: itemText.text
- // A custom signal that is triggered when the acceptAction is triggered.
+ // A custom signal is triggered when the acceptAction is triggered.
signal saveBucketItem(string text)
Page {
@@ -38,15 +38,15 @@ Sheet {
title: "Cancel"
onTriggered: {
// Hide the Sheet.
- editSheet.visible = false
+ editSheet.close()
}
}
acceptAction: ActionItem {
title: "Save"
onTriggered: {
- // Hide the Sheet and emit signal the the item should be saved.
- editSheet.visible = false
+ // Hide the Sheet and emit signal that the item should be saved.
+ editSheet.close();
editSheet.saveBucketItem(itemText.text);
}
}
@@ -56,11 +56,11 @@ Sheet {
id: editPane
property real margins: 40
background: Color.create("#f8f8f8")
+ topPadding: editPane.margins
+ leftPadding: editPane.margins
+ rightPadding: editPane.margins
layout: DockLayout {
- topPadding: editPane.margins
- leftPadding: editPane.margins
- rightPadding: editPane.margins
}
attachedObjects: [
@@ -79,16 +79,13 @@ Sheet {
bottomMargin: topMargin
preferredHeight: 450
maxHeight: 450
+ horizontalAlignment: HorizontalAlignment.Fill
textStyle {
base: editTextStyle.style
}
-
- layoutProperties: StackLayoutProperties {
- horizontalAlignment: HorizontalAlignment.Fill
- }
}
- }
- }
- }
-}
+ }// Text Area Container
+ }// Edit pane Container
+ }// Page
+}// Sheet
@@ -14,13 +14,14 @@
*/
import bb.cascades 1.0
+
// This the item component for the items in the bucket list. It is a StandardListItem
// with an action set for altering the state of an item and for entering the multi select state.
StandardListItem {
id: bucketItem
title: ListItemData.title
- reserveImageSpace: false
+ imageSpaceReserved: false
contextActions: [
ActionSet {
@@ -64,21 +65,21 @@ StandardListItem {
}
}
}
-
- multiSelectAction: MultiSelectActionItem {
- multiSelectHandler: bucketItem.ListItem.view.multiSelectHandler
- onTriggered: {
- multiSelectHandler.active = true
- }
- }
- deleteAction: DeleteActionItem {
+ DeleteActionItem {
title: "Delete"
onTriggered: {
bucketItem.ListItem.view.select(bucketItem.ListItem.indexPath);
bucketItem.ListItem.view.dataModel.deleteBucketItems(bucketItem.ListItem.view.selectionList());
}
}
+
+ MultiSelectActionItem {
+ multiSelectHandler: bucketItem.ListItem.view.multiSelectHandler
+ onTriggered: {
+ multiSelectHandler.active;
+ }
+ }
}
]
}
Oops, something went wrong.

0 comments on commit af4ec1c

Please sign in to comment.