This is an automated email from the ASF dual-hosted git repository.
pushminakazi 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 c518eac Added IBorder.as and IRectangularBorder.as,Added Properties
for DataGrid.as
c518eac is described below
commit c518eacd5a780af61ec0c9496b23be96d9c06f2f
Author: pashminakazi <[email protected]>
AuthorDate: Sat Jun 19 11:28:33 2021 -0700
Added IBorder.as and IRectangularBorder.as,Added Properties for DataGrid.as
---
.../MXRoyale/src/main/royale/MXRoyaleClasses.as | 2 +
.../src/main/royale/mx/controls/DataGrid.as | 131 ++++++++++++++++++++-
.../royale/mx/controls/listClasses/ListBase.as | 10 ++
.../MXRoyale/src/main/royale/mx/core/IBorder.as | 70 +++++++++++
.../src/main/royale/mx/core/IRectangularBorder.as | 87 ++++++++++++++
.../src/main/royale/mx/core/ScrollControlBase.as | 12 +-
.../src/main/royale/mx/core/UIComponent.as | 86 ++++++++++++++
.../MXRoyale/src/main/royale/mx/system/System.as | 4 +
8 files changed, 396 insertions(+), 6 deletions(-)
diff --git a/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as
b/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as
index f8da3a3..d0f047c 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as
@@ -387,6 +387,8 @@ internal class MXRoyaleClasses
import mx.controls.beads.MultiSelectionItemRendererClassFactory;
MultiSelectionItemRendererClassFactory;
import mx.utils.DescribeTypeCache; DescribeTypeCache;
import mx.events.FocusRequestDirection; FocusRequestDirection;
+ import mx.core.IBorder; IBorder;
+ import mx.core.IRectangularBorder; IRectangularBorder;
}
diff --git
a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/DataGrid.as
b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/DataGrid.as
index 09f3ca5..fb3786f 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/DataGrid.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/DataGrid.as
@@ -958,7 +958,136 @@ public class DataGrid extends
DataGridListBase/*ListBase*/ implements IDataGrid/
public function set selectionColor(value:uint):void {} // not implemented
public function set headerSeparatorSkin(value:Class):void {} // not
implemented
- public function set editable(value:Boolean):void {} // not implemented
+ //public function set editable(value:Boolean):void {} // not implemented
+
+ //----------------------------------
+ // editable
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage for the draggableColumns property.
+ */
+ private var _editable:Boolean = false;
+
+ [Inspectable(category="General")]
+
+ /**
+ * A flag that indicates whether or not the user can edit
+ * items in the data provider.
+ * If <code>true</code>, the item renderers in the control are editable.
+ * The user can click on an item renderer to open an editor.
+ *
+ * <p>You can turn off editing for individual columns of the
+ * DataGrid control using the <code>DataGridColumn.editable</code>
property,
+ * or by handling the <code>itemEditBeginning</code> and
+ * <code>itemEditBegin</code> events</p>
+ *
+ * @default false
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get editable():Boolean
+ {
+ return _editable;
+ }
+
+ /**
+ * @private
+ */
+ public function set editable(value:Boolean):void
+ {
+ _editable = value;
+ }
+
+ //----------------------------------
+ // editedItemPosition
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ private var bEditedItemPositionChanged:Boolean = false;
+
+ /**
+ * @private
+ * undefined means we've processed it
+ * null means don't put up an editor
+ * {} is the coordinates for the editor
+ */
+ private var _proposedEditedItemPosition:*;
+
+ /**
+ * @private
+ * the last editedItemPosition and the last
+ * position where editing was attempted if editing
+ * was cancelled. We restore editing
+ * to this point if we get focus from the TAB key
+ */
+ private var lastEditedItemPosition:*;
+
+ /**
+ * @private
+ */
+ private var _editedItemPosition:Object;
+
+ /**
+ * @private
+ */
+ private var itemEditorPositionChanged:Boolean = false;
+
+
+ [Bindable("itemFocusIn")]
+
+ /**
+ * The column and row index of the item renderer for the
+ * data provider item being edited, if any.
+ *
+ * <p>This Object has two fields, <code>columnIndex</code> and
+ * <code>rowIndex</code>,
+ * the zero-based column and row indexes of the item.
+ * For example: {columnIndex:2, rowIndex:3}</p>
+ *
+ * <p>Setting this property scrolls the item into view and
+ * dispatches the <code>itemEditBegin</code> event to
+ * open an item editor on the specified item renderer.</p>
+ *
+ * @default null
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get editedItemPosition():Object
+ {
+ if (_editedItemPosition)
+ return {rowIndex: _editedItemPosition.rowIndex,
+ columnIndex: _editedItemPosition.columnIndex};
+ else
+ return _editedItemPosition;
+ }
+
+ /**
+ * @private
+ */
+ public function set editedItemPosition(value:Object):void
+ {
+ if (!value)
+ {
+ //setEditedItemPosition(null);
+ return;
+ }
+
+ var newValue:Object = {rowIndex: value.rowIndex,
+ columnIndex: value.columnIndex};
+
+ //setEditedItemPosition(newValue);
+ }
+
/**
* @private
* Storage for the headerHeight property.
diff --git
a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/listClasses/ListBase.as
b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/listClasses/ListBase.as
index b54ccb4..9719d57 100644
---
a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/listClasses/ListBase.as
+++
b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/listClasses/ListBase.as
@@ -1893,6 +1893,16 @@ use namespace mx_internal;
dispatchEvent(new FlexEvent(FlexEvent.DATA_CHANGE));
}
+
+ public function measureHeightOfItems(index:int = -1, count:int =
0):Number
+ {
+ return NaN;
+ }
+
+ public function measureWidthOfItems(index:int = -1, count:int =
0):Number
+ {
+ return NaN;
+ }
}
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/core/IBorder.as
b/frameworks/projects/MXRoyale/src/main/royale/mx/core/IBorder.as
new file mode 100644
index 0000000..7e98be4
--- /dev/null
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/core/IBorder.as
@@ -0,0 +1,70 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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
+{
+
+/**
+ * The IBorder interface defines the interface that all classes
+ * used for border skins should implement.
+ *
+ * <p>It is not an error if the border skin does not implement IBorder.
+ * In this case, however, the container using the skin cannot determine
+ * the border metrics of the border.
+ * Therefore, the container places content starting at its top-left edge
+ * (adjusted for padding, if any).
+ * For the HaloBorder class, the <code>borderThickness</code> style
+ * usually determines the value of the <code>borderMetrics</code> style.
+ * For graphical skin classes, Flex examines the <code>scale9Grid</code>
+ * property to determine the value of the <code>borderMetrics</code>
style.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public interface IBorder
+{
+
//--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+
//--------------------------------------------------------------------------
+
+ //----------------------------------
+ // borderMetrics
+ //----------------------------------
+
+ /**
+ * Returns an EdgeMetrics object for the border that has four properties:
+ * <code>left</code>, <code>top</code>, <code>right</code>,
+ * and <code>bottom</code>.
+ * The value of each property is equal to the thickness of one side
+ * of the border, in pixels.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get borderMetrics():EdgeMetrics;
+
+}
+
+}
diff --git
a/frameworks/projects/MXRoyale/src/main/royale/mx/core/IRectangularBorder.as
b/frameworks/projects/MXRoyale/src/main/royale/mx/core/IRectangularBorder.as
new file mode 100644
index 0000000..5f50c96
--- /dev/null
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/core/IRectangularBorder.as
@@ -0,0 +1,87 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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
+{
+
+import org.apache.royale.geom.Rectangle;
+
+/**
+ * The IRectangularBorder interface defines the interface that all classes
+ * used for rectangular border skins should implement.
+ *
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public interface IRectangularBorder extends IBorder
+{
+
//--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+
//--------------------------------------------------------------------------
+
+ //----------------------------------
+ // backgroundImageBounds
+ //----------------------------------
+
+ /**
+ * @copy mx.skins.RectangularBorder#backgroundImageBounds
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get backgroundImageBounds():Rectangle;
+ function set backgroundImageBounds(value:Rectangle):void;
+
+ //----------------------------------
+ // hasBackgroundImage
+ //----------------------------------
+
+ /**
+ * @copy mx.skins.RectangularBorder#hasBackgroundImage
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get hasBackgroundImage():Boolean;
+
+ //----------------------------------
+ // adjustBackgroundImage
+ //----------------------------------
+
+ /**
+ * @copy mx.skins.RectangularBorder#layoutBackgroundImage()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function layoutBackgroundImage():void;
+}
+
+}
diff --git
a/frameworks/projects/MXRoyale/src/main/royale/mx/core/ScrollControlBase.as
b/frameworks/projects/MXRoyale/src/main/royale/mx/core/ScrollControlBase.as
index 2b339bd..3281f2c 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/core/ScrollControlBase.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/core/ScrollControlBase.as
@@ -354,6 +354,8 @@ public class ScrollControlBase extends UIComponent
//----------------------------------
// borderMetrics
//----------------------------------
+
+ protected var border:IFlexDisplayObject;
/**
* Returns an EdgeMetrics object that has four properties:
@@ -370,11 +372,11 @@ public class ScrollControlBase extends UIComponent
* @playerversion AIR 1.1
* @productversion Flex 3
*/
-// public function get borderMetrics():EdgeMetrics
-// {
-// return (border && border is IRectangularBorder) ?
-// IRectangularBorder(border).borderMetrics : EdgeMetrics.EMPTY;
-// }
+ public function get borderMetrics():EdgeMetrics
+ {
+ return (border && border is IRectangularBorder) ?
+ IRectangularBorder(border).borderMetrics : EdgeMetrics.EMPTY;
+ }
//----------------------------------
// horizontalScrollPosition
diff --git
a/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as
b/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as
index e207a03..653e4ed 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as
@@ -6747,6 +6747,92 @@ COMPILE::JS
_contextMenu = value
}
}
+
+
+ public function drawFocus(isFocused:Boolean):void
+ {
+ // Gets called by removeChild() after un-parented.
+ /* if (!parent)
+ return;
+
+ var focusObj:DisplayObject = getFocusObject();
+ var focusPane:Sprite = focusManager ? focusManager.focusPane : null;
+
+ if (isFocused && !preventDrawFocus) //&& !isEffectStarted
+ {
+ var focusOwner:DisplayObjectContainer = focusPane.parent;
+
+ if (focusOwner != parent)
+ {
+ if (focusOwner)
+ {
+ if (focusOwner is ISystemManager)
+ ISystemManager(focusOwner).focusPane = null;
+ else
+ IUIComponent(focusOwner).focusPane = null;
+ }
+ if (parent is ISystemManager)
+ ISystemManager(parent).focusPane = focusPane;
+ else
+ IUIComponent(parent).focusPane = focusPane;
+ }
+
+ var focusClass:Class = getStyle("focusSkin");
+
+ if (!focusClass)
+ return;
+
+ if (focusObj && !(focusObj is focusClass))
+ {
+ focusPane.removeChild(focusObj);
+ focusObj = null;
+ }
+
+ if (!focusObj)
+ {
+ focusObj = new focusClass();
+
+ focusObj.name = "focus";
+
+ focusPane.addChild(focusObj);
+ }
+
+ if (focusObj is ILayoutManagerClient )
+ ILayoutManagerClient (focusObj).nestLevel = nestLevel;
+
+ if (focusObj is ISimpleStyleClient)
+ ISimpleStyleClient(focusObj).styleName = this;
+
+ addEventListener(MoveEvent.MOVE, focusObj_moveHandler, true);
+ addEventListener(MoveEvent.MOVE, focusObj_moveHandler);
+ addEventListener(ResizeEvent.RESIZE, focusObj_resizeHandler, true);
+ addEventListener(ResizeEvent.RESIZE, focusObj_resizeHandler);
+ addEventListener(Event.REMOVED, focusObj_removedHandler, true);
+
+ focusObj.visible = true;
+ hasFocusRect = true;
+
+ adjustFocusRect();
+ }
+ else if (hasFocusRect)
+ {
+ hasFocusRect = false;
+
+ if (focusObj)
+ {
+ focusObj.visible = false;
+
+ if (focusObj is ISimpleStyleClient)
+ ISimpleStyleClient(focusObj).styleName = null;
+ }
+
+ removeEventListener(MoveEvent.MOVE, focusObj_moveHandler);
+ removeEventListener(MoveEvent.MOVE, focusObj_moveHandler, true);
+ removeEventListener(ResizeEvent.RESIZE, focusObj_resizeHandler,
true);
+ removeEventListener(ResizeEvent.RESIZE, focusObj_resizeHandler);
+ removeEventListener(Event.REMOVED, focusObj_removedHandler, true);
+ } */
+ }
}
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/system/System.as
b/frameworks/projects/MXRoyale/src/main/royale/mx/system/System.as
index 75a9ef1..c50400b 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/system/System.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/system/System.as
@@ -79,5 +79,9 @@ package mx.system
document.body.removeChild( span );
}
}
+
+ public static function get totalMemory():uint {
+ return 0;
+ }
}
}