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

Fl_Tool_Bar Class Reference

Tool bar for eFLTK applications. More...

#include <Fl_Tool_Bar.h>

Inheritance diagram for Fl_Tool_Bar:

Fl_Bar Fl_Widget List of all members.

Public Types

enum  TbSize { TB_SIZE_SMALL = 0, TB_SIZE_BIG, TB_SIZE_DEFAULT }
 Size of toolbar button icons. More...


Public Methods

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

 Fl_Tool_Bar (const char *l=0, int layout_size=30, Fl_Align layout_al=FL_ALIGN_TOP, int label_w=-1)
 Creates new toolbar widget using the label, size, alignment, and label width.

 ~Fl_Tool_Bar ()
 Destructor.

Fl_Tool_Button * add_button (Fl_Image *image, long id, const char *label=0, const char *tip=0)
 Add normal button to tool bar. More...

Fl_Tool_Button * add_button (const char *label, const char *tip, Fl_Image *image=0, Fl_Callback *cb=0, void *data=0)
 Add normal button to tool bar. More...

Fl_Tool_Button * add_toggle (Fl_Image *image, long id, const char *label=0, const char *tip=0)
 Add toggle button to tool bar. More...

Fl_Tool_Button * add_toggle (const char *label, const char *tip, Fl_Image *image=0, Fl_Callback *cb=0, void *data=0)
 Add toggle button to tool bar. More...

Fl_Divideradd_divider ()
 Add divider to tool bar.

Fl_Widgetitem () const
 Returns current item, this should be used ONLY is Fl_Tool_Bar::callback function.

void item (Fl_Widget *i)
 Set current item, used internally.

virtual void draw ()
 void Fl_Widget::draw().

virtual void layout ()
 void Fl_Widget::layout().

virtual int handle (int ev)
 int Fl_Widget::handle(int event).

virtual void preferred_size (int &w, int &h) const
 Returns preferred size for tool bar, regarding to its state.

int spacing () const
 This function is obsolete, you should use layout_spacing() instead. More...

void spacing (int v)
 This function is obsolete, you should use layout_spacing() instead. More...

TbSize tb_size () const
 Return current size mode. More...

void tb_size (TbSize s)
 Set size mode. More...


Static Public Methods

void default_callback (Fl_Widget *button, void *arg)
 Default callback for tool bar buttons. More...

void button_glyph (const Fl_Widget *widget, int glyph, int x, int y, int w, int h, Fl_Flags flags)
 Default open/close glyph.

void set_icon_size (TbSize size, int w, int h)
 Set default button sizes for ALL tool bars. More...

void get_icon_size (TbSize size, int &w, int &h)
 Get default button sizes. More...

TbSize default_tb_size ()
 Return default size mode. More...

void default_tb_size (TbSize s)
 Set default size mode for ALL tool bars. More...


Static Public Attributes

Fl_Named_Styledefault_style
 Named style for toolbar. More...


Detailed Description

Tool bar for eFLTK applications.

Toolbar usually contains shortcuts to menu actions, such as "Open File". Items are normally represented as buttons, either normal or toggles. However, it is possible to add any kind of widget to tool bar group.

Fl_Tool_Bar provides simple interface for adding buttons. It is recommended to use these functions, this way you can get maximum usability for tool bar.

Definition at line 42 of file Fl_Tool_Bar.h.


Member Enumeration Documentation

enum Fl_Tool_Bar::TbSize
 

Size of toolbar button icons.

Enumeration values:
TB_SIZE_SMALL  Small size, default small icon size is 20x20.
TB_SIZE_BIG  Big size, default big icon size is 32x32.
TB_SIZE_DEFAULT  Select small/big regarding to system default.

Definition at line 51 of file Fl_Tool_Bar.h.

Referenced by default_tb_size(), get_icon_size(), set_icon_size(), and tb_size().


Member Function Documentation

Fl_Tool_Button* Fl_Tool_Bar::add_button const char *    label,
const char *    tip,
Fl_Image   image = 0,
Fl_Callback *    cb = 0,
void *    data = 0
 

Add normal button to tool bar.

Parameters:
label  Label of button
tip  Tooltip of button
image  Button image
cb  Callback for button. If NULL, Fl_Tool_Bar::default_callback is used.
data  User data for this button

Fl_Tool_Button* Fl_Tool_Bar::add_button Fl_Image   image,
long    id,
const char *    label = 0,
const char *    tip = 0
 

Add normal button to tool bar.

Parameters:
image  Button image
id  argument for button, usually unique for each button.
label  Label of button
tip  Tooltip of button

Fl_Tool_Button* Fl_Tool_Bar::add_toggle const char *    label,
const char *    tip,
Fl_Image   image = 0,
Fl_Callback *    cb = 0,
void *    data = 0
 

Add toggle button to tool bar.

Parameters:
label  Label of button
tip  Tooltip of button
image  Button image
cb  Callback for button. If NULL, Fl_Tool_Bar::default_callback is used.
data  User data for this button

Fl_Tool_Button* Fl_Tool_Bar::add_toggle Fl_Image   image,
long    id,
const char *    label = 0,
const char *    tip = 0
 

Add toggle button to tool bar.

Parameters:
image  Button image
id  argument for button, usually unique for each button.
label  Label of button
tip  Tooltip of button

void Fl_Tool_Bar::default_callback Fl_Widget   button,
void *    arg
[static]
 

Default callback for tool bar buttons.

This sets 'button' to be current item() of tool bar and makes this->do_callback()

Reimplemented from Fl_Widget.

void Fl_Tool_Bar::default_tb_size TbSize    s [inline, static]
 

Set default size mode for ALL tool bars.

See also:
enum TbSize

Definition at line 179 of file Fl_Tool_Bar.h.

References TbSize.

TbSize Fl_Tool_Bar::default_tb_size   [inline, static]
 

Return default size mode.

See also:
enum TbSize

Definition at line 174 of file Fl_Tool_Bar.h.

References TbSize.

Referenced by tb_size().

void Fl_Tool_Bar::get_icon_size TbSize    size,
int &    w,
int &    h
[inline, static]
 

Get default button sizes.

See also:
enum TbSize

Definition at line 157 of file Fl_Tool_Bar.h.

References TbSize.

void Fl_Tool_Bar::set_icon_size TbSize    size,
int    w,
int    h
[inline, static]
 

Set default button sizes for ALL tool bars.

See also:
enum TbSize

Definition at line 152 of file Fl_Tool_Bar.h.

References TbSize.

void Fl_Tool_Bar::spacing int    v [inline]
 

This function is obsolete, you should use layout_spacing() instead.

Set spacing between items.

Definition at line 146 of file Fl_Tool_Bar.h.

int Fl_Tool_Bar::spacing   const [inline]
 

This function is obsolete, you should use layout_spacing() instead.

Spacing between items.

Definition at line 141 of file Fl_Tool_Bar.h.

void Fl_Tool_Bar::tb_size TbSize    s [inline]
 

Set size mode.

See also:
enum TbSize

Definition at line 168 of file Fl_Tool_Bar.h.

References TbSize.

TbSize Fl_Tool_Bar::tb_size   const [inline]
 

Return current size mode.

See also:
enum TbSize

Definition at line 163 of file Fl_Tool_Bar.h.

References default_tb_size(), TB_SIZE_DEFAULT, and TbSize.


Member Data Documentation

Fl_Named_Style* Fl_Tool_Bar::default_style [static]
 

Named style for toolbar.

Name: "Tool Bar"

Reimplemented from Fl_Bar.

Definition at line 46 of file Fl_Tool_Bar.h.


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