You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by gb...@apache.org on 2009/11/21 16:59:55 UTC

svn commit: r882936 - /incubator/pivot/trunk/wtk/test/org/apache/pivot/wtk/text/test/text_area_test.wtkx

Author: gbrown
Date: Sat Nov 21 15:59:54 2009
New Revision: 882936

URL: http://svn.apache.org/viewvc?rev=882936&view=rev
Log:
Add support for turning wrapping on/off in TextArea test app.

Modified:
    incubator/pivot/trunk/wtk/test/org/apache/pivot/wtk/text/test/text_area_test.wtkx

Modified: incubator/pivot/trunk/wtk/test/org/apache/pivot/wtk/text/test/text_area_test.wtkx
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/test/org/apache/pivot/wtk/text/test/text_area_test.wtkx?rev=882936&r1=882935&r2=882936&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/test/org/apache/pivot/wtk/text/test/text_area_test.wtkx (original)
+++ incubator/pivot/trunk/wtk/test/org/apache/pivot/wtk/text/test/text_area_test.wtkx Sat Nov 21 15:59:54 2009
@@ -29,7 +29,7 @@
                 <TablePane.Row height="1*">
                     <Border>
                         <content>
-                            <ScrollPane horizontalScrollBarPolicy="fill_to_capacity"
+                            <ScrollPane wtkx:id="textAreaScrollPane" horizontalScrollBarPolicy="fill_to_capacity"
                                 verticalScrollBarPolicy="fill_to_capacity">
                                 <view>
                                     <TextArea wtkx:id="textArea" styles="{margin:10, wrapText:false}">
@@ -78,6 +78,29 @@
                     </Border>
                 </TablePane.Row>
                 <TablePane.Row height="-1">
+                    <Checkbox buttonData="Wrap Text">
+                        <buttonStateListeners>
+                            <wtkx:script>
+                                <![CDATA[
+                                importClass(org.apache.pivot.wtk.ScrollPane);
+                                function stateChanged(button, previousState) {
+                                    textArea.getStyles().put("wrapText", button.isSelected());
+
+                                    var horizontalScrollBarPolicy;
+                                    if (button.isSelected()) {
+                                        horizontalScrollBarPolicy = ScrollPane.ScrollBarPolicy.FILL;
+                                    } else {
+                                        horizontalScrollBarPolicy = ScrollPane.ScrollBarPolicy.FILL_TO_CAPACITY;
+                                    }
+
+                                    textAreaScrollPane.setHorizontalScrollBarPolicy(horizontalScrollBarPolicy);
+                                }
+                                ]]>
+                            </wtkx:script>
+                        </buttonStateListeners>
+                    </Checkbox>
+                </TablePane.Row>
+                <TablePane.Row height="-1">
                     <Form styles="{verticalSpacing:2}">
                         <sections>
                             <Form.Section>