Resizing and Moving Controls


  Rect  get_control_area(Control *c);

  void  move_control(Control *c, Rect r);
  void  size_control(Control *c, Rect r);


The get_control_area function can be used to discover the rectangle of a control in its own co-ordinate system. Hence, the top-left point of this rectangle will be (0,0).

A control can be moved using the move_control function. This will change the location (but not the size) of the control on its parent. The width and height fields in the supplied rectangle will be ignored, while the x and y field must be expressed relative the parent's top-left point.

A control's size can be changed without moving it, using size_control. Here, the given rectangle's width and height field are used, while the x and y fields are ignored. The control's top-left point will remain in the same location.