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
The following commit(s) were added to refs/heads/develop by this push:
new b47459c jewel textinput examples
b47459c is described below
commit b47459c428c6b1334059df7b955fccc24401c666
Author: Carlos Rovira <[email protected]>
AuthorDate: Tue Sep 11 21:01:23 2018 +0200
jewel textinput examples
---
.../src/main/royale/TextInputPlayGround.mxml | 34 ++++++++++++++++++++--
.../supportClasses/textinput/TextInputBase.as | 5 ++++
2 files changed, 36 insertions(+), 3 deletions(-)
diff --git
a/examples/royale/JewelExample/src/main/royale/TextInputPlayGround.mxml
b/examples/royale/JewelExample/src/main/royale/TextInputPlayGround.mxml
index 53854ad..5c16b91 100644
--- a/examples/royale/JewelExample/src/main/royale/TextInputPlayGround.mxml
+++ b/examples/royale/JewelExample/src/main/royale/TextInputPlayGround.mxml
@@ -22,6 +22,22 @@ limitations under the License.
xmlns:js="library://ns.apache.org/royale/basic"
xmlns:html="library://ns.apache.org/royale/html">
+ <fx:Script>
+ <![CDATA[
+ private function onValueChange(event:Event):void
+ {
+ // trace("onValueChange"); // if target IE11
you must use this event handler
+ textinput.width = slider_w.value;
+ // button.height = slider_h.value;
+ }
+
+ private function textInputChange(event:Event):void
+ {
+ textToChange.text = event.target.text;
+ }
+ ]]>
+ </fx:Script>
+
<j:beads>
<js:ContainerDataBinding/>
</j:beads>
@@ -39,14 +55,14 @@ limitations under the License.
<j:HorizontalLayout gap="3"/>
</j:beads>
<j:Button text="Check it!"
emphasis="primary"/>
- <j:TextInput text="A TextInput"/>
+ <j:TextInput text="A TextInput"
change="textInputChange(event)"/>
</j:Group>
<j:Group>
<j:beads>
<j:HorizontalLayout gap="3"/>
</j:beads>
- <j:TextInput>
+ <j:TextInput id="textToChange">
<j:beads>
<j:TextPrompt
prompt="With prompt..."/>
</j:beads>
@@ -61,12 +77,24 @@ limitations under the License.
</j:beads>
</j:TextInput>
- <j:TextInput>
+ <j:TextInput text="{textToChange.text}">
<j:beads>
<j:TextPrompt prompt="Disabled
with prompt..."/>
<j:Disabled/>
</j:beads>
</j:TextInput>
+
+ <j:HGroup gap="3"
itemsVerticalAlign="itemsSameHeight">
+ <j:TextInput id="textinput">
+ <j:beads>
+ <j:TextPrompt
prompt="Slider resize..."/>
+ </j:beads>
+ </j:TextInput>
+ <j:Label text="A label to check
layout"/>
+ </j:HGroup>
+
+ <j:Slider id="slider_w" width="350" value="211"
minimum="10" maximum="350" valueChange="onValueChange(event)"/>
+ <j:Label
text="textinput.width='{textinput.width}'"/>
</j:Card>
</j:GridCell>
diff --git
a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/textinput/TextInputBase.as
b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/textinput/TextInputBase.as
index ad41d99..f3ce7f5 100644
---
a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/textinput/TextInputBase.as
+++
b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/textinput/TextInputBase.as
@@ -146,6 +146,7 @@ package org.apache.royale.jewel.supportClasses.textinput
}
}
+ COMPILE::SWF
private var inSetter:Boolean;
/**
@@ -158,8 +159,12 @@ package org.apache.royale.jewel.supportClasses.textinput
*/
public function textChangeHandler(event:Event):void
{
+ COMPILE::SWF
+ {
if (!inSetter)
dispatchEvent(new Event(Event.CHANGE));
+ }
+ dispatchEvent(new Event(Event.CHANGE));
}
COMPILE::JS