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); }
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); }
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); }
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); }
void Pack(Widget widget, bool expand, WidgetPlacement vpos, WidgetPlacement hpos, double marginLeft, double marginTop, double marginRight, double marginBottom, double margin, PackOrigin ptype) { WidgetPlacement align; if (direction == Orientation.Horizontal) { align = hpos; if (vpos != default(WidgetPlacement)) { widget.VerticalPlacement = vpos; } } else { align = vpos; if (hpos != default(WidgetPlacement)) { widget.HorizontalPlacement = hpos; } } 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; } Pack(widget, expand, align, PackOrigin.Start); }