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

yishayw 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 f3eed9e139 Emulation - Some layout improvements to ColorPicker
f3eed9e139 is described below

commit f3eed9e139242287d613a32724b67ac5bb7ce991
Author: Yishay Weiss <[email protected]>
AuthorDate: Tue Nov 22 12:19:13 2022 +0200

    Emulation - Some layout improvements to ColorPicker
---
 .../MXRoyale/src/main/resources/defaults.css       |  2 +-
 .../src/main/resources/mx-royale-manifest.xml      |  2 +
 .../royale/mx/controls/beads/ColorPickerPopUp.as   | 78 ++++++++++++++++++++++
 3 files changed, 81 insertions(+), 1 deletion(-)

diff --git a/frameworks/projects/MXRoyale/src/main/resources/defaults.css 
b/frameworks/projects/MXRoyale/src/main/resources/defaults.css
index 630ca90c2b..b9e881aaff 100644
--- a/frameworks/projects/MXRoyale/src/main/resources/defaults.css
+++ b/frameworks/projects/MXRoyale/src/main/resources/defaults.css
@@ -210,7 +210,7 @@ ColorPicker
        IBeadModel: 
ClassReference("org.apache.royale.html.beads.models.ArrayListColorSelectionModel");
        IBeadView: 
ClassReference("org.apache.royale.html.beads.ColorPickerView");
        IBeadController: 
ClassReference("org.apache.royale.html.beads.controllers.ComboBoxController");
-       IPopUp: 
ClassReference("org.apache.royale.html.supportClasses.ColorPickerPopUpWithPalette");
+       IPopUp: ClassReference("mx.controls.beads.ColorPickerPopUp");
 }
 
 Basic|ColorPalette
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 c4c102e7e1..cbb4a8918a 100644
--- a/frameworks/projects/MXRoyale/src/main/resources/mx-royale-manifest.xml
+++ b/frameworks/projects/MXRoyale/src/main/resources/mx-royale-manifest.xml
@@ -242,6 +242,8 @@
     <component id="DataGridHeaderRenderer" 
class="mx.controls.dataGridClasses.DataGridHeaderRenderer"/>
     <component id="CascadingMenuFactory" 
class="mx.controls.menuClasses.CascadingMenuFactory"/>
 
+    <!-- ColorPicker-->
+       <component id="ColorPickerPopUp" 
class="mx.controls.beads.ColorPickerPopUp" />
     <!-- new/experimental -->
     <component id="SimpleTextHighlighter" 
class="mx.controls.SimpleTextHighlighter" />
 </componentPackage>
diff --git 
a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/ColorPickerPopUp.as
 
b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/ColorPickerPopUp.as
new file mode 100644
index 0000000000..dd888b0879
--- /dev/null
+++ 
b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/beads/ColorPickerPopUp.as
@@ -0,0 +1,78 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.beads
+{
+       import org.apache.royale.core.IColorModel;
+       import org.apache.royale.core.IColorSpectrumModel;
+       import org.apache.royale.core.IStrand;
+       import org.apache.royale.core.UIBase;
+       import org.apache.royale.utils.loadBeadFromValuesManager;
+       import org.apache.royale.core.IBead;
+       import org.apache.royale.html.supportClasses.ColorPalette;
+       import org.apache.royale.html.beads.layouts.TileLayout;
+       import org.apache.royale.html.supportClasses.IColorPickerPopUp;
+
+       /**
+        *  The ColorPickerPopUp class is used in ColorPicker. It contains a 
set of controls for picking a color.
+        * 
+        *
+     *  @toplevel
+        *  @langversion 3.0
+        *  @playerversion Flash 10.2
+        *  @playerversion AIR 2.6
+        *  @productversion Royale 0.9.6
+        */
+       public class ColorPickerPopUp extends UIBase implements 
IColorPickerPopUp, IBead
+       {
+               protected var colorPalette:ColorPalette;
+               protected var host:IStrand;
+               /**
+                *  constructor.
+                *
+                *  @langversion 3.0
+                *  @playerversion Flash 10.2
+                *  @playerversion AIR 2.6
+                *  @productversion Royale 0.9.10
+                */
+               public function ColorPickerPopUp()
+               {
+                       super();
+                       colorPalette = new ColorPalette();
+                       var colorPaletteLayout:TileLayout = 
loadBeadFromValuesManager(TileLayout, "iBeadLayout", colorPalette) as 
TileLayout;
+                       colorPaletteLayout.rowHeight = 
colorPaletteLayout.columnWidth = 12;
+                       colorPalette.width =  200;
+               }
+               
+               override public function set model(value:Object):void
+               {
+                       super.model = value;
+                       colorPalette.model = value;
+                       if (getElementIndex(colorPalette) < 0)
+                       {
+                               addElement(colorPalette);
+                       }
+               }
+               
+               public function set strand(value:IStrand):void
+               {
+                       host = value;
+               }
+               
+       }
+}

Reply via email to