You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ca...@apache.org on 2019/12/12 23:47:43 UTC
[royale-asjs] 42/42: jewel-examples: upgrade tour de jewel for the
changes in ButtonBar and DataGrid
This is an automated email from the ASF dual-hosted git repository.
carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
commit 6270a038ecf8edc97d2fb4e8edbde7decd10c283
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Fri Dec 13 00:29:33 2019 +0100
jewel-examples: upgrade tour de jewel for the changes in ButtonBar and DataGrid
---
.../src/main/royale/ButtonBarPlayGround.mxml | 13 +++++++++----
.../src/main/royale/DataGridPlayGround.mxml | 18 +++---------------
.../TourDeJewel/src/main/royale/models/ListsModel.as | 17 +++++++++++++++++
3 files changed, 29 insertions(+), 19 deletions(-)
diff --git a/examples/royale/TourDeJewel/src/main/royale/ButtonBarPlayGround.mxml b/examples/royale/TourDeJewel/src/main/royale/ButtonBarPlayGround.mxml
index 2f149a1..09a9bb1 100644
--- a/examples/royale/TourDeJewel/src/main/royale/ButtonBarPlayGround.mxml
+++ b/examples/royale/TourDeJewel/src/main/royale/ButtonBarPlayGround.mxml
@@ -76,7 +76,7 @@ limitations under the License.
<j:ButtonBar localId="bb3" change="bb2_label.text = bb3.selectedItem as String"
emphasis="primary">
<j:beads>
- <j:ButtonBarLayout proportionalWidths="true"/>
+ <j:ButtonBarLayout/>
</j:beads>
<j:dataProvider>
<js:ArrayList source="[Home, Support, Operations, Service]" />
@@ -88,15 +88,20 @@ limitations under the License.
<j:ButtonBar localId="bb4" change="bb2_label.text = bb4.selectedItem as String"
emphasis="secondary" width="100%">
<j:beads>
- <j:ButtonBarLayout localId="ppw" proportionalWidths="true" gap="3"/>
+ <j:ButtonBarLayout localId="ppw" gap="3"/>
</j:beads>
<j:dataProvider>
<js:ArrayList source="[Home, Support, Operations, Service]" />
</j:dataProvider>
</j:ButtonBar>
- <j:CheckBox change="ppw.proportionalWidths = !ppw.proportionalWidths" selected="true"
- text="Proportional Widths (true) / Same Widths (false)"/>
+ <j:DropDownList dataProvider="{listModel.bblayout_options}"
+ labelField="label" selectedIndex="2" width="230"
+ change="ppw.widthType = event.target.selectedItem.value">
+ <j:beads>
+ <j:RequireSelection requireSelection="true"/>
+ </j:beads>
+ </j:DropDownList>
<j:Label localId="bb2_label"/>
</j:Card>
diff --git a/examples/royale/TourDeJewel/src/main/royale/DataGridPlayGround.mxml b/examples/royale/TourDeJewel/src/main/royale/DataGridPlayGround.mxml
index 230cb0e..e8e4ef5 100644
--- a/examples/royale/TourDeJewel/src/main/royale/DataGridPlayGround.mxml
+++ b/examples/royale/TourDeJewel/src/main/royale/DataGridPlayGround.mxml
@@ -54,7 +54,7 @@ limitations under the License.
<j:Card>
<html:H3 text="Jewel DataGrid"/>
- <j:Label text="Basic configuration with no column widths"/>
+ <j:Label text="Basic configuration, width = 100%, no column widths"/>
<j:DataGrid localId="datagrid" width="100%" height="100%"
change="dataGridChange(event.target as DataGrid, datagrid_lb)">
@@ -73,7 +73,7 @@ limitations under the License.
</j:DataGrid>
<j:Label id="datagrid_lb" text="DagaGrid selection will be shown here"/>
- <j:Button text="Refresh Grid" click="refreshGrid(datagrid)" emphasis="primary"/>
+ <!-- <j:Button text="Refresh Grid" click="refreshGrid(datagrid)" emphasis="primary"/> -->
</j:Card>
</j:GridCell>
<j:GridCell desktopNumerator="1" desktopDenominator="2" tabletNumerator="1" tabletDenominator="2" phoneNumerator="1" phoneDenominator="1">
@@ -82,7 +82,7 @@ limitations under the License.
<j:Label text="Using specific column widths"/>
- <j:DataGrid localId="datagrid2" width="100%" height="100%"
+ <j:DataGrid localId="datagrid2" width="100%" height="100%"
rowHeight="40" emphasis="primary"
change="dataGridChange(event.target as DataGrid, datagrid2_lb)"
dataProvider="{productModel.productList}">
@@ -99,17 +99,5 @@ limitations under the License.
</j:Card>
</j:GridCell>
</j:Grid>
-
- <fx:Style>
- @namespace j "library://ns.apache.org/royale/jewel";
-
- /* Allows the DataGrid to be specified with percentage widths for the columns (rather
- * than pixel widths) and does not respond to changes to its dataProvider.
- */
- /* .PercentageColumnWidths {
- IBeadLayout: ClassReference("org.apache.royale.html.beads.layouts.DataGridPercentageLayout");
- border: 1px solid #ACACAC;
- } */
- </fx:Style>
</c:ExampleAndSourceCodeTabbedSectionContent>
diff --git a/examples/royale/TourDeJewel/src/main/royale/models/ListsModel.as b/examples/royale/TourDeJewel/src/main/royale/models/ListsModel.as
index dcc8649..a3f726d 100644
--- a/examples/royale/TourDeJewel/src/main/royale/models/ListsModel.as
+++ b/examples/royale/TourDeJewel/src/main/royale/models/ListsModel.as
@@ -133,5 +133,22 @@ package models
{
return _iconLDetailistDataSource.slice();
}
+
+
+ /**
+ * Used in the ButtonBar example. Commented options need to be implemented
+ */
+ private var _bblayout_options:ArrayList = new ArrayList([
+ {label: "PIXEL_WIDTHS", value: 0},
+ // {label: "PROPORTIONAL_WIDTHS", value: 1},
+ {label: "PERCENT_WIDTHS", value: 2},
+ // {label: "NATURAL_WIDTHS", value: 3},
+ {label: "SAME_WIDTHS", value: NaN}
+ ]);
+
+ public function get bblayout_options():ArrayList
+ {
+ return _bblayout_options;
+ }
}
}