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

Fl_Widget Class Referenceabstract

#include <Fl_Widget.H>

Inheritance diagram for Fl_Widget:
[legend]
Collaboration diagram for Fl_Widget:
[legend]

Public Member Functions

virtual ~Fl_Widget ()
 
virtual void draw ()=0
 
virtual int handle (int event)
 
int is_label_copied () const
 
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 ()
 
void clear_active ()
 
void set_active ()
 
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 ()
 
void _set_fullscreen ()
 
void _clear_fullscreen ()
 
int contains (const Fl_Widget *w) const
 
int inside (const Fl_Widget *wgt) 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
 
Fl_Windowtop_window () const
 
Fl_Windowtop_window_offset (int &xoff, int &yoff) const
 
virtual Fl_Groupas_group ()
 
virtual Fl_Windowas_window ()
 
virtual class Fl_Gl_Windowas_gl_window ()
 
int use_accents_menu ()
 
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, FULLSCREEN = 1<<18, MAC_USE_ACCENTS_MENU = 1<<19,
  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
 

Private Member Functions

 Fl_Widget (const Fl_Widget &)
 
Fl_Widgetoperator= (const Fl_Widget &)
 

Private Attributes

Fl_Groupparent_
 
Fl_Callbackcallback_
 
void * user_data_
 
int x_
 
int y_
 
int w_
 
int h_
 
Fl_Label label_
 
unsigned int flags_
 
Fl_Color color_
 
Fl_Color color2_
 
uchar type_
 
uchar damage_
 
uchar box_
 
uchar when_
 
const char * tooltip_
 

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 101 of file Fl_Widget.H.

Member Enumeration Documentation

◆ anonymous enum

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 a few special 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 

this is 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 

Reserved, not implemented. DO NOT USE.

COPIED_TOOLTIP 

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

FULLSCREEN 

a fullscreen window (Fl_Window)

MAC_USE_ACCENTS_MENU 

On the Mac OS platform, pressing and holding a key on the keyboard opens an accented-character menu window (Fl_Input_, Fl_Text_Editor)

USERFLAG3 

reserved for 3rd party extensions

USERFLAG2 

reserved for 3rd party extensions

USERFLAG1 

reserved for 3rd party extensions

Definition at line 155 of file Fl_Widget.H.

Constructor & Destructor Documentation

◆ Fl_Widget() [1/2]

Fl_Widget::Fl_Widget ( const Fl_Widget )
private

unimplemented copy ctor

◆ Fl_Widget() [2/2]

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 119 of file Fl_Widget.cxx.

References Fl_Group::add(), Fl_Label::align_, box_, callback_, Fl_Label::color, color2_, color_, Fl_Group::current(), damage_, default_callback(), Fl_Label::deimage, Fl_Display_Device::display_device(), FL_ALIGN_CENTER, FL_FOREGROUND_COLOR, fl_graphics_driver, FL_GRAY, FL_HELVETICA, FL_NO_BOX, FL_NORMAL_LABEL, FL_NORMAL_SIZE, FL_WHEN_RELEASE, flags_, Fl_Label::font, H, h_, Fl_Label::image, label_, parent_, Fl_Label::size, tooltip_, Fl_Label::type, type_, user_data_, Fl_Label::value, VISIBLE_FOCUS, w_, when_, x_, Y, and y_.

◆ ~Fl_Widget()

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 178 of file Fl_Widget.cxx.

References callback_, cleanup_readqueue(), Fl::clear_widget_pointer(), COPIED_LABEL, COPIED_TOOLTIP, default_callback(), fl_throw_focus(), flags(), free(), label_, parent_, Fl_Group::remove(), tooltip_, and Fl_Label::value.

Member Function Documentation

◆ _clear_fullscreen()

void Fl_Widget::_clear_fullscreen ( )
inline

Definition at line 883 of file Fl_Widget.H.

References flags_, and FULLSCREEN.

Referenced by fl_handle(), and Fl_Window::fullscreen_off_x().

◆ _set_fullscreen()

void Fl_Widget::_set_fullscreen ( )
inline

Definition at line 882 of file Fl_Widget.H.

References flags_, and FULLSCREEN.

Referenced by fl_handle(), and Fl_Window::fullscreen_x().

◆ activate()

◆ active()

unsigned int Fl_Widget::active ( ) const
inline

◆ active_r()

◆ align() [1/2]

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 348 of file Fl_Widget.H.

References Fl_Label::align_, and label_.

Referenced by Fl_Window::_Fl_Window(), 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_Window::draw(), Fl_Browser_::draw(), Fl_FormsText::draw(), draw_backdrop(), draw_label(), Fl_Group::draw_outside_label(), Fl_Window_Type::draw_overlay(), fl_add_labelframe(), 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_FormsText::Fl_FormsText(), 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_set_pixmap_align(), 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(), makeform(), Fl_Widget_Type::read_fdesign(), Fl_Widget_Type::read_property(), Fl_Scroll::recalc_scrollbars(), redraw_label(), Fl::reload_scheme(), Fl_Scroll::resize(), Fl_Browser_::resize(), Fl_Browser_::scrollbar_left(), Fl_Browser_::scrollbar_right(), Fl_Window::show(), Fl_File_Chooser::update_preview(), Fl_Widget_Type::write_properties(), and Fl_Widget_Type::write_widget_code().

◆ align() [2/2]

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 357 of file Fl_Widget.H.

References Fl_Label::align_, and label_.

◆ argument() [1/2]

long Fl_Widget::argument ( ) const
inline

Gets 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.

References user_data_.

Referenced by align_cb().

◆ argument() [2/2]

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 611 of file Fl_Widget.H.

References user_data_.

◆ as_gl_window()

virtual class Fl_Gl_Window* Fl_Widget::as_gl_window ( )
inlinevirtual

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 1012 of file Fl_Widget.H.

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

◆ as_group()

virtual Fl_Group* Fl_Widget::as_group ( )
inlinevirtual

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 986 of file Fl_Widget.H.

Referenced by Fl_Paged_Device::traverse(), and traverse_to_gl_subwindows().

◆ as_window()

virtual Fl_Window* Fl_Widget::as_window ( )
inlinevirtual

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 1000 of file Fl_Widget.H.

Referenced by Fl::delete_widget(), Fl_Group::draw_outside_label(), Fl_Tooltip::enter_(), Fl::focus(), Fl_Paged_Device::print_widget(), Fl_Paged_Device::traverse(), and traverse_to_gl_subwindows().

◆ box() [1/2]

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 363 of file Fl_Widget.H.

References box_.

Referenced by Fl_Window::_Fl_Window(), menuwindow::autoscroll(), Fl_Scroll::bbox(), Fl_Browser_::bbox(), box_cb(), ColorChip::ColorChip(), Fl_Widget_Type::copy_properties(), Fl_FormsBitmap::draw(), Fl_FormsPixmap::draw(), Fl_Return_Button::draw(), Fl_Roller::draw(), Fl_Value_Slider::draw(), Fl_Light_Button::draw(), Flcc_HueBox::draw(), Fl_Wizard::draw(), Fl_Progress::draw(), Fl_Positioner::draw(), Fl_Value_Output::draw(), Fl_Timer::draw(), Fl_Adjuster::draw(), Fl_Scrollbar::draw(), Flcc_ValueBox::draw(), Fl_Pack::draw(), Fl_Dial::draw(), Fl_Clock_Output::draw(), Fl_Menu_Button::draw(), Fl_Counter::draw(), Fl_File_Input::draw(), Fl_Value_Input::draw(), Fl_Menu_Bar::draw(), Fl_Slider::draw(), Fl_Chart::draw(), Fl_Choice::draw(), Fl_Button::draw(), menuwindow::draw(), Fl_Scroll::draw(), Fl_Window::draw(), Fl_Browser_::draw(), Fl_Tabs::draw(), Fl_Input::draw(), Fl_Help_View::draw(), Overlay_Window::draw(), Fl_Menu_Item::draw(), Fl_Text_Display::draw(), ColorChip::draw(), Fl_Table::draw(), Fl_Group::draw_children(), Fl_Scroll::draw_clip(), draw_focus(), draw_label(), Fl_Text_Display::draw_line_numbers(), Fl_Tabs::draw_tab(), Fl_Tree::draw_tree(), menuwindow::drawentry(), Fl_Input_::drawtext(), Fl_Input_::expand(), 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_FormsText::Fl_FormsText(), 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_Help_View::format(), generate_image(), generate_vimage(), Fl_Value_Slider::handle(), Fl_Light_Button::handle(), Flcc_HueBox::handle(), Flcc_ValueBox::handle(), Fl_Menu_Button::handle(), Fl_Slider::handle(), Fl_Button::handle(), Fl_Input::handle(), Flcc_HueBox::handle_key(), Flcc_ValueBox::handle_key(), Fl_Browser_Type::ideal_size(), Fl_Check_Browser_Type::ideal_size(), Fl_File_Browser_Type::ideal_size(), Fl_Spinner_Type::ideal_size(), Fl_Input_Type::ideal_size(), Fl_Widget_Type::ideal_size(), Fl_File_Input_Type::ideal_size(), Fl_Text_Display_Type::ideal_size(), Fl_Text_Editor_Type::ideal_size(), Fl_Help_View_Type::ideal_size(), Fl_Choice_Type::ideal_size(), Fl_Output_Type::ideal_size(), Fl_Input_Choice_Type::ideal_size(), Fl_Value_Input_Type::ideal_size(), Fl_Menu_Bar_Type::ideal_size(), Fl_Value_Output_Type::ideal_size(), Fl_Input_Choice::inp_h(), Fl_Input_Choice::inp_w(), Fl_Input_Choice::inp_x(), Fl_Input_Choice::inp_y(), 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_settings_window(), make_shell_window(), make_sourceview(), make_template_panel(), make_widget_panel(), make_widgetbin(), makeform(), Fl_Input_Choice::menu_h(), Fl_Input_Choice::menu_x(), Fl_Input_Choice::menu_y(), menuwindow::menuwindow(), Fl_Menu_Button::popup(), Fl_Widget_Type::read_fdesign(), Fl_Window_Type::read_fdesign(), Fl_Widget_Type::read_property(), Fl_Table::recalc_dimensions(), Fl_Scroll::recalc_scrollbars(), redraw_label(), Fl_Tabs::redraw_tabs(), Fl_Text_Display::resize(), Fl_Help_View::resize(), Fl_Tabs::tab_positions(), Fl_File_Input::update_buttons(), Fl_Button::value(), Fl_Widget_Type::write_properties(), and Fl_Widget_Type::write_widget_code().

