public virtual void Dispose() { if (DriverObject != null) { Guppy.Driver.DefaultDispose(DriverObject); } else { //Driver object is null, but it might be a composite widget so //dispose each child individually CompositeWidget cw = this as CompositeWidget; if (cw != null) { while (cw.Children.Count > 0) { cw.Children.Detach(cw.Children[cw.Children.Count - 1]); } } } if (Parent != null) { Parent.Children.Detach(this); //detach to avoid refresing problems in layout manager } }
private void PhysicalDetach(DriverCompositeWidget parent, Widget child) { if (parent == null) { return; } if (child.DriverObject == null) { //no driver object to detach, but it might be a composite container so apply recursivly CompositeWidget cw = child as CompositeWidget; if (cw != null) { foreach (Widget wi in cw.Children) { PhysicalDetach(parent, wi); } } } else { DriverWidget ch = child.DriverObject as DriverWidget; if (ch != null) { parent.Detach(ch); } } }
public Splitter(CompositeWidget parent, bool vertical) { AttachDriverObject(parent, Guppy.Driver.CreateSplitter(this, vertical)); this.Vertical = vertical; EvChanged += new GuppyEventHandler(Splitter_EvChanged); }
public MenuItem(CompositeWidget menu, string caption, Image image, MenuFlags flags) { if (menu != null && !(menu is PopupMenu) && !(menu is MenuItem)) { throw new Exception("MenuItem:s can only have menus/popup and other menuitems as parent"); } AttachDriverObject(menu, Guppy.Driver.CreateMenuItem(this, caption, image, flags)); }
virtual protected void AttachDriverObject(CompositeWidget parent, DriverWidget w) { //use this function from inheriting constructor with driver object DriverObject = w; // this.Parent = parent; if (parent != null) { parent.Children.Append(this); } }
public Choice(CompositeWidget parent, params object[] items) { AttachDriverObject(parent, Guppy.Driver.CreateChoice(this, items)); /*DriverObject = Guppy.Driver.CreateChoice (this, entries); * if (parent != null) { * this.Parent = parent; * parent.Append (this); * }*/ SelectedIndex = 0; //select first item if any }
public Frame(CompositeWidget parent, string caption, bool border) { AttachDriverObject(parent, Guppy.Driver.CreateFrame(this, caption, border)); if (border) { Margin = new Margin(Guppy.DefaultMargin); } else { Margin = Margin.Empty; } }
public Label(CompositeWidget parent, string caption) { AttachDriverObject(parent, Guppy.Driver.CreateLabel(this, caption)); }
public ImageLabel(CompositeWidget parent, Image img) { AttachDriverObject(parent, Guppy.Driver.CreateSlide(this, img)); this.image = img; }
bool eventblock = false; //used to block changed events when changed from code public Toggle(CompositeWidget parent, string caption, bool isbutton) { AttachDriverObject(parent, Guppy.Driver.CreateToggle(this, caption, isbutton)); }
public ProgressBar(CompositeWidget parent) { AttachDriverObject(parent, Guppy.Driver.CreateProgressBar(this)); }
public ChildCollection(CompositeWidget owner) { this.owner = owner; }
public Valuator(CompositeWidget parent, bool vertical) { AttachDriverObject(parent, Guppy.Driver.CreateValuator(this, vertical)); }
public MenuItem(CompositeWidget parent, string caption) : this(parent, caption, null, MenuFlags.None) { }
bool eventblock = false; //used do thrash event when changing value from code public RadioButton(CompositeWidget parent, string caption) : base() { AttachDriverObject(parent, Guppy.Driver.CreateRadioButton(this, caption)); }
public Memo(CompositeWidget parent) { AttachDriverObject(parent, Guppy.Driver.CreateMemo(this)); }
public Tabs(CompositeWidget parent) { AttachDriverObject(parent, Guppy.Driver.CreateTabs(this)); }
public Edit(CompositeWidget parent) { AttachDriverObject(parent, Guppy.Driver.CreateEdit(this)); }
public ListBox(CompositeWidget parent, params object[] items) { AttachDriverObject(parent, Guppy.Driver.CreateListBox(this, items)); SelectedIndex = 0; //Select first item if any }
internal SplitterPanel(CompositeWidget parent, object driverobject)//special class cannot be constructed from outside thus internal { AttachDriverObject(parent, Guppy.Driver.CreateSplitterPanel(this, driverobject)); }
public ChoiceEdit(CompositeWidget parent, params object[] items) { AttachDriverObject(parent, Guppy.Driver.CreateChoiceEdit(this, items)); }