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 e4c5b28 Add focus event handlers - not tested
e4c5b28 is described below
commit e4c5b283545db3464dc080e8ab716d25c046ade6
Author: DESKTOP-RH4S838\Yishay <[email protected]>
AuthorDate: Tue Feb 25 14:05:48 2020 +0200
Add focus event handlers - not tested
---
.../src/main/royale/mx/core/UIComponent.as | 42 ++++++++++++++++++++++
1 file changed, 42 insertions(+)
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 80eeeaf..6289d6d 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/core/UIComponent.as
@@ -95,6 +95,8 @@ import mx.validators.IValidatorListener;
import mx.validators.ValidationResult;
import mx.events.ValidationResultEvent;
import org.apache.royale.utils.MXMLDataInterpreter;
+import mx.managers.IFocusManagerComponent;
+import mx.events.FocusEvent;
/**
* Set a different class for click events so that
@@ -617,6 +619,13 @@ public class UIComponent extends UIBase
public function UIComponent()
{
super();
+ if (this is IFocusManagerComponent)
+ {
+ addEventListener(FocusEvent.FOCUS_IN, focusInHandler);
+ addEventListener(FocusEvent.FOCUS_OUT, focusOutHandler);
+ addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler);
+ addEventListener(KeyboardEvent.KEY_UP, keyUpHandler);
+ }
}
//--------------------------------------------------------------------------
@@ -5160,6 +5169,39 @@ COMPILE::JS
// You must override this function if your component accepts focus
}
+ /**
+ * The event handler called for a <code>focusIn</code> event.
+ * If you override this method, make sure to call the base class version.
+ *
+ * @param event The event object.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ protected function focusInHandler(event:FocusEvent):void
+ {
+ // You must override this function if your component accepts focus
+ }
+
+
+ /**
+ * The event handler called for a <code>focusOut</code> event.
+ * If you override this method, make sure to call the base class version.
+ *
+ * @param event The event object.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ protected function focusOutHandler(event:FocusEvent):void
+ {
+ // You must override this function if your component accepts focus
+ }
+
//--------------------------------------------------------------------------
//