layout.h File Reference


Enumerations

enum  {
  LAYOUT_X, LAYOUT_Y, LAYOUT_XY, LAYOUT_W,
  LAYOUT_H, LAYOUT_WH, LAYOUT_XYWH, LAYOUT_CHILD,
  LAYOUT_USER, LAYOUT_DAMAGE
}

Detailed Description

Values of the bits stored in Widget::layout_damage().

When a widget resized or moved (or when it is initially created), flags are set in Widget::layout_damage() to indicate the layout is damaged. This will cause the virtual function Widget::layout() to be called just before fltk attempts to draw the windows on the screen. This is useful because often calculating the new layout is quite expensive, this expense is now deferred until the user will actually see the new size.

Some Group widgets such as PackedGroup will also use the virtual Widget::layout() function to find out how big a widget should be. A Widget is allowed to change it's own dimensions in layout() (except it is not allowed to change it if called a second time with no changes other than it's x/y position). This allows widgets to resize to fit their contents.

The layout bits are turned on by calling Widget::relayout().


Enumeration Type Documentation

anonymous enum
 

Enumeration values:
LAYOUT_X  Widget::x() changed by resize()
LAYOUT_Y  Widget::y() changed by resize()
LAYOUT_XY  Same as LAYOUT_X|LAYOUT_Y
LAYOUT_W  Widget::w() changed by resize()
LAYOUT_H  Widget::h() changed by resize()
LAYOUT_WH  Same as LAYOUT_W|LAYOUT_H
LAYOUT_XYWH  Same as LAYOUT_XY|LAYOUT_WH
LAYOUT_CHILD  Widget::layout() needs to be called on a child of this group widget.
LAYOUT_USER  The moving/resizing is being caused by the user and not internal code.
LAYOUT_DAMAGE  Widget::relayout() was called.


Sun Jan 7 00:55:17 2007. FLTK ©2006 Bill Spitzak and others.
Permission is granted to reproduce this manual or any portion for any purpose, provided this copyright and permission notice are preserved.