Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

Fl_Pack Class Reference

This grouping widget arranges and resizes all of it's children so they are all packed close together and completely fill the widget. More...

#include <Fl_Pack.h>

Inheritance diagram for Fl_Pack:

Fl_Widget List of all members.

Public Types

enum  Types { NORMAL = GROUP_TYPE, VERTICAL = NORMAL, HORIZONTAL = GROUP_TYPE+1 }
 values for type(int). More...


Public Methods

 Fl_Pack (int x, int y, int w,int h, const char *label=0)
 Creates new pack widget using the given position, size, and label string.

 Fl_Pack (const char *l=0, int layout_size=30, Fl_Align layout_al=FL_ALIGN_TOP, int label_w=100)
 Creates new pack widget using the label, size, alignment, and label_width.

virtual void layout ()
int spacing () const
 Get the number of extra pixels of blank space that are added between each child widgets.

void spacing (int i)
 Set the number of extra pixels of blank space that are added between each child widgets. More...


Static Public Attributes

Fl_Named_Styledefault_style

Detailed Description

This grouping widget arranges and resizes all of it's children so they are all packed close together and completely fill the widget.

This is similar to layout widgets used by TK and some other toolkits.

Each child widget is stretched (ie one of it's dimensions is changed and the other left alone) to completely fill the remaining space on one edge of the pack and placed against all the previous widgets on that edge.

Any widget with the FL_PACK_VERTICAL bit (8) set in the flags() are placed against the left or right edge, otherwise against the top or bottom edge. (If type() of the pack is set to Fl_Pack::HORIZONTAL then it will "pack horzontally" which means that all widgets are packed against the left or right edges, whether or not they have FL_PACK_VERTICAL turned on)

All widgets before the resizable() widget are placed against the top and left edge, all widgets after the resizable() widget are placed against the bottom and right edge in backwards order. If the resizable() is not set, all widgets are placed against the top and left edge, and the pack itself resizes to surround them. Such a pack must be imbedded in another pack or be the only child of a window so that this resizing can be used to layout the parent widget.

If any child changes size the pack automatically re-layouts and possibly changes it's own size to accomodate it. If you add, move, remove, hide, or show a child widget, or change the FL_PACK_VERTICAL flag, you should call relayout() on the pack yourself.

The default box is FL_FLAT_BOX. If you set it to something else the border of the box is drawn and the widgets are packed against the inside of this border.

Definition at line 41 of file Fl_Pack.h.


Member Enumeration Documentation

enum Fl_Pack::Types
 

values for type(int).

Enumeration values:
NORMAL  Pack widgets vertically.
VERTICAL  For back compatability.
HORIZONTAL  Pack widgets horizontally.

Definition at line 52 of file Fl_Pack.h.


Member Function Documentation

void Fl_Pack::spacing int    i [inline]
 

Set the number of extra pixels of blank space that are added between each child widgets.

Parameters:
i  pixels

Definition at line 69 of file Fl_Pack.h.


The documentation for this class was generated from the following file:
Generated on Thu Jul 31 15:33:51 2003 for eFLTK by doxygen1.2.15