Example #1
0
 internal void OnChildPlacementChanged(Widget child)
 {
     Backend.UpdateChildPlacement(child.GetBackend());
     if (!BackendHost.EngineBackend.HandlesSizeNegotiation)
     {
         Widget.QueueWindowSizeNegotiation(this);
     }
 }
Example #2
0
 public void RemoveChild(Widget w)
 {
     if (positions != null)
     {
         positions.Remove(w);
     }
     Backend.RemoveChild((IWidgetBackend)Widget.GetBackend(w));
     UnregisterChild(w);
     OnPreferredSizeChanged();
 }
Example #3
0
        /// <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);
        }
Example #4
0
        /// <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);
        }
Example #5
0
        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();
        }
Example #6
0
        /// <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);
        }
Example #7
0
 public void SetChildBounds(Widget w, Rectangle rect)
 {
     Backend.SetChildBounds((IWidgetBackend)Widget.GetBackend(w), rect);
     OnPreferredSizeChanged();
 }
Example #8
0
 internal void OnChildPlacementChanged(Widget child)
 {
     Backend.UpdateChildPlacement (child.GetBackend ());
     if (!BackendHost.EngineBackend.HandlesSizeNegotiation)
         Widget.QueueWindowSizeNegotiation (this);
 }
Example #9
0
 /// <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));
 }
Example #10
0
File: Menu.cs Project: wwwK/xwt
 /// <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);
 }