This is an automated email from the ASF dual-hosted git repository.

pent pushed a commit to branch feature/MXRoyale
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/feature/MXRoyale by this push:
     new cc60bdf  LinkButton.
     new 7ad9d7c  Merge branch 'feature/MXRoyale' of 
https://github.com/apache/royale-asjs into feature/MXRoyale
cc60bdf is described below

commit cc60bdf8e4dcc7fab73e5e38e59c549d48b638be
Author: Peter Ent <[email protected]>
AuthorDate: Wed Mar 28 16:25:06 2018 -0400

    LinkButton.
---
 .../src/main/resources/mx-royale-manifest.xml      |   1 +
 .../src/main/royale/mx/controls/LinkButton.as      | 118 +++++++++++++++++++++
 .../MXRoyale/src/main/royale/mx/controls/Spacer.as |   9 ++
 frameworks/themes/MXRoyale/src/mx.css              |  10 ++
 4 files changed, 138 insertions(+)

diff --git 
a/frameworks/projects/MXRoyale/src/main/resources/mx-royale-manifest.xml 
b/frameworks/projects/MXRoyale/src/main/resources/mx-royale-manifest.xml
index ca118ab..8f61fad 100644
--- a/frameworks/projects/MXRoyale/src/main/resources/mx-royale-manifest.xml
+++ b/frameworks/projects/MXRoyale/src/main/resources/mx-royale-manifest.xml
@@ -26,6 +26,7 @@
        <component id="CheckBox" class="mx.controls.CheckBox" />
        <component id="Image" class="mx.controls.Image" />
        <component id="Label" class="mx.controls.Label" />
+       <component id="LinkButton" class="mx.controls.LinkButton" />
        <component id="RadioButton" class="mx.controls.RadioButton" />
        <component id="RadioButtonGroup" class="mx.controls.RadioButtonGroup" />
        <component id="Spacer" class="mx.controls.Spacer" />
diff --git 
a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/LinkButton.as 
b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/LinkButton.as
new file mode 100644
index 0000000..1377e9a
--- /dev/null
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/LinkButton.as
@@ -0,0 +1,118 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 mx.controls
+{
+COMPILE::JS {
+       import goog.DEBUG;
+}
+
+/**
+ *  The LinkButton control is a borderless Button control
+ *  whose contents are highlighted when a user moves the mouse over it.
+ *  These traits are often exhibited by HTML links
+ *  contained within a browser page.
+ *  In order for the LinkButton control to perform some action,
+ *  you must specify a <code>click</code> event handler,  
+ *  as you do with a Button control.
+ *
+ *  <p>The LinkButton control has the following default characteristics:</p>
+ *     <table class="innertable">
+ *        <tr>
+ *           <th>Characteristic</th>
+ *           <th>Description</th>
+ *        </tr>
+ *        <tr>
+ *           <td>Default size</td>
+ *           <td>Width and height large enough for the text</td>
+ *        </tr>
+ *        <tr>
+ *           <td>Minimum size</td>
+ *           <td>0 pixels</td>
+ *        </tr>
+ *        <tr>
+ *           <td>Maximum size</td>
+ *           <td>Undefined</td>
+ *        </tr>
+ *     </table>
+ *
+ *  @mxml
+ *
+ *  <p>The <code>&lt;mx:LinkButton&gt;</code> tag inherits all of the tag 
attributes 
+ *  of its superclass, and adds the following tag attributes:</p>
+ *
+ *  <pre>
+ *  &lt;mx:LinkButton
+ *    <b>Styles</b>
+ *    cornerRadius="4""
+ *    rollOverColor="0xEEFEE6"
+ *    selectionColor="0xB7F39B"
+ *    textRollOverColor="0x2B333C"
+ *    textSelectedColor="0x2B333C"
+ *  /&gt;
+ *  </pre>
+ *
+ *  @includeExample examples/LinkButtonExample.mxml
+ * 
+ *  @see mx.controls.LinkBar
+ *  
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Flex 3
+ */
+public class LinkButton extends Button
+{
+
+       
//--------------------------------------------------------------------------
+       //
+       //  Constructor
+       //
+       
//--------------------------------------------------------------------------
+
+       /**
+        *  Constructor.
+        *  
+        *  @langversion 3.0
+        *  @playerversion Flash 9
+        *  @playerversion AIR 1.1
+        *  @productversion Flex 3
+        */
+       public function LinkButton()
+       {
+               super();
+               typeNames = "LinkButton";
+       }
+
+       
//--------------------------------------------------------------------------
+       //
+       //  Overridden properties
+       //
+       
//--------------------------------------------------------------------------
+
+
+       
//--------------------------------------------------------------------------
+       //
+       //  Overridden methods: UIComponent
+       //
+       
//--------------------------------------------------------------------------
+
+}
+
+}
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/Spacer.as 
b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/Spacer.as
index 3740222..72e478c 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/Spacer.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/Spacer.as
@@ -77,6 +77,15 @@ public class Spacer extends UIComponent
     {
         super();
     }
+       
+       COMPILE::JS
+       override public function setActualSize(w:Number, h:Number):void
+       {
+               // For HTML/JS, we only set the size if there is an explicit
+               // size set. 
+               if (!isNaN(explicitWidth)) setWidth(w);
+               if (!isNaN(explicitHeight)) setHeight(h);
+       }
 }
 
 }
diff --git a/frameworks/themes/MXRoyale/src/mx.css 
b/frameworks/themes/MXRoyale/src/mx.css
index ebd98c4..c9eae07 100644
--- a/frameworks/themes/MXRoyale/src/mx.css
+++ b/frameworks/themes/MXRoyale/src/mx.css
@@ -54,6 +54,16 @@ Image
        vertical-align: top;
 }
 
+LinkButton {
+       border: none;
+       background-color: transparent;
+       text-decoration: underline;
+}
+
+LinkButton:hover {
+       color: black;
+}
+
 TextInput
 {
        border: 1px solid #808080;

-- 
To stop receiving notification emails like this one, please contact
[email protected].

Reply via email to