Esempio n. 1
0
File: Box.cs Progetto: wesreid/xwt
        void Pack(Widget widget, bool?expand, WidgetPlacement align, PackOrigin ptype)
        {
            if (expand.HasValue)
            {
                if (direction == Orientation.Vertical)
                {
                    widget.ExpandVertical = expand.Value;
                }
                else
                {
                    widget.ExpandHorizontal = expand.Value;
                }
            }
            if (align != default(WidgetPlacement))
            {
                if (direction == Orientation.Vertical)
                {
                    widget.VerticalPlacement = align;
                }
                else
                {
                    widget.HorizontalPlacement = align;
                }
            }

            if (widget == null)
            {
                throw new ArgumentNullException("widget");
            }
            var p = new BoxPlacement((WidgetBackendHost)BackendHost, widget);

            p.PackOrigin = ptype;
            children.Add(p);
        }
Esempio n. 2
0
File: Box.cs Progetto: wesreid/xwt
 internal protected virtual void OnReplaceChild(BoxPlacement placement, Widget oldWidget, Widget newWidget)
 {
     if (oldWidget != null)
     {
         OnRemove(oldWidget);
     }
     OnAdd(newWidget, placement);
 }
Esempio n. 3
0
File: Box.cs Progetto: Clancey/xwt
        void Pack(Widget widget, BoxMode mode, int padding, PackOrigin ptype)
        {
            var p = new BoxPlacement((WidgetBackendHost)BackendHost, widget);

            p.BoxMode    = mode;
            p.Padding    = padding;
            p.PackOrigin = ptype;
            children.Add(p);
        }
Esempio n. 4
0
        void Pack(Widget widget, BoxMode mode, int padding, PackOrigin ptype)
        {
            var p = new BoxPlacement((EventSink)WidgetEventSink, widget);

            p.BoxMode    = mode;
            p.Padding    = padding;
            p.PackOrigin = ptype;
            children.Add(p);
        }
Esempio n. 5
0
File: Box.cs Progetto: codeyu/xwt
        void Pack(Widget widget, BoxMode mode, double padding, PackOrigin ptype)
        {
            if (widget == null)
            {
                throw new ArgumentNullException("widget");
            }
            if (padding < 0)
            {
                throw new ArgumentException("padding can't be negative");
            }
            var p = new BoxPlacement((WidgetBackendHost)BackendHost, widget);

            p.BoxMode    = mode;
            p.Padding    = padding;
            p.PackOrigin = ptype;
            children.Add(p);
        }
Esempio n. 6
0
File: Box.cs Progetto: wesreid/xwt
 void OnChildChanged(BoxPlacement placement, object hint)
 {
     OnPreferredSizeChanged();
 }
Esempio n. 7
0
File: Box.cs Progetto: wesreid/xwt
 void OnAdd(Widget child, BoxPlacement placement)
 {
     RegisterChild(child);
     Backend.Add((IWidgetBackend)GetBackend(child));
     OnPreferredSizeChanged();
 }