NTK 1.3.0
Fl_Widget.H
Go to the documentation of this file.
1//
2// "$Id: Fl_Widget.H 8623 2011-04-24 17:09:41Z AlbrechtS $"
3//
4// Widget header file for the Fast Light Tool Kit (FLTK).
5//
6// Copyright 1998-2010 by Bill Spitzak and others.
7//
8// This library is free software; you can redistribute it and/or
9// modify it under the terms of the GNU Library General Public
10// License as published by the Free Software Foundation; either
11// version 2 of the License, or (at your option) any later version.
12//
13// This library is distributed in the hope that it will be useful,
14// but WITHOUT ANY WARRANTY; without even the implied warranty of
15// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16// Library General Public License for more details.
17//
18// You should have received a copy of the GNU Library General Public
19// License along with this library; if not, write to the Free Software
20// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
21// USA.
22//
23// Please report all bugs and problems on the following page:
24//
25// http://www.fltk.org/str.php
26//
27
31#ifndef Fl_Widget_H
32#define Fl_Widget_H
33
34#include "Enumerations.H"
35
39#ifdef _WIN64
40#ifdef __GNUC__
41#include <stdint.h>
42#else
43#include <stddef.h> // M$VC
44#endif
45typedef intptr_t fl_intptr_t;
46typedef uintptr_t fl_uintptr_t;
47#else
48typedef long fl_intptr_t;
49typedef unsigned long fl_uintptr_t;
50#endif
51
52typedef unsigned char fl_damage_t;
53
54class Fl_Widget;
55class Fl_Window;
56class Fl_Group;
57class Fl_Image;
58
60typedef void (Fl_Callback )(Fl_Widget*, void*);
62typedef Fl_Callback* Fl_Callback_p; // needed for BORLAND
64typedef void (Fl_Callback0)(Fl_Widget*);
66typedef void (Fl_Callback1)(Fl_Widget*, long);
67
75struct FL_EXPORT Fl_Label {
77 const char* value;
92
94 void draw(int,int,int,int, Fl_Align) const ;
95 void measure(int &w, int &h) const ;
96};
97
98
111class FL_EXPORT Fl_Widget {
112 friend class Fl_Group;
113
114 Fl_Group* parent_;
115 Fl_Callback* callback_;
116 void* user_data_;
117 int x_,y_,w_,h_;
118 Fl_Label label_;
119 unsigned int flags_;
120 Fl_Color color_;
121 Fl_Color color2_;
122 uchar type_;
123 fl_damage_t damage_;
124 uchar box_;
125 uchar when_;
126
127 const char *tooltip_;
128
130 Fl_Widget(const Fl_Widget &);
132 Fl_Widget& operator=(const Fl_Widget &);
133
134protected:
135
146 Fl_Widget(int x, int y, int w, int h, const char *label=0L);
147
149 void x(int v) {x_ = v;}
151 void y(int v) {y_ = v;}
153 void w(int v) {w_ = v;}
155 void h(int v) {h_ = v;}
157 unsigned int flags() const {return flags_;}
159 void set_flag(unsigned int c) {flags_ |= c;}
161 void clear_flag(unsigned int c) {flags_ &= ~c;}
165 enum {
166 INACTIVE = 1<<0,
167 INVISIBLE = 1<<1,
168 OUTPUT = 1<<2,
169 NOBORDER = 1<<3,
171 NON_MODAL = 1<<5,
173 CHANGED = 1<<7,
174 OVERRIDE = 1<<8,
176 COPIED_LABEL = 1<<10,
178 MENU_WINDOW = 1<<12,
180 MODAL = 1<<14,
181 NO_OVERLAY = 1<<15,
184 // (space for more flags)
185 USERFLAG3 = 1<<29,
186 USERFLAG2 = 1<<30,
187 USERFLAG1 = 1<<31
188 };
189 void draw_box() const;
190 void draw_box(Fl_Boxtype t, Fl_Color c) const;
191 void draw_box(Fl_Boxtype t, int x,int y,int w,int h, Fl_Color c) const;
192 void draw_backdrop() const;
194 void draw_focus() {draw_focus(box(),x(),y(),w(),h());}
195 void draw_focus(Fl_Boxtype t, int x,int y,int w,int h) const;
196 void draw_label() const;
197 void draw_label(int, int, int, int) const;
198
199public:
200
209 virtual ~Fl_Widget();
210
227 virtual void draw() = 0;
228
245 virtual int handle(int event);
246
252 Fl_Group* parent() const {return parent_;}
253
262 void parent(Fl_Group* p) {parent_ = p;} // for hacks only, use Fl_Group::add()
263
272 uchar type() const {return type_;}
273
277 void type(uchar t) {type_ = t;}
278
282 int x() const {return x_;}
283
287 int y() const {return y_;}
288
292 int w() const {return w_;}
293
297 int h() const {return h_;}
298
318 virtual void resize(int x, int y, int w, int h);
319
321 int damage_resize(int,int,int,int);
322
330 void position(int X,int Y) {resize(X,Y,w_,h_);}
331
339 void size(int W,int H) {resize(x_,y_,W,H);}
340
346 Fl_Align align() const {return label_.align_;}
347
355 void align(Fl_Align alignment) {label_.align_ = alignment;}
356
361 Fl_Boxtype box() const {return (Fl_Boxtype)box_;}
362
370 void box(Fl_Boxtype new_box) {box_ = new_box;}
371
376 Fl_Color color() const {return color_;}
377
388 void color(Fl_Color bg) {color_ = bg;}
389
394 Fl_Color selection_color() const {return color2_;}
395
404 void selection_color(Fl_Color a) {color2_ = a;}
405
413 void color(Fl_Color bg, Fl_Color sel) {color_=bg; color2_=sel;}
414
419 const char* label() const {return label_.value;}
420
431 void label(const char* text);
432
443 void copy_label(const char *new_label);
444
448 void label(Fl_Labeltype a, const char* b) {label_.type = a; label_.value = b;}
449
454 Fl_Labeltype labeltype() const {return (Fl_Labeltype)label_.type;}
455
464 void labeltype(Fl_Labeltype a) {label_.type = a;}
465
470 Fl_Color labelcolor() const {return label_.color;}
471
476 void labelcolor(Fl_Color c) {label_.color=c;}
477
485 Fl_Font labelfont() const {return label_.font;}
486
494 void labelfont(Fl_Font f) {label_.font=f;}
495
500 Fl_Fontsize labelsize() const {return label_.size;}
501
506 void labelsize(Fl_Fontsize pix) {label_.size=pix;}
507
512 Fl_Image* image() {return label_.image;}
513 const Fl_Image* image() const {return label_.image;}
514
519 void image(Fl_Image* img) {label_.image=img;}
520
525 void image(Fl_Image& img) {label_.image=&img;}
526
531 Fl_Image* deimage() {return label_.deimage;}
532 const Fl_Image* deimage() const {return label_.deimage;}
533
538 void deimage(Fl_Image* img) {label_.deimage=img;}
539
544 void deimage(Fl_Image& img) {label_.deimage=&img;}
545
550 const char *tooltip() const {return tooltip_;}
551
552 void tooltip(const char *text); // see Fl_Tooltip
553 void copy_tooltip(const char *text); // see Fl_Tooltip
554
559 Fl_Callback_p callback() const {return callback_;}
560
566 void callback(Fl_Callback* cb, void* p) {callback_=cb; user_data_=p;}
567
572 void callback(Fl_Callback* cb) {callback_=cb;}
573
578 void callback(Fl_Callback0*cb) {callback_=(Fl_Callback*)cb;}
579
585 void callback(Fl_Callback1*cb, long p=0) {callback_=(Fl_Callback*)cb; user_data_=(void*)p;}
586
591 void* user_data() const {return user_data_;}
592
597 void user_data(void* v) {user_data_ = v;}
598
601 long argument() const {return (long)(fl_intptr_t)user_data_;}
602
607 void argument(long v) {user_data_ = (void*)v;}
608
617 Fl_When when() const {return (Fl_When)when_;}
618
650 void when(uchar i) {when_ = i;}
651
656 unsigned int visible() const {return !(flags_&INVISIBLE);}
657
662 int visible_r() const;
663
681 virtual void show();
682
686 virtual void hide();
687
692 void set_visible() {flags_ &= ~INVISIBLE;}
693
698 void clear_visible() {flags_ |= INVISIBLE;}
699
704 unsigned int active() const {return !(flags_&INACTIVE);}
705
710 int active_r() const;
711
717 void activate();
718
733 void deactivate();
734
743 unsigned int output() const {return (flags_&OUTPUT);}
744
748 void set_output() {flags_ |= OUTPUT;}
749
753 void clear_output() {flags_ &= ~OUTPUT;}
754
760 unsigned int takesevents() const {return !(flags_&(INACTIVE|INVISIBLE|OUTPUT));}
761
777 unsigned int changed() const {return flags_&CHANGED;}
778
782 void set_changed() {flags_ |= CHANGED;}
783
787 void clear_changed() {flags_ &= ~CHANGED;}
788
796 int take_focus();
797
804 void set_visible_focus() { flags_ |= VISIBLE_FOCUS; }
805
810 void clear_visible_focus() { flags_ &= ~VISIBLE_FOCUS; }
811
816 void visible_focus(int v) { if (v) set_visible_focus(); else clear_visible_focus(); }
817
822 unsigned int visible_focus() { return flags_ & VISIBLE_FOCUS; }
823
831 static void default_callback(Fl_Widget *cb, void *d);
832
837 void do_callback() {do_callback(this,user_data_);}
838
845 void do_callback(Fl_Widget* o,long arg) {do_callback(o,(void*)arg);}
846
847 // Causes a widget to invoke its callback function with arbitrary arguments.
848 // Documentation and implementation in Fl_Widget.cxx
849 void do_callback(Fl_Widget* o,void* arg=0);
850
851 /* Internal use only. */
852 int test_shortcut();
853 /* Internal use only. */
854 static unsigned int label_shortcut(const char *t);
855 /* Internal use only. */
856 static int test_shortcut(const char*, const bool require_alt = false);
857
863 int contains(const Fl_Widget *w) const ;
864
871 int inside(const Fl_Widget* w) const {return w ? w->contains(this) : 0;}
872
876 void redraw();
877
882 void redraw_label();
883
890 fl_damage_t damage() const {return damage_;}
891
904 void clear_damage(fl_damage_t c = 0) {damage_ = c;}
905
911 void damage(fl_damage_t c);
912
919 void damage(fl_damage_t c, int x, int y, int w, int h);
920
921 void draw_label(int, int, int, int, Fl_Align) const;
922
926 void measure_label(int& ww, int& hh) const {label_.measure(ww, hh);}
927
933 Fl_Window* window() const ;
934
958 virtual Fl_Group* as_group() {return 0;}
959
972 virtual Fl_Window* as_window() {return 0;}
973
984 virtual class Fl_Gl_Window* as_gl_window() {return 0;}
985
989 Fl_Color color2() const {return (Fl_Color)color2_;}
990
994 void color2(unsigned a) {color2_ = a;}
995};
996
1002#define FL_RESERVED_TYPE 100
1003
1004#endif
1005
1006//
1007// End of "$Id: Fl_Widget.H 8623 2011-04-24 17:09:41Z AlbrechtS $".
1008//
This file contains type definitions and general enumerations.
int Fl_Font
A font number is an index into the internal font table.
Definition: Enumerations.H:707
unsigned Fl_Align
FLTK type for alignment control.
Definition: Enumerations.H:658
unsigned int Fl_Color
an FLTK color value
Definition: Enumerations.H:764
Fl_Labeltype
The labeltype() method sets the type of the label.
Definition: Enumerations.H:601
int Fl_Fontsize
Size of a font in pixels.
Definition: Enumerations.H:736
Fl_When
These constants determine when a callback is performed.
Definition: Enumerations.H:313
Fl_Boxtype
Definition: Enumerations.H:472
void() Fl_Callback1(Fl_Widget *, long)
Callback type definition passing the widget and a long data value.
Definition: Fl_Widget.H:66
void() Fl_Callback(Fl_Widget *, void *)
Default callback type definition for all fltk widgets (by far the most used)
Definition: Fl_Widget.H:60
long fl_intptr_t
Definition: Fl_Widget.H:48
void() Fl_Callback0(Fl_Widget *)
One parameter callback type definition passing only the widget.
Definition: Fl_Widget.H:64
Fl_Callback * Fl_Callback_p
Default callback type pointer definition for all fltk widgets.
Definition: Fl_Widget.H:62
The Fl_Gl_Window widget sets things up so OpenGL works.
Definition: Fl_Gl_Window.H:65
The Fl_Group class is the FLTK container widget.
Definition: Fl_Group.H:45
int handle(int)
Handles the specified event.
Definition: Fl_Group.cxx:150
void resize(int, int, int, int)
Resizes the Fl_Group widget and all of its children.
Definition: Fl_Group.cxx:637
Fl_Image is the base class used for caching and drawing all kinds of images in FLTK.
Definition: Fl_Image.H:51
Fl_Widget is the base class for all widgets in FLTK.
Definition: Fl_Widget.H:111
Fl_Color labelcolor() const
Gets the label color.
Definition: Fl_Widget.H:470
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:984
Fl_Font labelfont() const
Gets the font to use.
Definition: Fl_Widget.H:485
Fl_Color color() const
Gets the background color of the widget.
Definition: Fl_Widget.H:376
int inside(const Fl_Widget *w) const
Checks if this widget is a child of w.
Definition: Fl_Widget.H:871
void clear_damage(fl_damage_t c=0)
Clears or sets the damage flags.
Definition: Fl_Widget.H:904
@ OVERRIDE
position window on top (Fl_Window)
Definition: Fl_Widget.H:174
@ COPIED_TOOLTIP
the widget tooltip is internally copied, its destruction is handled by the widget
Definition: Fl_Widget.H:183
@ USERFLAG2
reserved for 3rd party extensions
Definition: Fl_Widget.H:186
@ INACTIVE
the widget can't receive focus, and is disabled but potentially visible
Definition: Fl_Widget.H:166
@ FORCE_POSITION
don't let the window manager position the window (Fl_Window)
Definition: Fl_Widget.H:170
@ NOBORDER
don't draw a decoration (Fl_Window)
Definition: Fl_Widget.H:169
@ TOOLTIP_WINDOW
a temporary popup, transparent to events, and dismissed easily (Fl_Window)
Definition: Fl_Widget.H:179
@ GROUP_RELATIVE
position this widget relative to the parent group, not to the window
Definition: Fl_Widget.H:182
@ USERFLAG3
reserved for 3rd party extensions
Definition: Fl_Widget.H:185
@ USERFLAG1
reserved for 3rd party extensions
Definition: Fl_Widget.H:187
@ CHANGED
the widget value changed
Definition: Fl_Widget.H:173
@ MODAL
a window blocking input to all other winows (Fl_Window)
Definition: Fl_Widget.H:180
@ MENU_WINDOW
a temporary popup window, dismissed by clicking outside (Fl_Window)
Definition: Fl_Widget.H:178
@ CLIP_CHILDREN
all drawing within this widget will be clipped (Fl_Group)
Definition: Fl_Widget.H:177
@ SHORTCUT_LABEL
the label contains a shortcut we need to draw
Definition: Fl_Widget.H:172
@ INVISIBLE
the widget is not drawn, but can receive a few special events
Definition: Fl_Widget.H:167
@ VISIBLE_FOCUS
accepts keyboard focus navigation if the widget can have the focus
Definition: Fl_Widget.H:175
@ NON_MODAL
this is a hovering toolbar window (Fl_Window)
Definition: Fl_Widget.H:171
@ COPIED_LABEL
the widget label is internally copied, its destruction is handled by the widget
Definition: Fl_Widget.H:176
@ NO_OVERLAY
window not using a hardware overlay plane (Fl_Menu_Window)
Definition: Fl_Widget.H:181
@ OUTPUT
for output only
Definition: Fl_Widget.H:168
void clear_visible()
Hides the widget.
Definition: Fl_Widget.H:698
unsigned int visible_focus()
Checks whether this widget has a visible focus.
Definition: Fl_Widget.H:822
virtual void draw()=0
Draws the widget.
virtual void hide()
Makes a widget invisible.
Definition: Fl_Widget.cxx:242
long argument() const
Gets the current user data (long) argument that is passed to the callback function.
Definition: Fl_Widget.H:601
static void default_callback(Fl_Widget *cb, void *d)
Sets the default callback for all widgets.
Definition: Fl_Widget.cxx:48
void redraw_label()
Schedules the drawing of the label.
Definition: Fl.cxx:1575
int active_r() const
Returns whether the widget and all of its parents are active.
Definition: Fl_Widget.cxx:224
void user_data(void *v)
Sets the user data for this widget.
Definition: Fl_Widget.H:597
void image(Fl_Image *img)
Sets the image to use as part of the widget label.
Definition: Fl_Widget.H:519
void deactivate()
Deactivates the widget.
Definition: Fl_Widget.cxx:212
int contains(const Fl_Widget *w) const
Checks if w is a child of this widget.
Definition: Fl_Widget.cxx:262
void callback(Fl_Callback *cb)
Sets the current callback function for the widget.
Definition: Fl_Widget.H:572
void deimage(Fl_Image *img)
Sets the image to use as part of the widget label.
Definition: Fl_Widget.H:538
void do_callback()
Calls the widget callback.
Definition: Fl_Widget.H:837
Fl_Image * deimage()
Gets the image that is used as part of the widget label.
Definition: Fl_Widget.H:531
void argument(long v)
Sets the current user data (long) argument that is passed to the callback function.
Definition: Fl_Widget.H:607
void clear_output()
Sets a widget to accept input.
Definition: Fl_Widget.H:753
void box(Fl_Boxtype new_box)
Sets the box type for the widget.
Definition: Fl_Widget.H:370
const char * label() const
Gets the current label text.
Definition: Fl_Widget.H:419
int y() const
Gets the widget position in its window.
Definition: Fl_Widget.H:287
void clear_visible_focus()
Disables keyboard focus navigation with this widget.
Definition: Fl_Widget.H:810
int h() const
Gets the widget height.
Definition: Fl_Widget.H:297
int damage_resize(int, int, int, int)
Internal use only.
Definition: Fl_Widget.cxx:145
void color(Fl_Color bg, Fl_Color sel)
Sets the background and selection color of the widget.
Definition: Fl_Widget.H:413
unsigned int flags() const
Gets the widget flags mask.
Definition: Fl_Widget.H:157
void draw_focus()
draws a focus rectangle around the widget
Definition: Fl_Widget.H:194
void visible_focus(int v)
Modifies keyboard focus navigation.
Definition: Fl_Widget.H:816
Fl_Align align() const
Gets the label alignment.
Definition: Fl_Widget.H:346
void parent(Fl_Group *p)
Internal use only - "for hacks only".
Definition: Fl_Widget.H:262
virtual Fl_Group * as_group()
Returns an Fl_Group pointer if this widget is an Fl_Group.
Definition: Fl_Widget.H:958
void set_flag(unsigned int c)
Sets a flag in the flags mask.
Definition: Fl_Widget.H:159
void deimage(Fl_Image &img)
Sets the image to use as part of the widget label.
Definition: Fl_Widget.H:544
const char * tooltip() const
Gets the current tooltip text.
Definition: Fl_Widget.H:550
void color(Fl_Color bg)
Sets the background color of the widget.
Definition: Fl_Widget.H:388
void align(Fl_Align alignment)
Sets the label alignment.
Definition: Fl_Widget.H:355
void draw_box() const
Draws the widget box according its box style.
Definition: fl_boxtype.cxx:416
void set_changed()
Marks the value of the widget as changed.
Definition: Fl_Widget.H:782
void set_visible()
Makes the widget visible.
Definition: Fl_Widget.H:692
void do_callback(Fl_Widget *o, long arg)
Calls the widget callback.
Definition: Fl_Widget.H:845
void measure_label(int &ww, int &hh) const
Sets width ww and height hh accordingly with the label size.
Definition: Fl_Widget.H:926
void callback(Fl_Callback1 *cb, long p=0)
Sets the current callback function for the widget.
Definition: Fl_Widget.H:585
Fl_Window * window() const
Returns a pointer to the primary Fl_Window widget.
Definition: Fl_Window.cxx:86
void labeltype(Fl_Labeltype a)
Sets the label type.
Definition: Fl_Widget.H:464
void set_output()
Sets a widget to output only.
Definition: Fl_Widget.H:748
void * user_data() const
Gets the user data for this widget.
Definition: Fl_Widget.H:591
void labelsize(Fl_Fontsize pix)
Sets the font size in pixels.
Definition: Fl_Widget.H:506
int w() const
Gets the widget width.
Definition: Fl_Widget.H:292
Fl_Boxtype box() const
Gets the box type of the widget.
Definition: Fl_Widget.H:361
Fl_Fontsize labelsize() const
Gets the font size in pixels.
Definition: Fl_Widget.H:500
Fl_Color selection_color() const
Gets the selection color.
Definition: Fl_Widget.H:394
static unsigned int label_shortcut(const char *t)
Returns the Unicode value of the '&x' shortcut in a given text.
Definition: fl_shortcut.cxx:308
void label(Fl_Labeltype a, const char *b)
Shortcut to set the label text and type in one call.
Definition: Fl_Widget.H:448
void redraw()
Schedules the drawing of the widget.
Definition: Fl.cxx:1571
void draw_label() const
Draws the widget's label at the defined label position.
Definition: fl_labeltype.cxx:108
void labelcolor(Fl_Color c)
Sets the label color.
Definition: Fl_Widget.H:476
virtual Fl_Window * as_window()
Returns an Fl_Window pointer if this widget is an Fl_Window.
Definition: Fl_Widget.H:972
int take_focus()
Gives the widget the keyboard focus.
Definition: Fl_Widget.cxx:152
void callback(Fl_Callback0 *cb)
Sets the current callback function for the widget.
Definition: Fl_Widget.H:578
void copy_label(const char *new_label)
Sets the current label.
Definition: Fl_Widget.cxx:284
void selection_color(Fl_Color a)
Sets the selection color.
Definition: Fl_Widget.H:404
virtual void show()
Makes a widget visible.
Definition: Fl_Widget.cxx:230
int test_shortcut()
Returns true if the widget's label contains the entered '&x' shortcut.
Definition: fl_shortcut.cxx:379
void clear_changed()
Marks the value of the widget as unchanged.
Definition: Fl_Widget.H:787
Fl_Labeltype labeltype() const
Gets the label type.
Definition: Fl_Widget.H:454
void x(int v)
Internal use only.
Definition: Fl_Widget.H:149
unsigned int visible() const
Returns whether a widget is visible.
Definition: Fl_Widget.H:656
unsigned int output() const
Returns if a widget is used for output only.
Definition: Fl_Widget.H:743
Fl_Callback_p callback() const
Gets the current callback function for the widget.
Definition: Fl_Widget.H:559
void position(int X, int Y)
Repositions the window or widget.
Definition: Fl_Widget.H:330
int visible_r() const
Returns whether a widget and all its parents are visible.
Definition: Fl_Widget.cxx:254
virtual ~Fl_Widget()
Destroys the widget.
Definition: Fl_Widget.cxx:168
void when(uchar i)
Sets the flags used to decide when a callback is called.
Definition: Fl_Widget.H:650
Fl_Group * parent() const
Returns a pointer to the parent widget.
Definition: Fl_Widget.H:252
void set_visible_focus()
Enables keyboard focus navigation with this widget.
Definition: Fl_Widget.H:804
void type(uchar t)
Sets the widget type.
Definition: Fl_Widget.H:277
Fl_Color color2() const
For back compatibility only.
Definition: Fl_Widget.H:989
Fl_Image * image()
Gets the image that is used as part of the widget label.
Definition: Fl_Widget.H:512
Fl_When when() const
Returns the conditions under which the callback is called.
Definition: Fl_Widget.H:617
void w(int v)
Internal use only.
Definition: Fl_Widget.H:153
void callback(Fl_Callback *cb, void *p)
Sets the current callback function for the widget.
Definition: Fl_Widget.H:566
fl_damage_t damage() const
Returns non-zero if draw() needs to be called.
Definition: Fl_Widget.H:890
void labelfont(Fl_Font f)
Sets the font to use.
Definition: Fl_Widget.H:494
uchar type() const
Gets the widget type.
Definition: Fl_Widget.H:272
void activate()
Activates the widget.
Definition: Fl_Widget.cxx:200
unsigned int active() const
Returns whether the widget is active.
Definition: Fl_Widget.H:704
void size(int W, int H)
Changes the size of the widget.
Definition: Fl_Widget.H:339
unsigned int takesevents() const
Returns if the widget is able to take events.
Definition: Fl_Widget.H:760
void color2(unsigned a)
For back compatibility only.
Definition: Fl_Widget.H:994
void y(int v)
Internal use only.
Definition: Fl_Widget.H:151
void clear_flag(unsigned int c)
Clears a flag in the flags mask.
Definition: Fl_Widget.H:161
void h(int v)
Internal use only.
Definition: Fl_Widget.H:155
int x() const
Gets the widget position in its window.
Definition: Fl_Widget.H:282
void draw_backdrop() const
If FL_ALIGN_IMAGE_BACKDROP is set, the image or deimage will be drawn.
Definition: fl_boxtype.cxx:437
unsigned int changed() const
Checks if the widget value changed since the last callback.
Definition: Fl_Widget.H:777
void copy_tooltip(const char *text)
Sets the current tooltip text.
Definition: Fl_Tooltip.cxx:365
void image(Fl_Image &img)
Sets the image to use as part of the widget label.
Definition: Fl_Widget.H:525
This widget produces an actual window.
Definition: Fl_Window.H:58
unsigned char uchar
unsigned char
Definition: fl_types.h:39
This struct stores all information for a text or mixed graphics label.
Definition: Fl_Widget.H:75
uchar type
type of label.
Definition: Fl_Widget.H:91
Fl_Image * deimage
optional image for a deactivated label
Definition: Fl_Widget.H:81
void measure(int &w, int &h) const
Measures the size of the label.
Definition: fl_labeltype.cxx:95
Fl_Fontsize size
size of label font
Definition: Fl_Widget.H:85
const char * value
label text
Definition: Fl_Widget.H:77
Fl_Align align_
alignment of label
Definition: Fl_Widget.H:89
Fl_Color color
text color
Definition: Fl_Widget.H:87
Fl_Image * image
optional image for an active label
Definition: Fl_Widget.H:79
Fl_Font font
label font used in text
Definition: Fl_Widget.H:83