◆ box() [2/2]

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 372 of file Fl_Widget.H.

References box_.

◆ callback() [1/5]

◆ callback() [2/5]

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 574 of file Fl_Widget.H.

References callback_, and cb().

◆ callback() [3/5]

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 568 of file Fl_Widget.H.

References callback_, cb(), p, and user_data_.

◆ callback() [4/5]

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 580 of file Fl_Widget.H.

References callback_, and cb().

◆ callback() [5/5]

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 587 of file Fl_Widget.H.

References callback_, cb(), p, and user_data_.

◆ changed()

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()

Definition at line 781 of file Fl_Widget.H.

References CHANGED, and flags_.

Referenced by Fl_Help_Dialog::cb_view__i(), Fl_Input_Choice::changed(), Fl_Tree::extend_selection__(), Shortcut_Button::handle(), Fl_Positioner::handle(), Fl_Input_Choice::inp_cb(), 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().

◆ clear_active()

void Fl_Widget::clear_active ( )
inline

Marks the widget as inactive without sending events or changing focus. This is mainly for specialized use, for normal cases you want deactivate().

See also
deactivate()

Definition at line 797 of file Fl_Widget.H.

References flags_, and INACTIVE.

◆ clear_changed()

◆ clear_damage()

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 931 of file Fl_Widget.H.

References damage_.

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

◆ clear_flag()

◆ clear_output()

void Fl_Widget::clear_output ( )
inline

Sets a widget to accept input.

See also
set_output(), output()

Definition at line 757 of file Fl_Widget.H.

References flags_, and OUTPUT.

◆ clear_visible()

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 702 of file Fl_Widget.H.

References flags_, and 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().

◆ clear_visible_focus()

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 826 of file Fl_Widget.H.

References flags_, and VISIBLE_FOCUS.

Referenced by visible_focus().

◆ color() [1/3]

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 378 of file Fl_Widget.H.

References color_.

Referenced by Fl_Text_Display::clear_rect(), Fl_File_Chooser::color(), Fl_Spinner::color(), color2_cb(), color_cb(), Fl_Widget_Type::copy_properties(), Fl_FormsBitmap::draw(), Fl_FormsPixmap::draw(), Fl_Return_Button::draw(), Fl_Roller::draw(), ColorMenu::draw(), Fl_Value_Slider::draw(), Fl_Light_Button::draw(), Fl_Wizard::draw(), Fl_Progress::draw(), Fl_Positioner::draw(), Fl_Value_Output::draw(), Fl_Timer::draw(), Fl_Adjuster::draw(), Fl_Pack::draw(), Fl_Dial::draw(), Fl_Menu_Button::draw(), Fl_Clock_Output::draw(), Fl_Counter::draw(), Fl_File_Input::draw(), Fl_Value_Input::draw(), Fl_Choice::draw(), Fl_Button::draw(), menuwindow::draw(), Fl_Scroll::draw(), Fl_Tree_Item::draw(), Fl_Window::draw(), Fl_Browser_::draw(), Fl_Tabs::draw(), Fl_Input::draw(), Fl_Menu_Item::draw(), Fl_Text_Display::draw(), Fl_Table::draw(), Fl_Scroll::draw_clip(), draw_focus(), Fl_Text_Display::draw_string(), Fluid_Table::DrawData(), menuwindow::drawentry(), 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_Help_View::format(), Fl_Choice::handle(), Widget_Browser::item_draw(), labelcolor_cb(), live_mode_cb(), make_about_panel(), make_code_panel(), make_comment_panel(), make_global_settings_window(), make_print_panel(), make_settings_window(), make_sourceview(), make_widget_panel(), makeform(), 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().

◆ color() [2/3]

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 390 of file Fl_Widget.H.

References color_.

◆ color() [3/3]

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 415 of file Fl_Widget.H.

References color2_, and color_.

◆ color2() [1/2]

Fl_Color Fl_Widget::color2 ( ) const
inline

For back compatibility only.

Deprecated:
Use selection_color() instead.

Definition at line 1021 of file Fl_Widget.H.

References color2_.

◆ color2() [2/2]

void Fl_Widget::color2 ( unsigned  a)
inline

For back compatibility only.

Deprecated:
Use selection_color(unsigned) instead.

Definition at line 1026 of file Fl_Widget.H.

References color2_.

◆ contains()

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 303 of file Fl_Widget.cxx.

References parent_.

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

◆ copy_label()

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()

Definition at line 324 of file Fl_Widget.cxx.

References COPIED_LABEL, flags(), label(), label_, set_flag(), and Fl_Label::value.

Referenced by Fl_Window::copy_label(), and make_about_panel().

◆ copy_tooltip()

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 365 of file Fl_Tooltip.cxx.

References clear_flag(), COPIED_TOOLTIP, flags(), free(), Fl_Tooltip::set_enter_exit_once_(), set_flag(), and tooltip_.

◆ damage() [1/3]

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 917 of file Fl_Widget.H.

References damage_.

Referenced by Fl_Slider::bounds(), Fl_Text_Display::buffer_modified_cb(), chooser_cb(), damage(), Fl_Roller::draw(), ColorMenu::draw(), Fl_Value_Slider::draw(), Flcc_HueBox::draw(), Fl_Wizard::draw(), Fl_Value_Output::draw(), Fl_Scrollbar::draw(), Fl_Pack::draw(), Flcc_ValueBox::draw(), Fl_Dial::draw(), Fl_Group::draw(), Fl_Counter::draw(), Fl_File_Input::draw(), Fl_Value_Input::draw(), Fl_Slider::draw(), menuwindow::draw(), Fl_Scroll::draw(), Fl_Tree_Item::draw(), Fl_Window::draw(), Fl_Browser_::draw(), Fl_Tabs::draw(), Fl_Input::draw(), Overlay_Window::draw(), Fl_Text_Display::draw(), ColorChip::draw(), Fl_Table::draw(), Fl_File_Input::draw_buttons(), Fl_Group::draw_children(), Fl_Tree::draw_tree(), Fl_Input_::drawtext(), fl_handle(), Fl_Double_Window::flush(), Fl_Overlay_Window::flush(), Fl::flush(), ColorMenu::handle(), Fl_Scrollbar::handle(), Fl_File_Input::handle(), Fl_Button::handle(), Fl_Input_::handletext(), Fl_Text_Display::highlight_data(), Fl_Color_Chooser::hsv(), Fl_Input_::minimal_update(), 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_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_Browser_::update_top(), Fl_Clock_Output::value(), Fl_File_Input::value(), Fl_Valuator::value_damage(), WndProc(), and Fl_Input_::yscroll().

◆ damage() [2/3]

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 1843 of file Fl.cxx.

References Fl::damage(), damage(), damage_, FL_DAMAGE_CHILD, FL_WINDOW, h(), type(), w(), x(), and y().

◆ damage() [3/3]

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 1857 of file Fl.cxx.

References arg(), Fl::damage(), damage(), damage_, FL_DAMAGE_CHILD, FL_WINDOW, H, h(), parent(), type(), w(), XRectangleRegion(), and Y.

◆ damage_resize()

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

Internal use only.

Definition at line 155 of file Fl_Widget.cxx.

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

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

◆ deactivate()

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()

Definition at line 253 of file Fl_Widget.cxx.

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

Referenced by Fl_Tree_Item::activate(), active_cb(), align_cb(), align_position_cb(), align_text_image_cb(), box_cb(), Fl_Help_Dialog::cb_back__i(), Fl_Help_Dialog::cb_forward__i(), Fl_Help_Dialog::cb_larger__i(), cb_print_all(), cb_print_copies(), cb_print_selection(), Fl_Help_Dialog::cb_smaller__i(), cb_template_browser(), cb_template_name(), Fl_Help_Dialog::cb_view__i(), color2_cb(), color_cb(), Fl_Widget_Type::copy_properties(), Fl_Repeat_Button::deactivate(), do_shell_command(), down_box_cb(), Fl_File_Chooser::favoritesCB(), Fl_File_Chooser::fileListCB(), Fl_File_Chooser::fileNameCB(), fl_deactivate_form(), fl_deactivate_object(), Fl_Help_Dialog::Fl_Help_Dialog(), h_cb(), hotspot_cb(), image_cb(), inactive_cb(), make_print_panel(), max_cb(), min_cb(), new_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().

◆ default_callback()

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

The default callback for all widgets that don't set a callback.

This callback function puts a pointer to the widget on the queue returned by Fl::readqueue().

Relying on the default callback and reading the callback queue with Fl::readqueue() is not recommended. If you need a callback, you should set one with Fl_Widget::callback(Fl_Callback *cb, void *data) or one of its variants.

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

Definition at line 39 of file Fl_Widget.cxx.

References obj_head, obj_queue, obj_tail, p, parent(), and QUEUE_SIZE.

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

◆ deimage() [1/4]

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 533 of file Fl_Widget.H.

References Fl_Label::deimage, and label_.

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

◆ deimage() [2/4]

const Fl_Image* Fl_Widget::deimage ( ) const
inline

Definition at line 534 of file Fl_Widget.H.

