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_Widget Class Reference

#include <Fl_Widget.H>

Inheritance diagram for Fl_Widget:
Collaboration diagram for Fl_Widget:

List of all members.

Public Member Functions

virtual ~Fl_Widget ()
virtual void draw ()=0
virtual int handle (int event)
Fl_Groupparent () const
void parent (Fl_Group *p)
uchar type () const
void type (uchar t)
int x () const
int y () const
int w () const
int h () const
virtual void resize (int x, int y, int w, int h)
int damage_resize (int, int, int, int)
void position (int X, int Y)
void size (int W, int H)
Fl_Align align () const
void align (Fl_Align alignment)
Fl_Boxtype box () const
void box (Fl_Boxtype new_box)
Fl_Color color () const
void color (Fl_Color bg)
Fl_Color selection_color () const
void selection_color (Fl_Color a)
void color (Fl_Color bg, Fl_Color sel)
const char * label () const
void label (const char *text)
void copy_label (const char *new_label)
void label (Fl_Labeltype a, const char *b)
Fl_Labeltype labeltype () const
void labeltype (Fl_Labeltype a)
Fl_Color labelcolor () const
void labelcolor (Fl_Color c)
Fl_Font labelfont () const
void labelfont (Fl_Font f)
Fl_Fontsize labelsize () const
void labelsize (Fl_Fontsize pix)
Fl_Imageimage ()
const Fl_Imageimage () const
void image (Fl_Image *img)
void image (Fl_Image &img)
Fl_Imagedeimage ()
const Fl_Imagedeimage () const
void deimage (Fl_Image *img)
void deimage (Fl_Image &img)
const char * tooltip () const
void tooltip (const char *text)
void copy_tooltip (const char *text)
Fl_Callback_p callback () const
void callback (Fl_Callback *cb, void *p)
void callback (Fl_Callback *cb)
void callback (Fl_Callback0 *cb)
void callback (Fl_Callback1 *cb, long p=0)
void * user_data () const
void user_data (void *v)
long argument () const
void argument (long v)
Fl_When when () const
void when (uchar i)
unsigned int visible () const
int visible_r () const
virtual void show ()
virtual void hide ()
void set_visible ()
void clear_visible ()
unsigned int active () const
int active_r () const
void activate ()
void deactivate ()
unsigned int output () const
void set_output ()
void clear_output ()
unsigned int takesevents () const
unsigned int changed () const
void set_changed ()
void clear_changed ()
int take_focus ()
void set_visible_focus ()
void clear_visible_focus ()
void visible_focus (int v)
unsigned int visible_focus ()
void do_callback ()
void do_callback (Fl_Widget *o, long arg)
void do_callback (Fl_Widget *o, void *arg=0)
int test_shortcut ()
int contains (const Fl_Widget *w) const
int inside (const Fl_Widget *w) const
void redraw ()
void redraw_label ()
uchar damage () const
void clear_damage (uchar c=0)
void damage (uchar c)
void damage (uchar c, int x, int y, int w, int h)
void draw_label (int, int, int, int, Fl_Align) const
void measure_label (int &ww, int &hh) const
Fl_Windowwindow () const
virtual Fl_Groupas_group ()
virtual Fl_Windowas_window ()
virtual class Fl_Gl_Windowas_gl_window ()
Fl_Color color2 () const
void color2 (unsigned a)

Static Public Member Functions

static void default_callback (Fl_Widget *cb, void *d)
static unsigned int label_shortcut (const char *t)
static int test_shortcut (const char *, const bool require_alt=false)

Protected Types

enum  {
  INACTIVE = 1<<0, INVISIBLE = 1<<1, OUTPUT = 1<<2, NOBORDER = 1<<3,
  FORCE_POSITION = 1<<4, NON_MODAL = 1<<5, SHORTCUT_LABEL = 1<<6, CHANGED = 1<<7,
  OVERRIDE = 1<<8, VISIBLE_FOCUS = 1<<9, COPIED_LABEL = 1<<10, CLIP_CHILDREN = 1<<11,
  MENU_WINDOW = 1<<12, TOOLTIP_WINDOW = 1<<13, MODAL = 1<<14, NO_OVERLAY = 1<<15,
  GROUP_RELATIVE = 1<<16, COPIED_TOOLTIP = 1<<17, USERFLAG3 = 1<<29, USERFLAG2 = 1<<30,
  USERFLAG1 = 1<<31
}

Protected Member Functions

 Fl_Widget (int x, int y, int w, int h, const char *label=0L)
void x (int v)
void y (int v)
void w (int v)
void h (int v)
unsigned int flags () const
void set_flag (unsigned int c)
void clear_flag (unsigned int c)
void draw_box () const
void draw_box (Fl_Boxtype t, Fl_Color c) const
void draw_box (Fl_Boxtype t, int x, int y, int w, int h, Fl_Color c) const
void draw_backdrop () const
void draw_focus ()
void draw_focus (Fl_Boxtype t, int x, int y, int w, int h) const
void draw_label () const
void draw_label (int, int, int, int) const

Friends

class Fl_Group

Detailed Description

Fl_Widget is the base class for all widgets in FLTK.

You can't create one of these because the constructor is not public. However you can subclass it.

All "property" accessing methods, such as color(), parent(), or argument() are implemented as trivial inline functions and thus are as fast and small as accessing fields in a structure. Unless otherwise noted, the property setting methods such as color(n) or label(s) are also trivial inline functions, even if they change the widget's appearance. It is up to the user code to call redraw() after these.

Definition at line 109 of file Fl_Widget.H.


Member Enumeration Documentation

anonymous enum [protected]

flags possible values enumeration. See activate(), output(), visible(), changed(), set_visible_focus()

Enumerator:
INACTIVE 

the widget can't receive focus, and is disabled but potentially visible

INVISIBLE 

the widget is not drawn but can receive events

OUTPUT 

for output only

NOBORDER 

don't draw a decoration (Fl_Window)

FORCE_POSITION 

don't let the window manager position the window (Fl_Window)

NON_MODAL 

thisis a hovering toolbar window (Fl_Window)

SHORTCUT_LABEL 

the label contains a shortcut we need to draw

CHANGED 

the widget value changed

OVERRIDE 

position window on top (Fl_Window)

VISIBLE_FOCUS 

accepts keyboard focus navigation if the widget can have the focus

COPIED_LABEL 

the widget label is internally copied, its destruction is handled by the widget

CLIP_CHILDREN 

all drawing within this widget will be clipped (Fl_Group)

MENU_WINDOW 

a temporary popup window, dismissed by clicking outside (Fl_Window)

TOOLTIP_WINDOW 

a temporary popup, transparent to events, and dismissed easily (Fl_Window)

MODAL 

a window blocking input to all other winows (Fl_Window)

NO_OVERLAY 

window not using a hardware overlay plane (Fl_Menu_Window)

GROUP_RELATIVE 

position this idget relative to the parent group, not to the window

COPIED_TOOLTIP 

the widget tooltip is internally copied, its destruction is handled by the widget

USERFLAG3 

reserved for 3rd party extensions

USERFLAG2 

reserved for 3rd party extensions

USERFLAG1 

reserved for 3rd party extensions

Definition at line 163 of file Fl_Widget.H.


Constructor & Destructor Documentation

Fl_Widget::Fl_Widget ( int  x,
int  y,
int  w,
int  h,
const char *  label = 0L 
) [protected]

Creates a widget at the given position and size.

The Fl_Widget is a protected constructor, but all derived widgets have a matching public constructor. It takes a value for x(), y(), w(), h(), and an optional value for label().

Parameters:
[in]x,ythe position of the widget relative to the enclosing window
[in]w,hsize of the widget in pixels
[in]labeloptional text for the widget label

Definition at line 113 of file Fl_Widget.cxx.

References Fl_Group::add(), Fl_Label::align_, Fl_Label::color, Fl_Group::current(), default_callback(), Fl_Label::deimage, FL_ALIGN_CENTER, FL_FOREGROUND_COLOR, FL_GRAY, FL_HELVETICA, FL_NO_BOX, FL_NORMAL_LABEL, FL_NORMAL_SIZE, FL_WHEN_RELEASE, Fl_Label::font, H, Fl_Label::image, Fl_Label::size, Fl_Label::type, Fl_Label::value, and VISIBLE_FOCUS.

Fl_Widget::~Fl_Widget ( ) [virtual]

Destroys the widget. Destroying single widgets is not very common. You almost always want to destroy the parent group instead, which will destroy all of the child widgets and groups in that group.

Since:
FLTK 1.3, the widget's destructor removes the widget from its parent group, if it is member of a group.

Destroys the widget, taking care of throwing focus before if any. Destruction removes the widget from any parent group! And groups when destroyed destroy all their children. This is convenient and fast.

Definition at line 168 of file Fl_Widget.cxx.

References Fl::clear_widget_pointer(), COPIED_LABEL, COPIED_TOOLTIP, default_callback(), fl_throw_focus(), flags(), Fl_Group::remove(), and Fl_Label::value.


Member Function Documentation

unsigned int Fl_Widget::active ( ) const [inline]
Fl_Align Fl_Widget::align ( ) const [inline]

Gets the label alignment.

Returns:
label alignment
See also:
label(), align(Fl_Align), Fl_Align

Definition at line 344 of file Fl_Widget.H.

Referenced by align_cb(), align_position_cb(), align_text_image_cb(), Fl_Scroll::bbox(), Fl_Browser_::bbox(), Fl_Widget_Type::copy_properties(), Fl_Scroll_Type::copy_properties(), Fl_Browser_::draw(), draw_backdrop(), draw_label(), Fl_Group::draw_outside_label(), Fl_Window_Type::draw_overlay(), Fl_Browser_::Fl_Browser_(), Fl_Chart::Fl_Chart(), Fl_Choice::Fl_Choice(), Fl_Clock_Output::Fl_Clock_Output(), Fl_Counter::Fl_Counter(), Fl_File_Chooser::Fl_File_Chooser(), Fl_FormsBitmap::Fl_FormsBitmap(), Fl_FormsPixmap::Fl_FormsPixmap(), Fl_Group::Fl_Group(), Fl_Input_::Fl_Input_(), Fl_Input_Choice::Fl_Input_Choice(), Fl_Light_Button::Fl_Light_Button(), Fl_Positioner::Fl_Positioner(), Fl_Progress::Fl_Progress(), fl_set_object_lalign(), Fl_Spinner::Fl_Spinner(), Fl_Timer::Fl_Timer(), Fl_Valuator::Fl_Valuator(), Fl_Value_Input::Fl_Value_Input(), Fl_Value_Output::Fl_Value_Output(), make_about_panel(), make_class_panel(), make_code_panel(), make_codeblock_panel(), make_comment_panel(), make_data_panel(), make_decl_panel(), make_declblock_panel(), make_function_panel(), make_global_settings_window(), make_layout_window(), make_print_panel(), make_project_window(), make_settings_window(), make_shell_window(), make_sourceview(), make_template_panel(), make_widget_panel(), make_widgetbin(), Fl_Widget_Type::read_fdesign(), Fl_Widget_Type::read_property(), redraw_label(), Fl::reload_scheme(), Fl_File_Chooser::rescan_keep_filename(), Fl_Scroll::resize(), Fl_Browser_::resize(), Fl_Browser_::scrollbar_left(), Fl_Browser_::scrollbar_right(), Fl_Window::show(), Fl_Widget_Type::write_properties(), and Fl_Widget_Type::write_widget_code().

void Fl_Widget::align ( Fl_Align  alignment) [inline]

Sets the label alignment. This controls how the label is displayed next to or inside the widget. The default value is FL_ALIGN_CENTER, which centers the label inside the widget.

