public void ChangeCurrentWindow(WidgetTreeNode neww) { if (neww.Widget.WidgetType == (int)StandardWidgetType.WID_APP) { // Hide, when we select the application. if (Common.Instance().CurrentWindow != null) Common.Instance().CurrentWindow.Hide(); } IWDBBase _cur = FindTopMostFrame(neww); if (_cur != null) { if (Common.Instance().CurrentWindow != null) Common.Instance().CurrentWindow.Hide(); Common.Instance().CurrentWindow = (wx.Window)_cur; Common.Instance().CurrentWindow.Show(); } }
WidgetTreeNode FindBestParentSizer(WidgetTreeNode curNode, bool sizerIsAsking) { if (curNode.Widget.IsSizer == false) { return null; } if (curNode.Widget.CanAcceptChildren()) { return curNode; } else { if (curNode.Parent == null) { return null; } else { return FindBestParentSizer((WidgetTreeNode)curNode.Parent, false); } } }
void CheckParentForWidget(WidgetTreeNode _c, WidgetTreeNode _s, out wx.Window _rc) { _rc = null; if (_c == null) { _rc = (wx.Window)_s.Widget.ParentContainer; } else { _rc = (wx.Window)_c.Widget; } }
void CheckParentForSizer(WidgetTreeNode _c, WidgetTreeNode _s, out wx.Window _rc, out wx.Sizer _rs) { _rc = null; _rs = null; if (_c != null) _rc = (wx.Window)_c.Widget; if (_s != null) { _rs = (wx.Sizer)_s.Widget; _rc = _s.Widget.ParentContainer; } }
void CanvasPaintRecursive(WidgetTreeNode elem) { foreach (WidgetTreeNode e in elem.Nodes) { CanvasPaintRecursive(e); } if (elem.Widget.IsSelected) { elem.Widget.HighlightSelection(); } }
public IWDBBase FindTopMostFrame(WidgetTreeNode node) { if (node.Level == 1) { if (node.Widget.WidgetType == (int)StandardWidgetType.WID_FRAME) { return node.Widget; } else { return null; } } if (node.Parent != null) { return FindTopMostFrame((WidgetTreeNode)node.Parent); } return null; }