예제 #1
0
        public void Add(Widget w, string label)
        {
            NotebookTab t = new NotebookTab((EventSink)WidgetEventSink, w);

            t.Label = label;
            tabs.Add(t);
        }
예제 #2
0
        public void Add(Widget w, string label)
        {
            NotebookTab t = new NotebookTab((WidgetBackendHost)BackendHost, w);

            t.Label = label;
            tabs.Add(t);
        }
예제 #3
0
파일: Box.cs 프로젝트: 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);
        }
예제 #4
0
        public void Add(Widget widget, int left, int top, int rowspan = 1, int colspan = 1, bool hexpand = false, bool vexpand = false, WidgetPlacement hpos = WidgetPlacement.Fill, WidgetPlacement vpos = WidgetPlacement.Fill, double marginLeft = -1, double marginTop = -1, double marginRight = -1, double marginBottom = -1, double margin = -1)
        {
            if (vpos != default(WidgetPlacement))
            {
                widget.VerticalPlacement = vpos;
            }
            if (hpos != default(WidgetPlacement))
            {
                widget.HorizontalPlacement = hpos;
            }

            widget.ExpandHorizontal = hexpand;
            widget.ExpandVertical   = vexpand;

            if (margin != -1)
            {
                widget.Margin = margin;
            }
            if (marginLeft != -1)
            {
                widget.MarginLeft = marginLeft;
            }
            if (marginTop != -1)
            {
                widget.MarginTop = marginTop;
            }
            if (marginTop != -1)
            {
                widget.MarginRight = marginRight;
            }
            if (marginBottom != -1)
            {
                widget.MarginBottom = marginBottom;
            }

            var p = new TablePlacement((WidgetBackendHost)BackendHost, widget)
            {
                Left   = left,
                Right  = left + colspan,
                Top    = top,
                Bottom = top + rowspan
            };

            placements.Add(p);
        }
예제 #5
0
파일: Box.cs 프로젝트: 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);
        }
예제 #6
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);
        }
예제 #7
0
        public void Attach(Widget widget, int left, int right, int top, int bottom, AttachOptions xOptions, AttachOptions yOptions)
        {
            var p = new TablePlacement((EventSink)WidgetEventSink, widget)
            {
                Left     = left,
                Right    = right,
                Top      = top,
                Bottom   = bottom,
                XOptions = xOptions,
                YOptions = yOptions
            };

            children.Add(p);
        }
예제 #8
0
파일: Box.cs 프로젝트: 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);
        }