Parameters:
[in]alignmentnew label alignment
See also:
align(), Fl_Align

Definition at line 353 of file Fl_Widget.H.

long Fl_Widget::argument ( ) const [inline]

Gets the current user data (long) argument that is passed to the callback function.

Definition at line 599 of file Fl_Widget.H.

Referenced by align_cb().

void Fl_Widget::argument ( long  v) [inline]

Sets the current user data (long) argument that is passed to the callback function.

Todo:
The user data value must be implemented using intptr_t or similar to avoid 64-bit machine incompatibilities.

Definition at line 605 of file Fl_Widget.H.

virtual class Fl_Gl_Window* Fl_Widget::as_gl_window ( ) [inline, virtual]

Returns an Fl_Gl_Window pointer if this widget is an Fl_Gl_Window.

Use this method if you have a widget (pointer) and need to know whether this widget is derived from Fl_Gl_Window. If it returns non-NULL, then the widget in question is derived from Fl_Gl_Window.

Return values:
NULLif this widget is not derived from Fl_Gl_Window.
Note:
This method is provided to avoid dynamic_cast.
See also:
Fl_Widget::as_group(), Fl_Widget::as_window()

Reimplemented in Fl_Gl_Window.

Definition at line 981 of file Fl_Widget.H.

Referenced by Fl_Gl_Device_Plugin::print(), and Fl_Paged_Device::print_widget().

virtual Fl_Group* Fl_Widget::as_group ( ) [inline, virtual]

Returns an Fl_Group pointer if this widget is an Fl_Group.

Use this method if you have a widget (pointer) and need to know whether this widget is derived from Fl_Group. If it returns non-NULL, then the widget in question is derived from Fl_Group, and you can use the returned pointer to access its children or other Fl_Group-specific methods.

Example:

      void my_callback (Fl_Widget *w, void *) {
        Fl_Group *g = w->as_group();
        if (g)
          printf ("This group has %d children\n",g->children());
        else
          printf ("This widget is not a group!\n");
      }
Return values:
NULLif this widget is not derived from Fl_Group.
Note:
This method is provided to avoid dynamic_cast.
See also:
Fl_Widget::as_window(), Fl_Widget::as_gl_window()

Reimplemented in Fl_Group.

Definition at line 955 of file Fl_Widget.H.

virtual Fl_Window* Fl_Widget::as_window ( ) [inline, virtual]

Returns an Fl_Window pointer if this widget is an Fl_Window.

Use this method if you have a widget (pointer) and need to know whether this widget is derived from Fl_Window. If it returns non-NULL, then the widget in question is derived from Fl_Window, and you can use the returned pointer to access its children or other Fl_Window-specific methods.

Return values:
NULLif this widget is not derived from Fl_Window.
Note:
This method is provided to avoid dynamic_cast.
See also:
Fl_Widget::as_group(), Fl_Widget::as_gl_window()

Reimplemented in Fl_Window.

Definition at line 969 of file Fl_Widget.H.

Referenced by Fl_Group::draw_outside_label(), and Fl_Paged_Device::print_widget().

Fl_Boxtype Fl_Widget::box ( ) const [inline]

Gets the box type of the widget.

Returns:
the current box type
See also:
box(Fl_Boxtype), Fl_Boxtype

Definition at line 359 of file Fl_Widget.H.

Referenced by menuwindow::autoscroll(), Fl_Scroll::bbox(), Fl_Browser_::bbox(), box_cb(), ColorChip::ColorChip(), Fl_Widget_Type::copy_properties(), Fl_Timer::draw(), Fl_FormsPixmap::draw(), Fl_FormsBitmap::draw(), Fl_Window::draw(), Fl_Value_Slider::draw(), Fl_Value_Output::draw(), Fl_Value_Input::draw(), Fl_Tree::draw(), Fl_Text_Display::draw(), Fl_Tabs::draw(), Fl_Table::draw(), Fl_Slider::draw(), Fl_Scrollbar::draw(), Fl_Scroll::draw(), Fl_Roller::draw(), Fl_Return_Button::draw(), Fl_Progress::draw(), Fl_Positioner::draw(), Fl_Pack::draw(), Fl_Menu_Button::draw(), Fl_Menu_Bar::draw(), Fl_Menu_Item::draw(), Fl_Light_Button::draw(), Fl_Input::draw(), Fl_File_Input::draw(), Fl_Dial::draw(), Fl_Counter::draw(), Flcc_ValueBox::draw(), Flcc_HueBox::draw(), Fl_Clock_Output::draw(), Fl_Choice::draw(), Fl_Chart::draw(), Fl_Button::draw(), Fl_Browser_::draw(), Fl_Adjuster::draw(), Fl_Group::draw_children(), draw_focus(), draw_label(), Fl_Input_::drawtext(), menuwindow::find_selected(), Fl_Adjuster::Fl_Adjuster(), fl_bgn_form(), Fl_Box::Fl_Box(), Fl_Browser_::Fl_Browser_(), Fl_Button::Fl_Button(), Fl_Chart::Fl_Chart(), Fl_Check_Button::Fl_Check_Button(), Fl_Choice::Fl_Choice(), Fl_Clock::Fl_Clock(), Fl_Clock_Output::Fl_Clock_Output(), Fl_Color_Chooser::Fl_Color_Chooser(), Fl_Counter::Fl_Counter(), Fl_Dial::Fl_Dial(), Fl_File_Chooser::Fl_File_Chooser(), Fl_FormsBitmap::Fl_FormsBitmap(), Fl_FormsPixmap::Fl_FormsPixmap(), Fl_Help_Dialog::Fl_Help_Dialog(), Fl_Hor_Nice_Slider::Fl_Hor_Nice_Slider(), Fl_Input_::Fl_Input_(), Fl_Input_Choice::Fl_Input_Choice(), Fl_Menu_::Fl_Menu_(), Fl_Nice_Slider::Fl_Nice_Slider(), Fl_Positioner::Fl_Positioner(), Fl_Progress::Fl_Progress(), Fl_Roller::Fl_Roller(), Fl_Round_Button::Fl_Round_Button(), Fl_Round_Clock::Fl_Round_Clock(), Fl_Scrollbar::Fl_Scrollbar(), fl_set_object_boxtype(), Fl_Slider::Fl_Slider(), Fl_Table::Fl_Table(), Fl_Tabs::Fl_Tabs(), Fl_Text_Display::Fl_Text_Display(), Fl_Timer::Fl_Timer(), Fl_Tree::Fl_Tree(), Fl_Value_Input::Fl_Value_Input(), Fl_Value_Output::Fl_Value_Output(), Fl_Wizard::Fl_Wizard(), Fl_Value_Slider::handle(), Fl_Slider::handle(), Fl_Menu_Button::handle(), Fl_Light_Button::handle(), Fl_Input::handle(), Flcc_ValueBox::handle(), Flcc_HueBox::handle(), Fl_Button::handle(), Flcc_ValueBox::handle_key(), Flcc_HueBox::handle_key(), Fl_Widget_Type::ideal_size(), Fl_Menu_Bar_Type::ideal_size(), Fl_Input_Choice_Type::ideal_size(), Fl_Choice_Type::ideal_size(), Fl_Value_Output_Type::ideal_size(), Fl_Value_Input_Type::ideal_size(), Fl_Output_Type::ideal_size(), Fl_Help_View_Type::ideal_size(), Fl_Text_Editor_Type::ideal_size(), Fl_Text_Display_Type::ideal_size(), Fl_File_Input_Type::ideal_size(), Fl_Input_Type::ideal_size(), Fl_Spinner_Type::ideal_size(), Fl_File_Browser_Type::ideal_size(), Fl_Check_Browser_Type::ideal_size(), Fl_Browser_Type::ideal_size(), live_mode_cb(), make_class_panel(), make_code_panel(), make_comment_panel(), make_data_panel(), make_decl_panel(), make_function_panel(), make_global_settings_window(), make_layout_window(), make_main_window(), make_print_panel(), make_project_window(), make_shell_window(), make_sourceview(), make_template_panel(), make_widget_panel(), make_widgetbin(), menuwindow::menuwindow(), Fl_Menu_Button::popup(), Fl_Window_Type::read_fdesign(), Fl_Widget_Type::read_fdesign(), Fl_Widget_Type::read_property(), Fl_Table::recalc_dimensions(), redraw_label(), Fl_Tabs::redraw_tabs(), Fl_Text_Display::resize(), Fl_Help_View::resize(), Fl_Button::value(), Fl_Widget_Type::write_properties(), and Fl_Widget_Type::write_widget_code().

void Fl_Widget::box ( Fl_Boxtype  new_box) [inline]

Sets the box type for the widget. This identifies a routine that draws the background of the widget. See Fl_Boxtype for the available types. The default depends on the widget, but is usually FL_NO_BOX or FL_UP_BOX.

Parameters:
[in]new_boxthe new box type
See also:
box(), Fl_Boxtype

Definition at line 368 of file Fl_Widget.H.

void Fl_Widget::callback ( Fl_Callback0 cb) [inline]

Sets the current callback function for the widget. Each widget has a single callback.

Parameters:
[in]cbnew callback

Definition at line 576 of file Fl_Widget.H.

void Fl_Widget::callback ( Fl_Callback1 cb,
long  p = 0 
) [inline]

Sets the current callback function for the widget. Each widget has a single callback.

Parameters:
[in]cbnew callback
[in]puser data

Definition at line 583 of file Fl_Widget.H.

void Fl_Widget::callback ( Fl_Callback cb) [inline]

Sets the current callback function for the widget. Each widget has a single callback.

Parameters:
[in]cbnew callback

Definition at line 570 of file Fl_Widget.H.

void Fl_Widget::callback ( Fl_Callback cb,
void *  p 
) [inline]

Sets the current callback function for the widget. Each widget has a single callback.

Parameters:
[in]cbnew callback
[in]puser data

Definition at line 564 of file Fl_Widget.H.

unsigned int Fl_Widget::changed ( ) const [inline]

Checks if the widget value changed since the last callback.

"Changed" is a flag that is turned on when the user changes the value stored in the widget. This is only used by subclasses of Fl_Widget that store values, but is in the base class so it is easier to scan all the widgets in a panel and do_callback() on the changed ones in response to an "OK" button.

Most widgets turn this flag off when they do the callback, and when the program sets the stored value.

Return values:
0if the value did not change
See also:
set_changed(), clear_changed()

Reimplemented in Fl_Input_Choice.

Definition at line 774 of file Fl_Widget.H.

References CHANGED.

Referenced by Fl_Input_Choice::changed(), Fl_Positioner::handle(), Shortcut_Button::handle(), Fl_Text_Editor::maybe_do_callback(), Fl_Input_::maybe_do_callback(), Fl_Menu_::picked(), Fl_Table_Row::select_all_rows(), Fl_Tree::select_only(), and set_cb().

void Fl_Widget::clear_changed ( ) [inline]
void Fl_Widget::clear_damage ( uchar  c = 0) [inline]

Clears or sets the damage flags. Damage flags are cleared when parts of the widget drawing is repaired.

The optional argument c specifies the bits that are set after the call (default: 0) and not the bits that are cleared!

Note:
Therefore it is possible to set damage bits with this method, but this should be avoided. Use damage(uchar) instead.
Parameters:
[in]cnew bitmask of damage flags (default: 0)
See also:
damage(uchar), damage()

Definition at line 901 of file Fl_Widget.H.

Referenced by Fl_Value_Input::draw(), Fl_Pack::draw(), Fl_Browser_::draw(), Fl_Group::draw_child(), Fl_Overlay_Window::flush(), Fl_Double_Window::flush(), Fl::flush(), Fl_Overlay_Window::redraw_overlay(), and Fl_Group::update_child().

