// ReSharper disable MemberCanBePrivate.Global protected virtual void AttachSkin() // ReSharper restore MemberCanBePrivate.Global { /*if (Id == "TooltipManagerStage") * Debug.Log("AttachSkin: " + this + "; skin: " + GetStyle("skinClass"));*/ // Factory IFactory skinClassFactory = GetStyle("skinFactory" /*, false*/) as IFactory; // do not check default style //Debug.Log(1); if (null != skinClassFactory) { SetSkin(skinClassFactory.NewInstance() as Component); } // Class if (null == Skin) { //Debug.Log(NonInheritingStyles.ToString()); //Debug.Log(this + " -> skinClass: " + GetStyle("skinClass")); var skinClass = EvaluateSkinClassFromStyle(); //Debug.Log(string.Format("******************* {0}: skinClass: {1}", this, skinClass)); // TODO: the problem is in the folowing: // we don't have a skin reference here because our framework uses the invalidation methods for attaching the skin // we should change the framework to process the skin the moment the child is being added // no metter that setting the skin will mess with children and sub-children // it is simply so and we couldn't get away from it! // NOTE: This is why we have the problem of skinnable components not measuring themselves properly // the problem is that by the measurement time the skin is not yet being attached, so we cannot measure it // the skin is currently being measured in another pass, after the container (HBox) has already been measured! if (null != skinClass) { SetSkin((Component)Activator.CreateInstance(skinClass)); } } if (null != Skin) { AddSkinAsChild(Skin); Skin.AddEventListener(PropertyChangeEvent.PROPERTY_CHANGE, SkinPropertyChangeHandler); // TEMP: because of styling // currently the component ID doesn't propagate to Skin, and we need this for styling! Skin.Id = Id; } else { throw new Exception(this + " -> Skin not found: "); } FindSkinParts(); InvalidateSkinState(); }
public string Trigger = MouseEvent.ROLL_OUT; // default // fires after the GUI component is instantiated void ComponentInstantiated(Component component) { //Slider slider = (Slider) component; // you can do a cast here component.AddEventListener(Trigger, delegate(Event e) { Factory.Play(e.Target); }, EventPhase.Target); }
public string Trigger = MouseEvent.ROLL_OVER; // default // fires after the GUI component is instantiated void ComponentInstantiated(Component component) { //Slider slider = (Slider) component; // you can do a cast here component.AddEventListener(Trigger, delegate(Event e) { Factory.Play(e.Target); }, EventPhase.Target); }
public void Initialize(InvalidationManagerClient component) { if (_initialized) return; _initialized = true; _component = (Component) component; // subscribe to TARGET PHASE component events _component.AddEventListener(LoadingEvent.START, StartHandler, EventPhase.Target); _component.AddEventListener(LoadingEvent.PROGRESS, ProgressHandler, EventPhase.Target); _component.AddEventListener(LoadingEvent.END, EndHandler, EventPhase.Target); _component.AddEventListener(LoadingEvent.ERROR, ErrorHandler, EventPhase.Target); //if (null == AnimationId) // AnimationId = AnimationId; }
public void Initialize(InvalidationManagerClient component) { if (_initialized) return; _initialized = true; _component = (Component) component; // subscribe to CAPTURE PHASE component events // listening for mouse move over the component border _component.AddEventListener(MouseEvent.MOUSE_OVER, MouseOverHandler, EventPhase.Capture | EventPhase.Target); // NOTE: Target phase must be present because of the simple components // listening for mouse out to remove the overlay _component.AddEventListener(MouseEvent.MOUSE_OUT, MouseOutHandler, EventPhase.Capture | EventPhase.Target); }
private void StartHandler(Event e) { #if DEBUG if (DebugMode) { Debug.Log("StartHandler " + _component.Width + ", " + _component.Height); } #endif if (null != _maskGraphics) { return; // already masking this component } _parent = _component.Parent ?? (_component is Stage ? _component : null); if (null == _parent) { return; // we are not on the display list, so we have nothing to mask indeed } _maskGraphics = new LoadingMaskAnimator { IncludeInLayout = false, X = _component.X, Y = _component.Y, Width = _component.Width, Height = _component.Height, //Bounds = (Rectangle) _component.Bounds.Clone() // BEWARE! This was the reference bug (without Clone())!!!!!!!!! }; _parent.AddChild(_maskGraphics); LoadingEvent le = e as LoadingEvent; if (null != le) { _maskGraphics.Message = le.Message; } // critical! //_maskGraphics.Transform.Apply(); _maskGraphics.InvalidateTransform(); // subscribe to MOVE and RESIZE events of the component // we shall be levitating just over the component _component.AddEventListener(MoveEvent.MOVE, MoveHandler, EventPhase.Target); _component.AddEventListener(ResizeEvent.RESIZE, ResizeHandler, EventPhase.Target); _maskGraphics.Play(); }
public void Initialize(InvalidationManagerClient component) { if (_initialized) { return; } _initialized = true; _component = (Component)component; // subscribe to CAPTURE PHASE component events // listening for mouse move over the component border _component.AddEventListener(MouseEvent.MOUSE_OVER, MouseOverHandler, EventPhase.Capture | EventPhase.Target); // NOTE: Target phase must be present because of the simple components // listening for mouse out to remove the overlay _component.AddEventListener(MouseEvent.MOUSE_OUT, MouseOutHandler, EventPhase.Capture | EventPhase.Target); }
public void Initialize(InvalidationManagerClient component) { if (_initialized) { return; } _initialized = true; _component = (Component)component; // subscribe to TARGET PHASE component events _component.AddEventListener(LoadingEvent.START, StartHandler, EventPhase.Target); _component.AddEventListener(LoadingEvent.PROGRESS, ProgressHandler, EventPhase.Target); _component.AddEventListener(LoadingEvent.END, EndHandler, EventPhase.Target); _component.AddEventListener(LoadingEvent.ERROR, ErrorHandler, EventPhase.Target); //if (null == AnimationId) // AnimationId = AnimationId; }
private void StartScanning() { #if DEBUG if (DebugMode) { Debug.Log("StartScanning"); } #endif // listening for roll out to remove resizing overlay _component.AddEventListener(MouseEvent.MOUSE_OUT, IdleMouseOutHandler, EventPhase.Capture | EventPhase.Target, EventPriority.CURSOR_MANAGEMENT); // listening for mouse down to start resizing process _component.AddEventListener(MouseEvent.MOUSE_DOWN, MouseDownHandler, EventPhase.Capture | EventPhase.Target); // listening for mouse click just to cancel it if being over the border // TODO: implement priority and use the highest one _component.AddEventListener(MouseEvent.CLICK, ClickHandler, EventPhase.Capture | EventPhase.Target); _scanning = true; }
public void Initialize(InvalidationManagerClient component) { if (_initialized) return; _initialized = true; _component = (Component) component; _component.OptimizeMeasureCalls = false; // subscribe to CAPTURE PHASE component events // listening for mouse move over the component border //_component.AddEventListener(MouseEvent.MOUSE_MOVE, IdleMouseMoveHandler, EventPhase.Capture | EventPhase.Target, EventPriority.CURSOR_MANAGEMENT); // NOTE: Target phase must be present because of the simple components _component.AddEventListener(MouseEvent.ROLL_OVER, IdleRollOverHandler, EventPhase.Capture | EventPhase.Target); //, EventPriority.CURSOR_MANAGEMENT); // NOTE: Target phase must be present because of the simple components _component.AddEventListener(MouseEvent.ROLL_OUT, IdleRollOutHandler, EventPhase.Capture | EventPhase.Target); //, EventPriority.CURSOR_MANAGEMENT); // NOTE: Target phase must be present because of the simple components //// listening for mouse click just to cancel it if being over the border //// TODO: implement priority and use the highest one //_component.AddEventListener(MouseEvent.CLICK, ClickHandler, EventPhase.Capture | EventPhase.Target); }
// fires after the GUI component is instantiated void ComponentInstantiated(Component component) { //Slider slider = (Slider) component; // you can do a cast here component.AddEventListener(Trigger, delegate(Event e) { ExpandRightDownAlpha tween = new ExpandRightDownAlpha { Bounds = Bounds }; tween.Play(e.Target); e.CancelAndStopPropagation(); //Factory.Blueprint = tween; //Factory.Play(e.Target); }, EventPhase.Capture | EventPhase.Target); }
public void Initialize(InvalidationManagerClient component) { if (_initialized) { return; } _initialized = true; _component = (Component)component; _component.OptimizeMeasureCalls = false; // subscribe to CAPTURE PHASE component events // listening for mouse move over the component border //_component.AddEventListener(MouseEvent.MOUSE_MOVE, IdleMouseMoveHandler, EventPhase.Capture | EventPhase.Target, EventPriority.CURSOR_MANAGEMENT); // NOTE: Target phase must be present because of the simple components _component.AddEventListener(MouseEvent.ROLL_OVER, IdleRollOverHandler, EventPhase.Capture | EventPhase.Target); //, EventPriority.CURSOR_MANAGEMENT); // NOTE: Target phase must be present because of the simple components _component.AddEventListener(MouseEvent.ROLL_OUT, IdleRollOutHandler, EventPhase.Capture | EventPhase.Target); //, EventPriority.CURSOR_MANAGEMENT); // NOTE: Target phase must be present because of the simple components //// listening for mouse click just to cancel it if being over the border //// TODO: implement priority and use the highest one //_component.AddEventListener(MouseEvent.CLICK, ClickHandler, EventPhase.Capture | EventPhase.Target); }
// fires after the GUI component is instantiated void ComponentInstantiated(Component component) { //Slider slider = (Slider) component; // you can do a cast here component.AddEventListener(Trigger, delegate(Event e) { CollapseAlphaLeftTop tween = new CollapseAlphaLeftTop { Bounds = Bounds }; tween.Play(e.Target); e.CancelAndStopPropagation(); //Factory.Blueprint = tween; //Factory.Play(e.Target); }, EventPhase.Capture | EventPhase.Target); }
/// <summary> /// Recursively instantiates components specified by descriptors in the hierarchy /// </summary> /// <param name="instantiate">Instantiate component</param> /// <param name="assignToDescriptor">Register to transform, and put into registry so it is available by clicking</param> public Component Produce(bool instantiate, bool assignToDescriptor) { _assignToDescriptor = assignToDescriptor; if (instantiate) { _component = DoInstantiate(assignToDescriptor); InitEvents(_component); } /** * IMPORTANT (20130813): * We have to follow the instantiation cycle! * Cannot create children until the PREINITIALIZE is fired on the parent!!! * Until this was not done on PREINITIALIZE, but directly, there were problems with creating children (ScrollBar children were rendered in the top-left corner of the Stage) * */ if (null != _component) { _component.AddEventListener(FrameworkEvent.INITIALIZE, InitializeHandler); } return(_component); }
/// <summary> /// Initializes the plugin /// </summary> /// <param name="component"></param> public void Initialize(InvalidationManagerClient component) { if (_initialized) { return; } _initialized = true; //Debug.Log("TabManager init"); _component = (Component)component; ITabManagerClient tabManagerClient = component as ITabManagerClient; if (null == tabManagerClient) { return; } _components = TabChildren ?? tabManagerClient.GetTabChildren(); // gets all focusable children if (null == _circularTabs) // if not set on plugin { _circularTabs = tabManagerClient.CircularTabs; } if (null == _circularArrows) // if not set on plugin { _circularArrows = tabManagerClient.CircularArrows; } if (_components.Count > 0) { _component.AddEventListener(KeyboardEvent.KEY_DOWN, KeyDownHandler, Phases); // subscribe to keys } }
/// <summary> /// Initializes the plugin /// </summary> /// <param name="component"></param> public void Initialize(InvalidationManagerClient component) { if (_initialized) return; _initialized = true; //Debug.Log("TabManager init"); _component = (Component) component; ITabManagerClient tabManagerClient = component as ITabManagerClient; if (null == tabManagerClient) return; _components = TabChildren ?? tabManagerClient.GetTabChildren(); // gets all focusable children if (null == _circularTabs) // if not set on plugin _circularTabs = tabManagerClient.CircularTabs; if (null == _circularArrows) // if not set on plugin _circularArrows = tabManagerClient.CircularArrows; if (_components.Count > 0) _component.AddEventListener(KeyboardEvent.KEY_DOWN, KeyDownHandler, Phases); // subscribe to keys }