References Fl_Label::deimage, and label_.

◆ deimage() [3/4]

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 546 of file Fl_Widget.H.

References Fl_Label::deimage, and label_.

◆ deimage() [4/4]

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 540 of file Fl_Widget.H.

References Fl_Label::deimage, and label_.

◆ do_callback() [1/3]

void Fl_Widget::do_callback ( )
inline

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

See also
callback()

Definition at line 861 of file Fl_Widget.H.

References do_callback(), and user_data_.

Referenced by Fl_Table::_auto_drag_cb(), CodeEditor::auto_indent(), cb_1(), Fl_Table::col_width(), do_callback(), Fl_Table::do_callback(), Fl_Tree::do_callback_for_item(), fl_call_object_callback(), fl_trigger_object(), Shortcut_Button::handle(), Fl_Tile::handle(), Fl_Repeat_Button::handle(), Fl_Return_Button::handle(), Flcc_HueBox::handle(), Fl_Positioner::handle(), Fl_Text_Editor::handle(), Fl_Scrollbar::handle(), Flcc_ValueBox::handle(), Fl_Free::handle(), Fl_Button::handle(), Fl_Browser_::handle(), Fl_Tabs::handle(), Fl_Input::handle(), Fl_Table::handle(), Fl::handle_(), Fl_File_Input::handle_button(), Fl_Valuator::handle_drag(), Flcc_HueBox::handle_key(), Flcc_ValueBox::handle_key(), Fl_Text_Editor::handle_key(), Fl_Valuator::handle_release(), Fl_Input_Choice::inp_cb(), Fl_Value_Input::input_cb(), 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(), Fl_Text_Editor::maybe_do_callback(), Fl_Input_::maybe_do_callback(), Fl_Input_Choice::menu_cb(), Fl_Color_Chooser::mode(), new_cb(), Fl_Menu_::picked(), propagate_load(), Fl_Input_::replace(), Fl_Color_Chooser::rgb_cb(), Fl_Table::row_height(), Fl_Spinner::sb_cb(), Fl_Browser_::select(), set_cb(), Fl_PostScript_Printer::start_job(), Fl_Timer::step(), template_delete_cb(), Fl_Help_View::topline(), and Fl_Input_::undo().

◆ do_callback() [2/3]

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 869 of file Fl_Widget.H.

References arg(), and do_callback().

Referenced by do_callback().

◆ do_callback() [3/3]

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 345 of file Fl_Widget.cxx.

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

◆ draw()

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_Table, Fl_FormsText, ColorChip, Fl_Tree, Fl_Text_Display, Overlay_Window, Fl_Gl_Window, Fl_Help_View, Fl_Input, Fl_Tabs, Fl_Browser_, Fl_Window, Fl_Scroll, menuwindow, menutitle, Fl_Input_Choice::InputMenuButton, Fl_Button, Fl_Choice, Fl_Chart, CodeViewer, Fl_Slider, Fl_Menu_Bar, Fl_Value_Input, Fl_File_Input, Fl_Counter, Fl_Free, Fl_Menu_Button, Fl_Clock_Output, Fl_Group, Fl_Dial, Fl_TooltipBox, Flcc_ValueBox, Fl_Pack, Fl_Scrollbar, Fl_Positioner, Fl_Adjuster, Fl_Timer, Fl_Value_Output, Fl_Glut_Window, Fl_Progress, Fl_Wizard, Flcc_HueBox, Fl_Light_Button, Fl_Value_Slider, Fl_Roller, ColorMenu, Fl_Box, Fl_Return_Button, Fl_FormsPixmap, Fl_FormsBitmap, and Shortcut_Button.

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

◆ draw_backdrop()

void Fl_Widget::draw_backdrop ( ) const
protected

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

Definition at line 447 of file fl_boxtype.cxx.

References active_r(), align(), deimage(), FL_ALIGN_IMAGE_BACKDROP, Fl_Image::h(), h_, image(), Fl_Image::w(), w_, x_, and y_.

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

◆ draw_box() [1/3]

◆ draw_box() [2/3]

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 458 of file fl_boxtype.cxx.

References draw_box(), h_, w_, x_, and y_.

◆ draw_box() [3/3]

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 462 of file fl_boxtype.cxx.

References active_r(), draw_it_active, fl_box_table, H, and Y.

◆ draw_focus() [1/2]

void Fl_Widget::draw_focus ( )
inlineprotected

◆ draw_focus() [2/2]

void Fl_Widget::draw_focus ( Fl_Boxtype  B,
int  X,
int  Y,
int  W,
int  H 
) const
protected

◆ draw_label() [1/3]

◆ draw_label() [2/3]

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 109 of file fl_labeltype.cxx.

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

◆ draw_label() [3/3]

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 118 of file fl_labeltype.cxx.

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

◆ flags()

◆ h() [1/2]

int Fl_Widget::h ( ) const
inline

Gets the widget height.

Returns
the height of the widget in pixels.

Definition at line 299 of file Fl_Widget.H.

References h_.

Referenced by Fl_Table::_auto_drag_cb(), Fl_Window::_Fl_Window(), Fl_Scroll::bbox(), Fl_Browser_::bbox(), Fl_Text_Display::buffer(), Fl_Counter::calc_mouseobj(), capture_gl_rectangle(), Fl_Tabs::client_area(), Fl_Window::combine_mask(), damage(), damage_resize(), Fl_Window::decorated_h(), Fl_Tree::displayed(), Shortcut_Button::draw(), Fl_FormsBitmap::draw(), Fl_FormsPixmap::draw(), Fl_Return_Button::draw(), Fl_Roller::draw(), ColorMenu::draw(), Fl_Value_Slider::draw(), Fl_Light_Button::draw(), Flcc_HueBox::draw(), Fl_Wizard::draw(), Fl_Progress::draw(), Fl_Adjuster::draw(), Fl_Value_Output::draw(), Fl_Timer::draw(), Fl_Positioner::draw(), Fl_Scrollbar::draw(), Flcc_ValueBox::draw(), Fl_Pack::draw(), Fl_TooltipBox::draw(), Fl_Dial::draw(), Fl_Clock_Output::draw(), Fl_Menu_Button::draw(), Fl_Counter::draw(), Fl_File_Input::draw(), Fl_Menu_Bar::draw(), Fl_Slider::draw(), Fl_Chart::draw(), Fl_Choice::draw(), menutitle::draw(), menuwindow::draw(), Fl_Scroll::draw(), Fl_Window::draw(), Fl_Browser_::draw(), Fl_Tabs::draw(), Fl_Input::draw(), Fl_Help_View::draw(), Overlay_Window::draw(), Fl_Text_Display::draw(), ColorChip::draw(), Fl_Table::draw(), Fl_Group::draw_children(), Fl_Scroll::draw_clip(), draw_focus(), Fl_Text_Display::draw_line_numbers(), Fl_Group::draw_outside_label(), Fl_Tabs::draw_tab(), Fl_Tree::draw_tree(), menuwindow::drawentry(), Fl_Help_View::find_link(), menuwindow::find_selected(), Fl_Table::Fl_Table(), Fl_Double_Window::flush(), Fl_Help_View::format(), Fl_Group::forms_end(), Fl_Window::fullscreen(), Fl_Window::fullscreen_x(), Fl_Value_Slider::handle(), Flcc_HueBox::handle(), Fl_Adjuster::handle(), Fl_Positioner::handle(), Fl_Scrollbar::handle(), Flcc_ValueBox::handle(), Fl_Dial::handle(), Fl_Menu_Bar::handle(), Fl_Slider::handle(), Fl_Choice::handle(), Fl_Button::handle(), Fl_Tabs::handle(), Fl_Input::handle(), Fl_Table::handle(), Fl_Tree::handle(), Flcc_HueBox::handle_key(), Flcc_ValueBox::handle_key(), Fl_Input_::handletext(), Fl_Window::hotspot(), Fl_Input_Choice::inp_h(), menuwindow::is_inside(), Fl_Text_Display::linenumber_width(), Fl_Input_::linesPerPage(), Fl_Input_Choice::menu_h(), menuwindow::menuwindow(), Fl_Gl_Window::pixel_h(), Fl_Menu_Button::popup(), Fl_Paged_Device::print_window_part(), Overlay_Window::read_image(), Fl_Table::recalc_dimensions(), Fl_Scroll::recalc_scrollbars(), redraw_label(), Fl_Tabs::redraw_tabs(), Fl_Tile::resize(), Fl_Double_Window::resize(), Fl_Overlay_Window::resize(), Fl_Group::resize(), Fl_Scroll::resize(), Fl_Input_::resize(), Fl_Window::resize(), Overlay_Window::resize(), Fl_Text_Display::resize(), Fl_Help_View::resize(), Fl_Text_Display::scroll(), Fl_Tree::scrollbar_size(), Fl_Window::shape_alpha_(), Fl_Window::show(), Fl_Text_Display::show_insert_position(), Fl_Tree::show_item_bottom(), Fl_Tree::show_item_middle(), Fl_Group::sizes(), Fl_Tabs::tab_height(), Fl_Help_View::topline(), Fl_Tabs::which(), and Fl_Text_Display::wrap_mode().

◆ h() [2/2]

void Fl_Widget::h ( int  v)
inlineprotected

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

Definition at line 145 of file Fl_Widget.H.

References h_.