void Fl_Widget::clear_flag ( unsigned int  c) [inline, protected]
void Fl_Widget::clear_output ( ) [inline]

Sets a widget to accept input.

See also:
set_output(), output()

Definition at line 748 of file Fl_Widget.H.

References OUTPUT.

void Fl_Widget::clear_visible ( ) [inline]

Hides the widget. You must still redraw the parent to see a change in the window. Normally you want to use the hide() method instead.

Definition at line 693 of file Fl_Widget.H.

References INVISIBLE.

Referenced by Fl_Scroll::draw(), Fl_Browser_::draw(), Fl_Timer::Fl_Timer(), Fl_Window::Fl_Window(), Fl_Window::hide(), and Fl_Text_Display::resize().

void Fl_Widget::clear_visible_focus ( ) [inline]

Disables keyboard focus navigation with this widget. Normally, all widgets participate in keyboard focus navigation.

See also:
set_visible_focus(), visible_focus(), visible_focus(int)

Definition at line 807 of file Fl_Widget.H.

References VISIBLE_FOCUS.

Referenced by visible_focus().

Fl_Color Fl_Widget::color ( ) const [inline]

Gets the background color of the widget.

Returns:
current background color
See also:
color(Fl_Color), color(Fl_Color, Fl_Color)

Definition at line 374 of file Fl_Widget.H.

Referenced by Fl_Text_Display::clear_rect(), Fl_File_Chooser::color(), color2_cb(), color_cb(), Fl_Widget_Type::copy_properties(), Fl_Timer::draw(), Fl_FormsPixmap::draw(), Fl_FormsBitmap::draw(), Fl_Window::draw(), Fl_Value_Slider::draw(), Fl_Value_Output::draw(), Fl_Value_Input::draw(), Fl_Tree_Item::draw(), Fl_Text_Display::draw(), Fl_Tabs::draw(), Fl_Table::draw(), Fl_Scroll::draw(), Fl_Roller::draw(), Fl_Return_Button::draw(), Fl_Progress::draw(), Fl_Positioner::draw(), Fl_Pack::draw(), Fl_Menu_Button::draw(), Fl_Menu_Item::draw(), Fl_Light_Button::draw(), Fl_Input::draw(), Fl_File_Input::draw(), Fl_Dial::draw(), Fl_Counter::draw(), Fl_Clock_Output::draw(), Fl_Choice::draw(), Fl_Button::draw(), Fl_Browser_::draw(), Fl_Adjuster::draw(), draw_focus(), Fl_Text_Display::draw_string(), Fl_Input_::drawtext(), Fl_Browser_::Fl_Browser_(), Fl_FormsBitmap::Fl_FormsBitmap(), Fl_FormsPixmap::Fl_FormsPixmap(), Fl_Help_Dialog::Fl_Help_Dialog(), Fl_Help_View::Fl_Help_View(), Fl_Input_::Fl_Input_(), Fl_Progress::Fl_Progress(), Fl_Scrollbar::Fl_Scrollbar(), fl_set_object_color(), Fl_Table::Fl_Table(), Fl_Text_Display::Fl_Text_Display(), Fl_Tree::Fl_Tree(), Fl_Value_Input::Fl_Value_Input(), Fl_Choice::handle(), labelcolor_cb(), live_mode_cb(), make_about_panel(), make_code_panel(), make_comment_panel(), make_global_settings_window(), make_print_panel(), make_sourceview(), make_widget_panel(), menuwindow::menuwindow(), Fl_Widget_Type::read_fdesign(), Fl_Widget_Type::read_property(), textcolor_cb(), Fl_Widget_Type::write_properties(), and Fl_Widget_Type::write_widget_code().

void Fl_Widget::color ( Fl_Color  bg) [inline]

Sets the background color of the widget. The color is passed to the box routine. The color is either an index into an internal table of RGB colors or an RGB color value generated using fl_rgb_color().

The default for most widgets is FL_BACKGROUND_COLOR. Use Fl::set_color() to redefine colors in the color map.

Parameters:
[in]bgbackground color
See also:
color(), color(Fl_Color, Fl_Color), selection_color(Fl_Color)

Definition at line 386 of file Fl_Widget.H.

void Fl_Widget::color ( Fl_Color  bg,
Fl_Color  sel 
) [inline]

Sets the background and selection color of the widget.

The two color form sets both the background and selection colors.

Parameters:
[in]bgbackground color
[in]selselection color
See also:
color(unsigned), selection_color(unsigned)

Definition at line 411 of file Fl_Widget.H.

Fl_Color Fl_Widget::color2 ( ) const [inline]

For back compatibility only.

Deprecated:
Use selection_color() instead.

Definition at line 986 of file Fl_Widget.H.

void Fl_Widget::color2 ( unsigned  a) [inline]

For back compatibility only.

Deprecated:
Use selection_color(unsigned) instead.

Definition at line 991 of file Fl_Widget.H.

int Fl_Widget::contains ( const Fl_Widget w) const

Checks if w is a child of this widget.

Parameters:
[in]wpotential child widget
Returns:
Returns 1 if w is a child of this widget, or is equal to this widget. Returns 0 if w is NULL.

Definition at line 293 of file Fl_Widget.cxx.

Referenced by Fl::belowmouse(), Fl_Group::clear(), fl_fix_focus(), fl_throw_focus(), Fl_Table::handle(), Fl_Group::handle(), inside(), and take_focus().

void Fl_Widget::copy_label ( const char *  new_label)

Sets the current label. Unlike label(), this method allocates a copy of the label string instead of using the original string pointer.

The internal copy will automatically be freed whenever you assign a new label or when the widget is destroyed.

Parameters:
[in]new_labelthe new label text
See also:
label()

Reimplemented in Fl_Window.

Definition at line 314 of file Fl_Widget.cxx.

References clear_flag(), COPIED_LABEL, flags(), redraw_label(), set_flag(), and Fl_Label::value.

void Fl_Widget::copy_tooltip ( const char *  text)

Sets the current tooltip text. Unlike tooltip(), this method allocates a copy of the tooltip string instead of using the original string pointer.

The internal copy will automatically be freed whenever you assign a new tooltip or when the widget is destroyed.

If no tooltip is set, the tooltip of the parent is inherited. Setting a tooltip for a group and setting no tooltip for a child will show the group's tooltip instead. To avoid this behavior, you can set the child's tooltip to an empty string ("").

Parameters:
[in]textNew tooltip text (an internal copy is made and managed)
See also:
tooltip(const char*), tooltip()

Definition at line 330 of file Fl_Tooltip.cxx.

References clear_flag(), COPIED_TOOLTIP, flags(), and set_flag().

uchar Fl_Widget::damage ( ) const [inline]

Returns non-zero if draw() needs to be called. The damage value is actually a bit field that the widget subclass can use to figure out what parts to draw.

Returns:
a bitmap of flags describing the kind of damage to the widget
See also:
damage(uchar), clear_damage(uchar)

Definition at line 887 of file Fl_Widget.H.

Referenced by Fl_Slider::bounds(), Fl_Text_Display::buffer_modified_cb(), damage(), Fl_Window::draw(), Fl_Value_Slider::draw(), Fl_Value_Output::draw(), Fl_Value_Input::draw(), Fl_Text_Display::draw(), Fl_Tabs::draw(), Fl_Table::draw(), Fl_Slider::draw(), Fl_Scrollbar::draw(), Fl_Scroll::draw(), Fl_Roller::draw(), Fl_Pack::draw(), Fl_Input::draw(), Fl_Group::draw(), Fl_File_Input::draw(), Fl_Dial::draw(), Fl_Counter::draw(), Flcc_ValueBox::draw(), Flcc_HueBox::draw(), Fl_Browser_::draw(), Fl_Group::draw_children(), Fl_Input_::drawtext(), fl_handle(), Fl_Overlay_Window::flush(), Fl_Double_Window::flush(), Fl::flush(), Fl_Scrollbar::handle(), Fl_File_Input::handle(), Fl_Button::handle(), Fl_Input_::handletext(), Fl_Text_Display::highlight_data(), Fl_Color_Chooser::hsv(), Fl_Input_::position(), Fl_Paged_Device::print_widget(), Fl_Text_Display::redisplay_range(), redraw(), redraw_label(), Fl_Browser_::redraw_line(), Fl_Overlay_Window::redraw_overlay(), Fl_Table::redraw_range(), Fl_Tabs::redraw_tabs(), Fl_Color_Chooser::rgb(), Fl_Text_Display::scroll_(), Fl_Scroll::scroll_to(), menuwindow::set_selected(), Fl_Slider::slider_size(), Fl_Group::update_child(), Fl_File_Input::value(), Fl_Clock_Output::value(), Fl_Valuator::value_damage(), and Fl_Input_::yscroll().

void Fl_Widget::damage ( uchar  c)

Sets the damage bits for the widget. Setting damage bits will schedule the widget for the next redraw.

Parameters:
[in]cbitmask of flags to set
See also:
damage(), clear_damage(uchar)

Definition at line 1469 of file Fl.cxx.

References damage(), FL_DAMAGE_CHILD, FL_WINDOW, h(), i, Fl_X::region, type(), w(), x(), XDestroyRegion(), and y().

void Fl_Widget::damage ( uchar  c,
int  x,
int  y,
int  w,
int  h 
)

Sets the damage bits for an area inside the widget. Setting damage bits will schedule the widget for the next redraw.

Parameters:
[in]cbitmask of flags to set
[in]x,y,w,hsize of damaged area
See also:
damage(), clear_damage(uchar)

Definition at line 1483 of file Fl.cxx.

References damage(), FL_DAMAGE_CHILD, FL_WINDOW, H, h(), XRectangle::height, i, parent(), Fl_X::region, type(), w(), XRectangle::width, XRectangle::x, XDestroyRegion(), XRectangleRegion(), and XRectangle::y.

int Fl_Widget::damage_resize ( int  X,
int  Y,
int  W,
int  H 
)

Internal use only.

Definition at line 145 of file Fl_Widget.cxx.

References h(), redraw(), resize(), w(), x(), and y().

Referenced by Fl_Browser_::draw(), and Fl_Tile::position().

void Fl_Widget::deactivate ( )

Deactivates the widget. Inactive widgets will be drawn "grayed out", e.g. with less contrast than the active widget. Inactive widgets will not receive any keyboard or mouse button events. Other events (including FL_ENTER, FL_MOVE, FL_LEAVE, FL_SHORTCUT, and others) will still be sent. A widget is only active if active() is true on it and all of its parents.

Changing this value will send FL_DEACTIVATE to the widget if active_r() is true.

Currently you cannot deactivate Fl_Window widgets.

See also:
activate(), active(), active_r()

Reimplemented in Fl_Repeat_Button.

Definition at line 243 of file Fl_Widget.cxx.

References active_r(), FL_DEACTIVATE, fl_throw_focus(), handle(), INACTIVE, redraw(), redraw_label(), and set_flag().

Referenced by active_cb(), align_cb(), align_position_cb(), align_text_image_cb(), box_cb(), color2_cb(), color_cb(), Fl_Widget_Type::copy_properties(), Fl_Repeat_Button::deactivate(), do_shell_command(), down_box_cb(), fl_deactivate_form(), fl_deactivate_object(), Fl_Help_Dialog::Fl_Help_Dialog(), h_cb(), hotspot_cb(), image_browse_cb(), image_cb(), inactive_browse_cb(), inactive_cb(), make_print_panel(), max_cb(), min_cb(), new_cb(), print_cb(), print_menu_cb(), Fl_Widget_Type::read_property(), Fl_File_Chooser::rescan(), Fl_File_Chooser::rescan_keep_filename(), resizable_cb(), save_template_cb(), slider_size_cb(), Fl_PostScript_Printer::start_job(), step_cb(), subclass_cb(), subtype_cb(), textcolor_cb(), textfont_cb(), Fl_Help_Dialog::textsize(), textsize_cb(), tooltip_cb(), Fl_File_Chooser::type(), Fl_File_Chooser::value(), value_cb(), visible_cb(), w_cb(), when_button_cb(), when_cb(), x_cb(), and y_cb().

