FLTK 1.3.2

- Main Page
- Related Pages
- Modules
- Classes
- Files

- File List
- File Members

Fl_Widget.H
Go to the documentation of this file.
1 //
2 // "$Id: Fl_Widget.H 9388 2012-04-23 20:12:06Z matt $"
3 //
4 // Widget header file for the Fast Light Tool Kit (FLTK).
5 //
6 // Copyright 1998-2012 by Bill Spitzak and others.
7 //
8 // This library is free software. Distribution and use rights are outlined in
9 // the file "COPYING" which should have been included with this file. If this
10 // file is missing or damaged, see the license at:
11 //
12 // http://www.fltk.org/COPYING.php
13 //
14 // Please report all bugs and problems on the following page:
15 //
16 // http://www.fltk.org/str.php
17 //
18
22 #ifndef Fl_Widget_H
23 #define Fl_Widget_H
24
25 #include "Enumerations.H"
26
30 #ifdef _WIN64
31 #ifdef __GNUC__
32 #include <stdint.h>
33 #else
34 #include <stddef.h> // M$VC
35 #endif
36 typedef intptr_t fl_intptr_t;
37 typedef uintptr_t fl_uintptr_t;
38 #else
39 typedef long fl_intptr_t;
40 typedef unsigned long fl_uintptr_t;
41 #endif
42
43 class Fl_Widget;
44 class Fl_Window;
45 class Fl_Group;
46 class Fl_Image;
47
49 typedef void (Fl_Callback )(Fl_Widget*, void*);
51 typedef Fl_Callback* Fl_Callback_p; // needed for BORLAND
53 typedef void (Fl_Callback0)(Fl_Widget*);
55 typedef void (Fl_Callback1)(Fl_Widget*, long);
56
64 struct FL_EXPORT Fl_Label {
66 const char* value;
68 Fl_Image* image;
70 Fl_Image* deimage;
72 Fl_Font font;
74 Fl_Fontsize size;
76 Fl_Color color;
78 Fl_Align align_;
80 uchar type;
81
83 void draw(int,int,int,int, Fl_Align) const ;
84 void measure(int &w, int &h) const ;
85 };
86
87
100 class FL_EXPORT Fl_Widget {
101 friend class Fl_Group;
102
103 Fl_Group* parent_;
104 Fl_Callback* callback_;
105 void* user_data_;
106 int x_,y_,w_,h_;
107 Fl_Label label_;
108 unsigned int flags_;
109 Fl_Color color_;
110 Fl_Color color2_;
111 uchar type_;
112 uchar damage_;
113 uchar box_;
114 uchar when_;
115
116 const char *tooltip_;
117
119 Fl_Widget(const Fl_Widget &);
121 Fl_Widget& operator=(const Fl_Widget &);
122
123 protected:
124
135 Fl_Widget(int x, int y, int w, int h, const char *label=0L);
136
138 void x(int v) {x_ = v;}
140 void y(int v) {y_ = v;}
142 void w(int v) {w_ = v;}
144 void h(int v) {h_ = v;}
146 unsigned int flags() const {return flags_;}
148 void set_flag(unsigned int c) {flags_ |= c;}
150 void clear_flag(unsigned int c) {flags_ &= ~c;}
154 enum {
155 INACTIVE = 1<<0,
156 INVISIBLE = 1<<1,
157 OUTPUT = 1<<2,
158 NOBORDER = 1<<3,
159 FORCE_POSITION = 1<<4,
160 NON_MODAL = 1<<5,
161 SHORTCUT_LABEL = 1<<6,
162 CHANGED = 1<<7,
163 OVERRIDE = 1<<8,
164 VISIBLE_FOCUS = 1<<9,
165 COPIED_LABEL = 1<<10,
166 CLIP_CHILDREN = 1<<11,
167 MENU_WINDOW = 1<<12,
168 TOOLTIP_WINDOW = 1<<13,
169 MODAL = 1<<14,
170 NO_OVERLAY = 1<<15,
171 GROUP_RELATIVE = 1<<16,
172 COPIED_TOOLTIP = 1<<17,
173 FULLSCREEN = 1<<18,
174 SIMPLE_KEYBOARD = 1<<19,
175 // (space for more flags)
176 USERFLAG3 = 1<<29,
177 USERFLAG2 = 1<<30,
178 USERFLAG1 = 1<<31
179 };
180 void draw_box() const;
181 void draw_box(Fl_Boxtype t, Fl_Color c) const;
182 void draw_box(Fl_Boxtype t, int x,int y,int w,int h, Fl_Color c) const;
183 void draw_backdrop() const;
185 void draw_focus() {draw_focus(box(),x(),y(),w(),h());}
186 void draw_focus(Fl_Boxtype t, int x,int y,int w,int h) const;
187 void draw_label() const;
188 void draw_label(int, int, int, int) const;
189
190 public:
191
200 virtual ~Fl_Widget();
201
218 virtual void draw() = 0;
219
236 virtual int handle(int event);
237
243 Fl_Group* parent() const {return parent_;}
244
253 void parent(Fl_Group* p) {parent_ = p;} // for hacks only, use Fl_Group::add()
254
263 uchar type() const {return type_;}
264
268 void type(uchar t) {type_ = t;}
269
273 int x() const {return x_;}
274
278 int y() const {return y_;}
279
283 int w() const {return w_;}
284
288 int h() const {return h_;}
289
309 virtual void resize(int x, int y, int w, int h);
310
312 int damage_resize(int,int,int,int);
313
321 void position(int X,int Y) {resize(X,Y,w_,h_);}
322
330 void size(int W,int H) {resize(x_,y_,W,H);}
331
337 Fl_Align align() const {return label_.align_;}
338
346 void align(Fl_Align alignment) {label_.align_ = alignment;}
347
352 Fl_Boxtype box() const {return (Fl_Boxtype)box_;}
353
361 void box(Fl_Boxtype new_box) {box_ = new_box;}
362
367 Fl_Color color() const {return color_;}
368
379 void color(Fl_Color bg) {color_ = bg;}
380
385 Fl_Color selection_color() const {return color2_;}
386
395 void selection_color(Fl_Color a) {color2_ = a;}
396
404 void color(Fl_Color bg, Fl_Color sel) {color_=bg; color2_=sel;}
405
410 const char* label() const {return label_.value;}
411
422 void label(const char* text);
423
434 void copy_label(const char *new_label);
435
439 void label(Fl_Labeltype a, const char* b) {label_.type = a; label_.value = b;}
440
445 Fl_Labeltype labeltype() const {return (Fl_Labeltype)label_.type;}
446
455 void labeltype(Fl_Labeltype a) {label_.type = a;}
456
461 Fl_Color labelcolor() const {return label_.color;}
462
467 void labelcolor(Fl_Color c) {label_.color=c;}
468
476 Fl_Font labelfont() const {return label_.font;}
477
485 void labelfont(Fl_Font f) {label_.font=f;}
486
491 Fl_Fontsize labelsize() const {return label_.size;}
492
497 void labelsize(Fl_Fontsize pix) {label_.size=pix;}
498
503 Fl_Image* image() {return label_.image;}
504 const Fl_Image* image() const {return label_.image;}
505
510 void image(Fl_Image* img) {label_.image=img;}
511
516 void image(Fl_Image& img) {label_.image=&img;}
517
522 Fl_Image* deimage() {return label_.deimage;}
523 const Fl_Image* deimage() const {return label_.deimage;}
524
529 void deimage(Fl_Image* img) {label_.deimage=img;}
530
535 void deimage(Fl_Image& img) {label_.deimage=&img;}
536
541 const char *tooltip() const {return tooltip_;}
542
543 void tooltip(const char *text); // see Fl_Tooltip
544 void copy_tooltip(const char *text); // see Fl_Tooltip
545
550 Fl_Callback_p callback() const {return callback_;}
551
557 void callback(Fl_Callback* cb, void* p) {callback_=cb; user_data_=p;}
558
563 void callback(Fl_Callback* cb) {callback_=cb;}
564
569 void callback(Fl_Callback0*cb) {callback_=(Fl_Callback*)cb;}
570
576 void callback(Fl_Callback1*cb, long p=0) {callback_=(Fl_Callback*)cb; user_data_=(void*)p;}
577
582 void* user_data() const {return user_data_;}
583
588 void user_data(void* v) {user_data_ = v;}
589
592 long argument() const {return (long)(fl_intptr_t)user_data_;}
593
598 void argument(long v) {user_data_ = (void*)v;}
599
608 Fl_When when() const {return (Fl_When)when_;}
609
641 void when(uchar i) {when_ = i;}
642
647 unsigned int visible() const {return !(flags_&INVISIBLE);}
648
653 int visible_r() const;
654
672 virtual void show();
673
677 virtual void hide();
678
683 void set_visible() {flags_ &= ~INVISIBLE;}
684
689 void clear_visible() {flags_ |= INVISIBLE;}
690
695 unsigned int active() const {return !(flags_&INACTIVE);}
696
701 int active_r() const;
702
708 void activate();
709
724 void deactivate();
725
734 unsigned int output() const {return (flags_&OUTPUT);}
735
739 void set_output() {flags_ |= OUTPUT;}
740
744 void clear_output() {flags_ &= ~OUTPUT;}
745
751 unsigned int takesevents() const {return !(flags_&(INACTIVE|INVISIBLE|OUTPUT));}
752
768 unsigned int changed() const {return flags_&CHANGED;}
769
773 void set_changed() {flags_ |= CHANGED;}
774
778 void clear_changed() {flags_ &= ~CHANGED;}
779
797 unsigned int simple_keyboard() const {return flags_&SIMPLE_KEYBOARD;}
798
802 void set_simple_keyboard() {flags_ |= SIMPLE_KEYBOARD;}
803
807 void set_normal_keyboard() {flags_ &= ~SIMPLE_KEYBOARD;}
808
816 int take_focus();
817
824 void set_visible_focus() { flags_ |= VISIBLE_FOCUS; }
825
830 void clear_visible_focus() { flags_ &= ~VISIBLE_FOCUS; }
831
836 void visible_focus(int v) { if (v) set_visible_focus(); else clear_visible_focus(); }
837
842 unsigned int visible_focus() { return flags_ & VISIBLE_FOCUS; }
843
851 static void default_callback(Fl_Widget *cb, void *d);
852
857 void do_callback() {do_callback(this,user_data_);}
858
865 void do_callback(Fl_Widget* o,long arg) {do_callback(o,(void*)arg);}
866
867 // Causes a widget to invoke its callback function with arbitrary arguments.
868 // Documentation and implementation in Fl_Widget.cxx
869 void do_callback(Fl_Widget* o,void* arg=0);
870
871 /* Internal use only. */
872 int test_shortcut();
873 /* Internal use only. */
874 static unsigned int label_shortcut(const char *t);
875 /* Internal use only. */
876 static int test_shortcut(const char*, const bool require_alt = false);
877 /* Internal use only. */
878 void _set_fullscreen() {flags_ |= FULLSCREEN;}
879 void _clear_fullscreen() {flags_ &= ~FULLSCREEN;}
880
886 int contains(const Fl_Widget *w) const ;
887
894 int inside(const Fl_Widget* wgt) const {return wgt ? wgt->contains(this) : 0;}
895
899 void redraw();
900
905 void redraw_label();
906
913 uchar damage() const {return damage_;}
914
927 void clear_damage(uchar c = 0) {damage_ = c;}
928
934 void damage(uchar c);
935
942 void damage(uchar c, int x, int y, int w, int h);
943
944 void draw_label(int, int, int, int, Fl_Align) const;
945
949 void measure_label(int& ww, int& hh) const {label_.measure(ww, hh);}
950
956 Fl_Window* window() const ;
957
981 virtual Fl_Group* as_group() {return 0;}
982
995 virtual Fl_Window* as_window() {return 0;}
996
1007 virtual class Fl_Gl_Window* as_gl_window() {return 0;}
1008
1012 Fl_Color color2() const {return (Fl_Color)color2_;}
1013
1017 void color2(unsigned a) {color2_ = a;}
1018 };
1019
1025 #define FL_RESERVED_TYPE 100
1026
1027 #endif
1028
1029 //
1030 // End of "$Id: Fl_Widget.H 9388 2012-04-23 20:12:06Z matt $".
1031 //
Fl_Widget::set_output
void set_output()
Sets a widget to output only.
Definition: Fl_Widget.H:739
Fl_Widget::test_shortcut
int test_shortcut()
Returns true if the widget&#39;s label contains the entered &#39;&amp;x&#39; shortcut.
Definition: fl_shortcut.cxx:370
Fl_Widget::when
void when(uchar i)
Sets the flags used to decide when a callback is called.
Definition: Fl_Widget.H:641
Fl_Widget::user_data
void user_data(void *v)
Sets the user data for this widget.
Definition: Fl_Widget.H:588
Fl_Widget
Fl_Widget is the base class for all widgets in FLTK.
Definition: Fl_Widget.H:100
Fl_Widget::FORCE_POSITION
don&#39;t let the window manager position the window (Fl_Window)
Definition: Fl_Widget.H:159
Fl_Widget::box
void box(Fl_Boxtype new_box)
Sets the box type for the widget.
Definition: Fl_Widget.H:361
Fl_Label::font
Fl_Font font
label font used in text
Definition: Fl_Widget.H:72
Fl_Widget::label_shortcut
static unsigned int label_shortcut(const char *t)
Returns the Unicode value of the &#39;&amp;x&#39; shortcut in a given text.
Definition: fl_shortcut.cxx:299
Fl_Widget::visible
unsigned int visible() const
Returns whether a widget is visible.
Definition: Fl_Widget.H:647
Fl_Widget::deactivate
void deactivate()
Deactivates the widget.
Definition: Fl_Widget.cxx:234
Fl_Widget::measure_label
void measure_label(int &ww, int &hh) const
Sets width ww and height hh accordingly with the label size.
Definition: Fl_Widget.H:949
Fl_Window
This widget produces an actual window.
Definition: Fl_Window.H:54
Fl_Widget::selection_color
Fl_Color selection_color() const
Gets the selection color.
Definition: Fl_Widget.H:385
Fl_Widget::OVERRIDE
position window on top (Fl_Window)
Definition: Fl_Widget.H:163
Fl_Widget::hide
virtual void hide()
Makes a widget invisible.
Definition: Fl_Widget.cxx:264
Fl_Widget::h
void h(int v)
Internal use only.
Definition: Fl_Widget.H:144
Fl_Widget::user_data
void * user_data() const
Gets the user data for this widget.
Definition: Fl_Widget.H:582
Fl_Widget::type
void type(uchar t)
Sets the widget type.
Definition: Fl_Widget.H:268
Fl_Widget::USERFLAG1
reserved for 3rd party extensions
Definition: Fl_Widget.H:178
Fl_Widget::align
Fl_Align align() const
Gets the label alignment.
Definition: Fl_Widget.H:337
Fl_Widget::tooltip
const char * tooltip() const
Gets the current tooltip text.
Definition: Fl_Widget.H:541
Fl_Widget::x
int x() const
Gets the widget position in its window.
Definition: Fl_Widget.H:273
Fl_Label::deimage
Fl_Image * deimage
optional image for a deactivated label
Definition: Fl_Widget.H:70
Fl_Widget::align
void align(Fl_Align alignment)
Sets the label alignment.
Definition: Fl_Widget.H:346
Fl_Widget::callback
void callback(Fl_Callback *cb, void *p)
Sets the current callback function for the widget.
Definition: Fl_Widget.H:557
Fl_Widget::INVISIBLE
the widget is not drawn, but can receive a few special events
Definition: Fl_Widget.H:156
Fl_Widget::USERFLAG2
reserved for 3rd party extensions
Definition: Fl_Widget.H:177
Fl_Widget::redraw
void redraw()
Schedules the drawing of the widget.
Definition: Fl.cxx:1633
Fl_Widget::clear_output
void clear_output()
Sets a widget to accept input.
Definition: Fl_Widget.H:744
Fl_Widget::clear_damage
void clear_damage(uchar c=0)
Clears or sets the damage flags.
Definition: Fl_Widget.H:927
Fl_Label::type
uchar type
type of label.
Definition: Fl_Widget.H:80
Fl_Widget::changed
unsigned int changed() const
Checks if the widget value changed since the last callback.
Definition: Fl_Widget.H:768
Fl_Widget::h
int h() const
Gets the widget height.
Definition: Fl_Widget.H:288
Fl_Widget::y
void y(int v)
Internal use only.
Definition: Fl_Widget.H:140
Fl_Widget::set_changed
void set_changed()
Marks the value of the widget as changed.
Definition: Fl_Widget.H:773
Fl_When
Fl_When
These constants determine when a callback is performed.
Definition: Enumerations.H:309
Fl_Widget::size
void size(int W, int H)
Changes the size of the widget.
Definition: Fl_Widget.H:330
Fl_Widget::default_callback
static void default_callback(Fl_Widget *cb, void *d)
Sets the default callback for all widgets.
Definition: Fl_Widget.cxx:39
Fl_Widget::parent
Fl_Group * parent() const
Returns a pointer to the parent widget.
Definition: Fl_Widget.H:243
Fl_Widget::parent
void parent(Fl_Group *p)
Internal use only - &quot;for hacks only&quot;.
Definition: Fl_Widget.H:253
Fl_Widget::image
void image(Fl_Image *img)
Sets the image to use as part of the widget label.
Definition: Fl_Widget.H:510
Fl_Label::image
Fl_Image * image
optional image for an active label
Definition: Fl_Widget.H:68
Fl_Widget::w
int w() const
Gets the widget width.
Definition: Fl_Widget.H:283
Fl_Widget::COPIED_LABEL
the widget label is internally copied, its destruction is handled by the widget
Definition: Fl_Widget.H:165
Fl_Widget::MODAL
a window blocking input to all other winows (Fl_Window)
Definition: Fl_Widget.H:169
Fl_Widget::clear_visible_focus
void clear_visible_focus()
Disables keyboard focus navigation with this widget.
Definition: Fl_Widget.H:830
Fl_Widget::takesevents
unsigned int takesevents() const
Returns if the widget is able to take events.
Definition: Fl_Widget.H:751
Fl_Widget::argument
void argument(long v)
Sets the current user data (long) argument that is passed to the callback function.
Definition: Fl_Widget.H:598
Fl_Widget::copy_tooltip
void copy_tooltip(const char *text)
Sets the current tooltip text.
Definition: Fl_Tooltip.cxx:336
Fl_Image
Fl_Image is the base class used for caching and drawing all kinds of images in FLTK.
Definition: Fl_Image.H:44
Fl_Widget::labelsize
void labelsize(Fl_Fontsize pix)
Sets the font size in pixels.
Definition: Fl_Widget.H:497
Fl_Widget::do_callback
void do_callback(Fl_Widget *o, long arg)
Calls the widget callback.
Definition: Fl_Widget.H:865
Fl_Widget::visible_focus
unsigned int visible_focus()
Checks whether this widget has a visible focus.
Definition: Fl_Widget.H:842
Fl_Widget::take_focus
int take_focus()
Gives the widget the keyboard focus.
Definition: Fl_Widget.cxx:143
Fl_Label::align_
Fl_Align align_
alignment of label
Definition: Fl_Widget.H:78
Fl_Widget::callback
void callback(Fl_Callback1 *cb, long p=0)
Sets the current callback function for the widget.
Definition: Fl_Widget.H:576
Fl_Widget::damage_resize
int damage_resize(int, int, int, int)
Internal use only.
Definition: Fl_Widget.cxx:136
Fl_Widget::labelcolor
Fl_Color labelcolor() const
Gets the label color.
Definition: Fl_Widget.H:461
Fl_Widget::labelfont
Fl_Font labelfont() const
Gets the font to use.
Definition: Fl_Widget.H:476
Fl_Label::value
const char * value
label text
Definition: Fl_Widget.H:66
Fl_Widget::damage
uchar damage() const
Returns non-zero if draw() needs to be called.
Definition: Fl_Widget.H:913
Fl_Group::draw
void draw()
Draws the widget.
Definition: Fl_Group.cxx:736
Fl_Boxtype
Fl_Boxtype
Definition: Enumerations.H:469
Fl_Widget::output
unsigned int output() const
Returns if a widget is used for output only.
Definition: Fl_Widget.H:734
Fl_Widget::OUTPUT
for output only
Definition: Fl_Widget.H:157
fl_intptr_t
long fl_intptr_t
Definition: Fl_Widget.H:39
Fl_Widget::set_simple_keyboard
void set_simple_keyboard()
Marks a widget to use the simple keyboard model.
Definition: Fl_Widget.H:802
Fl_Widget::window
Fl_Window * window() const
Returns a pointer to the primary Fl_Window widget.
Definition: Fl_Window.cxx:81
Fl_Widget::y
int y() const
Gets the widget position in its window.
Definition: Fl_Widget.H:278
Fl_Group
The Fl_Group class is the FLTK container widget.
Definition: Fl_Group.H:36
Enumerations.H
This file contains type definitions and general enumerations.
Fl_Widget::clear_flag
void clear_flag(unsigned int c)
Clears a flag in the flags mask.
Definition: Fl_Widget.H:150
Fl_Callback1
void( Fl_Callback1)(Fl_Widget *, long)
Callback type definition passing the widget and a long data value.
Definition: Fl_Widget.H:55
Fl_Widget::deimage
Fl_Image * deimage()
Gets the image that is used as part of the widget label.
Definition: Fl_Widget.H:522
Fl_Widget::simple_keyboard
unsigned int simple_keyboard() const
Returns if the widget sees a simplified keyboard model or not.
Definition: Fl_Widget.H:797
Fl_Label::size
Fl_Fontsize size
size of label font
Definition: Fl_Widget.H:74
Fl_Widget::as_group
virtual Fl_Group * as_group()
Returns an Fl_Group pointer if this widget is an Fl_Group.
Definition: Fl_Widget.H:981
Fl_Widget::labelcolor
void labelcolor(Fl_Color c)
Sets the label color.
Definition: Fl_Widget.H:467
Fl_Group::handle
int handle(int)
Handles the specified event.
Definition: Fl_Group.cxx:145
Fl_Widget::labelsize
Fl_Fontsize labelsize() const
Gets the font size in pixels.
Definition: Fl_Widget.H:491
Fl_Widget::selection_color
void selection_color(Fl_Color a)
Sets the selection color.
Definition: Fl_Widget.H:395
Fl_Widget::activate
void activate()
Activates the widget.
Definition: Fl_Widget.cxx:222
Fl_Widget::deimage
void deimage(Fl_Image &img)
Sets the image to use as part of the widget label.
Definition: Fl_Widget.H:535
Fl_Widget::TOOLTIP_WINDOW
a temporary popup, transparent to events, and dismissed easily (Fl_Window)
Definition: Fl_Widget.H:168
Fl_Callback
void( Fl_Callback)(Fl_Widget *, void *)
Default callback type definition for all fltk widgets (by far the most used)
Definition: Fl_Widget.H:49
Fl_Widget::image
Fl_Image * image()
Gets the image that is used as part of the widget label.
Definition: Fl_Widget.H:503
Fl_Widget::box
Fl_Boxtype box() const
Gets the box type of the widget.
Definition: Fl_Widget.H:352
Fl_Widget::draw_focus
void draw_focus()
draws a focus rectangle around the widget
Definition: Fl_Widget.H:185
Fl_Widget::set_normal_keyboard
void set_normal_keyboard()
Marks a widget to use the normal keyboard model.
Definition: Fl_Widget.H:807
Fl_Widget::VISIBLE_FOCUS
accepts keyboard focus navigation if the widget can have the focus
Definition: Fl_Widget.H:164
Fl_Widget::redraw_label
void redraw_label()
Schedules the drawing of the label.
Definition: Fl.cxx:1637
Fl_Widget::contains
int contains(const Fl_Widget *w) const
Checks if w is a child of this widget.
Definition: Fl_Widget.cxx:284
Fl_Widget::color
void color(Fl_Color bg)
Sets the background color of the widget.
Definition: Fl_Widget.H:379
Fl_Widget::GROUP_RELATIVE
position this widget relative to the parent group, not to the window
Definition: Fl_Widget.H:171
Fl_Widget::show
virtual void show()
Makes a widget visible.
Definition: Fl_Widget.cxx:252
Fl_Widget::active
unsigned int active() const
Returns whether the widget is active.
Definition: Fl_Widget.H:695
Fl_Widget::draw_box
void draw_box() const
Draws the widget box according its box style.
Definition: fl_boxtype.cxx:392
Fl_Widget::visible_focus
void visible_focus(int v)
Modifies keyboard focus navigation.
Definition: Fl_Widget.H:836
Fl_Widget::SIMPLE_KEYBOARD
the widget wants simple, consistent keypresses and not advanced input (like character composition and...
Definition: Fl_Widget.H:174
Fl_Widget::SHORTCUT_LABEL
the label contains a shortcut we need to draw
Definition: Fl_Widget.H:161
Fl_Widget::FULLSCREEN
a fullscreen window (Fl_Window)
Definition: Fl_Widget.H:173
Fl_Widget::callback
void callback(Fl_Callback0 *cb)
Sets the current callback function for the widget.
Definition: Fl_Widget.H:569
Fl_Widget::clear_changed
void clear_changed()
Marks the value of the widget as unchanged.
Definition: Fl_Widget.H:778
Fl_Widget::~Fl_Widget
virtual ~Fl_Widget()
Destroys the widget.
Definition: Fl_Widget.cxx:159
Fl_Widget::labelfont
void labelfont(Fl_Font f)
Sets the font to use.
Definition: Fl_Widget.H:485
Fl_Label
This struct stores all information for a text or mixed graphics label.
Definition: Fl_Widget.H:64
Fl_Fontsize
int Fl_Fontsize
Size of a font in pixels.
Definition: Enumerations.H:746
Fl_Widget::visible_r
int visible_r() const
Returns whether a widget and all its parents are visible.
Definition: Fl_Widget.cxx:276
Fl_Widget::NON_MODAL
this is a hovering toolbar window (Fl_Window)
Definition: Fl_Widget.H:160
Fl_Widget::draw_label
void draw_label() const
Draws the widget&#39;s label at the defined label position.
Definition: fl_labeltype.cxx:99
Fl_Callback0
void( Fl_Callback0)(Fl_Widget *)
One parameter callback type definition passing only the widget.
Definition: Fl_Widget.H:53
Fl_Widget::deimage
void deimage(Fl_Image *img)
Sets the image to use as part of the widget label.
Definition: Fl_Widget.H:529
Fl_Group::resize
void resize(int, int, int, int)
Resizes the Fl_Group widget and all of its children.
Definition: Fl_Group.cxx:632
Fl_Widget::set_visible_focus
void set_visible_focus()
Enables keyboard focus navigation with this widget.
Definition: Fl_Widget.H:824
Fl_Widget::NO_OVERLAY
window not using a hardware overlay plane (Fl_Menu_Window)
Definition: Fl_Widget.H:170
Fl_Widget::labeltype
void labeltype(Fl_Labeltype a)
Sets the label type.
Definition: Fl_Widget.H:455
Fl_Widget::argument
long argument() const
Gets the current user data (long) argument that is passed to the callback function.
Definition: Fl_Widget.H:592
Fl_Widget::INACTIVE
the widget can&#39;t receive focus, and is disabled but potentially visible
Definition: Fl_Widget.H:155
Fl_Gl_Window
The Fl_Gl_Window widget sets things up so OpenGL works.
Definition: Fl_Gl_Window.H:56
Fl_Color
unsigned int Fl_Color
an FLTK color value
Definition: Enumerations.H:774
Fl_Labeltype
Fl_Labeltype
The labeltype() method sets the type of the label.
Definition: Enumerations.H:611
Fl_Callback_p
Fl_Callback * Fl_Callback_p
Default callback type pointer definition for all fltk widgets.
Definition: Fl_Widget.H:51
Fl_Widget::MENU_WINDOW
a temporary popup window, dismissed by clicking outside (Fl_Window)
Definition: Fl_Widget.H:167
Fl_Widget::do_callback
void do_callback()
Calls the widget callback.
Definition: Fl_Widget.H:857
Fl_Font
int Fl_Font
A font number is an index into the internal font table.
Definition: Enumerations.H:717
Fl_Widget::inside
int inside(const Fl_Widget *wgt) const
Checks if this widget is a child of wgt.
Definition: Fl_Widget.H:894
Fl_Align
unsigned Fl_Align
FLTK type for alignment control.
Definition: Enumerations.H:668
Fl_Widget::NOBORDER
don&#39;t draw a decoration (Fl_Window)
Definition: Fl_Widget.H:158
Fl_Widget::set_flag
void set_flag(unsigned int c)
Sets a flag in the flags mask.
Definition: Fl_Widget.H:148
Fl_Widget::active_r
int active_r() const
Returns whether the widget and all of its parents are active.
Definition: Fl_Widget.cxx:246
Fl_Widget::color2
void color2(unsigned a)
For back compatibility only.
Definition: Fl_Widget.H:1017
Fl_Widget::set_visible
void set_visible()
Makes the widget visible.
Definition: Fl_Widget.H:683
Fl_Widget::as_window
virtual Fl_Window * as_window()
Returns an Fl_Window pointer if this widget is an Fl_Window.
Definition: Fl_Widget.H:995
Fl_Widget::image
void image(Fl_Image &img)
Sets the image to use as part of the widget label.
Definition: Fl_Widget.H:516
Fl_Widget::clear_visible
void clear_visible()
Hides the widget.
Definition: Fl_Widget.H:689
Fl_Widget::label
void label(Fl_Labeltype a, const char *b)
Shortcut to set the label text and type in one call.
Definition: Fl_Widget.H:439
Fl_Widget::position
void position(int X, int Y)
Repositions the window or widget.
Definition: Fl_Widget.H:321
Fl_Widget::COPIED_TOOLTIP
the widget tooltip is internally copied, its destruction is handled by the widget ...
Definition: Fl_Widget.H:172
Fl_Widget::label
const char * label() const
Gets the current label text.
Definition: Fl_Widget.H:410
Fl_Widget::color2
Fl_Color color2() const
For back compatibility only.
Definition: Fl_Widget.H:1012
Fl_Widget::flags
unsigned int flags() const
Gets the widget flags mask.
Definition: Fl_Widget.H:146
Fl_Widget::color
void color(Fl_Color bg, Fl_Color sel)
Sets the background and selection color of the widget.
Definition: Fl_Widget.H:404
Fl_Widget::when
Fl_When when() const
Returns the conditions under which the callback is called.
Definition: Fl_Widget.H:608
Fl_Widget::callback
Fl_Callback_p callback() const
Gets the current callback function for the widget.
Definition: Fl_Widget.H:550
Fl_Label::color
Fl_Color color
text color
Definition: Fl_Widget.H:76
Fl_Widget::USERFLAG3
reserved for 3rd party extensions
Definition: Fl_Widget.H:176
Fl_Widget::draw_backdrop
void draw_backdrop() const
If FL_ALIGN_IMAGE_BACKDROP is set, the image or deimage will be drawn.
Definition: fl_boxtype.cxx:397
Fl_Widget::w
void w(int v)
Internal use only.
Definition: Fl_Widget.H:142
Fl_Widget::copy_label
void copy_label(const char *new_label)
Sets the current label.
Definition: Fl_Widget.cxx:305
uchar
unsigned char uchar
unsigned char
Definition: fl_types.h:30
Fl_Widget::CHANGED
the widget value changed
Definition: Fl_Widget.H:162
Fl_Widget::callback
void callback(Fl_Callback *cb)
Sets the current callback function for the widget.
Definition: Fl_Widget.H:563
Fl_Widget::x
void x(int v)
Internal use only.
Definition: Fl_Widget.H:138
Fl_Widget::CLIP_CHILDREN
all drawing within this widget will be clipped (Fl_Group)
Definition: Fl_Widget.H:166
Fl_Widget::type
uchar type() const
Gets the widget type.
Definition: Fl_Widget.H:263
Fl_Widget::labeltype
Fl_Labeltype labeltype() const
Gets the label type.
Definition: Fl_Widget.H:445
Fl_Widget::color
Fl_Color color() const
Gets the background color of the widget.
Definition: Fl_Widget.H:367
Fl_Widget::as_gl_window
virtual class Fl_Gl_Window * as_gl_window()
Returns an Fl_Gl_Window pointer if this widget is an Fl_Gl_Window.
Definition: Fl_Widget.H:1007
- © 1998-2012 by Bill Spitzak and others.