Referenced by Fl_File_Chooser::add_extra(), align_widget_cb(), Fl_Scroll::bbox(), border_width_title_bar_height(), Fl_Tree_Item::calc_item_height(), Fl_Tabs::client_area(), damage(), decorated_win_size(), Fl_Tiled_Image::draw(), Fl_Pack::draw(), Fl_Scroll::draw(), Fl_Tree_Item::draw(), Fl_Help_View::draw(), Fl_Text_Display::draw(), Fl_Table::draw(), draw_bottom_brace(), Fl_Group::draw_child(), Fl_Paged_Device::draw_decorated_window(), draw_left_brace(), Fl_Text_Display::draw_line_numbers(), Fl_Group::draw_outside_label(), Fl_Window_Type::draw_overlay(), draw_right_brace(), Fl_Tooltip::enter_(), Fl_Widget_Type::enter_live_mode(), Fl_Group_Type::enter_live_mode(), Fl_Table_Type::enter_live_mode(), Fl_Tabs_Type::enter_live_mode(), Fl_Scroll_Type::enter_live_mode(), Fl_Window_Type::enter_live_mode(), fake_X_wm_style(), fix_group_size(), Fl_File_Chooser::Fl_File_Chooser(), fl_get_object_geometry(), Fl_Group::forms_end(), generate_image(), generate_vimage(), group_cb(), Fl_Help_Dialog::h(), Fl_Tile::handle(), Fl_Window_Type::handle(), Fl::handle_(), Fl_Window::hotspot(), Fl_Return_Button_Type::ideal_size(), Fl_Choice_Type::ideal_size(), live_mode_cb(), Fl_Widget_Type::make(), make_codeblock_panel(), make_declblock_panel(), make_settings_window(), make_widget_panel(), menuwindow::menuwindow(), Fl_Window_Type::newposition(), Fl_Tile::position(), Fl_File_Chooser::preview(), Fl_Gl_Device_Plugin::print(), Fl_Paged_Device::print_widget(), Fl_Menu_Item::pulldown(), Fl_Widget_Type::read_fdesign(), Fl_Window_Type::read_fdesign(), Fl_Scroll::recalc_scrollbars(), Fl_Tile::resize(), Fl_Group::resize(), Fl_Scroll::resize(), save_position(), Fl_Tree::scrollbar_size(), set_max_size_cb(), set_min_size_cb(), Fl_Group::sizes(), Fl_Tabs::tab_height(), traverse_to_gl_subwindows(), Fl_Group::update_child(), Fl_File_Chooser::update_preview(), w_cb(), WndProc(), Fl_Widget_Type::write_code1(), Fl_Widget_Class_Type::write_code1(), Fl_Widget_Type::write_properties(), x_cb(), and y_cb().

◆ handle()

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 Overlay_Window, Fl_Help_View, Fl_Input, Fl_Window, Widget_Browser, Fl_Tabs, Fl_Scroll, menuwindow, Fl_Clock, Fl_Check_Browser, Fl_Button, Fl_Choice, Fl_Gl_Window, Fl_Slider, Fl_Menu_Button, Fl_Menu_Bar, Fl_Group, Fl_Value_Input, Fl_Counter, Fl_Dial, Flcc_ValueBox, Fl_Scrollbar, Fl_Positioner, Fl_Box, Fl_Value_Output, Fl_Timer, Fl_Glut_Window, Fl_Adjuster, Flcc_HueBox, Fl_Secret_Input, Fl_Light_Button, Fl_Value_Slider, Fl_Roller, ColorMenu, Fl_Return_Button, Fl_Repeat_Button, Shortcut_Button, Fl_Browser_, Fl_Spinner, Fl_Table_Row, Fl_File_Input, Fl_Tile, CodeViewer, Fl_Tree, Fl_Table, Fl_Text_Display, Fl_TooltipBox, Fl_Free, and Fl_Text_Editor.

Definition at line 112 of file Fl_Widget.cxx.

Referenced by activate(), Fl_Menu_Type::click_test(), Fl_Input_Choice_Type::click_test(), deactivate(), FLDropTarget::Drop(), fl_fix_focus(), fl_handle(), Fl_Group::handle(), Fl_Clock::handle(), Fl_Input::handle(), handler(), Fl_Input_::handletext(), hide(), Fl::paste(), send(), send_event(), show(), and take_focus().

◆ hide()

◆ image() [1/4]

◆ image() [2/4]

const Fl_Image* Fl_Widget::image ( ) const
inline

Definition at line 515 of file Fl_Widget.H.

References Fl_Label::image, and label_.

◆ image() [3/4]

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 527 of file Fl_Widget.H.

References Fl_Label::image, and label_.

◆ image() [4/4]

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 521 of file Fl_Widget.H.

References Fl_Label::image, and label_.

◆ inside()

int Fl_Widget::inside ( const Fl_Widget wgt) const
inline

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

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

Definition at line 898 of file Fl_Widget.H.

References contains().

Referenced by activate(), and show().

◆ is_label_copied()

int Fl_Widget::is_label_copied ( ) const
inline

Returns whether the current label was assigned with copy_label().

This can be useful for temporarily overwriting the widget's label and restoring it later.

Return values
0current label was assigned with label().
1current label was assigned with copy_label().

Definition at line 247 of file Fl_Widget.H.

References COPIED_LABEL, and flags_.

◆ label() [1/3]

◆ label() [2/3]

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()

Definition at line 310 of file Fl_Widget.cxx.

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

◆ label() [3/3]

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 450 of file Fl_Widget.H.

References b, label_, Fl_Label::type, and Fl_Label::value.

◆ label_shortcut()

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 (code point) 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 423 of file fl_shortcut.cxx.

References fl_utf8decode().

Referenced by innards(), and test_shortcut().

◆ labelcolor() [1/2]

◆ labelcolor() [2/2]

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 478 of file Fl_Widget.H.

References Fl_Label::color, and label_.

◆ labelfont() [1/2]

◆ labelfont() [2/2]

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

Definition at line 496 of file Fl_Widget.H.

References f, Fl_Label::font, and label_.

◆ labelsize() [1/2]

◆ labelsize() [2/2]

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()

Definition at line 508 of file Fl_Widget.H.

References label_, and Fl_Label::size.

◆ labeltype() [1/2]

◆ labeltype() [2/2]

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 466 of file Fl_Widget.H.

References label_, and Fl_Label::type.

◆ measure_label()

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.

This calls fl_measure() internally. For more information about the arguments ww and hh and word wrapping

See also
fl_measure(const char*, int&, int&, int)

Definition at line 957 of file Fl_Widget.H.

References label_, and Fl_Label::measure().

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

◆ operator=()

Fl_Widget& Fl_Widget::operator= ( const Fl_Widget )
private

unimplemented assignment operator

◆ output()

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 747 of file Fl_Widget.H.

References flags_, and OUTPUT.

◆ parent() [1/2]

Fl_Group* Fl_Widget::parent ( ) const
inline

Returns a pointer to the parent widget.
Usually this is a Fl_Group or Fl_Window.

Return values
NULLif the widget has no parent
See also
Fl_Group::add(Fl_Widget*)

Definition at line 254 of file Fl_Widget.H.

References parent_.

Referenced by active_r(), border_width_title_bar_height(), Fl_File_Chooser::cb_(), Fl_Help_Dialog::cb_back_(), Fl_File_Chooser::cb_cancelButton(), cb_Close(), Fl_File_Chooser::cb_favCancelButton(), Fl_File_Chooser::cb_favDeleteButton(), Fl_File_Chooser::cb_favDownButton(), Fl_File_Chooser::cb_favList(), Fl_File_Chooser::cb_favOkButton(), Fl_File_Chooser::cb_favoritesButton(), Fl_File_Chooser::cb_favUpButton(), Fl_File_Chooser::cb_fileList(), Fl_File_Chooser::cb_fileName(), Fl_Help_Dialog::cb_find_(), Fl_Help_Dialog::cb_forward_(), Fl_Help_Dialog::cb_larger_(), Fl_File_Chooser::cb_newButton(), Fl_File_Chooser::cb_okButton(), Fl_File_Chooser::cb_previewButton(), Fl_File_Chooser::cb_showChoice(), Fl_File_Chooser::cb_showHiddenButton(), Fl_Help_Dialog::cb_smaller_(), Fl_Help_Dialog::cb_view_(), color_cb(), Fl_Widget_Type::copy_properties(), Fl_Tooltip::current(), damage(), decorated_win_size(), default_callback(), Flcc_HueBox::draw(), Flcc_ValueBox::draw(), Fl_Window::draw(), Fl_Browser_::draw(), Fl_Scroll::draw_clip(), FLDropTarget::Drop(), Fl_Group::end(), Fl_Table::end(), Fl_Tooltip::enter_(), fake_X_wm_style(), find_active(), fl_delete_object(), fl_fix_focus(), fl_handle(), fl_set_spot(), Fl_Value_Input::Fl_Value_Input(), Flcc_Value_Input::format(), generate_image(), Flcc_HueBox::handle(), Flcc_ValueBox::handle(), Fl_Window::handle(), Fl_Tree::handle(), Fl_Window_Type::handle(), Fl::handle_(), Flcc_HueBox::handle_key(), Flcc_ValueBox::handle_key(), Fl_Window::hide(), hide(), hscrollbar_callback(), Fl_Scroll::hscrollbar_cb(), Fl_Group::insert(), Fl_Window::label(), min_w_cb(), Fl_Color_Chooser::mode_cb(), mouse_event(), Fl_Group::navigation(), Fl_File_Chooser::ok_label(), Fl_File_Chooser::preview(), Fl_Widget_Type::read_property(), relative(), Fl_Tree::remove(), Fl_Widget_Type::resizable(), Fl_Color_Chooser::rgb_cb(), Fl_Scroll::scroll_to(), scrollbar_callback(), Fl_Scroll::scrollbar_cb(), send_event(), Fl_Button::setonly(), slider_size_cb(), visible_cb(), visible_r(), window(), WndProc(), Fl_Widget_Type::write_widget_code(), xclass_cb(), Fl_Value_Input::~Fl_Value_Input(), and Fl_Widget_Type::~Fl_Widget_Type().

◆ parent() [2/2]

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 264 of file Fl_Widget.H.

References p, and parent_.

◆ position()