void Fl_Widget::default_callback ( Fl_Widget cb,
void *  d 
) [static]

Sets the default callback for all widgets. Sets the default callback, which puts a pointer to the widget on the queue returned by Fl::readqueue(). You may want to call this from your own callback.

Parameters:
[in]cbthe new callback
[in]duser data associated with that callback
See also:
callback(), do_callback(), Fl::readqueue()

Definition at line 48 of file Fl_Widget.cxx.

References obj_tail, parent(), and QUEUE_SIZE.

Referenced by Fl::default_atclose(), do_callback(), Fl_Widget(), and ~Fl_Widget().

const Fl_Image* Fl_Widget::deimage ( ) const [inline]

Definition at line 530 of file Fl_Widget.H.

void Fl_Widget::deimage ( Fl_Image img) [inline]

Sets the image to use as part of the widget label. This image is used when drawing the widget in the inactive state.

Parameters:
[in]imgthe new image for the deactivated widget

Definition at line 542 of file Fl_Widget.H.

Fl_Image* Fl_Widget::deimage ( ) [inline]

Gets the image that is used as part of the widget label. This image is used when drawing the widget in the inactive state.

Returns:
the current image for the deactivated widget

Definition at line 529 of file Fl_Widget.H.

Referenced by Fluid_Image::deimage(), draw_backdrop(), and Fl_Widget_Type::setinactive().

void Fl_Widget::deimage ( Fl_Image img) [inline]

Sets the image to use as part of the widget label. This image is used when drawing the widget in the inactive state.

Parameters:
[in]imgthe new image for the deactivated widget

Definition at line 536 of file Fl_Widget.H.

void Fl_Widget::do_callback ( Fl_Widget o,
long  arg 
) [inline]

Calls the widget callback. Causes a widget to invoke its callback function with arbitrary arguments.

Parameters:
[in]ocall the callback with o as the widget argument
[in]argcall the callback with arg as the user data argument
See also:
callback()

Definition at line 842 of file Fl_Widget.H.

References do_callback().

Referenced by do_callback().

void Fl_Widget::do_callback ( Fl_Widget o,
void *  arg = 0 
)

Calls the widget callback.

Causes a widget to invoke its callback function with arbitrary arguments.

Parameters:
[in]ocall the callback with o as the widget argument
[in]arguse arg as the user data argument
See also:
callback()

Definition at line 335 of file Fl_Widget.cxx.

References clear_changed(), default_callback(), and Fl_Widget_Tracker::deleted().

