You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ha...@apache.org on 2017/12/04 18:44:08 UTC
[royale-asjs] branch develop updated: Added Button
This is an automated email from the ASF dual-hosted git repository.
harbs 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 d6d04cb Added Button
d6d04cb is described below
commit d6d04cb05e9412619fbb191d52c5095f6956d621
Author: Harbs <ha...@in-tools.com>
AuthorDate: Mon Dec 4 20:39:12 2017 +0200
Added Button
---
.../HTML/src/main/resources/html-manifest.xml | 1 +
.../org/apache/royale/html/elements/Button.as | 239 +++++++++++++++++++++
2 files changed, 240 insertions(+)
diff --git a/frameworks/projects/HTML/src/main/resources/html-manifest.xml b/frameworks/projects/HTML/src/main/resources/html-manifest.xml
index d16bf18..1bf99be 100644
--- a/frameworks/projects/HTML/src/main/resources/html-manifest.xml
+++ b/frameworks/projects/HTML/src/main/resources/html-manifest.xml
@@ -22,6 +22,7 @@
<componentPackage>
<component id="A" class="org.apache.royale.html.elements.A" />
+ <component id="Button" class="org.apache.royale.html.elements.Button" />
<component id="Em" class="org.apache.royale.html.elements.Em" />
<component id="H1" class="org.apache.royale.html.elements.H1" />
<component id="H2" class="org.apache.royale.html.elements.H2" />
diff --git a/frameworks/projects/HTML/src/main/royale/org/apache/royale/html/elements/Button.as b/frameworks/projects/HTML/src/main/royale/org/apache/royale/html/elements/Button.as
new file mode 100644
index 0000000..86d64fc
--- /dev/null
+++ b/frameworks/projects/HTML/src/main/royale/org/apache/royale/html/elements/Button.as
@@ -0,0 +1,239 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You 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.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.royale.html.elements
+{
+ import org.apache.royale.core.UIBase;
+
+ COMPILE::JS
+ {
+ import org.apache.royale.core.WrappedHTMLElement;
+ import org.apache.royale.html.util.addElementToWrapper;
+ }
+ import org.apache.royale.html.NodeElementBase;
+
+ /**
+ * The Button class represents an HTML <button> element
+ *
+ *
+ * @toplevel
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Royale 0.0
+ */
+ public class Button extends NodeElementBase
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Royale 0.0
+ */
+ public function Button()
+ {
+ super();
+ }
+
+ COMPILE::JS
+ private function get button():HTMLButtonElement
+ {
+ return element as HTMLButtonElement;
+ }
+
+ COMPILE::SWF
+ private var _autofocus:Boolean;
+ /**
+ * Whether the button is autofocused
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Royale 0.9
+ */
+ public function get autofocus():Boolean
+ {
+ COMPILE::SWF
+ {
+ return _autofocus;
+ }
+
+ COMPILE::JS
+ {
+ return button.autofocus;
+ }
+ }
+ public function set autofocus(value:Boolean):void
+ {
+ COMPILE::SWF
+ {
+ _autofocus = value;
+ }
+ COMPILE::JS
+ {
+ button.autofocus = value;
+ }
+ }
+
+ COMPILE::SWF
+ private var _disabled:Boolean;
+ /**
+ * Whether the button is disabled
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Royale 0.9
+ */
+ public function get disabled():Boolean
+ {
+ COMPILE::SWF
+ {
+ return _disabled;
+ }
+
+ COMPILE::JS
+ {
+ return button.disabled;
+ }
+ }
+ public function set disabled(value:Boolean):void
+ {
+ COMPILE::SWF
+ {
+ _disabled = value;
+ }
+ COMPILE::JS
+ {
+ button.disabled = value;
+ }
+ }
+
+ COMPILE::SWF
+ private var _name:String;
+ /**
+ * The button name
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Royale 0.9
+ */
+ public function get name():String
+ {
+ COMPILE::SWF
+ {
+ return _name;
+ }
+
+ COMPILE::JS
+ {
+ return button.name;
+ }
+ }
+ public function set name(value:String):void
+ {
+ COMPILE::SWF
+ {
+ _name = value;
+ }
+ COMPILE::JS
+ {
+ button.name = value;
+ }
+ }
+
+ COMPILE::SWF
+ private var _type:String;
+ /**
+ * The button type
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Royale 0.9
+ */
+ public function get type():String
+ {
+ COMPILE::SWF
+ {
+ return _type;
+ }
+
+ COMPILE::JS
+ {
+ return button.type;
+ }
+ }
+ public function set type(value:String):void
+ {
+ COMPILE::SWF
+ {
+ _type = value;
+ }
+ COMPILE::JS
+ {
+ button.type = value;
+ }
+ }
+
+ COMPILE::SWF
+ private var _value:String = "";
+
+ /**
+ * The current value of the control
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Royale 0.9
+ */
+ public function get value():String
+ {
+ COMPILE::SWF
+ {
+ return _value;
+ }
+ COMPILE::JS
+ {
+ return button.value;
+ }
+ }
+
+ public function set value(value:String):void
+ {
+ COMPILE::SWF
+ {
+ _value = value;
+ }
+ COMPILE::JS
+ {
+ button.value = value;
+ }
+ }
+
+
+ COMPILE::JS
+ override protected function createElement():WrappedHTMLElement
+ {
+ return addElementToWrapper(this,'button');
+ }
+ }
+}
--
To stop receiving notification emails like this one, please contact
['"commits@royale.apache.org" <co...@royale.apache.org>'].