void Fl_Widget::position ( int  X,
int  Y 
)
inline

◆ redraw()

void Fl_Widget::redraw ( )

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

Definition at line 1782 of file Fl.cxx.

References damage(), and FL_DAMAGE_ALL.

Referenced by Fl_Tree_Item::activate(), activate(), Fl_Type::add(), Fl_Chart::add(), Fl_Group_Type::add_child(), Fl_Table_Type::add_child(), Fl_Window_Type::add_child(), align_widget_cb(), Fl_Chart::bounds(), Fl_Menu_Type::build_menu(), Fl_Input_Choice_Type::build_menu(), cb_template_browser(), Fl_Check_Browser::check_all(), Fl_Check_Browser::check_none(), Fl_Check_Browser::checked(), Fl_Chart::clear(), Fl_Tree::clear_children(), Fl_Help_View::clear_global_selection(), Fl_Tree::close(), Fl_Tree::closeicon(), Fl_Table::col_position(), Fl_Table::col_width(), color2_cb(), color_cb(), Fl_Table::cols(), Fl_Type::comment(), Fl_Tree::connectorstyle(), Fl_Tree::connectorwidth(), damage_resize(), deactivate(), Fl_Tree::deselect(), Fl_File_Chooser::fileNameCB(), fl_redraw_object(), fl_set_object_label(), Fl_Table::Fl_Table(), glutPostRedisplay(), h_cb(), Shortcut_Button::handle(), Fl_Roller::handle(), Fl_Value_Slider::handle(), Fl_Light_Button::handle(), Flcc_HueBox::handle(), Fl_Positioner::handle(), Fl_Adjuster::handle(), Fl_Text_Editor::handle(), Flcc_ValueBox::handle(), Fl_Counter::handle(), Fl_Slider::handle(), Fl_Menu_Button::handle(), Fl_Choice::handle(), Fl_Button::handle(), Fl_Browser_::handle(), Fl_Tabs::handle(), Widget_Browser::handle(), Fl_Help_View::handle(), Fl_Table::handle(), Fl_Tree::handle(), Fl_Browser::hide(), Fl_Tree::hposition(), Fl_Browser::icon(), Fl_File_Browser::iconsize(), Fl_Type::insert(), Fl_Chart::insert(), Fl_Button::key_release_timeout(), Fl_Type::label(), labelcolor_cb(), Fl_Tree::labelmarginleft(), Fl_Help_View::leftline(), Fl_Tree::linespacing(), Fl_Tree::marginleft(), Fl_Tree::margintop(), max_cb(), Fl_Progress::maximum(), Fl_Chart::maxsize(), min_cb(), Fl_Progress::minimum(), Fl_Type::move_before(), Fl_Group_Type::move_child(), Fl_Table_Type::move_child(), Fl_Window_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(), redraw_widget_browser(), Fl::reload_scheme(), Fl_Type::remove(), Fl_Group_Type::remove_child(), Fl_Table_Type::remove_child(), Fl_Window_Type::remove_child(), Fl_Chart::replace(), Fl_Scroll::resize(), Fl_Window::resize(), Fl_Text_Display::resize(), igroup::resize(), itabs::resize(), iwizard::resize(), Fl_Table::resize(), 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(), Fl_Browser::show(), show(), Fl_Tree::show_item(), Fl_Tree::showcollapse(), Fl_File_Chooser::showHidden(), Fl_Tree::showroot(), Fl_Button::simulate_key_action(), slider_size_cb(), Fl_Timer::step(), step_cb(), subtype_cb(), textcolor_cb(), textfont_cb(), textsize_cb(), tooltip_timeout(), Fl_Help_View::topline(), Fl_Table_Row::type(), Fl_File_Chooser::update_preview(), Fl_Tree::usericon(), Fl_Tree::usericonmarginleft(), Fl_Timer::value(), Fl_Progress::value(), Fl_Positioner::value(), Fl_Choice::value(), Fl_Button::value(), Fl_File_Chooser::value(), Fl_Tree::vposition(), w_cb(), widget_size_cb(), Fl_Code_Type::write(), Fl_Code_Type::write_code1(), x_cb(), Fl_Positioner::xbounds(), y_cb(), and Fl_Positioner::ybounds().

◆ redraw_label()

void Fl_Widget::redraw_label ( )

◆ resize()

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 iwizard, itabs, igroup, Fl_Tree, Fl_Help_View, Overlay_Window, Fl_Input_, Fl_Group, Fl_Gl_Window, Fl_Value_Input, Fl_Overlay_Window, Fl_Double_Window, Fl_Table, Fl_Text_Display, Fl_Window, Fl_Browser_, Fl_Input_Choice, Fl_Spinner, Fl_Scroll, and Fl_Tile.

Definition at line 150 of file Fl_Widget.cxx.

References H, h_, w_, x_, Y, and y_.

Referenced by align_widget_cb(), cb(), damage_resize(), Fl_Pack::draw(), Fl_Scroll::draw(), Fl_Tree_Item::draw(), Fl_Help_View::draw(), Fl_Tree::draw_tree(), fix_group_size(), fl_set_object_geometry(), Fl_Help_View::format(), 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_Value_Input::resize(), Fl_Group::resize(), Fl_Scroll::resize(), Fl_Input_::resize(), Fl_Browser_::resize(), Fl_Text_Display::resize(), Fl_Help_View::resize(), igroup::resize(), itabs::resize(), iwizard::resize(), resizeform(), Fl_Tree::scrollbar_size(), Fl_Table::table_resized(), w_cb(), x_cb(), and y_cb().

◆ selection_color() [1/2]

Fl_Color Fl_Widget::selection_color ( ) const
inline

◆ selection_color() [2/2]

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 406 of file Fl_Widget.H.

References color2_.

◆ set_active()

void Fl_Widget::set_active ( )
inline

Marks the widget as active without sending events or changing focus. This is mainly for specialized use, for normal cases you want activate().

See also
activate()

Definition at line 803 of file Fl_Widget.H.

References flags_, and INACTIVE.

◆ set_changed()

◆ set_flag()

◆ set_output()

void Fl_Widget::set_output ( )
inline

Sets a widget to output only.

See also
output(), clear_output()

Definition at line 752 of file Fl_Widget.H.

References flags_, and OUTPUT.

◆ set_visible()

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 696 of file Fl_Widget.H.

References flags_, and INVISIBLE.

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

◆ set_visible_focus()

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 820 of file Fl_Widget.H.

References flags_, and VISIBLE_FOCUS.

Referenced by visible_focus().

◆ show()

void Fl_Widget::show ( )
virtual

Makes a widget visible.

An invisible widget never gets redrawn and does not get keyboard or mouse events, but can receive a few other events like FL_SHOW.

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_Window, Fl_Browser, Fl_Gl_Window, Fl_TooltipBox, Fl_Overlay_Window, Fl_Double_Window, Fl_Single_Window, and Fl_Menu_Window.

Definition at line 271 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(), cb_print_collate_button(), Fl_Tree::draw_tree(), Fl_Scroll_Type::enter_live_mode(), Fl_Help_View::Fl_Help_View(), fl_show_object(), Fl_Help_View::format(), i18n_type_cb(), innards(), input_innards(), min_w_cb(), modal_cb(), name_cb(), name_public_cb(), name_public_member_cb(), new_cb(), non_modal_cb(), Fl_Function_Type::open(), Fl_Decl_Type::open(), Fl_Data_Type::open(), Fl_File_Chooser::preview(), 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().

◆ size()

void Fl_Widget::size ( int  W,
int  H 
)
inline

◆ take_focus()

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 162 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(), Shortcut_Button::handle(), Fl_Value_Input::handle(), Fl_Group::handle(), Fl_Spinner::handle(), Fl_Input::handle(), Fl_Table::handle(), Fl_Tree::handle(), input_innards(), Fl_Group::navigation(), Fl_File_Chooser::show(), and show().

◆ takesevents()

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 764 of file Fl_Widget.H.

References flags_, INACTIVE, INVISIBLE, and OUTPUT.

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

◆ test_shortcut() [1/2]

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.

Definition at line 494 of file fl_shortcut.cxx.

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

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

◆ test_shortcut() [2/2]

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 456 of file fl_shortcut.cxx.

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

◆ tooltip() [1/2]

◆ tooltip() [2/2]

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 339 of file Fl_Tooltip.cxx.

References clear_flag(), COPIED_TOOLTIP, flags(), free(), Fl_Tooltip::set_enter_exit_once_(), and tooltip_.

◆ top_window()

Fl_Window * Fl_Widget::top_window ( ) const

Returns a pointer to the top-level window for the widget. In other words, the 'window manager window' that contains this widget. This method differs from window() in that it won't return sub-windows (if there are any).

Returns
the top-level window, or NULL if no top-level window is associated with this widget.
See also
window()

Definition at line 130 of file Fl_Window.cxx.

References w().

Referenced by top_win_iconified_().

◆ top_window_offset()

Fl_Window * Fl_Widget::top_window_offset ( int &  xoff,
int &  yoff 
) const

Finds the x/y offset of the current widget relative to the top-level window.