virtual void Fl_Widget::draw ( ) [pure 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()

Implemented in Fl_Adjuster, Fl_Box, Fl_Browser_, Fl_Button, Fl_Chart, Fl_Choice, Fl_Clock_Output, Flcc_HueBox, Flcc_ValueBox, Fl_Counter, Fl_Dial, Fl_File_Input, Fl_FormsBitmap, Fl_FormsPixmap, Fl_Free, Fl_Gl_Window, Fl_Group, Fl_Input, Fl_Light_Button, Fl_Menu_Bar, Fl_Menu_Button, Fl_Pack, Fl_Positioner, Fl_Progress, Fl_Return_Button, Fl_Roller, Fl_Scroll, Fl_Scrollbar, Fl_Slider, Fl_Table, Fl_Tabs, Fl_Text_Display, Fl_Timer, Fl_Tree, Fl_Value_Input, Fl_Value_Output, Fl_Value_Slider, Fl_Window, Fl_Glut_Window, Shortcut_Button, and Fl_TooltipBox.

Referenced by Fl_Value_Input::draw(), Fl_Group::draw_child(), Fl_Paged_Device::print_widget(), and Fl_Group::update_child().

void Fl_Widget::draw_backdrop ( ) const [protected]

If FL_ALIGN_IMAGE_BACKDROP is set, the image or deimage will be drawn

Definition at line 406 of file fl_boxtype.cxx.

References active_r(), align(), deimage(), FL_ALIGN_IMAGE_BACKDROP, and image().

Referenced by Fl_Button::draw(), and draw_box().

void Fl_Widget::draw_box ( Fl_Boxtype  t,
Fl_Color  c 
) const [protected]

Draws a box of type t, of color c at the widget's position and size.

Definition at line 417 of file fl_boxtype.cxx.

References draw_box().

void Fl_Widget::draw_box ( Fl_Boxtype  t,
int  X,
int  Y,
int  W,
int  H,
Fl_Color  c 
) const [protected]

Draws a box of type t, of color c at the position X,Y and size W,H.

Definition at line 421 of file fl_boxtype.cxx.

References active_r().

void Fl_Widget::draw_focus ( ) [inline, protected]
void Fl_Widget::draw_focus ( Fl_Boxtype  B,
int  X,
int  Y,
int  W,
int  H 
) const [protected]
void Fl_Widget::draw_label ( int  X,
int  Y,
int  W,
int  H,
Fl_Align  a 
) const

Draws the label in an arbitrary bounding box with an arbitrary alignment. Anybody can call this to force the label to draw anywhere.

Definition at line 127 of file fl_labeltype.cxx.

References active_r(), Fl_Label::color, Fl_Label::deimage, Fl_Label::draw(), fl_draw_shortcut, fl_inactive(), flags(), Fl_Label::image, and SHORTCUT_LABEL.

void Fl_Widget::draw_label ( int  X,
int  Y,
int  W,
int  H 
) const [protected]

Draws the label in an arbitrary bounding box. draw() can use this instead of draw_label(void) to change the bounding box

Definition at line 118 of file fl_labeltype.cxx.

References align(), draw_label(), and FL_ALIGN_INSIDE.

void Fl_Widget::h ( int  v) [inline, protected]

Internal use only. Use position(int,int), size(int,int) or resize(int,int,int,int) instead.

Definition at line 153 of file Fl_Widget.H.

Referenced by Fl_File_Chooser::add_extra(), align_widget_cb(), Fl_Scroll::bbox(), Fl_Tabs::client_area(), damage(), Fl_Text_Display::draw(), Fl_Table::draw(), Fl_Scroll::draw(), Fl_Pack::draw(), Fl_Group::draw_child(), Fl_Group::draw_outside_label(), Fl_Window_Type::draw_overlay(), Fl_Window_Type::enter_live_mode(), Fl_Widget_Type::enter_live_mode(), Fl_Scroll_Type::enter_live_mode(), Fl_Table_Type::enter_live_mode(), Fl_Tabs_Type::enter_live_mode(), Fl_Group_Type::enter_live_mode(), Fl_X::fake_X_wm(), fix_group_size(), Fl_File_Chooser::Fl_File_Chooser(), fl_get_object_geometry(), Fl_Native_File_Chooser::Fl_Native_File_Chooser(), fl_scale_form(), fl_show_form(), Fl_Group::forms_end(), group_cb(), Fl_Help_Dialog::h(), Fl_Tile::handle(), Fl::handle(), Fl_Window_Type::handle(), Fl_Window::hotspot(), Fl_Choice_Type::ideal_size(), Fl_Return_Button_Type::ideal_size(), live_mode_cb(), Fl_X::make(), Fl_Widget_Type::make(), make_codeblock_panel(), Fl_Window::make_current(), make_declblock_panel(), make_widget_panel(), Fl_X::make_xid(), menuwindow::menuwindow(), Fl_Window_Type::newposition(), Fl_Tile::position(), Fl_File_Chooser::preview(), Fl_Paged_Device::print_widget(), Fl_Menu_Item::pulldown(), Fl_Window_Type::read_fdesign(), Fl_Widget_Type::read_fdesign(), Fl_File_Chooser::rescan_keep_filename(), Fl_Tile::resize(), Fl_Scroll::resize(), Fl_Group::resize(), save_position(), Fl_X::sendxjunk(), set_max_size_cb(), set_min_size_cb(), Fl_Group::sizes(), Fl_Group::update_child(), w_cb(), Fl_Widget_Class_Type::write_code1(), Fl_Widget_Type::write_code1(), Fl_Widget_Type::write_properties(), x_cb(), and y_cb().

int Fl_Widget::h ( ) const [inline]

Gets the widget height.

Returns:
the height of the widget in pixels.

Definition at line 295 of file Fl_Widget.H.

Referenced by Fl_Scroll::bbox(), Fl_Browser_::bbox(), Fl_Text_Display::buffer(), Fl_Tabs::client_area(), damage(), damage_resize(), Fl_Tree::displayed(), Fl_Timer::draw(), Fl_FormsPixmap::draw(), Fl_FormsBitmap::draw(), Fl_Window::draw(), Fl_Value_Slider::draw(), Fl_Value_Output::draw(), Fl_Tree::draw(), Fl_TooltipBox::draw(), Fl_Text_Display::draw(), Fl_Tabs::draw(), Fl_Table::draw(), Fl_Slider::draw(), Fl_Scrollbar::draw(), Fl_Scroll::draw(), Fl_Roller::draw(), Fl_Return_Button::draw(), Fl_Progress::draw(), Fl_Positioner::draw(), Fl_Pack::draw(), Fl_Menu_Button::draw(), Fl_Menu_Bar::draw(), Fl_Light_Button::draw(), Fl_Input::draw(), Fl_File_Input::draw(), Fl_Dial::draw(), Fl_Counter::draw(), Flcc_ValueBox::draw(), Flcc_HueBox::draw(), Fl_Clock_Output::draw(), Fl_Choice::draw(), Fl_Chart::draw(), Fl_Browser_::draw(), Fl_Adjuster::draw(), Shortcut_Button::draw(), Fl_Group::draw_children(), Fl_Group::draw_outside_label(), menuwindow::find_selected(), Fl_Table::Fl_Table(), Fl_Double_Window::flush(), Fl_Group::forms_end(), Fl_Window::fullscreen(), Fl_Value_Slider::handle(), Fl_Tree::handle(), Fl_Tabs::handle(), Fl_Table::handle(), Fl_Slider::handle(), Fl_Scrollbar::handle(), Fl_Positioner::handle(), Fl_Menu_Bar::handle(), Fl_Input::handle(), Fl_Dial::handle(), Flcc_ValueBox::handle(), Flcc_HueBox::handle(), Fl_Choice::handle(), Fl_Button::handle(), Fl_Adjuster::handle(), Flcc_ValueBox::handle_key(), Flcc_HueBox::handle_key(), Fl_Input_::handletext(), Fl_Window::hotspot(), menuwindow::is_inside(), Fl_Input_::linesPerPage(), Fl_Window::make_current(), menuwindow::menuwindow(), Fl_Menu_Button::popup(), Overlay_Window::read_image(), Fl_Table::recalc_dimensions(), redraw_label(), Fl_Tabs::redraw_tabs(), Fl_Tile::resize(), Fl_Scroll::resize(), Fl_Overlay_Window::resize(), Fl_Window::resize(), Fl_Input_::resize(), Fl_Help_View::resize(), Fl_Group::resize(), Fl_Double_Window::resize(), Overlay_Window::resize(), Fl_Text_Display::scroll(), Fl_Tree::scrollbar_size(), Fl_Window::show(), Fl_Text_Display::show_insert_position(), Fl_Tree::show_item_bottom(), Fl_Tree::show_item_middle(), Fl_Group::sizes(), Fl_Help_View::topline(), Fl_Tabs::which(), and Fl_Text_Display::wrap_mode().

int Fl_Widget::handle ( int  event) [virtual]

Handles the specified event. You normally don't call this method directly, but instead let FLTK do it when the user interacts with the widget.

When implemented in a widget, this function must return 0 if the widget does not use the event or 1 otherwise.

Most of the time, you want to call the inherited handle() method in your overridden method so that you don't short-circuit events that you don't handle. In this last case you should return the callee retval.

Parameters:
[in]eventthe kind of event received
Return values:
0if the event was not used or understood
1if the event was used and can be deleted
See also:
Fl_Event

Reimplemented in Fl_Adjuster, Fl_Box, Fl_Browser_, Fl_Button, Fl_Check_Browser, Fl_Choice, Fl_Clock, Flcc_HueBox, Flcc_ValueBox, Fl_Counter, Fl_Dial, Fl_File_Input, Fl_Free, Fl_Gl_Window, Fl_Group, Fl_Input, Fl_Light_Button, Fl_Menu_Bar, Fl_Menu_Button, Fl_Positioner, Fl_Repeat_Button, Fl_Return_Button, Fl_Roller, Fl_Scroll, Fl_Scrollbar, Fl_Slider, Fl_Spinner, Fl_Table, Fl_Table_Row, Fl_Tabs, Fl_Text_Display, Fl_Text_Editor, Fl_Tile, Fl_Timer, Fl_Tree, Fl_Value_Input, Fl_Value_Output, Fl_Value_Slider, Fl_Window, Fl_Glut_Window, CodeViewer, Widget_Browser, Overlay_Window, Shortcut_Button, and menuwindow.

Definition at line 106 of file Fl_Widget.cxx.

Referenced by activate(), Fl::belowmouse(), Fl_Input_Choice_Type::click_test(), Fl_Menu_Type::click_test(), deactivate(), Fl::dnd(), FLDropTarget::Drop(), fl_fix_focus(), fl_handle(), Fl::focus(), Fl_Group::handle(), Fl_Input_::handletext(), hide(), Fl::paste(), show(), and take_focus().

void Fl_Widget::image ( Fl_Image img) [inline]

Sets the image to use as part of the widget label. This image is used when drawing the widget in the active state.

Parameters:
[in]imgthe new image for the label

Definition at line 517 of file Fl_Widget.H.

void Fl_Widget::image ( Fl_Image img) [inline]

Sets the image to use as part of the widget label. This image is used when drawing the widget in the active state.

Parameters:
[in]imgthe new image for the label

Definition at line 523 of file Fl_Widget.H.

const Fl_Image* Fl_Widget::image ( ) const [inline]

Definition at line 511 of file Fl_Widget.H.

int Fl_Widget::inside ( const Fl_Widget w) const [inline]

Checks if this widget is a child of w. Returns 1 if this widget is a child of w, or is equal to w. Returns 0 if w is NULL.

Parameters:
[in]wthe possible parent widget.
See also:
contains()

Definition at line 868 of file Fl_Widget.H.

References contains().

Referenced by activate(), and show().

void Fl_Widget::label ( const char *  text)

Sets the current label pointer.

The label is shown somewhere on or next to the widget. The passed pointer is stored unchanged in the widget (the string is not copied), so if you need to set the label to a formatted value, make sure the buffer is static, global, or allocated. The copy_label() method can be used to make a copy of the label string automatically.

Parameters:
[in]textpointer to new label text
See also:
copy_label()

Reimplemented in Fl_Window.

Definition at line 300 of file Fl_Widget.cxx.

References clear_flag(), COPIED_LABEL, flags(), redraw_label(), and Fl_Label::value.

void Fl_Widget::label ( Fl_Labeltype  a,
const char *  b 
) [inline]

Shortcut to set the label text and type in one call.

See also:
label(const char *), labeltype(Fl_Labeltype)

Definition at line 446 of file Fl_Widget.H.

References b.

unsigned int Fl_Widget::label_shortcut ( const char *  t) [static]

Returns the Unicode value of the '&x' shortcut in a given text.

The given text t (usually a widget's label or a menu text) is searched for a '&x' shortcut label, and if found, the Unicode value of the '&x' shortcut is returned.

Parameters:
ttext or label to search for '&x' shortcut.
Returns:
Unicode (UCS-4) value of shortcut in t or 0.
Note:
Internal use only.

Definition at line 309 of file fl_shortcut.cxx.

References fl_utf8decode().

Referenced by test_shortcut().

void Fl_Widget::labelcolor ( Fl_Color  c) [inline]

Sets the label color. The default color is FL_FOREGROUND_COLOR.

Parameters:
[in]cthe new label color

Definition at line 474 of file Fl_Widget.H.

void Fl_Widget::labelfont ( Fl_Font  f) [inline]

Sets the font to use. Fonts are identified by indexes into a table. The default value uses a Helvetica typeface (Arial for Microsoft® Windows®). The function Fl::set_font() can define new typefaces.

Parameters:
[in]fthe new font for the label
See also:
Fl_Font

Reimplemented in Fl_Tree.

Definition at line 492 of file Fl_Widget.H.

References f.

void Fl_Widget::labelsize ( Fl_Fontsize  pix) [inline]

Sets the font size in pixels.

Parameters:
[in]pixthe new font size
See also:
Fl_Fontsize labelsize()

Reimplemented in Fl_Tree.

Definition at line 504 of file Fl_Widget.H.

void Fl_Widget::labeltype ( Fl_Labeltype  a) [inline]

Sets the label type. The label type identifies the function that draws the label of the widget. This is generally used for special effects such as embossing or for using the label() pointer as another form of data such as an icon. The value FL_NORMAL_LABEL prints the label as plain text.

Parameters:
[in]anew label type
See also:
Fl_Labeltype

Definition at line 462 of file Fl_Widget.H.

void Fl_Widget::measure_label ( int &  ww,
int &  hh 
) const [inline]

Sets width ww and height hh accordingly with the label size. Labels with images will return w() and h() of the image.

Definition at line 923 of file Fl_Widget.H.

Referenced by Fl_Window_Type::draw_overlay(), Fl_Widget_Type::ideal_size(), and Fl_File_Chooser::ok_label().

unsigned int Fl_Widget::output ( ) const [inline]

Returns if a widget is used for output only. output() means the same as !active() except it does not change how the widget is drawn. The widget will not receive any events. This is useful for making scrollbars or buttons that work as displays rather than input devices.

Return values:
0if the widget is used for input and output
See also:
set_output(), clear_output()

Definition at line 738 of file Fl_Widget.H.

References OUTPUT.

Referenced by takesevents().

void Fl_Widget::parent ( Fl_Group p) [inline]

Internal use only - "for hacks only".

It is STRONGLY recommended not to use this method, because it short-circuits Fl_Group's normal widget adding and removing methods, if the widget is already a child widget of another Fl_Group.

Use Fl_Group::add(Fl_Widget*) and/or Fl_Group::remove(Fl_Widget*) instead.

Definition at line 260 of file Fl_Widget.H.

void Fl_Widget::position ( int  X,
int  Y 
) [inline]
void Fl_Widget::redraw ( )

Schedules the drawing of the widget. Marks the widget as needing its draw() routine called.

Definition at line 1408 of file Fl.cxx.

References damage(), and FL_DAMAGE_ALL.

Referenced by activate(), Fl_Chart::add(), Fl_Type::add(), Fl_Window_Type::add_child(), Fl_Table_Type::add_child(), Fl_Group_Type::add_child(), align_widget_cb(), Fl_Chart::bounds(), Fl_Menu_Type::build_menu(), Fl_Input_Choice_Type::build_menu(), Fl_Check_Browser::check_all(), Fl_Check_Browser::check_none(), Fl_Check_Browser::checked(), Fl_Chart::clear(), Fl_Tree::clear_children(), Fl_Tree::close(), Fl_Tree::closeicon(), Fl_Table::col_header(), Fl_Table::col_header_color(), Fl_Table::col_header_height(), Fl_Table::col_position(), Fl_Table::col_width(), color2_cb(), color_cb(), Fl_Table::cols(), Fl_Tree::connectorstyle(), Fl_Tree::connectorwidth(), damage_resize(), deactivate(), Fl_Tree::deselect(), fl_redraw_form(), fl_redraw_object(), fl_set_object_label(), Fl_Table::Fl_Table(), glutPostRedisplay(), h_cb(), Fl_Value_Slider::handle(), Fl_Tree::handle(), Fl_Text_Editor::handle(), Fl_Tabs::handle(), Fl_Table::handle(), Fl_Slider::handle(), Fl_Roller::handle(), Fl_Positioner::handle(), Fl_Menu_Button::handle(), Fl_Light_Button::handle(), Fl_Counter::handle(), Flcc_ValueBox::handle(), Flcc_HueBox::handle(), Fl_Choice::handle(), Fl_Button::handle(), Fl_Browser_::handle(), Fl_Adjuster::handle(), Widget_Browser::handle(), Shortcut_Button::handle(), Fl_Browser::hide(), Fl_Browser::icon(), Fl_File_Browser::iconsize(), Fl_Chart::insert(), Fl_Type::insert(), Fl_Button::key_release_timeout(), Fl_Type::label(), labelcolor_cb(), Fl_Help_View::leftline(), MacMapWindow(), Fl_X::make(), Fl_X::make_xid(), Fl_Tree::marginleft(), Fl_Tree::margintop(), max_cb(), Fl_Progress::maximum(), Fl_Chart::maxsize(), min_cb(), Fl_Progress::minimum(), Fl_Type::move_before(), Fl_Table_Type::move_child(), Fl_Group_Type::move_child(), Fl_Window_Type::moveallchildren(), Fl_Type::name(), Fl_Tree::open(), Fl_Tree::openchild_marginbottom(), Fl_Tree::openicon(), Fl_Menu_::picked(), Fl_Menu_Button::popup(), Fl_File_Chooser::preview(), Overlay_Window::read_image(), Fl_Widget_Type::redraw(), redraw_browser(), Fl::reload_scheme(), Fl_Type::remove(), Fl_Chart::replace(), Fl_File_Chooser::rescan_keep_filename(), Fl_Text_Display::resize(), Fl_Table::resize(), Fl_Scroll::resize(), Fl_Window::resize(), iwizard::resize(), itabs::resize(), igroup::resize(), Fl_Table::row_header(), Fl_Table::row_header_color(), Fl_Table::row_header_width(), Fl_Table::row_height(), Fl_Table::row_position(), Fl_Table::rows(), Fl_Table::scroll_cb(), Fl_Scroll::scrollbar_size(), Fl_Tree::select(), Fl_Table_Row::select_all_rows(), Fl_Tree::select_toggle(), Fl_Tree::selectbox(), Fl_Tree::set_item_focus(), shortcut_in_cb(), show(), Fl_Browser::show(), Fl_Tree::show_item(), Fl_Tree::showcollapse(), Fl_Tree::showroot(), Fl_Button::simulate_key_action(), slider_size_cb(), step_cb(), subtype_cb(), textcolor_cb(), textfont_cb(), textsize_cb(), Fl_Help_View::topline(), Fl_Table_Row::type(), Fl_Tree::usericon(), Fl_Timer::value(), Fl_Positioner::value(), Fl_File_Chooser::value(), Fl_Choice::value(), Fl_Button::value(), Fl_Progress::value(), Fl_Tree::vposition(), w_cb(), widget_size_cb(), x_cb(), Fl_Positioner::xbounds(), y_cb(), and Fl_Positioner::ybounds().

void Fl_Widget::redraw_label ( )
void Fl_Widget::resize ( int  x,
int  y,
int  w,
int  h 
) [virtual]

Changes the size or position of the widget.

This is a virtual function so that the widget may implement its own handling of resizing. The default version does not call the redraw() method, but instead relies on the parent widget to do so because the parent may know a faster way to update the display, such as scrolling from the old position.

Some window managers under X11 call resize() a lot more often than needed. Please verify that the position or size of a widget did actually change before doing any extensive calculations.

position(X, Y) is a shortcut for resize(X, Y, w(), h()), and size(W, H) is a shortcut for resize(x(), y(), W, H).

Parameters:
[in]x,ynew position relative to the parent window
[in]w,hnew size
See also:
position(int,int), size(int,int)

Reimplemented in Fl_Browser_, Fl_Double_Window, Fl_Gl_Window, Fl_Group, Fl_Help_View, Fl_Input_, Fl_Input_Choice, Fl_Overlay_Window, Fl_Scroll, Fl_Spinner, Fl_Table, Fl_Text_Display, Fl_Tile, Fl_Value_Input, Fl_Window, igroup, itabs, iwizard, and Overlay_Window.

Definition at line 140 of file Fl_Widget.cxx.

References H.

Referenced by align_widget_cb(), damage_resize(), Fl_Tree_Item::draw(), Fl_Tree::draw(), Fl_Scroll::draw(), Fl_Pack::draw(), fix_group_size(), fl_set_object_geometry(), group_cb(), h_cb(), Fl_Window_Type::moveallchildren(), Fl_File_Chooser::ok_label(), Fl_File_Chooser::preview(), Fl_Widget_Type::read_fdesign(), Fl_Widget_Type::read_property(), Fl_Tile::resize(), Fl_Text_Display::resize(), Fl_Help_View::resize(), Fl_Group::resize(), Fl_Browser_::resize(), resizeform(), Fl_Table::table_resized(), w_cb(), x_cb(), and y_cb().

void Fl_Widget::selection_color ( Fl_Color  a) [inline]

Sets the selection color. The selection color is defined for Forms compatibility and is usually used to color the widget when it is selected, although some widgets use this color for other purposes. You can set both colors at once with color(Fl_Color bg, Fl_Color sel).

Parameters:
[in]athe new selection color
See also:
selection_color(), color(Fl_Color, Fl_Color)

Definition at line 402 of file Fl_Widget.H.

void Fl_Widget::set_output ( ) [inline]

Sets a widget to output only.

See also:
output(), clear_output()

Definition at line 743 of file Fl_Widget.H.

References OUTPUT.

void Fl_Widget::set_visible ( ) [inline]

Makes the widget visible. You must still redraw the parent widget to see a change in the window. Normally you want to use the show() method instead.

Definition at line 687 of file Fl_Widget.H.

References INVISIBLE.

Referenced by Fl_Scroll::draw(), Fl_Browser_::draw(), Fl_Window::hide(), Fl_X::make(), Fl_X::make_xid(), and Fl_Text_Display::resize().

void Fl_Widget::set_visible_focus ( ) [inline]

Enables keyboard focus navigation with this widget. Note, however, that this will not necessarily mean that the widget will accept focus, but for widgets that can accept focus, this method enables it if it has been disabled.

See also:
visible_focus(), clear_visible_focus(), visible_focus(int)

Definition at line 801 of file Fl_Widget.H.

References VISIBLE_FOCUS.

Referenced by visible_focus().

void Fl_Widget::show ( ) [virtual]

Makes a widget visible. An invisible widget never gets redrawn and does not get events. The visible() method returns true if the widget is set to be visible. The visible_r() method returns true if the widget and all of its parents are visible. A widget is only visible if visible() is true on it and all of its parents.

Changing it will send FL_SHOW or FL_HIDE events to the widget. Do not change it if the parent is not visible, as this will send false FL_SHOW or FL_HIDE events to the widget. redraw() is called if necessary on this or the parent.

See also:
hide(), visible(), visible_r()

Reimplemented in Fl_Browser, Fl_Double_Window, Fl_Gl_Window, Fl_Menu_Window, Fl_Overlay_Window, Fl_Single_Window, Fl_Window, and Fl_TooltipBox.

Definition at line 261 of file Fl_Widget.cxx.

References clear_flag(), FL_SHOW, Fl::focus(), handle(), inside(), INVISIBLE, redraw(), redraw_label(), take_focus(), visible(), and visible_r().

Referenced by border_cb(), Fl_Tree::draw(), Fl_Scroll_Type::enter_live_mode(), Fl_Help_View::Fl_Help_View(), fl_show_object(), i18n_type_cb(), min_w_cb(), modal_cb(), name_cb(), name_public_cb(), name_public_member_cb(), new_cb(), non_modal_cb(), Fl_Data_Type::open(), Fl_Decl_Type::open(), Fl_Function_Type::open(), Fl_File_Chooser::preview(), print_cb(), Fl_Table::recalc_dimensions(), save_template_cb(), shortcut_in_cb(), Fl_Browser::show(), show_project_cb(), Fl_Tree_Item::show_widgets(), slider_size_cb(), Fl_Wizard::value(), Fl_Tabs::value(), visible_cb(), wc_relative_cb(), and xclass_cb().

void Fl_Widget::size ( int  W,
int  H 
) [inline]
int Fl_Widget::take_focus ( )

Gives the widget the keyboard focus. Tries to make this widget be the Fl::focus() widget, by first sending it an FL_FOCUS event, and if it returns non-zero, setting Fl::focus() to this widget. You should use this method to assign the focus to a widget.

Returns:
true if the widget accepted the focus.

Definition at line 152 of file Fl_Widget.cxx.

References contains(), FL_FOCUS, Fl::focus(), handle(), takesevents(), and visible_focus().

Referenced by activate(), fl_fix_focus(), Fl_Group::focus(), Fl_Value_Input::handle(), Fl_Table::handle(), Fl_Input::handle(), Fl_Group::handle(), Shortcut_Button::handle(), show(), and Fl_File_Chooser::show().

unsigned int Fl_Widget::takesevents ( ) const [inline]

Returns if the widget is able to take events. This is the same as (active() && !output() && visible()) but is faster.

Return values:
0if the widget takes no events

Definition at line 755 of file Fl_Widget.H.

References active_r(), output(), and visible_r().

Referenced by Fl_Group::handle(), and take_focus().

int Fl_Widget::test_shortcut ( )

Returns true if the widget's label contains the entered '&x' shortcut.

This method must only be called in handle() methods or callbacks after a keypress event (usually FL_KEYDOWN or FL_SHORTCUT). The widget's label is searched for a '&x' shortcut, and if found, this is compared with the entered key value.

Fl::event_text() is used to get the entered key value.

Returns:
true, if the entered text matches the widget's'&x' shortcut, false (0) otherwise.
Note:
Internal use only.

Reimplemented in Fl_Menu_.

Definition at line 368 of file fl_shortcut.cxx.

References flags(), label(), and SHORTCUT_LABEL.

Referenced by Fl_Text_Editor::handle(), Fl_Text_Display::handle(), Fl_Tabs::handle(), Fl_Menu_Button::handle(), Fl_Choice::handle(), Fl_Button::handle(), and Fl_Input_::handletext().

int Fl_Widget::test_shortcut ( const char *  t,
const bool  require_alt = false 
) [static]

Returns true if the given text t contains the entered '&x' shortcut.

This method must only be called in handle() methods or callbacks after a keypress event (usually FL_KEYDOWN or FL_SHORTCUT). The given text t (usually a widget's label or menu text) is searched for a '&x' shortcut, and if found, this is compared with the entered key value.

Fl::event_text() is used to get the entered key value. Fl::event_state() is used to get the Alt modifier, if require_alt is true.

Parameters:
ttext or label to search for '&x' shortcut.
require_altif true: match only if Alt key is pressed.
Returns:
true, if the entered text matches the '&x' shortcut in t false (0) otherwise.
Note:
Internal use only.

Definition at line 342 of file fl_shortcut.cxx.

References Fl::event_length(), Fl::event_state(), Fl::event_text(), FL_ALT, fl_utf8decode(), and label_shortcut().

void Fl_Widget::tooltip ( const char *  text)

Sets the current tooltip text.

Sets a string of text to display in a popup tooltip window when the user hovers the mouse over the widget. The string is not copied, so make sure any formatted string is stored in a static, global, or allocated buffer. If you want a copy made and managed for you, use the copy_tooltip() method, which will manage the tooltip string automatically.

If no tooltip is set, the tooltip of the parent is inherited. Setting a tooltip for a group and setting no tooltip for a child will show the group's tooltip instead. To avoid this behavior, you can set the child's tooltip to an empty string ("").

Parameters:
[in]textNew tooltip text (no copy is made)
See also:
copy_tooltip(const char*), tooltip()

Definition at line 304 of file Fl_Tooltip.cxx.

References clear_flag(), COPIED_TOOLTIP, and flags().

void Fl_Widget::type ( uchar  t) [inline]

Sets the widget type. This is used for Forms compatibility.

Reimplemented in Fl_Spinner.

Definition at line 275 of file Fl_Widget.H.

uchar Fl_Widget::type ( ) const [inline]

Gets the widget type. Returns the widget type value, which is used for Forms compatibility and to simulate RTTI.

Todo:
Explain "simulate RTTI" (currently only used to decide if a widget is a window, i.e. type()>=FL_WINDOW ?). Is type() really used in a way that ensures "Forms compatibility" ?

Reimplemented in Fl_Spinner, and Fl_Table_Row.

Definition at line 270 of file Fl_Widget.H.

Referenced by Fl_Widget_Type::copy_properties(), Fl_Scroll_Type::copy_properties(), damage(), Fl_Browser_::deselect(), Fl_Timer::draw(), Fl_Slider::draw(), Fl_Return_Button::draw(), Fl_Menu_Button::draw(), Fl_Dial::draw(), Fl_Counter::draw(), Fl_Clock_Output::draw(), Fl_Chart::draw(), Fl_Button::draw(), Fl_Group::draw_child(), fl_add_button(), fl_add_new(), Fl_Browser_::Fl_Browser_(), Fl_Check_Browser::Fl_Check_Browser(), Fl_Clock::Fl_Clock(), Fl_Double_Window::Fl_Double_Window(), Fl_File_Chooser::Fl_File_Chooser(), Fl_Fill_Dial::Fl_Fill_Dial(), Fl_Fill_Slider::Fl_Fill_Slider(), Fl_Float_Input::Fl_Float_Input(), Fl_Free::Fl_Free(), Fl_Help_View::Fl_Help_View(), Fl_Hold_Browser::Fl_Hold_Browser(), Fl_Hor_Fill_Slider::Fl_Hor_Fill_Slider(), Fl_Hor_Nice_Slider::Fl_Hor_Nice_Slider(), Fl_Hor_Slider::Fl_Hor_Slider(), Fl_Hor_Value_Slider::Fl_Hor_Value_Slider(), Fl_Int_Input::Fl_Int_Input(), Fl_Light_Button::Fl_Light_Button(), Fl_Line_Dial::Fl_Line_Dial(), Fl_Multi_Browser::Fl_Multi_Browser(), Fl_Multiline_Input::Fl_Multiline_Input(), Fl_Multiline_Output::Fl_Multiline_Output(), Fl_Nice_Slider::Fl_Nice_Slider(), Fl_Output::Fl_Output(), Fl_Radio_Button::Fl_Radio_Button(), Fl_Radio_Light_Button::Fl_Radio_Light_Button(), Fl_Radio_Round_Button::Fl_Radio_Round_Button(), Fl_Round_Clock::Fl_Round_Clock(), Fl_Scroll::Fl_Scroll(), Fl_Secret_Input::Fl_Secret_Input(), Fl_Select_Browser::Fl_Select_Browser(), Fl_Simple_Counter::Fl_Simple_Counter(), Fl_Slider::Fl_Slider(), Fl_Table::Fl_Table(), Fl_Text_Display::Fl_Text_Display(), Fl_Timer::Fl_Timer(), Fl_Toggle_Button::Fl_Toggle_Button(), Fl_Tree::Fl_Tree(), Fl_Menu_Item_Type::flags(), Fl_Group::forms_end(), Fl_Free::handle(), Fl_Value_Input::handle(), Fl_Slider::handle(), Fl_Scrollbar::handle(), Fl_Menu_Button::handle(), Fl_Button::handle(), Fl_Browser_::handle(), Fl_Window::handle(), Shortcut_Button::handle(), Fl_Valuator::horizontal(), Fl_Pack::horizontal(), Fl_Input_::input_type(), make_layout_window(), make_print_panel(), make_project_window(), make_template_panel(), make_widget_panel(), Fl_Menu_Button::popup(), Fl_Widget_Type::read_fdesign(), Fl_Widget_Type::read_property(), Fl_Input_::readonly(), Fl_Group::resize(), Fl_Browser_::select(), Fl_Browser_::select_only(), Fl_Button::setonly(), Fl_Group::sizes(), subclassname(), subtype_cb(), Fl_File_Chooser::type(), Fl_Group::update_child(), Fl_Timer::value(), Widget_Browser::Widget_Browser(), Fl_Input_::wrap(), and Fl_Widget_Type::write_properties().

void* Fl_Widget::user_data ( ) const [inline]

Gets the user data for this widget. Gets the current user data (void *) argument that is passed to the callback function.

Returns:
user data as a pointer

Definition at line 589 of file Fl_Widget.H.

Referenced by align_cb(), Fl_Tabs_Type::click_test(), Fl_Tree::do_callback_for_item(), Fl_File_Chooser::Fl_File_Chooser(), Fl_Help_Dialog::Fl_Help_Dialog(), Fl_Widget_Type::make(), user_data_cb(), and v_input_cb().

void Fl_Widget::user_data ( void *  v) [inline]

Sets the user data for this widget. Sets the new user data (void *) argument that is passed to the callback function.

Parameters:
[in]vnew user data

Definition at line 595 of file Fl_Widget.H.

void Fl_Widget::visible_focus ( int  v) [inline]

Modifies keyboard focus navigation.

Parameters:
[in]vset or clear visible focus
See also:
set_visible_focus(), clear_visible_focus(), visible_focus()

Definition at line 813 of file Fl_Widget.H.

References clear_visible_focus(), and set_visible_focus().

Referenced by Fl::focus().

unsigned int Fl_Widget::visible_focus ( ) [inline]

Checks whether this widget has a visible focus.

Return values:
0if this widget has no visible focus.
See also:
visible_focus(int), set_visible_focus(), clear_visible_focus()

Definition at line 819 of file Fl_Widget.H.

References VISIBLE_FOCUS.

Referenced by Fl_Tree::handle(), Fl_Tree::set_item_focus(), Fl_Window::show(), and take_focus().

int Fl_Widget::visible_r ( ) const

Returns whether a widget and all its parents are visible.

Return values:
0if the widget or any of its parents are invisible.
See also:
show(), hide(), visible()

Definition at line 285 of file Fl_Widget.cxx.

References parent(), and visible().

Referenced by Fl_Text_Display::buffer_modified_cb(), Fl_Text_Display::draw_line_numbers(), Fl_Window_Type::draw_overlay(), Fl::flush(), Fl_Menu_Bar::handle(), Fl_Gl_Window::handle(), hide(), Fl_Window::make_current(), show(), takesevents(), and update_sourceview_position().

int Fl_Widget::w ( ) const [inline]

Gets the widget width.

Returns:
the width of the widget in pixels.

Definition at line 290 of file Fl_Widget.H.

Referenced by Fl_Scroll::bbox(), Fl_Browser_::bbox(), Fl_Text_Display::buffer(), Fl_Group::clear(), Fl_Tabs::client_area(), damage(), damage_resize(), Fl_Timer::draw(), Fl_FormsPixmap::draw(), Fl_FormsBitmap::draw(), Fl_Window::draw(), Fl_Value_Slider::draw(), Fl_Value_Output::draw(), Fl_Tree::draw(), Fl_TooltipBox::draw(), Fl_Text_Display::draw(), Fl_Tabs::draw(), Fl_Table::draw(), Fl_Slider::draw(), Fl_Scrollbar::draw(), Fl_Scroll::draw(), Fl_Roller::draw(), Fl_Return_Button::draw(), Fl_Progress::draw(), Fl_Positioner::draw(), Fl_Pack::draw(), Fl_Menu_Button::draw(), Fl_Light_Button::draw(), Fl_Input::draw(), Fl_File_Input::draw(), Fl_Dial::draw(), Fl_Counter::draw(), Flcc_ValueBox::draw(), Flcc_HueBox::draw(), Fl_Clock_Output::draw(), Fl_Choice::draw(), Fl_Chart::draw(), Fl_Browser_::draw(), Fl_Adjuster::draw(), Shortcut_Button::draw(), Fl_Group::draw_children(), Fl_Group::draw_outside_label(), menuwindow::find_selected(), Fl_Text_Display::find_x(), Fl_Table::Fl_Table(), Fl_Double_Window::flush(), Fl_Group::forms_end(), Fl_Window::fullscreen(), Fl_Value_Slider::handle(), Fl_Table::handle(), Fl_Slider::handle(), Fl_Scrollbar::handle(), Fl_Positioner::handle(), Fl_Menu_Bar::handle(), Fl_Input::handle(), Fl_Dial::handle(), Flcc_HueBox::handle(), Fl_Choice::handle(), Fl_Button::handle(), Fl_Browser_::handle(), Fl_Adjuster::handle(), Flcc_HueBox::handle_key(), Fl_Text_Display::handle_vline(), Fl_Input_::handletext(), Fl_Window::hotspot(), menuwindow::is_inside(), Fl_Help_View::leftline(), Fl_Window::make_current(), menuwindow::menuwindow(), Fl_Menu_Button::popup(), Overlay_Window::read_image(), Fl_Table::recalc_dimensions(), redraw_label(), Fl_Tabs::redraw_tabs(), Fl_Tile::resize(), Fl_Text_Display::resize(), Fl_Scroll::resize(), Fl_Overlay_Window::resize(), Fl_Window::resize(), Fl_Input_::resize(), Fl_Help_View::resize(), Fl_Group::resize(), Fl_Double_Window::resize(), Overlay_Window::resize(), ColorMenu::run(), Fl_Text_Display::scroll(), Fl_Text_Display::scroll_timer_cb(), Fl_Tree::scrollbar_size(), Fl_Window::show(), Fl_Text_Display::show_insert_position(), Fl_Group::sizes(), and Fl_Text_Display::wrap_mode().

void Fl_Widget::w ( int  v) [inline, protected]

Internal use only. Use position(int,int), size(int,int) or resize(int,int,int,int) instead.

Definition at line 151 of file Fl_Widget.H.

Referenced by Fl_File_Chooser::add_extra(), align_widget_cb(), Fl_Scroll::bbox(), Fl_Tabs::client_area(), damage(), Fl_Tree_Item::draw(), Fl_Text_Display::draw(), Fl_Table::draw(), Fl_Scroll::draw(), Fl_Pack::draw(), Fl_Group::draw_child(), Fl_Group::draw_outside_label(), Fl_Window_Type::draw_overlay(), Fl_Window_Type::enter_live_mode(), Fl_Widget_Type::enter_live_mode(), Fl_Scroll_Type::enter_live_mode(), Fl_Table_Type::enter_live_mode(), Fl_Tabs_Type::enter_live_mode(), Fl_Group_Type::enter_live_mode(), Fl_X::fake_X_wm(), fix_group_size(), Fl_File_Chooser::Fl_File_Chooser(), fl_get_object_geometry(), Fl_Native_File_Chooser::Fl_Native_File_Chooser(), fl_scale_form(), fl_show_form(), Fl_Group::forms_end(), group_cb(), h_cb(), Fl_Tile::handle(), Fl::handle(), Fl_Window_Type::handle(), Fl_Window::hide(), Fl_Window::hotspot(), Fl_Menu_Bar_Type::ideal_size(), Fl_Input_Choice_Type::ideal_size(), Fl_Value_Output_Type::ideal_size(), Fl_Return_Button_Type::ideal_size(), live_mode_cb(), Fl_X::make(), Fl_Widget_Type::make(), make_codeblock_panel(), Fl_Window::make_current(), make_declblock_panel(), make_print_panel(), make_widget_panel(), Fl_X::make_xid(), Fl_Window_Type::newposition(), Fl_Tile::position(), Fl_File_Chooser::preview(), Fl_Paged_Device::print_widget(), Fl_Menu_Item::pulldown(), Fl_Window_Type::read_fdesign(), Fl_File_Chooser::rescan_keep_filename(), Fl_Tile::resize(), Fl_Scroll::resize(), Fl_Group::resize(), save_position(), Fl_X::sendxjunk(), set_max_size_cb(), set_min_size_cb(), Fl_Group::sizes(), Fl_Group::update_child(), Fl_Help_Dialog::w(), Fl_Widget_Class_Type::write_code1(), Fl_Widget_Type::write_code1(), Fl_Widget_Type::write_properties(), x_cb(), and y_cb().

Fl_When Fl_Widget::when ( ) const [inline]

Returns the conditions under which the callback is called.

You can set the flags with when(uchar), the default value is FL_WHEN_RELEASE.

Returns:
set of flags
See also:
when(uchar)

Definition at line 615 of file Fl_Widget.H.

Referenced by Fl_Table::col_width(), fl_add_button(), Fl_Browser_::Fl_Browser_(), Fl_Check_Browser::Fl_Check_Browser(), Fl_Choice::Fl_Choice(), Fl_File_Chooser::Fl_File_Chooser(), Fl_Help_Dialog::Fl_Help_Dialog(), Fl_Menu_::Fl_Menu_(), Fl_Positioner::Fl_Positioner(), fl_set_object_return(), Fl_Tree::Fl_Tree(), Fl_Valuator::Fl_Valuator(), Fl_Value_Input::Fl_Value_Input(), Fl_Value_Input::handle(), Fl_Tree::handle(), Fl_Text_Editor::handle(), Fl_Table::handle(), Fl_Positioner::handle(), Fl_Button::handle(), Fl_Browser_::handle(), Shortcut_Button::handle(), Fl_Valuator::handle_drag(), Fl_Text_Editor::handle_key(), Fl_Valuator::handle_release(), Fl_Input_::handletext(), Fl_Text_Editor::kf_backspace(), Fl_Text_Editor::kf_cut(), Fl_Text_Editor::kf_default(), Fl_Text_Editor::kf_delete(), Fl_Text_Editor::kf_enter(), Fl_Text_Editor::kf_paste(), Fl_Text_Editor::kf_undo(), labeltype_cb(), make_class_panel(), make_code_panel(), make_codeblock_panel(), make_comment_panel(), make_data_panel(), make_decl_panel(), make_declblock_panel(), make_function_panel(), make_layout_window(), make_print_panel(), make_project_window(), make_settings_window(), make_sourceview(), make_template_panel(), make_widget_panel(), Fl_Text_Editor::maybe_do_callback(), Fl_Input_::maybe_do_callback(), Fl_Menu_::picked(), Fl_Widget_Type::read_fdesign(), Fl_Widget_Type::read_property(), Fl_Input_::replace(), Fl_Table::row_height(), Fl_Input_::undo(), when_button_cb(), when_cb(), Widget_Browser::Widget_Browser(), Fl_Widget_Type::write_properties(), and Fl_Widget_Type::write_widget_code().

void Fl_Widget::when ( uchar  i) [inline]

Sets the flags used to decide when a callback is called.

This controls when callbacks are done. The following values are useful, the default value is FL_WHEN_RELEASE:

  • 0: The callback is not done, but changed() is turned on.
  • FL_WHEN_CHANGED: The callback is done each time the text is changed by the user.
  • FL_WHEN_RELEASE: The callback will be done when this widget loses the focus, including when the window is unmapped. This is a useful value for text fields in a panel where doing the callback on every change is wasteful. However the callback will also happen if the mouse is moved out of the window, which means it should not do anything visible (like pop up an error message). You might do better setting this to zero, and scanning all the items for changed() when the OK button on a panel is pressed.
  • FL_WHEN_ENTER_KEY: If the user types the Enter key, the entire text is selected, and the callback is done if the text has changed. Normally the Enter key will navigate to the next field (or insert a newline for a Fl_Multiline_Input) - this changes the behavior.
  • FL_WHEN_ENTER_KEY|FL_WHEN_NOT_CHANGED: The Enter key will do the callback even if the text has not changed. Useful for command fields. Fl_Widget::when() is a set of bitflags used by subclasses of Fl_Widget to decide when to do the callback.

If the value is zero then the callback is never done. Other values are described in the individual widgets. This field is in the base class so that you can scan a panel and do_callback() on all the ones that don't do their own callbacks in response to an "OK" button.

Parameters:
[in]iset of flags

Definition at line 648 of file Fl_Widget.H.

References i.

void Fl_Widget::x ( int  v) [inline, protected]

Internal use only. Use position(int,int), size(int,int) or resize(int,int,int,int) instead.

Definition at line 147 of file Fl_Widget.H.

Referenced by align_widget_cb(), Fl_Tabs::client_area(), FLDropTarget::DragEnter(), FLDropTarget::DragOver(), Fl_Text_Display::draw(), Fl_Table::draw(), Fl_Scroll::draw(), Fl_Pack::draw(), Fl_Browser_::draw(), Fl_Group::draw_child(), Fl_Group::draw_outside_label(), Fl_Window_Type::draw_overlay(), FLDropTarget::Drop(), Fl_Window_Type::enter_live_mode(), Fl_Widget_Type::enter_live_mode(), Fl_Scroll_Type::enter_live_mode(), Fl_Table_Type::enter_live_mode(), Fl_Tabs_Type::enter_live_mode(), Fl_Group_Type::enter_live_mode(), Fl::event_inside(), Fl_X::fake_X_wm(), fix_group_size(), fl_fix_focus(), fl_get_object_geometry(), fl_get_object_position(), fl_handle(), Fl_Native_File_Chooser::Fl_Native_File_Chooser(), fl_show_form(), Fl_Group::forms_end(), group_cb(), h_cb(), Fl_Tile::handle(), Fl::handle(), Fl_Window_Type::handle(), Fl_Window::hotspot(), Fl_X::make(), Fl_Widget_Type::make(), Fl_Window::make_current(), Fl_X::make_xid(), Fl_Window_Type::newposition(), Fl_File_Chooser::ok_label(), Fl_Tile::position(), Fl_File_Chooser::preview(), Fl_Paged_Device::print_widget(), Fl_Menu_Item::pulldown(), Fl_Widget_Type::read_property(), Fl_Tile::resize(), Fl_Scroll::resize(), Fl_Group::resize(), save_position(), Fl_Scroll::scroll_to(), Fl_X::sendxjunk(), Fl_Group::sizes(), sort(), Fl_Group::update_child(), w_cb(), Fl_Widget_Type::write_code1(), Fl_Widget_Type::write_properties(), Fl_Help_Dialog::x(), Fl_X::x(), and y_cb().

int Fl_Widget::x ( ) const [inline]

Gets the widget position in its window.

Returns:
the x position relative to the window

Definition at line 280 of file Fl_Widget.H.

Referenced by menuwindow::autoscroll(), Fl_Scroll::bbox(), Fl_Browser_::bbox(), Fl_Text_Display::buffer(), Fl_Tabs::client_area(), damage(), damage_resize(), Fl_Timer::draw(), Fl_FormsPixmap::draw(), Fl_FormsBitmap::draw(), Fl_Value_Slider::draw(), Fl_Value_Output::draw(), Fl_Tree::draw(), Fl_Text_Display::draw(), Fl_Tabs::draw(), Fl_Table::draw(), Fl_Slider::draw(), Fl_Scrollbar::draw(), Fl_Scroll::draw(), Fl_Roller::draw(), Fl_Return_Button::draw(), Fl_Progress::draw(), Fl_Positioner::draw(), Fl_Pack::draw(), Fl_Menu_Button::draw(), Fl_Menu_Bar::draw(), Fl_Light_Button::draw(), Fl_Input::draw(), Fl_File_Input::draw(), Fl_Dial::draw(), Fl_Counter::draw(), Flcc_ValueBox::draw(), Flcc_HueBox::draw(), Fl_Clock_Output::draw(), Fl_Choice::draw(), Fl_Chart::draw(), Fl_Browser_::draw(), Fl_Adjuster::draw(), Shortcut_Button::draw(), Fl_Group::draw_children(), Fl_Group::draw_outside_label(), menuwindow::find_selected(), Fl_Table::Fl_Table(), Fl_Group::forms_end(), Fl_Window::fullscreen(), Fl_Value_Slider::handle(), Fl_Tile::handle(), Fl_Table::handle(), Fl_Slider::handle(), Fl_Scrollbar::handle(), Fl_Positioner::handle(), Fl_Menu_Bar::handle(), Fl_Input::handle(), Fl_Dial::handle(), Flcc_HueBox::handle(), Fl_Choice::handle(), Fl_Button::handle(), Fl_Browser_::handle(), Fl_Adjuster::handle(), Fl_Input_::handletext(), Fl_Window::hotspot(), menuwindow::menuwindow(), Fl_Menu_Button::popup(), Fl_Table::recalc_dimensions(), redraw_label(), Fl_Tabs::redraw_tabs(), Fl_Tile::resize(), Fl_Scroll::resize(), Fl_Window::resize(), Fl_Help_View::resize(), Fl_Group::resize(), Fl_Text_Display::scroll(), Fl_Tree::scrollbar_size(), Fl_Window::show(), Fl_Text_Display::show_insert_position(), Fl_Group::sizes(), Fl_Table::table_scrolled(), Fl_Tabs::which(), Fl_Text_Display::wrap_mode(), and Fl_Window::x_root().

void Fl_Widget::y ( int  v) [inline, protected]

Internal use only. Use position(int,int), size(int,int) or resize(int,int,int,int) instead.

Definition at line 149 of file Fl_Widget.H.

Referenced by Fl_File_Chooser::add_extra(), align_widget_cb(), Fl_Tabs::client_area(), FLDropTarget::DragEnter(), FLDropTarget::DragOver(), Fl_Text_Display::draw(), Fl_Table::draw(), Fl_Scroll::draw(), Fl_Pack::draw(), Fl_Browser_::draw(), Fl_Group::draw_child(), Fl_Group::draw_outside_label(), Fl_Window_Type::draw_overlay(), FLDropTarget::Drop(), Fl_Window_Type::enter_live_mode(), Fl_Widget_Type::enter_live_mode(), Fl_Scroll_Type::enter_live_mode(), Fl_Table_Type::enter_live_mode(), Fl_Tabs_Type::enter_live_mode(), Fl_Group_Type::enter_live_mode(), Fl::event_inside(), Fl_X::fake_X_wm(), fix_group_size(), fl_fix_focus(), fl_get_object_geometry(), fl_get_object_position(), fl_handle(), Fl_Native_File_Chooser::Fl_Native_File_Chooser(), fl_show_form(), Fl_Group::forms_end(), group_cb(), h_cb(), Fl_Tile::handle(), Fl::handle(), Fl_Window_Type::handle(), Fl_Window::hotspot(), Fl_X::make(), Fl_Widget_Type::make(), Fl_Window::make_current(), Fl_X::make_xid(), Fl_Window_Type::newposition(), Fl_File_Chooser::ok_label(), Fl_Tile::position(), menuwindow::position(), Fl_File_Chooser::preview(), Fl_Paged_Device::print_widget(), Fl_Menu_Item::pulldown(), Fl_Widget_Type::read_property(), Fl_Tile::resize(), Fl_Scroll::resize(), Fl_Group::resize(), save_position(), Fl_Scroll::scroll_to(), Fl_X::sendxjunk(), Fl_Group::sizes(), sort(), Fl_Group::update_child(), w_cb(), Fl_Widget_Type::write_code1(), Fl_Widget_Type::write_properties(), x_cb(), Fl_Help_Dialog::y(), and Fl_X::y().

int Fl_Widget::y ( ) const [inline]

Gets the widget position in its window.

Returns:
the y position relative to the window

Definition at line 285 of file Fl_Widget.H.

Referenced by menuwindow::autoscroll(), Fl_Scroll::bbox(), Fl_Browser_::bbox(), Fl_Text_Display::buffer(), Fl_Tabs::client_area(), damage(), damage_resize(), Fl_Tree::displayed(), Fl_Timer::draw(), Fl_FormsPixmap::draw(), Fl_FormsBitmap::draw(), Fl_Value_Slider::draw(), Fl_Value_Output::draw(), Fl_Tree::draw(), Fl_Text_Display::draw(), Fl_Tabs::draw(), Fl_Table::draw(), Fl_Slider::draw(), Fl_Scrollbar::draw(), Fl_Scroll::draw(), Fl_Roller::draw(), Fl_Return_Button::draw(), Fl_Progress::draw(), Fl_Positioner::draw(), Fl_Pack::draw(), Fl_Menu_Button::draw(), Fl_Menu_Bar::draw(), Fl_Light_Button::draw(), Fl_Input::draw(), Fl_File_Input::draw(), Fl_Dial::draw(), Fl_Counter::draw(), Flcc_ValueBox::draw(), Flcc_HueBox::draw(), Fl_Clock_Output::draw(), Fl_Choice::draw(), Fl_Chart::draw(), Fl_Browser_::draw(), Fl_Adjuster::draw(), Shortcut_Button::draw(), Fl_Group::draw_children(), Fl_Text_Display::draw_line_numbers(), Fl_Group::draw_outside_label(), menuwindow::find_selected(), Fl_Table::Fl_Table(), Fl_Group::forms_end(), Fl_Window::fullscreen(), Fl_Value_Slider::handle(), Fl_Tree::handle(), Fl_Tile::handle(), Fl_Tabs::handle(), Fl_Table::handle(), Fl_Slider::handle(), Fl_Scrollbar::handle(), Fl_Positioner::handle(), Fl_Menu_Bar::handle(), Fl_Input::handle(), Fl_File_Input::handle(), Fl_Dial::handle(), Flcc_ValueBox::handle(), Flcc_HueBox::handle(), Fl_Choice::handle(), Fl_Button::handle(), Fl_Adjuster::handle(), Fl_Input_::handletext(), menuwindow::menuwindow(), Fl_Menu_Button::popup(), menuwindow::position(), Fl_Table::recalc_dimensions(), redraw_label(), Fl_Tabs::redraw_tabs(), Fl_Tile::resize(), Fl_Scroll::resize(), Fl_Window::resize(), Fl_Help_View::resize(), Fl_Group::resize(), ColorMenu::run(), Fl_Text_Display::scroll(), Fl_Window::show(), Fl_Text_Display::show_insert_position(), Fl_Tree::show_item(), Fl_Group::sizes(), Fl_Table::table_scrolled(), Fl_Tabs::which(), Fl_Text_Display::wrap_mode(), Fl_Window::y_root(), and Fl_Input_::yscroll().


Friends And Related Function Documentation

friend class Fl_Group [friend]

Definition at line 110 of file Fl_Widget.H.


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