Пример #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
            }
        }
Пример #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);
                }
            }
        }
Пример #3
0
        public Splitter(CompositeWidget parent, bool vertical)
        {
            AttachDriverObject(parent, Guppy.Driver.CreateSplitter(this, vertical));
            this.Vertical = vertical;

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