Parameters
[out]xoff,yoffReturns the x/y offset
Returns
the top-level window (or NULL for a widget that's not in any window)

Definition at line 141 of file Fl_Window.cxx.

References w().

◆ type() [1/2]

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" ?

Definition at line 274 of file Fl_Widget.H.

References type_.

Referenced by Fl_Window::_Fl_Window(), Fl_Counter::calc_mouseobj(), Fl_Widget_Type::copy_properties(), Fl_Scroll_Type::copy_properties(), damage(), Fl_Browser_::deselect(), Fl_Return_Button::draw(), Fl_Timer::draw(), Fl_Dial::draw(), Fl_Menu_Button::draw(), Fl_Clock_Output::draw(), Fl_Counter::draw(), Fl_Slider::draw(), Fl_Chart::draw(), Fl_Button::draw(), Fl_Slider::draw_bg(), Fl_Group::draw_child(), 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_Spinner::Fl_Spinner(), 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(), Shortcut_Button::handle(), Fl_Scrollbar::handle(), Fl_Free::handle(), Fl_Value_Input::handle(), Fl_Slider::handle(), Fl_Menu_Button::handle(), Fl_Button::handle(), Fl_Browser_::handle(), Fl_Valuator::horizontal(), Fl_Pack::horizontal(), input_innards(), 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_Scroll::recalc_scrollbars(), Fl_Group::resize(), Fl_Browser_::select(), Fl_Browser_::select_only(), send(), Fl_Button::setonly(), Fl_Group::sizes(), Fl_Timer::step(), Fl_Spinner::step(), subtype_cb(), Fl_File_Chooser::type(), Fl_Spinner::type(), Fl_Group::update_child(), Fl_Timer::value(), Widget_Browser::Widget_Browser(), WndProc(), Fl_Input_::wrap(), Fl_Widget_Type::write_properties(), and Fl_Widget_Type::write_widget_code().

◆ type() [2/2]

void Fl_Widget::type ( uchar  t)
inline

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

Definition at line 279 of file Fl_Widget.H.

References type_.

◆ use_accents_menu()

int Fl_Widget::use_accents_menu ( )
inline

Returns non zero if MAC_USE_ACCENTS_MENU flag is set, 0 otherwise.

Definition at line 1016 of file Fl_Widget.H.

References flags(), and MAC_USE_ACCENTS_MENU.

◆ user_data() [1/2]

◆ user_data() [2/2]

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 599 of file Fl_Widget.H.

References user_data_.

◆ visible()

unsigned int Fl_Widget::visible ( ) const
inline

Returns whether a widget is visible.

Return values
0if the widget is not drawn and hence invisible.
See also
show(), hide(), visible_r()

Definition at line 660 of file Fl_Widget.H.

References flags_, and INVISIBLE.

Referenced by Fl_Table::_auto_drag_cb(), Fl_Scroll::bbox(), Fl_Browser_::bbox(), border_width_title_bar_height(), Fl_Widget_Type::copy_properties(), decorated_win_size(), Fl_Pack::draw(), Fl_Scroll::draw(), Fl_Browser_::draw(), Fl_Help_View::draw(), Fl_Text_Display::draw(), Fl_Table::draw(), Fl_Group::draw_child(), Fl_Text_Display::draw_line_numbers(), Fl_Group::draw_outside_label(), Fl_Tabs::draw_tab(), Fl_Tree::draw_tree(), Fl_Tooltip::enter_area(), Fl_Tooltip::exit_(), Fl_Tree::extend_selection__(), Fl_Menu_Item_Type::flags(), Fl_Help_View::format(), Fl_Group::handle(), Fl_Tabs::handle(), Fl_Window::handle(), Fl_Tree::handle(), innards(), Fl_Tree::is_vscroll_visible(), Fl_Tree::next_item(), Fl_Paged_Device::print_widget(), Fl_Tabs::push(), Fl_Scroll::resize(), Fl_Text_Display::resize(), resizeform(), save_position(), selection_changed(), set_modflag(), show(), Fl_Tabs::tab_positions(), Fl_Table::table_resized(), toggle_sourceview_cb(), toggle_widgetbin_cb(), top_win_iconified_(), Fl_Paged_Device::traverse(), traverse_to_gl_subwindows(), Fl_Group::update_child(), update_sourceview_cb(), update_sourceview_position(), Fl_Wizard::value(), Fl_Tabs::value(), Fl_Help_Dialog::visible(), Fl_File_Chooser::visible(), visible_cb(), Fl_Widget_Type::write_properties(), Fl_Window_Type::write_properties(), and Fl_Widget_Type::write_widget_code().

◆ visible_focus() [1/2]

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 838 of file Fl_Widget.H.

References flags_, and VISIBLE_FOCUS.

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

◆ visible_focus() [2/2]

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 832 of file Fl_Widget.H.

References clear_visible_focus(), and set_visible_focus().

Referenced by Fl::focus().

◆ visible_r()

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 295 of file Fl_Widget.cxx.

References parent().

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

◆ w() [1/2]

int Fl_Widget::w ( ) const
inline

Gets the widget width.

Returns
the width of the widget in pixels.

Definition at line 294 of file Fl_Widget.H.

References w_.

Referenced by Fl_Table::_auto_drag_cb(), Fl_Window::_Fl_Window(), Fl_Scroll::bbox(), Fl_Browser_::bbox(), Fl_Text_Display::buffer(), Fl_Counter::calc_mouseobj(), capture_gl_rectangle(), Fl_Group::clear(), Fl_Tabs::client_area(), Fl_Window::combine_mask(), Fl_Window::cursor(), damage(), damage_resize(), Fl_Window::decorated_w(), Shortcut_Button::draw(), Fl_FormsBitmap::draw(), Fl_FormsPixmap::draw(), Fl_Return_Button::draw(), Fl_Roller::draw(), ColorMenu::draw(), Fl_Value_Slider::draw(), Fl_Light_Button::draw(), Flcc_HueBox::draw(), Fl_Wizard::draw(), Fl_Progress::draw(), Fl_Value_Output::draw(), Fl_Adjuster::draw(), Fl_Timer::draw(), Fl_Positioner::draw(), Fl_Scrollbar::draw(), Fl_Pack::draw(), Flcc_ValueBox::draw(), Fl_TooltipBox::draw(), Fl_Dial::draw(), Fl_Clock_Output::draw(), Fl_Menu_Button::draw(), Fl_Counter::draw(), Fl_File_Input::draw(), Fl_Slider::draw(), Fl_Chart::draw(), Fl_Choice::draw(), menutitle::draw(), menuwindow::draw(), Fl_Scroll::draw(), Fl_Window::draw(), Fl_Browser_::draw(), Fl_Tabs::draw(), Fl_Input::draw(), Fl_Help_View::draw(), Overlay_Window::draw(), Fl_Text_Display::draw(), ColorChip::draw(), Fl_Table::draw(), Fl_File_Input::draw_buttons(), Fl_Group::draw_children(), Fl_Scroll::draw_clip(), draw_focus(), Fl_Group::draw_outside_label(), Fl_Tree::draw_tree(), menuwindow::drawentry(), Fl_Input_::expand(), Fl_Help_View::find_link(), menuwindow::find_selected(), Fl_Text_Display::find_x(), Fl_Table::Fl_Table(), Fl_Double_Window::flush(), Fl_Help_View::format(), Fl_Help_View::format_table(), Fl_Group::forms_end(), Fl_Window::fullscreen(), Fl_Window::fullscreen_x(), Fl_Value_Slider::handle(), Flcc_HueBox::handle(), Fl_Adjuster::handle(), Fl_Positioner::handle(), Fl_Scrollbar::handle(), Fl_Dial::handle(), Fl_Menu_Bar::handle(), Fl_Slider::handle(), Fl_Choice::handle(), Fl_Button::handle(), Fl_Browser_::handle(), Fl_Input::handle(), Fl_Table::handle(), Flcc_HueBox::handle_key(), Fl_Text_Display::handle_vline(), Fl_Input_::handletext(), Fl_Window::hotspot(), Fl_Help_View::hv_draw(), Fl_Input_Choice::inp_w(), menuwindow::is_inside(), Fl_Tree::is_scrollbar(), Widget_Browser::item_draw(), Fl_Help_View::leftline(), Fl_Text_Display::linenumber_width(), Fl_Input_Choice::menu_x(), menuwindow::menuwindow(), Fl_Gl_Window::pixel_w(), Fl_Menu_Button::popup(), Fl_Paged_Device::print_window_part(), Overlay_Window::read_image(), Fl_Table::recalc_dimensions(), Fl_Scroll::recalc_scrollbars(), redraw_label(), Fl_Tabs::redraw_tabs(), Fl_Tile::resize(), Fl_Double_Window::resize(), Fl_Overlay_Window::resize(), Fl_Group::resize(), Fl_Scroll::resize(), Fl_Input_::resize(), Fl_Window::resize(), Overlay_Window::resize(), Fl_Text_Display::resize(), Fl_Help_View::resize(), ColorMenu::run(), Fl_Text_Display::scroll(), Fl_Text_Display::scroll_timer_cb(), Fl_Tree::scrollbar_size(), Fl_Window::shape_alpha_(), Fl_Window::show(), Fl_Text_Display::show_insert_position(), Fl_Group::sizes(), Fl_Tabs::tab_positions(), top_window(), top_window_offset(), and Fl_Text_Display::wrap_mode().

◆ w() [2/2]

void Fl_Widget::w ( int  v)
inlineprotected

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

Definition at line 143 of file Fl_Widget.H.

References w_.

Referenced by Fl_File_Chooser::add_extra(), align_widget_cb(), Fl_Scroll::bbox(), border_width_title_bar_height(), Fl_Tabs::client_area(), damage(), decorated_win_size(), Fl_Tiled_Image::draw(), Fl_Pack::draw(), Fl_Scroll::draw(), Fl_Tree_Item::draw(), Fl_Help_View::draw(), Fl_Text_Display::draw(), Fl_Table::draw(), draw_bottom_brace(), Fl_Group::draw_child(), Fl_Paged_Device::draw_decorated_window(), Fl_Text_Display::draw_line_numbers(), Fl_Group::draw_outside_label(), Fl_Window_Type::draw_overlay(), draw_right_brace(), draw_top_brace(), Fl_Tooltip::enter_(), Fl_Widget_Type::enter_live_mode(), Fl_Group_Type::enter_live_mode(), Fl_Table_Type::enter_live_mode(), Fl_Tabs_Type::enter_live_mode(), Fl_Scroll_Type::enter_live_mode(), Fl_Window_Type::enter_live_mode(), fake_X_wm_style(), fix_group_size(), Fl_File_Chooser::Fl_File_Chooser(), fl_find(), fl_get_object_geometry(), Fl::flush(), Fl_Group::forms_end(), generate_image(), group_cb(), h_cb(), Fl_Tile::handle(), Fl_Window_Type::handle(), Fl::handle_(), Fl_Window::hide(), Fl_Window::hotspot(), Fl_Return_Button_Type::ideal_size(), Fl_Input_Choice_Type::ideal_size(), Fl_Menu_Bar_Type::ideal_size(), Fl_Value_Output_Type::ideal_size(), live_mode_cb(), Fl_Widget_Type::make(), make_codeblock_panel(), make_declblock_panel(), make_print_panel(), make_settings_window(), make_widget_panel(), Fl_Group::navigation(), Fl_Window_Type::newposition(), Fl::next_window(), Fl_Tile::position(), Fl_Gl_Device_Plugin::print(), Fl_Paged_Device::print_widget(), Fl_Menu_Item::pulldown(), Fl_Window_Type::read_fdesign(), Fl_Scroll::recalc_scrollbars(), Fl_Tile::resize(), Fl_Group::resize(), Fl_Scroll::resize(), save_position(), Fl_Tree::scrollbar_size(), set_max_size_cb(), set_min_size_cb(), Fl_Group::sizes(), traverse_to_gl_subwindows(), Fl_Group::update_child(), Fl_File_Chooser::update_preview(), Fl_Help_Dialog::w(), WndProc(), Fl_Widget_Type::write_code1(), Fl_Widget_Class_Type::write_code1(), Fl_Widget_Type::write_properties(), x_cb(), and y_cb().

◆ when() [1/2]

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 621 of file Fl_Widget.H.

References when_.

Referenced by CodeEditor::auto_indent(), Fl_Table::col_width(), Fl_Tree::extend_selection__(), 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_Input_Choice::Fl_Input_Choice(), Fl_Menu_::Fl_Menu_(), Fl_Positioner::Fl_Positioner(), fl_set_object_return(), Fl_Spinner::Fl_Spinner(), Fl_Tree::Fl_Tree(), Fl_Valuator::Fl_Valuator(), Fl_Value_Input::Fl_Value_Input(), Shortcut_Button::handle(), Fl_Positioner::handle(), Fl_Text_Editor::handle(), Fl_Value_Input::handle(), Fl_Button::handle(), Fl_Browser_::handle(), Fl_Tabs::handle(), Fl_Table::handle(), Fl_Tree::handle(), Fl_File_Input::handle_button(), Fl_Valuator::handle_drag(), Fl_Text_Editor::handle_key(), Fl_Input::handle_key(), Fl_Valuator::handle_release(), Fl_Input_::handletext(), Fl_Input_Choice::inp_cb(), Fl_Value_Input::input_cb(), 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_Input_Choice::menu_cb(), 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().

◆ when() [2/2]

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 654 of file Fl_Widget.H.

References when_.

◆ window()

Fl_Window * Fl_Widget::window ( ) const

Returns a pointer to the nearest parent window up the widget hierarchy. This will return sub-windows if there are any, or the parent window if there's no sub-windows. If this widget IS the top-level window, NULL is returned.

Return values
NULLif no window is associated with this widget.
Note
for an Fl_Window widget, this returns its parent window (if any), not this window.
See also
top_window()

Definition at line 118 of file Fl_Window.cxx.

References FL_WINDOW, and parent().

Referenced by align_widget_cb(), callback_cb(), cc_cancel_cb(), cc_ok_cb(), comment_cb(), Fl_Window::cursor(), Fluid_Image::deimage(), Fl_Scroll::draw_clip(), Overlay_Window::draw_overlay(), Fl_Input_::drawtext(), FLDropTarget::Drop(), Fl_File_Chooser::Fl_File_Chooser(), FL_ObjWin(), fl_set_spot(), Fl::focus(), Fl_Group::forms_end(), h_cb(), Fl_Text_Editor::handle(), Fl_File_Input::handle(), Fl_Button::handle(), Fl_Text_Display::handle(), Fl_Input::handle(), Overlay_Window::handle(), Fl::handle_(), Fl_File_Input::handle_button(), handler(), Fl_Input_::handletext(), Fl_Window::hide(), Fl_Window::hotspot(), Fl_Menu_Bar_Type::ideal_size(), Fluid_Image::image(), make_class_panel(), make_code_panel(), make_codeblock_panel(), make_comment_panel(), make_data_panel(), make_decl_panel(), make_declblock_panel(), make_function_panel(), mouse_event(), Fl_Paged_Device::print_widget(), Fl_Menu_Item::pulldown(), Fl_Widget_Type::read_property(), redraw_label(), Fl_Scroll::scroll_to(), set_cursor(), traverse_to_gl_subwindows(), Fl_Wizard::value(), w_cb(), widget_size_cb(), WndProc(), x_cb(), Fl_Window::x_root(), y_cb(), and Fl_Window::y_root().

◆ x() [1/2]

int Fl_Widget::x ( ) const
inline

Gets the widget position in its window.

Returns
the x position relative to the window

Definition at line 284 of file Fl_Widget.H.

References x_.

Referenced by Fl_Table::_auto_drag_cb(), menuwindow::autoscroll(), Fl_Scroll::bbox(), Fl_Browser_::bbox(), Fl_Text_Display::buffer(), Fl_Counter::calc_mouseobj(), Fl_Tabs::client_area(), damage(), damage_resize(), Shortcut_Button::draw(), Fl_FormsBitmap::draw(), Fl_FormsPixmap::draw(), Fl_Return_Button::draw(), Fl_Roller::draw(), Fl_Value_Slider::draw(), Fl_Light_Button::draw(), Flcc_HueBox::draw(), Fl_Wizard::draw(), Fl_Progress::draw(), Fl_Value_Output::draw(), Fl_Timer::draw(), Fl_Adjuster::draw(), Fl_Positioner::draw(), Fl_Scrollbar::draw(), Fl_Pack::draw(), Flcc_ValueBox::draw(), Fl_Dial::draw(), Fl_Clock_Output::draw(), Fl_Menu_Button::draw(), Fl_Counter::draw(), Fl_File_Input::draw(), Fl_Menu_Bar::draw(), Fl_Slider::draw(), Fl_Chart::draw(), Fl_Choice::draw(), Fl_Scroll::draw(), Fl_Browser_::draw(), Fl_Tabs::draw(), Fl_Input::draw(), Fl_Help_View::draw(), Fl_Text_Display::draw(), ColorChip::draw(), Fl_Table::draw(), Fl_File_Input::draw_buttons(), Fl_Group::draw_children(), Fl_Text_Display::draw_line_numbers(), Fl_Group::draw_outside_label(), Fl_Tree::draw_tree(), menuwindow::find_selected(), Fl_Text_Display::find_x(), Fl_Table::Fl_Table(), Fl_Help_View::format(), Fl_Group::forms_end(), Fl_Window::fullscreen(), Fl_Window::fullscreen_off(), Fl_Window::fullscreen_off_x(), Fl_Window::fullscreen_x(), Fl_Tile::handle(), ColorMenu::handle(), Fl_Value_Slider::handle(), Flcc_HueBox::handle(), Fl_Adjuster::handle(), Fl_Positioner::handle(), Fl_Scrollbar::handle(), Fl_Dial::handle(), Fl_Menu_Bar::handle(), Fl_Slider::handle(), Fl_Choice::handle(), Fl_Button::handle(), Fl_Browser_::handle(), Fl_Input::handle(), Fl_Help_View::handle(), Fl_Table::handle(), Fl_File_Input::handle_button(), Fl_Input_::handletext(), Fl_Window::hotspot(), Fl_Help_View::hv_draw(), Fl_Input_Choice::inp_x(), Fl_Text_Display::linenumber_width(), Fl_Input_Choice::menu_x(), menuwindow::menuwindow(), Fl_Menu_Button::popup(), Fl_Table::recalc_dimensions(), Fl_Scroll::recalc_scrollbars(), redraw_label(), Fl_Tabs::redraw_tabs(), Fl_Tile::resize(), Fl_Group::resize(), Fl_Scroll::resize(), Fl_Window::resize(), Fl_Text_Display::resize(), Fl_Help_View::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().

◆ x() [2/2]

void Fl_Widget::x ( int  v)
inlineprotected

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

Definition at line 139 of file Fl_Widget.H.

References x_.

Referenced by align_widget_cb(), Fl_Tabs::client_area(), FLDropTarget::DragEnter(), FLDropTarget::DragOver(), Fl_Pack::draw(), Fl_Scroll::draw(), Fl_Tree_Item::draw(), Fl_Browser_::draw(), Fl_Text_Display::draw(), Fl_Table::draw(), draw_bottom_brace(), Fl_Group::draw_child(), draw_left_brace(), Fl_Group::draw_outside_label(), Fl_Window_Type::draw_overlay(), draw_right_brace(), draw_top_brace(), FLDropTarget::Drop(), Fl_Tooltip::enter_(), Fl_Widget_Type::enter_live_mode(), Fl_Group_Type::enter_live_mode(), Fl_Table_Type::enter_live_mode(), Fl_Tabs_Type::enter_live_mode(), Fl_Scroll_Type::enter_live_mode(), Fl_Window_Type::enter_live_mode(), Fl::event_inside(), fake_X_wm_style(), fix_group_size(), fl_fix_focus(), fl_get_object_geometry(), fl_get_object_position(), fl_handle(), Fl_Group::forms_end(), group_cb(), h_cb(), Fl_Tile::handle(), Fl_Window_Type::handle(), Fl::handle_(), Fl_Window::hotspot(), local_handle(), Fl_Widget_Type::make(), mouse_event(), Fl_Group::navigation(), 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_Scroll::recalc_scrollbars(), Fl_Tile::resize(), Fl_Group::resize(), Fl_Scroll::resize(), save_position(), Fl_Scroll::scroll_to(), send(), send_event(), Fl_Group::sizes(), sort(), Fl_Paged_Device::traverse(), traverse_to_gl_subwindows(), Fl_Group::update_child(), w_cb(), Fl_Widget_Type::write_code1(), Fl_Widget_Type::write_properties(), Fl_Help_Dialog::x(), and y_cb().

◆ y() [1/2]

int Fl_Widget::y ( ) const
inline

Gets the widget position in its window.

Returns
the y position relative to the window

Definition at line 289 of file Fl_Widget.H.

References y_.

Referenced by Fl_Table::_auto_drag_cb(), menuwindow::autoscroll(), Fl_Scroll::bbox(), Fl_Browser_::bbox(), Fl_Text_Display::buffer(), Fl_Counter::calc_mouseobj(), Fl_Tabs::client_area(), damage(), damage_resize(), Fl_Tree::displayed(), Shortcut_Button::draw(), Fl_FormsBitmap::draw(), Fl_FormsPixmap::draw(), Fl_Return_Button::draw(), Fl_Roller::draw(), Fl_Value_Slider::draw(), Fl_Light_Button::draw(), Flcc_HueBox::draw(), Fl_Wizard::draw(), Fl_Progress::draw(), Fl_Value_Output::draw(), Fl_Adjuster::draw(), Fl_Timer::draw(), Fl_Positioner::draw(), Fl_Scrollbar::draw(), Flcc_ValueBox::draw(), Fl_Pack::draw(), Fl_Dial::draw(), Fl_Clock_Output::draw(), Fl_Menu_Button::draw(), Fl_Counter::draw(), Fl_File_Input::draw(), Fl_Menu_Bar::draw(), Fl_Slider::draw(), Fl_Chart::draw(), Fl_Choice::draw(), Fl_Scroll::draw(), Fl_Browser_::draw(), Fl_Tabs::draw(), Fl_Input::draw(), Fl_Help_View::draw(), Fl_Text_Display::draw(), ColorChip::draw(), Fl_Table::draw(), Fl_File_Input::draw_buttons(), Fl_Group::draw_children(), Fl_Text_Display::draw_line_numbers(), Fl_Group::draw_outside_label(), Fl_Tabs::draw_tab(), Fl_Tree::draw_tree(), menuwindow::find_selected(), Fl_Table::Fl_Table(), Fl_Help_View::format(), Fl_Group::forms_end(), Fl_Window::fullscreen(), Fl_Window::fullscreen_off(), Fl_Window::fullscreen_off_x(), Fl_Window::fullscreen_x(), Fl_Tile::handle(), ColorMenu::handle(), Fl_Value_Slider::handle(), Flcc_HueBox::handle(), Fl_Adjuster::handle(), Fl_Positioner::handle(), Flcc_ValueBox::handle(), Fl_Scrollbar::handle(), Fl_Dial::handle(), Fl_File_Input::handle(), Fl_Menu_Bar::handle(), Fl_Slider::handle(), Fl_Choice::handle(), Fl_Button::handle(), Fl_Tabs::handle(), Fl_Input::handle(), Fl_Help_View::handle(), Fl_Table::handle(), Fl_Tree::handle(), Fl_Input_::handletext(), Fl_Help_View::hv_draw(), Fl_Input_Choice::inp_y(), Fl_Text_Display::linenumber_width(), Fl_Input_Choice::menu_y(), menuwindow::menuwindow(), Fl_Menu_Button::popup(), menuwindow::position(), Fl_Table::recalc_dimensions(), Fl_Scroll::recalc_scrollbars(), redraw_label(), Fl_Tabs::redraw_tabs(), Fl_Tile::resize(), Fl_Group::resize(), Fl_Scroll::resize(), Fl_Window::resize(), Fl_Text_Display::resize(), Fl_Help_View::resize(), ColorMenu::run(), Fl_Text_Display::scroll(), Fl_Tree::scrollbar_size(), Fl_Window::show(), Fl_Text_Display::show_insert_position(), Fl_Tree::show_item(), Fl_Group::sizes(), Fl_Tabs::tab_height(), Fl_Table::table_scrolled(), Fl_Tabs::which(), Fl_Text_Display::wrap_mode(), Fl_Text_Display::x_to_col(), and Fl_Window::y_root().

◆ y() [2/2]

void Fl_Widget::y ( int  v)
inlineprotected

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

Definition at line 141 of file Fl_Widget.H.

References y_.

Referenced by Fl_File_Chooser::add_extra(), align_widget_cb(), Fl_Tabs::client_area(), FLDropTarget::DragEnter(), FLDropTarget::DragOver(), Fl_Pack::draw(), Fl_Scroll::draw(), Fl_Tree_Item::draw(), Fl_Browser_::draw(), Fl_Text_Display::draw(), Fl_Table::draw(), draw_bottom_brace(), Fl_Group::draw_child(), draw_left_brace(), Fl_Group::draw_outside_label(), Fl_Window_Type::draw_overlay(), draw_right_brace(), draw_top_brace(), FLDropTarget::Drop(), Fl_Tooltip::enter_(), Fl_Widget_Type::enter_live_mode(), Fl_Group_Type::enter_live_mode(), Fl_Table_Type::enter_live_mode(), Fl_Tabs_Type::enter_live_mode(), Fl_Scroll_Type::enter_live_mode(), Fl_Window_Type::enter_live_mode(), Fl::event_inside(), fake_X_wm_style(), fix_group_size(), fl_fix_focus(), fl_get_object_geometry(), fl_get_object_position(), fl_handle(), Fl_Group::forms_end(), group_cb(), h_cb(), Fl_Tile::handle(), Fl_Window_Type::handle(), Fl::handle_(), Fl_Window::hotspot(), local_handle(), Fl_Widget_Type::make(), mouse_event(), 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_Scroll::recalc_scrollbars(), Fl_Tile::resize(), Fl_Group::resize(), Fl_Scroll::resize(), save_position(), Fl_Scroll::scroll_to(), send(), send_event(), Fl_Group::sizes(), sort(), Fl_Tabs::tab_height(), Fl_Paged_Device::traverse(), traverse_to_gl_subwindows(), Fl_Group::update_child(), w_cb(), Fl_Widget_Type::write_code1(), Fl_Widget_Type::write_properties(), x_cb(), and Fl_Help_Dialog::y().

Friends And Related Function Documentation

◆ Fl_Group

friend class Fl_Group
friend

Definition at line 102 of file Fl_Widget.H.

Member Data Documentation

◆ box_

uchar Fl_Widget::box_
private

Definition at line 114 of file Fl_Widget.H.

Referenced by box(), draw_box(), and Fl_Widget().

◆ callback_

Fl_Callback* Fl_Widget::callback_
private

Definition at line 105 of file Fl_Widget.H.

Referenced by callback(), do_callback(), Fl_Menu_::find_index(), Fl_Widget(), and ~Fl_Widget().

◆ color2_

Fl_Color Fl_Widget::color2_
private

Definition at line 111 of file Fl_Widget.H.

Referenced by color(), color2(), Fl_Widget(), and selection_color().

◆ color_

Fl_Color Fl_Widget::color_
private

Definition at line 110 of file Fl_Widget.H.

Referenced by color(), draw_box(), and Fl_Widget().

◆ damage_

uchar Fl_Widget::damage_
private

Definition at line 113 of file Fl_Widget.H.

Referenced by clear_damage(), damage(), and Fl_Widget().

◆ flags_

◆ h_

int Fl_Widget::h_
private

Definition at line 107 of file Fl_Widget.H.

Referenced by draw_backdrop(), draw_box(), draw_label(), Fl_Widget(), h(), position(), and resize().

◆ label_

◆ parent_

Fl_Group* Fl_Widget::parent_
private

Definition at line 104 of file Fl_Widget.H.

Referenced by contains(), Fl_Widget(), Fl_Group::insert(), parent(), Fl_Group::remove(), and ~Fl_Widget().

◆ tooltip_

const char* Fl_Widget::tooltip_
private

Definition at line 117 of file Fl_Widget.H.

Referenced by copy_tooltip(), Fl_Widget(), tooltip(), and ~Fl_Widget().

◆ type_

uchar Fl_Widget::type_
private

Definition at line 112 of file Fl_Widget.H.

Referenced by Fl_Widget(), and type().

◆ user_data_

void* Fl_Widget::user_data_
private

Definition at line 106 of file Fl_Widget.H.

Referenced by argument(), callback(), do_callback(), Fl_Widget(), and user_data().

◆ w_

int Fl_Widget::w_
private

Definition at line 107 of file Fl_Widget.H.

Referenced by draw_backdrop(), draw_box(), draw_label(), Fl_Widget(), position(), resize(), and w().

◆ when_

uchar Fl_Widget::when_
private

Definition at line 115 of file Fl_Widget.H.

Referenced by Fl_Widget(), and when().

◆ x_

int Fl_Widget::x_
private

Definition at line 107 of file Fl_Widget.H.

Referenced by draw_backdrop(), draw_box(), draw_label(), Fl_Widget(), resize(), size(), and x().

◆ y_

int Fl_Widget::y_
private

Definition at line 107 of file Fl_Widget.H.

Referenced by draw_backdrop(), draw_box(), draw_label(), Fl_Widget(), resize(), size(), and y().


The documentation for this class was generated from the following files:
Fl_Widget::w
int w() const
Definition: Fl_Widget.H:294
Fl_Widget
Definition: Fl_Widget.H:101
Fl_Group
Definition: Fl_Group.H:41
Fl_Group::children
int children() const
Definition: Fl_Group.H:75
Fl_Widget::draw
virtual void draw()=0