internal void OnChildPlacementChanged(Widget child) { Backend.UpdateChildPlacement(child.GetBackend()); if (!BackendHost.EngineBackend.HandlesSizeNegotiation) { Widget.QueueWindowSizeNegotiation(this); } }
public void RemoveChild(Widget w) { if (positions != null) { positions.Remove(w); } Backend.RemoveChild((IWidgetBackend)Widget.GetBackend(w)); UnregisterChild(w); OnPreferredSizeChanged(); }
/// <summary> /// Sets the position and size of a child widget /// </summary> /// <param name='widget'> /// The child widget. It must have been added using the AddChild method. /// </param> /// <param name='bounds'> /// New bounds, in container coordinates /// </param> /// <exception cref="System.ArgumentException">If the widget is not a child of this canvas</exception> public void SetChildBounds(Widget widget, Rectangle bounds) { if (positions == null || widget.Parent != this) { throw new ArgumentException("Widget is not a child of the canvas"); } positions [widget] = bounds; Backend.SetChildBounds((IWidgetBackend)Widget.GetBackend(widget), bounds); }
/// <summary> /// Removes a child widget /// </summary> /// <param name='widget'> /// The widget to remove. The widget must have been previously added using AddChild. /// </param> /// <exception cref="System.ArgumentException">If the widget is not a child of this canvas</exception> public void RemoveChild(Widget widget) { if (positions == null || widget.Parent != this) { throw new ArgumentException("Widget is not a child of the canvas"); } positions.Remove(widget); Backend.RemoveChild((IWidgetBackend)Widget.GetBackend(widget)); UnregisterChild(widget); }
public void AddChild(Widget w, Rectangle rect) { if (positions != null) { positions = new Dictionary <Widget, Rectangle> (); } var bk = (IWidgetBackend)Widget.GetBackend(w); Backend.AddChild(bk); Backend.SetChildBounds(bk, rect); RegisterChild(w); OnPreferredSizeChanged(); }
/// <summary> /// Adds a child widget. /// </summary> /// <param name='widget'> /// The widget /// </param> /// <param name='bounds'> /// Position and size of the child widget, in container coordinates /// </param> /// <remarks> /// The widget is placed in the canvas area, in the specified coordinates and /// using the specified size /// </remarks> public void AddChild(Widget widget, Rectangle bounds) { if (positions == null) { positions = new Dictionary <Widget, Rectangle> (); } positions [widget] = bounds; var bk = (IWidgetBackend)Widget.GetBackend(widget); Backend.AddChild(bk, bounds); RegisterChild(widget); }
public void SetChildBounds(Widget w, Rectangle rect) { Backend.SetChildBounds((IWidgetBackend)Widget.GetBackend(w), rect); OnPreferredSizeChanged(); }
internal void OnChildPlacementChanged(Widget child) { Backend.UpdateChildPlacement (child.GetBackend ()); if (!BackendHost.EngineBackend.HandlesSizeNegotiation) Widget.QueueWindowSizeNegotiation (this); }
/// <summary> /// Removes a child widget /// </summary> /// <param name='widget'> /// The widget to remove. The widget must have been previously added using AddChild. /// </param> /// <exception cref="System.ArgumentException">If the widget is not a child of this canvas</exception> public void RemoveChild(Widget widget) { UnregisterChild(widget); positions.Remove(widget); Backend.RemoveChild((IWidgetBackend)Widget.GetBackend(widget)); }
/// <summary> /// Shows the menu at the specified location /// </summary> /// <param name="parentWidget">Widget upon which to show the menu</param> /// <param name="x">The x coordinate, relative to the widget origin</param> /// <param name="y">The y coordinate, relative to the widget origin</param> public void Popup(Widget parentWidget, double x, double y) { Backend.Popup(parentWidget.GetBackend(), x, y); }