public T AddChild <T>(T child) where T : Widget { if (child == null) { this.LogError("Child must not be null."); return(null); } try { OnAddChild(child); Children.Add(child); if (child.IsOverlay) { RootContainer root = Root ?? child.Root; if (root != null) { root.RegisterOverlay(child); } } } catch (Exception ex) { ex.LogError(); } return((T)child); }
/*** * [System.ComponentModel.Browsable(false)] * internal string _FontTag; * [System.ComponentModel.Browsable(false)] * internal string _IconFontTag; ***/ protected override void CleanupManagedResources() { m_Parent = null; m_Root = null; ContextMenu = null; base.CleanupManagedResources(); }
public void RefreshCursor() { RootContainer root = Root; if (root != null) { root.CTX.SetCursor(Cursor); } }
protected override void OnRootChanged() { if (IsDisposed) { return; } base.OnRootChanged(); RootContainer root = Root; for (int i = 0; i < Children.Count; i++) { Children [i].Root = root; } }
public virtual void Invalidate(int frames = 0) { if (IsLayoutSuspended) { return; } if (InvalidateOnHeartBeat) { invalidateFlag = true; } else { RootContainer root = Root; if (root != null) { root.Invalidate(frames); } } }
public virtual void RemoveChild(Widget child) { if (child == null) { return; } try { // cleanup all necessary entries from the Root Container RootContainer root = Root ?? child.Root; if (root != null) { root.RemoveWidget(child); } if (Children.Remove(child)) { OnChildRemoved(child); } } catch (Exception ex) { ex.LogError(); } }
/// <summary> /// This scales the control, /// Call after setting your properties /// </summary> protected virtual void OnParentChanged() { if (IsDisposed) { return; } if (Parent != null) { RootContainer root = Parent.Root ?? Parent as RootContainer; if (root != null) { Root = root; } ResetCachedLayout(); Parent.ResetCachedLayout(); } else { Root = null; } }
public MenuManager(RootContainer root) { Root = root; Observer = new Observer <EventMessage> (OnNext, OnError, OnCompleted); root.Subscribe(Observer); }