Ejemplo n.º 1
0
        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
            }
        }
Ejemplo n.º 2
0
        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);
                }
            }
        }
Ejemplo n.º 3
0
        public Splitter(CompositeWidget parent, bool vertical)
        {
            AttachDriverObject(parent, Guppy.Driver.CreateSplitter(this, vertical));
            this.Vertical = vertical;

            EvChanged += new GuppyEventHandler(Splitter_EvChanged);
        }
Ejemplo n.º 4
0
 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));
 }
Ejemplo n.º 5
0
 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);
     }
 }
Ejemplo n.º 6
0
        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
        }
Ejemplo n.º 7
0
        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;
            }
        }
Ejemplo n.º 8
0
 public Label(CompositeWidget parent, string caption)
 {
     AttachDriverObject(parent, Guppy.Driver.CreateLabel(this, caption));
 }
Ejemplo n.º 9
0
 public ImageLabel(CompositeWidget parent, Image img)
 {
     AttachDriverObject(parent, Guppy.Driver.CreateSlide(this, img));
     this.image = img;
 }
Ejemplo n.º 10
0
        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));
        }
Ejemplo n.º 11
0
 public ProgressBar(CompositeWidget parent)
 {
     AttachDriverObject(parent, Guppy.Driver.CreateProgressBar(this));
 }
Ejemplo n.º 12
0
 public ChildCollection(CompositeWidget owner)
 {
     this.owner = owner;
 }
Ejemplo n.º 13
0
 public Valuator(CompositeWidget parent, bool vertical)
 {
     AttachDriverObject(parent, Guppy.Driver.CreateValuator(this, vertical));
 }
Ejemplo n.º 14
0
 public MenuItem(CompositeWidget parent, string caption)
     : this(parent, caption, null, MenuFlags.None)
 {
 }
Ejemplo n.º 15
0
        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));
        }
Ejemplo n.º 16
0
 public Memo(CompositeWidget parent)
 {
     AttachDriverObject(parent, Guppy.Driver.CreateMemo(this));
 }
Ejemplo n.º 17
0
 public Tabs(CompositeWidget parent)
 {
     AttachDriverObject(parent, Guppy.Driver.CreateTabs(this));
 }
Ejemplo n.º 18
0
 public Edit(CompositeWidget parent)
 {
     AttachDriverObject(parent, Guppy.Driver.CreateEdit(this));
 }
Ejemplo n.º 19
0
 public ListBox(CompositeWidget parent, params object[] items)
 {
     AttachDriverObject(parent, Guppy.Driver.CreateListBox(this, items));
     SelectedIndex = 0; //Select first item if any
 }
Ejemplo n.º 20
0
 internal SplitterPanel(CompositeWidget parent, object driverobject)//special class cannot be constructed from outside thus internal
 {
     AttachDriverObject(parent, Guppy.Driver.CreateSplitterPanel(this, driverobject));
 }
Ejemplo n.º 21
0
 public ChoiceEdit(CompositeWidget parent, params object[] items)
 {
     AttachDriverObject(parent, Guppy.Driver.CreateChoiceEdit(this, items));
 }