You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by tv...@apache.org on 2009/10/21 14:59:25 UTC
svn commit: r827998 - /incubator/pivot/trunk/tutorials/www/split_panes.html
Author: tvolkert
Date: Wed Oct 21 12:59:25 2009
New Revision: 827998
URL: http://svn.apache.org/viewvc?rev=827998&view=rev
Log:
Added part of the split panes tutorial html page
Modified:
incubator/pivot/trunk/tutorials/www/split_panes.html
Modified: incubator/pivot/trunk/tutorials/www/split_panes.html
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/tutorials/www/split_panes.html?rev=827998&r1=827997&r2=827998&view=diff
==============================================================================
--- incubator/pivot/trunk/tutorials/www/split_panes.html (original)
+++ incubator/pivot/trunk/tutorials/www/split_panes.html Wed Oct 21 12:59:25 2009
@@ -34,7 +34,220 @@
<body>
<h1>Split Panes</h1>
-<p>This section is not yet complete.</>
+<p>TODO</p>
+
+<script src="version.js"></script>
+<script>
+var attributes = {code:"org.apache.pivot.wtk.BrowserApplicationContext$HostApplet",
+ archive:"lib/pivot-core-" + version + ".jar"
+ + ",lib/pivot-wtk-" + version + ".jar"
+ + ",lib/pivot-wtk-" + version + ".terra.jar"
+ + ",lib/pivot-tutorials-" + version + ".jar",
+ width:320,
+ height:240
+};
+var parameters = {application_class_name:"org.apache.pivot.wtk.ScriptApplication",
+ codebase_lookup:false,
+ java_arguments:"-Dsun.awt.noerasebackground=true -Dsun.awt.erasebackgroundonresize=true",
+ startup_properties:"src=org/apache/pivot/tutorials/layout/split_panes.wtkx"
+};
+deployJava.writeAppletTag(attributes, parameters);
+</script>
+
+<p>The WTKX for this example is shown below:</p>
+
+<pre class="brush:xml">
+<Window title="Split Panes" maximized="true"
+ WindowStateListener.windowOpened="init();"
+ xmlns:wtkx="http://pivot.apache.org/wtkx"
+ xmlns:collections="org.apache.pivot.collections"
+ xmlns:content="org.apache.pivot.wtk.content"
+ xmlns="org.apache.pivot.wtk">
+ <wtkx:script>
+ <![CDATA[
+ function init() {
+ spinner.setSelectedIndex(3);
+ primaryColorListButton.setSelectedIndex(0);
+ secondaryColorListButton.setSelectedIndex(1);
+ orientationListButton.setSelectedIndex(0);
+ }
+ ]]>
+ </wtkx:script>
+
+ <content>
+ <SplitPane wtkx:id="splitPane" orientation="horizontal" splitRatio="0.6">
+ <splitPaneListeners>
+ <wtkx:script>
+ <![CDATA[
+ function splitRatioChanged(splitPane, previousSplitRatio) {
+ var value = Math.floor(splitPane.getSplitRatio() * 100);
+ label.setText(value + "%");
+ }
+ ]]>
+ </wtkx:script>
+ </splitPaneListeners>
+ <left>
+ <Border>
+ <content>
+ <Panel styles="{backgroundColor:'#f7f5ed'}"/>
+ </content>
+ </Border>
+ </left>
+ <right>
+ <Border styles="{padding:{top:10}}">
+ <content>
+ <BoxPane orientation="vertical" styles="{fill:true,
+ horizontalAlignment:'right'}">
+ <Label text="Properties" styles="{padding:{left:10}, font:{bold:true}}"/>
+ <BoxPane orientation="vertical" styles="{horizontalAlignment:'right'}">
+ <Form styles="{horizontalSpacing:18, rightAlignLabels:true}">
+ <sections>
+ <Form.Section>
+ <Label wtkx:id="label" Form.label="Split Ratio"
+ minimumPreferredWidth="100"/>
+ <ListButton wtkx:id="orientationListButton"
+ Form.label="Orientation"
+ listData="['Horizontal', 'Vertical']">
+ <listButtonSelectionListeners>
+ <wtkx:script>
+ <![CDATA[
+ function selectedIndexChanged(listButton, previousSelectedIndex) {
+ var orientation = listButton.getSelectedItem();
+ splitPane.setOrientation(orientation);
+ }
+ ]]>
+ </wtkx:script>
+ </listButtonSelectionListeners>
+ </ListButton>
+ <BoxPane Form.label="Flags" orientation="vertical"
+ styles="{spacing:10}">
+ <Checkbox buttonData="Locked">
+ <buttonStateListeners>
+ <wtkx:script>
+ <![CDATA[
+ function stateChanged(button, previousState) {
+ splitPane.setLocked(button.isSelected());
+ }
+ ]]>
+ </wtkx:script>
+ </buttonStateListeners>
+ </Checkbox>
+ </BoxPane>
+ </Form.Section>
+ </sections>
+ </Form>
+ </BoxPane>
+ <Separator/>
+ <Label text="Styles" styles="{padding:{left:10}, font:{bold:true}}"/>
+ <BoxPane orientation="vertical" styles="{horizontalAlignment:'right'}">
+ <Form styles="{horizontalSpacing:18, rightAlignLabels:true}">
+ <sections>
+ <Form.Section>
+ <Spinner wtkx:id="spinner"
+ Form.label="Splitter Thickness"
+ styles="{sizeToContent:true}">
+ <spinnerSelectionListeners>
+ <wtkx:script>
+ <![CDATA[
+ function selectedIndexChanged(spinner, previousSelectedIndex) {
+ var value = spinner.getSelectedItem();
+ splitPane.getStyles().put("splitterThickness", value);
+ }
+ ]]>
+ </wtkx:script>
+ </spinnerSelectionListeners>
+ <spinnerData>
+ <content:NumericSpinnerData lowerBound="3"
+ upperBound="20" />
+ </spinnerData>
+ </Spinner>
+ <ListButton wtkx:id="primaryColorListButton"
+ Form.label="Splitter Handle Primary Color"
+ styles="{listSize:6}">
+ <listData>
+ <collections:ArrayList>
+ <content:ColorItem color="#000000" name="Black"/>
+ <content:ColorItem color="#dddcd5" name="Tan"/>
+ <content:ColorItem color="#14538b" name="Blue"/>
+ <content:ColorItem color="#b0000f" name="Red"/>
+ </collections:ArrayList>
+ </listData>
+ <dataRenderer>
+ <content:ListButtonColorRenderer/>
+ </dataRenderer>
+ <itemRenderer>
+ <content:ListViewColorRenderer/>
+ </itemRenderer>
+ <listButtonSelectionListeners>
+ <wtkx:script>
+ <![CDATA[
+ function selectedIndexChanged(listButton, previousSelectedIndex) {
+ var colorItem = listButton.getSelectedItem();
+ splitPane.getStyles().put("splitterHandlePrimaryColor",
+ colorItem.getColor());
+ }
+ ]]>
+ </wtkx:script>
+ </listButtonSelectionListeners>
+ </ListButton>
+ <ListButton wtkx:id="secondaryColorListButton"
+ Form.label="Splitter Handle Secondary Color"
+ styles="{listSize:6}">
+ <listData>
+ <collections:ArrayList>
+ <content:ColorItem color="#000000" name="Black"/>
+ <content:ColorItem color="#dddcd5" name="Tan"/>
+ <content:ColorItem color="#14538b" name="Blue"/>
+ <content:ColorItem color="#b0000f" name="Red"/>
+ </collections:ArrayList>
+ </listData>
+ <dataRenderer>
+ <content:ListButtonColorRenderer/>
+ </dataRenderer>
+ <itemRenderer>
+ <content:ListViewColorRenderer/>
+ </itemRenderer>
+ <listButtonSelectionListeners>
+ <wtkx:script>
+ <![CDATA[
+ function selectedIndexChanged(listButton, previousSelectedIndex) {
+ var colorItem = listButton.getSelectedItem();
+ splitPane.getStyles().put("splitterHandleSecondaryColor",
+ colorItem.getColor());
+ }
+ ]]>
+ </wtkx:script>
+ </listButtonSelectionListeners>
+ </ListButton>
+ <BoxPane Form.label="Flags" orientation="vertical"
+ minimumPreferredWidth="100"
+ styles="{spacing:10}">
+ <Checkbox buttonData="Use Shadow">
+ <buttonStateListeners>
+ <wtkx:script>
+ <![CDATA[
+ function stateChanged(button, previousState) {
+ splitPane.getStyles().put("useShadow", button.isSelected());
+ }
+ ]]>
+ </wtkx:script>
+ </buttonStateListeners>
+ </Checkbox>
+ </BoxPane>
+ </Form.Section>
+ </sections>
+ </Form>
+ </BoxPane>
+ </BoxPane>
+ </content>
+ </Border>
+ </right>
+ </SplitPane>
+ </content>
+</Window>
+</pre>
+
+<p>Since this example is written entirely in WTKX and script, there is no associated Java source.</p>
<p>Next: <a href="forms.html">Forms</a></p>
</body>