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 87cf932  Added ScrollPolicy and ControlBar (#145)
87cf932 is described below

commit 87cf932ebe32dd4718963897fdedd855c71acea4
Author: Alina <[email protected]>
AuthorDate: Fri Apr 6 19:54:18 2018 +0500

    Added ScrollPolicy and ControlBar (#145)
    
    * Copied ScrollPolicy.as from FlexSDK->Royale
    
    Copied ScrollPolicy.as from FlexSDK->Royale
    
    * Copied ControlBar.as from FlexSDK->Royale
    
    Copied ControlBar.as from FlexSDK->Royale
    
    * Changes in ControlBar.as
    
    Changes in ControlBar.as
    
    * Update ScrollPolicy.as
    
    Update ScrollPolicy.as
    
    * Update MXRoyaleClasses.as ScrollPolicy& ControlBar
    
    Added
    import mx.core.ScrollPolicy; ScrollPolicy;
    import mx.containers.ControlBar; ControlBar;
    
    * Update ControlBar.as
    
    Update ControlBar.as
    
    * Product Version Updated
    
    Product Version Updated
    
    * product Version Updated
    
    product Version Updated
---
 .../MXRoyale/src/main/royale/MXRoyaleClasses.as    |   6 +
 .../src/main/royale/mx/containers/ControlBar.as    | 290 +++++++++++++++++++++
 .../src/main/royale/mx/core/ScrollPolicy.as        |  83 ++++++
 3 files changed, 379 insertions(+)

diff --git a/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as 
b/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as
index d022826..9019e0b 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as
@@ -31,6 +31,12 @@ internal class MXRoyaleClasses
     import mx.core.mx_internal; mx_internal;
     import mx.core.UIComponent; UIComponent;
        import mx.core.Container; Container;
+       import mx.core.ScrollPolicy; ScrollPolicy;
+       import mx.containers.beads.ApplicationLayout; ApplicationLayout;
+       import mx.containers.beads.BoxLayout; BoxLayout;
+       import mx.containers.ControlBar; ControlBar;
+       import mx.controls.ToolTip; ToolTip;
+       import mx.controls.beads.ToolTipBead; ToolTipBead;
        import mx.containers.Tile; Tile;
        import mx.containers.DividedBox; DividedBox;
        import mx.containers.beads.ApplicationLayout; ApplicationLayout;
diff --git 
a/frameworks/projects/MXRoyale/src/main/royale/mx/containers/ControlBar.as 
b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/ControlBar.as
new file mode 100644
index 0000000..f596e3d
--- /dev/null
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/ControlBar.as
@@ -0,0 +1,290 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.containers
+{
+/* 
+import mx.core.Container;
+import mx.core.FlexVersion;
+import mx.core.ScrollPolicy;
+import mx.core.mx_internal;
+import mx.core.UIComponent;
+import mx.styles.CSSStyleDeclaration;
+import mx.styles.IStyleClient;
+import mx.styles.StyleManager; */
+
+import mx.core.Container;
+import mx.core.mx_internal;
+import mx.core.UIComponent;
+import mx.core.ScrollPolicy;
+
+
+use namespace mx_internal;
+
+//--------------------------------------
+//  Excluded APIs
+//--------------------------------------
+
+[Exclude(name="direction", kind="property")]
+[Exclude(name="horizontalScrollPolicy", kind="property")]
+[Exclude(name="verticalScrollPolicy", kind="property")]
+
+[Exclude(name="focusIn", kind="event")]
+[Exclude(name="focusOut", kind="event")]
+
+[Exclude(name="backgroundColor", kind="style")]
+[Exclude(name="borderColor", kind="style")]
+[Exclude(name="borderSides", kind="style")]
+[Exclude(name="borderThickness", kind="style")]
+[Exclude(name="dropShadowColor", kind="style")]
+[Exclude(name="dropShadowEnabled", kind="style")]
+[Exclude(name="focusBlendMode", kind="style")]
+[Exclude(name="focusSkin", kind="style")]
+[Exclude(name="focusThickness", kind="style")]
+[Exclude(name="shadowDirection", kind="style")]
+[Exclude(name="shadowDistance", kind="style")]
+
+[Exclude(name="focusInEffect", kind="effect")]
+[Exclude(name="focusOutEffect", kind="effect")]
+
+//--------------------------------------
+//  Other metadata
+//--------------------------------------
+
+//[IconFile("ControlBar.png")]
+
+/**
+ *  As of Flex 4, the ControlBar component is no longer required. Use 
+ *  the <code>controlBarContent</code> property of the Spark Panel class
+ *  to specify the set of components to include in the control bar area. Use
+ *  the <code>controlBarLayout</code> property of the Spark Panel class
+ *  to specify the layout of the control bar area. 
+ */
+[Alternative(replacement="none", since="4.0")]
+
+/**
+ *  The ControlBar container lets you place controls
+ *  at the bottom of a Halo Panel or Halo TitleWindow container.
+ *  The <code>&lt;mx:ControlBar&gt;</code> tag must be the last child tag
+ *  of the enclosing tag for the Halo Panel or Halo TitleWindow container.
+ *
+ *  <p><b>Note:</b> The Spark Panel container does not support the ControlBar 
container. 
+ *  Modify the skin of the Spark Panel container to add this functionality.</p>
+ *
+ *  <p>The ControlBar is a Box with a background
+ *  and default style properties.</p>
+ *
+ *  <p>A ControlBar container has the following default sizing 
characteristics:</p>
+ *     <table class="innertable">
+ *        <tr>
+ *           <th>Characteristic</th>
+ *           <th>Description</th>
+ *        </tr>
+ *        <tr>
+ *           <td>Default size</td>
+ *           <td>Height is the default or explicit height of the tallest 
child, plus the top and bottom padding of the container. 
+ *               Width is large enough to hold all of its children at the 
default or explicit width of the children, 
+ *               plus any horizontal gap between the children, plus the left 
and right padding of the container.</td>
+ *        </tr>
+ *        <tr>
+ *           <td>Default padding</td>
+ *           <td>10 pixels for the top, bottom, left, and right values.</td>
+ *        </tr>
+ *     </table>
+ *
+ *  @mxml
+ *
+ *  <p>The <code>&lt;mx:ControlBar&gt;</code> tag inherits all the tag
+ *  attributes but adds no additional attributes:</p>
+ *
+ *  <pre>
+ *  &lt;mx:ControlBar&gt;
+ *    ...
+ *      <i>child tags</i>
+ *    ...
+ *  &lt;/mx:ControlBar&gt;
+ *  </pre>
+ *
+ *  @see mx.containers.Panel
+ *
+ *  @includeExample examples/SimpleControlBarExample.mxml
+ *  
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Royale 0.9.3
+ */
+public class ControlBar extends Box
+{
+   /*  include "../core/Version.as"; */
+    
+    
//--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    
//--------------------------------------------------------------------------
+
+    /**
+     *  Constructor.
+     *  
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Royale 0.9.3
+     */
+    public function ControlBar()
+    {
+        super();
+
+        // ControlBar defaults to direction="horizontal", but can be changed
+        // later if desired
+        direction = BoxDirection.HORIZONTAL;
+     }
+
+    
//--------------------------------------------------------------------------
+    //
+    //  Overridden properties
+    //
+    
//--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  enabled
+    //----------------------------------
+
+    [Inspectable(category="General", enumeration="true,false", 
defaultValue="true")]
+
+    /**
+     *  @private
+     */
+    override public function set enabled(value:Boolean):void
+    {
+        if (value != super.enabled)
+        {
+            super.enabled = value;
+            
+            // Since ControlBar typically has a transparent background and 
sits on top
+            // of a translucent part of the panel, we don't want the default 
overlay.
+            // Instead of the overlay, set the alpha value here.
+            alpha = value ? 1 : 0.4;
+        }
+    }
+
+    //----------------------------------
+    //  horizontalScrollPolicy
+    //----------------------------------
+
+    [Inspectable(environment="none")]
+
+    /**
+     *  @private
+     */
+  /*   override public function get horizontalScrollPolicy():String
+    {
+        return ScrollPolicy.OFF;
+    }
+ */
+    /**
+     *  @private
+     */
+   /*  override public function set horizontalScrollPolicy(value:String):void
+    {
+        // A ControlBar never scrolls.
+        // Its horizontalScrollPolicy is initialized to "off" and can't be 
changed.
+    }
+ */
+    //----------------------------------
+    //  includeInLayout
+    //----------------------------------
+
+    [Inspectable(category="General", defaultValue="true")]
+
+    /**
+     *  @private
+     */
+    override public function set includeInLayout(value:Boolean):void
+    {
+        if (includeInLayout != value)
+        {
+            super.includeInLayout = value;
+
+            var p:Container = parent as Container;
+            /* if (p)
+                p.invalidateViewMetricsAndPadding(); */
+        }
+    }
+
+    //----------------------------------
+    //  verticalScrollPolicy
+    //----------------------------------
+
+    [Inspectable(environment="none")]
+
+    /**
+     *  @private
+     */
+  /*   override public function get verticalScrollPolicy():String
+    {
+        return ScrollPolicy.OFF;
+    } */
+
+    /**
+     *  @private
+     */
+  /*   override public function set verticalScrollPolicy(value:String):void
+    {
+        // A ControlBar never scrolls.
+        // Its verticalScrollPolicy is initialized to "off" and can't be 
changed.
+    }
+ */
+    
//--------------------------------------------------------------------------
+    //
+    //  Overridden methods
+    //
+    
//--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    override public function invalidateSize():void
+    {
+        super.invalidateSize();
+
+        // Since controlbar isn't a "child" of Panel, we need to call
+        // invalidateViewMetricsAndPadding() here when our size is invalidated.
+        // This causes our parent Panel to adjust size.
+     /*    if (parent && parent is Container)
+            Container(parent).invalidateViewMetricsAndPadding(); */
+    }
+
+    /**
+     *  @private
+     */
+    override protected function updateDisplayList(unscaledWidth:Number,
+                                                  unscaledHeight:Number):void
+    {
+        super.updateDisplayList(unscaledWidth, unscaledHeight);
+
+        // Make sure we don't have an opaque background for the ControlBar,
+        // otherwise the background turns white.
+      /*   if (contentPane)
+            contentPane.opaqueBackground = null; */
+    }
+}
+
+}
diff --git 
a/frameworks/projects/MXRoyale/src/main/royale/mx/core/ScrollPolicy.as 
b/frameworks/projects/MXRoyale/src/main/royale/mx/core/ScrollPolicy.as
new file mode 100644
index 0000000..2800f10
--- /dev/null
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/core/ScrollPolicy.as
@@ -0,0 +1,83 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.core
+{
+
+/**
+ *  Values for the <code>horizontalScrollPolicy</code> and
+ *  <code>verticalScrollPolicy</code> properties
+ *  of the Container and ScrollControlBase classes.
+ *
+ *  @see mx.core.Container
+ *  @see mx.core.ScrollControlBase
+ *  
+ *  @langversion 3.0
+ *  @playerversion Flash 9
+ *  @playerversion AIR 1.1
+ *  @productversion Royale 0.9.3
+ */
+public final class ScrollPolicy
+{
+       /* include "../core/Version.as"; */
+
+       
//--------------------------------------------------------------------------
+       //
+       //  Class constants
+       //
+       
//--------------------------------------------------------------------------
+
+       /**
+        *  Show the scrollbar if the children exceed the owner's dimension.
+        *  The size of the owner is not adjusted to account
+        *  for the scrollbars when they appear, so this may cause the
+        *  scrollbar to obscure the contents of the control or container.
+        *  
+        *  @langversion 3.0
+        *  @playerversion Flash 9
+        *  @playerversion AIR 1.1
+        *  @productversion Royale 0.9.3
+        */
+       public static const AUTO:String = "auto";
+
+       /**
+        *  Never show the scrollbar.
+        *  
+        *  @langversion 3.0
+        *  @playerversion Flash 9
+        *  @playerversion AIR 1.1
+        *  @productversion Flex 3
+        */
+       public static const OFF:String = "off";
+       
+       /**
+        *  Always show the scrollbar.
+        *  The size of the scrollbar is automatically added to the size
+        *  of the owner's contents to determine the size of the owner
+        *  if explicit sizes are not specified.
+        *  
+        *  @langversion 3.0
+        *  @playerversion Flash 9
+        *  @playerversion AIR 1.1
+        *  @productversion Royale 0.9.3
+        */
+       public static const ON:String = "on";
+}
+
+}

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

Reply via email to