fltk 1.3.0rc3
About: FLTK (Fast Light Tool Kit) is a cross-platform C++ GUI toolkit for UNIX/Linux (X11), Microsoft Windows, and MacOS X. Release candidate.
  SfR Fresh Dox: fltk-1.3.0rc3-source.tar.gz ("inofficial" and yet experimental doxygen-generated source code documentation)  

Fl_Pack Class Reference

#include <Fl_Pack.H>

Inheritance diagram for Fl_Pack:
Collaboration diagram for Fl_Pack:

List of all members.

Public Types

enum  { VERTICAL = 0, HORIZONTAL = 1 }

Public Member Functions

 Fl_Pack (int x, int y, int w, int h, const char *l=0)
int spacing () const
void spacing (int i)
uchar horizontal () const

Protected Member Functions

void draw ()

Detailed Description

This widget was designed to add the functionality of compressing and aligning widgets.

If type() is Fl_Pack::HORIZONTAL all the children are resized to the height of the Fl_Pack, and are moved next to each other horizontally. If type() is not Fl_Pack::HORIZONTAL then the children are resized to the width and are stacked below each other. Then the Fl_Pack resizes itself to surround the child widgets.

This widget is needed for the Fl_Tabs. In addition you may want to put the Fl_Pack inside an Fl_Scroll.

The resizable for Fl_Pack is set to NULL by default.

See also: Fl_Group::resizable()

Definition at line 52 of file Fl_Pack.H.


Member Enumeration Documentation

anonymous enum
Enumerator:
VERTICAL 
HORIZONTAL 

Definition at line 56 of file Fl_Pack.H.


Constructor & Destructor Documentation

Fl_Pack::Fl_Pack ( int  X,
int  Y,
int  W,
int  H,
const char *  l = 0 
)

Creates a new Fl_Pack widget using the given position, size, and label string. The default boxtype is FL_NO_BOX.

The destructor also deletes all the children. This allows a whole tree to be deleted at once, without having to keep a pointer to all the children in the user code. A kludge has been done so the Fl_Pack and all of it's children can be automatic (local) variables, but you must declare the Fl_Packfirst, so that it is destroyed last.

Definition at line 47 of file Fl_Pack.cxx.

References Fl_Group::resizable().


Member Function Documentation

void Fl_Pack::draw ( ) [protected, virtual]

Draws the widget. Never call this function directly. FLTK will schedule redrawing whenever needed. If your widget must be redrawn as soon as possible, call redraw() instead.

Override this function to draw your own widgets.

If you ever need to call another widget's draw method from within your own draw() method, e.g. for an embedded scrollbar, you can do it (because draw() is virtual) like this:

        Fl_Widget *s = &scroll;         // scroll is an embedded Fl_Scrollbar
        s->draw();                      // calls Fl_Scrollbar::draw()

Reimplemented from Fl_Group.

Definition at line 54 of file Fl_Pack.cxx.

References Fl_Group::array(), Fl_Widget::box(), Fl::box_dh(), Fl::box_dw(), Fl::box_dx(), Fl::box_dy(), Fl_Group::child(), Fl_Group::children(), Fl_Widget::clear_damage(), Fl_Widget::color(), Fl_Widget::damage(), Fl_Widget::draw_box(), Fl_Group::draw_child(), Fl_Widget::draw_label(), Fl_Group::draw_outside_label(), fl_color(), FL_DAMAGE_ALL, fl_rectf(), H, Fl_Widget::h(), horizontal(), i, Fl_Group::resizable(), Fl_Group::resize(), Fl_Widget::resize(), Fl_Group::update_child(), Fl_Widget::visible(), Fl_Widget::w(), Fl_Widget::x(), and Fl_Widget::y().

uchar Fl_Pack::horizontal ( ) const [inline]

Same as Fl_Group::type()

Definition at line 77 of file Fl_Pack.H.

References Fl_Widget::type().

Referenced by draw().

void Fl_Pack::spacing ( int  i) [inline]

Sets the number of extra pixels of blank space that are added between the children.

Definition at line 75 of file Fl_Pack.H.

References i.

int Fl_Pack::spacing ( ) const [inline]

Gets the number of extra pixels of blank space that are added between the children.

Definition at line 70 of file Fl_Pack.H.

Referenced by Fl_Pack_Type::copy_properties().


The documentation for this class was generated from the following files: