FLTK 1.5.0
Loading...
Searching...
No Matches
Fl_Widget.H
Go to the documentation of this file.
1//
2// Widget header file for the Fast Light Tool Kit (FLTK).
3//
4// Copyright 1998-2024 by Bill Spitzak and others.
5//
6// This library is free software. Distribution and use rights are outlined in
7// the file "COPYING" which should have been included with this file. If this
8// file is missing or damaged, see the license at:
9//
10// https://www.fltk.org/COPYING.php
11//
12// Please see the following page on how to report bugs and issues:
13//
14// https://www.fltk.org/bugs.php
15//
16
22#ifndef Fl_Widget_H
23#define Fl_Widget_H
24
25#include "Fl.H"
26
27class Fl_Widget;
28class Fl_Window;
29class Fl_Group;
30class Fl_Image;
31
33typedef void (Fl_Callback )(Fl_Widget*, void*);
35typedef Fl_Callback* Fl_Callback_p; // needed for BORLAND
37typedef void (Fl_Callback0)(Fl_Widget*);
39typedef void (Fl_Callback1)(Fl_Widget*, long);
40
49struct FL_EXPORT Fl_Label {
51 const char* value;
67 signed char h_margin_;
69 signed char v_margin_;
72
74 void draw(int,int,int,int, Fl_Align) const ;
75 void measure(int &w, int &h) const ;
76};
77
78
92class FL_EXPORT Fl_Callback_User_Data {
93protected:
95public:
97};
98
99
112class FL_EXPORT Fl_Widget {
113 friend class Fl_Group;
114
115 Fl_Group* parent_;
116 Fl_Callback* callback_;
117 void* user_data_;
118 int x_,y_,w_,h_;
119 Fl_Label label_;
120 unsigned int flags_;
121 Fl_Color color_;
122 Fl_Color color2_;
123 uchar type_;
124 uchar damage_;
125 uchar box_;
126 uchar when_;
127
128 const char *tooltip_;
129
131 Fl_Widget(const Fl_Widget &);
133 Fl_Widget& operator=(const Fl_Widget &);
134
135protected:
136
147 Fl_Widget(int x, int y, int w, int h, const char *label=0L);
148
150 void x(int v) {x_ = v;}
152 void y(int v) {y_ = v;}
154 void w(int v) {w_ = v;}
156 void h(int v) {h_ = v;}
158 unsigned int flags() const {return flags_;}
160 void set_flag(unsigned int c) {flags_ |= c;}
162 void clear_flag(unsigned int c) {flags_ &= ~c;}
166 enum {
167 INACTIVE = 1<<0,
168 INVISIBLE = 1<<1,
169 OUTPUT = 1<<2,
170 NOBORDER = 1<<3,
171 FORCE_POSITION = 1<<4,
172 NON_MODAL = 1<<5,
173 SHORTCUT_LABEL = 1<<6,
174 CHANGED = 1<<7,
175 OVERRIDE = 1<<8,
176 VISIBLE_FOCUS = 1<<9,
177 COPIED_LABEL = 1<<10,
178 CLIP_CHILDREN = 1<<11,
179 MENU_WINDOW = 1<<12,
180 TOOLTIP_WINDOW = 1<<13,
181 MODAL = 1<<14,
182 NO_OVERLAY = 1<<15,
183 GROUP_RELATIVE = 1<<16,
184 COPIED_TOOLTIP = 1<<17,
185 FULLSCREEN = 1<<18,
186 MAC_USE_ACCENTS_MENU = 1<<19,
187 NEEDS_KEYBOARD = 1<<20,
188 IMAGE_BOUND = 1<<21,
189 DEIMAGE_BOUND = 1<<22,
190 AUTO_DELETE_USER_DATA = 1<<23,
191 MAXIMIZED = 1<<24,
192 POPUP = 1<<25,
193 // Note to devs: add new FLTK core flags above this line (up to 1<<28).
194
195 // Three more flags, reserved for user code
196
197 USERFLAG3 = 1<<29,
198 USERFLAG2 = 1<<30,
199 USERFLAG1 = 1<<31
200 };
201 void draw_box() const;
202 void draw_box(Fl_Boxtype t, Fl_Color c) const;
203 void draw_box(Fl_Boxtype t, int x,int y,int w,int h, Fl_Color c) const;
204 void draw_backdrop() const;
205
211 void draw_focus() const {
212 draw_focus(box(), x(), y(), w(), h(), color());
213 }
214
220 void draw_focus(Fl_Boxtype t, int X, int Y, int W, int H) const {
221 draw_focus(t, X, Y, W, H, color());
222
223 }
224 // See documentation in Fl_Widget.cxx
225 void draw_focus(Fl_Boxtype t, int x, int y, int w, int h, Fl_Color bg) const;
226
227 void draw_label() const;
228 void draw_label(int, int, int, int) const;
229
230public:
231
240 virtual ~Fl_Widget();
241
258 virtual void draw() = 0;
259
289 virtual int handle(int event);
290
299 int is_label_copied() const {return ((flags_ & COPIED_LABEL) ? 1 : 0);}
300
315 void needs_keyboard(bool needs) {
316 if (needs) set_flag(NEEDS_KEYBOARD);
317 else clear_flag(NEEDS_KEYBOARD);
318 }
319
325 bool needs_keyboard() const {
326 return (flags_ & NEEDS_KEYBOARD);
327 }
328
334 Fl_Group* parent() const {return parent_;}
335
344 void parent(Fl_Group* p) {parent_ = p;} // for hacks only, use Fl_Group::add()
345
351 uchar type() const {return type_;}
352
356 void type(uchar t) {type_ = t;}
357
361 int x() const {return x_;}
362
366 int y() const {return y_;}
367
371 int w() const {return w_;}
372
376 int h() const {return h_;}
377
397 virtual void resize(int x, int y, int w, int h);
398
400 int damage_resize(int,int,int,int);
401
409 void position(int X,int Y) {resize(X,Y,w_,h_);}
410
418 void size(int W,int H) {resize(x_,y_,W,H);}
419
425 Fl_Align align() const {return label_.align_;}
426
434 void align(Fl_Align alignment) {label_.align_ = alignment;}
435
440 Fl_Boxtype box() const {return (Fl_Boxtype)box_;}
441
449 void box(Fl_Boxtype new_box) {box_ = new_box;}
450
455 Fl_Color color() const {return color_;}
456
467 void color(Fl_Color bg) {color_ = bg;}
468
473 Fl_Color selection_color() const {return color2_;}
474
483 void selection_color(Fl_Color a) {color2_ = a;}
484
492 void color(Fl_Color bg, Fl_Color sel) {color_=bg; color2_=sel;}
493
498 const char* label() const {return label_.value;}
499
511 void label(const char* text);
512
523 void copy_label(const char *new_label);
524
528 void label(Fl_Labeltype a, const char* b) {label_.type = a; label_.value = b;}
529
534 Fl_Labeltype labeltype() const {return (Fl_Labeltype)label_.type;}
535
544 void labeltype(Fl_Labeltype a) {label_.type = a;}
545
550 Fl_Color labelcolor() const {return label_.color;}
551
556 void labelcolor(Fl_Color c) {label_.color=c;}
557
565 Fl_Font labelfont() const {return label_.font;}
566
574 void labelfont(Fl_Font f) {label_.font=f;}
575
580 Fl_Fontsize labelsize() const {return label_.size;}
581
586 void labelsize(Fl_Fontsize pix) {label_.size=pix;}
587
591 Fl_Image* image() {return label_.image;}
592
596 const Fl_Image* image() const {return label_.image;}
597
613 void image(Fl_Image* img);
614
619 void image(Fl_Image& img);
620
636 void bind_image(Fl_Image* img);
637
642 void bind_image(int f) { if (f) set_flag(IMAGE_BOUND); else clear_flag(IMAGE_BOUND); }
643
649 int image_bound() const {return ((flags_ & IMAGE_BOUND) ? 1 : 0);}
650
654 Fl_Image* deimage() {return label_.deimage;}
655
659 const Fl_Image* deimage() const {return label_.deimage;}
660
667 void deimage(Fl_Image* img);
668
673 void deimage(Fl_Image& img);
674
681 void bind_deimage(Fl_Image* img);
682
688 int deimage_bound() const {return ((flags_ & DEIMAGE_BOUND) ? 1 : 0);}
689
694 void bind_deimage(int f) { if (f) set_flag(DEIMAGE_BOUND); else clear_flag(DEIMAGE_BOUND); }
695
700 void label_image_spacing(int gap) { label_.spacing = (uchar)gap; }
701
705 int label_image_spacing() { return label_.spacing; }
706
710 void horizontal_label_margin(int px) { label_.h_margin_ = (signed char)px; }
711
715 int horizontal_label_margin() { return label_.h_margin_; }
716
720 void vertical_label_margin(int px) { label_.v_margin_ = (signed char)px; }
721
725 int vertical_label_margin() { return label_.v_margin_; }
726
731 const char *tooltip() const {return tooltip_;}
732
733 void tooltip(const char *text); // see Fl_Tooltip
734 void copy_tooltip(const char *text); // see Fl_Tooltip
735
740 Fl_Callback_p callback() const {return callback_;}
741
747 void callback(Fl_Callback* cb, void* p) {
748 callback_ = cb;
749 user_data(p);
750 }
751
759 void callback(Fl_Callback* cb, Fl_Callback_User_Data* p, bool auto_free) {
760 callback_ = cb;
761 user_data(p, auto_free);
762 }
763
768 void callback(Fl_Callback* cb) {callback_ = cb;}
769
775 callback_ = (Fl_Callback*)(fl_intptr_t)(cb);
776 }
777
783 void callback(Fl_Callback1* cb, long p = 0) {
784 callback_ = (Fl_Callback*)(fl_intptr_t)(cb);
785 user_data((void*)(fl_intptr_t)p);
786 }
787
792 void* user_data() const {return user_data_;}
793
795 void user_data(void* v);
796
798 void user_data(Fl_Callback_User_Data* v, bool auto_free);
799
811 long argument() const {return (long)(fl_intptr_t)user_data_;}
812
817 void argument(long v) {user_data((void*)(fl_intptr_t)v);}
818
827 Fl_When when() const {return (Fl_When)when_;}
828
866 void when(uchar i) {when_ = i;}
867
872 unsigned int visible() const {return !(flags_&INVISIBLE);}
873
878 int visible_r() const;
879
897 virtual void show();
898
902 virtual void hide();
903
908 void set_visible() {flags_ &= ~INVISIBLE;}
909
914 void clear_visible() {flags_ |= INVISIBLE;}
915
920 unsigned int active() const {return !(flags_&INACTIVE);}
921
926 int active_r() const;
927
933 void activate();
934
949 void deactivate();
950
959 unsigned int output() const {return (flags_&OUTPUT);}
960
964 void set_output() {flags_ |= OUTPUT;}
965
969 void clear_output() {flags_ &= ~OUTPUT;}
970
976 unsigned int takesevents() const {return !(flags_&(INACTIVE|INVISIBLE|OUTPUT));}
977
996 unsigned int changed() const {return flags_ & CHANGED;}
997
1001 void set_changed() {flags_ |= CHANGED;}
1002
1006 void clear_changed() {flags_ &= ~CHANGED;}
1007
1012 void clear_active() {flags_ |= INACTIVE;}
1013
1018 void set_active() {flags_ &= ~INACTIVE;}
1019
1027 int take_focus();
1028
1035 void set_visible_focus() { flags_ |= VISIBLE_FOCUS; }
1036
1041 void clear_visible_focus() { flags_ &= ~VISIBLE_FOCUS; }
1042
1047 void visible_focus(int v) { if (v) set_visible_focus(); else clear_visible_focus(); }
1048
1053 unsigned int visible_focus() const { return flags_ & VISIBLE_FOCUS; }
1054
1075 static void default_callback(Fl_Widget *widget, void *data);
1076
1089 void do_callback(Fl_Callback_Reason reason=FL_REASON_UNKNOWN) {do_callback(this, user_data_, reason);}
1090
1099 do_callback(widget, (void*)(fl_intptr_t)arg, reason);
1100 }
1101
1102 void do_callback(Fl_Widget *widget, void *arg = 0, Fl_Callback_Reason reason=FL_REASON_UNKNOWN);
1103
1104 /* Internal use only. */
1105 int test_shortcut();
1106 /* Internal use only. */
1107 static unsigned int label_shortcut(const char *t);
1108 /* Internal use only. */
1109 static int test_shortcut(const char*, const bool require_alt = false);
1110 /* Internal use only. */
1111 void _set_fullscreen() {flags_ |= FULLSCREEN;}
1112 void _clear_fullscreen() {flags_ &= ~FULLSCREEN;}
1113
1119 int contains(const Fl_Widget *w) const ;
1120
1127 int inside(const Fl_Widget *wgt) const {return wgt ? wgt->contains(this) : 0;}
1128
1132 void redraw();
1133
1138 void redraw_label();
1139
1146 uchar damage() const {return damage_;}
1147
1160 void clear_damage(uchar c = 0) {damage_ = c;}
1161
1167 void damage(uchar c);
1168
1175 void damage(uchar c, int x, int y, int w, int h);
1176
1177 void draw_label(int, int, int, int, Fl_Align) const;
1178
1186 void measure_label(int& ww, int& hh) const {label_.measure(ww, hh);}
1187
1188 Fl_Window* window() const ;
1189 Fl_Window* top_window() const;
1190 Fl_Window* top_window_offset(int& xoff, int& yoff) const;
1191
1215 virtual Fl_Group* as_group() { return NULL; }
1216 virtual Fl_Group const* as_group() const { return NULL; }
1217
1230 virtual Fl_Window* as_window() { return 0; }
1231 virtual Fl_Window const* as_window() const { return NULL; }
1232
1243 virtual class Fl_Gl_Window* as_gl_window() { return NULL; }
1244 virtual class Fl_Gl_Window const* as_gl_window() const { return NULL; }
1245
1248 int use_accents_menu() { return flags() & MAC_USE_ACCENTS_MENU; }
1249
1253 Fl_Color color2() const {return (Fl_Color)color2_;}
1254
1258 void color2(unsigned a) {color2_ = a;}
1259
1271 void shortcut_label(int value) {
1272 if (value)
1273 set_flag(SHORTCUT_LABEL);
1274 else
1275 clear_flag(SHORTCUT_LABEL);
1276 }
1277
1280 int shortcut_label() const { return flags_ & SHORTCUT_LABEL; }
1281};
1282
1288#define FL_RESERVED_TYPE 100
1289
1290#endif
int Fl_Font
A font number is an index into the internal font table.
Definition Enumerations.H:1057
unsigned Fl_Align
FLTK type for alignment control.
Definition Enumerations.H:980
unsigned int Fl_Color
An FLTK color value; see also Colors
Definition Enumerations.H:1114
Fl_Labeltype
The labeltype() method sets the type of the label.
Definition Enumerations.H:829
int Fl_Fontsize
Size of a font in pixels.
Definition Enumerations.H:1086
Fl_When
These constants determine when a callback is performed.
Definition Enumerations.H:429
Fl_Boxtype
FLTK standard box types.
Definition Enumerations.H:638
Fl_Callback_Reason
These constants describe why a callback is performed.
Definition Enumerations.H:449
@ FL_REASON_UNKNOWN
unknown or unset reason
Definition Enumerations.H:450
Fl static class.
void Fl_Callback(Fl_Widget *, void *)
Default callback type definition for all fltk widgets (by far the most used)
Definition Fl_Widget.H:33
void Fl_Callback0(Fl_Widget *)
One parameter callback type definition passing only the widget.
Definition Fl_Widget.H:37
void Fl_Callback1(Fl_Widget *, long)
Callback type definition passing the widget and a long data value.
Definition Fl_Widget.H:39
Fl_Callback * Fl_Callback_p
Default callback type pointer definition for all fltk widgets.
Definition Fl_Widget.H:35
A class prototype that allows for additional data in callbacks.
Definition Fl_Widget.H:92
virtual ~Fl_Callback_User_Data()
Destructor.
Definition Fl_Widget.H:96
Fl_Callback_User_Data()
Protected constructor.
Definition Fl_Widget.H:94
The Fl_Gl_Window widget sets things up so OpenGL works.
Definition Fl_Gl_Window.H:56
The Fl_Group class is the main FLTK container widget.
Definition Fl_Group.H:59
Base class for image caching, scaling and drawing.
Definition Fl_Image.H:60
Fl_Widget is the base class for all widgets in FLTK.
Definition Fl_Widget.H:112
Fl_Color labelcolor() const
Gets the label color.
Definition Fl_Widget.H:550
void shortcut_label(int value)
Sets whether the widget's label uses '&' to indicate shortcuts.
Definition Fl_Widget.H:1271
const Fl_Image * deimage() const
Gets the image that is used as part of the widget label when in the inactive state.
Definition Fl_Widget.H:659
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:1243
Fl_Font labelfont() const
Gets the font to use.
Definition Fl_Widget.H:565
Fl_Color color() const
Gets the background color of the widget.
Definition Fl_Widget.H:455
void clear_visible()
Hides the widget.
Definition Fl_Widget.H:914
virtual void draw()=0
Draws the widget.
long argument() const
Gets the current user data (long) argument that is passed to the callback function.
Definition Fl_Widget.H:811
int shortcut_label() const
Returns whether the widget's label uses '&' to indicate shortcuts.
Definition Fl_Widget.H:1280
int inside(const Fl_Widget *wgt) const
Checks if this widget is a child of wgt.
Definition Fl_Widget.H:1127
int contains(const Fl_Widget *w) const
Checks if w is a child of this widget.
Definition Fl_Widget.cxx:283
void draw_focus(Fl_Boxtype t, int X, int Y, int W, int H) const
Draws a focus rectangle around the widget.
Definition Fl_Widget.H:220
void bind_image(int f)
Bind the image to the widget, so the widget will delete the image when it is no longer needed.
Definition Fl_Widget.H:642
void callback(Fl_Callback *cb)
Sets the current callback function for the widget.
Definition Fl_Widget.H:768
Fl_Image * deimage()
Gets the image that is used as part of the widget label when in the inactive state.
Definition Fl_Widget.H:654
void argument(long v)
Sets the current user data (long) argument that is passed to the callback function.
Definition Fl_Widget.H:817
void clear_output()
Sets a widget to accept input.
Definition Fl_Widget.H:969
int is_label_copied() const
Returns whether the current label was assigned with copy_label().
Definition Fl_Widget.H:299
void box(Fl_Boxtype new_box)
Sets the box type for the widget.
Definition Fl_Widget.H:449
const char * label() const
Gets the current label text.
Definition Fl_Widget.H:498
int vertical_label_margin()
Get the spacing between the label and the vertical edge of the widget.
Definition Fl_Widget.H:725
int y() const
Gets the widget position in its window.
Definition Fl_Widget.H:366
void vertical_label_margin(int px)
Set the spacing between the label and the vertical edge of the widget.
Definition Fl_Widget.H:720
void clear_visible_focus()
Disables keyboard focus navigation with this widget.
Definition Fl_Widget.H:1041
int label_image_spacing()
Return the gap size between the label and the image.
Definition Fl_Widget.H:705
int h() const
Gets the widget height.
Definition Fl_Widget.H:376
void color(Fl_Color bg, Fl_Color sel)
Sets the background and selection color of the widget.
Definition Fl_Widget.H:492
unsigned int flags() const
Gets the widget flags mask.
Definition Fl_Widget.H:158
void label_image_spacing(int gap)
Set the gap between the label and the image in pixels.
Definition Fl_Widget.H:700
void horizontal_label_margin(int px)
Set the spacing between the label and the horizontal edge of the widget.
Definition Fl_Widget.H:710
void visible_focus(int v)
Modifies keyboard focus navigation.
Definition Fl_Widget.H:1047
Fl_Align align() const
Gets the label alignment.
Definition Fl_Widget.H:425
void parent(Fl_Group *p)
Internal use only - "for hacks only".
Definition Fl_Widget.H:344
virtual Fl_Group * as_group()
Returns an Fl_Group pointer if this widget is an Fl_Group.
Definition Fl_Widget.H:1215
void set_flag(unsigned int c)
Sets a flag in the flags mask.
Definition Fl_Widget.H:160
const char * tooltip() const
Gets the current tooltip text.
Definition Fl_Widget.H:731
void color(Fl_Color bg)
Sets the background color of the widget.
Definition Fl_Widget.H:467
void do_callback(Fl_Widget *widget, long arg, Fl_Callback_Reason reason=FL_REASON_UNKNOWN)
Calls the widget callback function with arbitrary arguments.
Definition Fl_Widget.H:1098
void align(Fl_Align alignment)
Sets the label alignment.
Definition Fl_Widget.H:434
void set_changed()
Marks the value of the widget as changed.
Definition Fl_Widget.H:1001
void set_visible()
Makes the widget visible.
Definition Fl_Widget.H:908
void measure_label(int &ww, int &hh) const
Sets width ww and height hh accordingly with the label size.
Definition Fl_Widget.H:1186
void callback(Fl_Callback1 *cb, long p=0)
Sets the current callback function for the widget.
Definition Fl_Widget.H:783
int deimage_bound() const
Returns whether the inactive image is managed by the widget.
Definition Fl_Widget.H:688
void clear_active()
Marks the widget as inactive without sending events or changing focus.
Definition Fl_Widget.H:1012
void labeltype(Fl_Labeltype a)
Sets the label type.
Definition Fl_Widget.H:544
void set_output()
Sets a widget to output only.
Definition Fl_Widget.H:964
void * user_data() const
Gets the user data for this widget.
Definition Fl_Widget.H:792
void labelsize(Fl_Fontsize pix)
Sets the font size in pixels.
Definition Fl_Widget.H:586
int w() const
Gets the widget width.
Definition Fl_Widget.H:371
Fl_Boxtype box() const
Gets the box type of the widget.
Definition Fl_Widget.H:440
Fl_Fontsize labelsize() const
Gets the font size in pixels.
Definition Fl_Widget.H:580
Fl_Color selection_color() const
Gets the selection color.
Definition Fl_Widget.H:473
void bind_deimage(int f)
Bind the inactive image to the widget, so the widget will delete the image when it is no longer neede...
Definition Fl_Widget.H:694
void label(Fl_Labeltype a, const char *b)
Shortcut to set the label text and type in one call.
Definition Fl_Widget.H:528
void labelcolor(Fl_Color c)
Sets the label color.
Definition Fl_Widget.H:556
virtual Fl_Window * as_window()
Returns an Fl_Window pointer if this widget is an Fl_Window.
Definition Fl_Widget.H:1230
void callback(Fl_Callback0 *cb)
Sets the current callback function for the widget.
Definition Fl_Widget.H:774
void selection_color(Fl_Color a)
Sets the selection color.
Definition Fl_Widget.H:483
void clear_changed()
Marks the value of the widget as unchanged.
Definition Fl_Widget.H:1006
Fl_Labeltype labeltype() const
Gets the label type.
Definition Fl_Widget.H:534
void x(int v)
Internal use only.
Definition Fl_Widget.H:150
unsigned int visible() const
Returns whether a widget is visible.
Definition Fl_Widget.H:872
unsigned int output() const
Returns if a widget is used for output only.
Definition Fl_Widget.H:959
Fl_Callback_p callback() const
Gets the current callback function for the widget.
Definition Fl_Widget.H:740
void position(int X, int Y)
Repositions the window or widget.
Definition Fl_Widget.H:409
void when(uchar i)
Sets the flags used to decide when a callback is called.
Definition Fl_Widget.H:866
Fl_Group * parent() const
Returns a pointer to the parent widget.
Definition Fl_Widget.H:334
const Fl_Image * image() const
Gets the image that is used as part of the widget label when in the active state.
Definition Fl_Widget.H:596
void set_visible_focus()
Enables keyboard focus navigation with this widget.
Definition Fl_Widget.H:1035
void type(uchar t)
Sets the widget type.
Definition Fl_Widget.H:356
void needs_keyboard(bool needs)
Sets whether this widget needs a keyboard.
Definition Fl_Widget.H:315
Fl_Color color2() const
For back compatibility only.
Definition Fl_Widget.H:1253
Fl_Image * image()
Gets the image that is used as part of the widget label when in the active state.
Definition Fl_Widget.H:591
Fl_When when() const
Returns the conditions under which the callback is called.
Definition Fl_Widget.H:827
void callback(Fl_Callback *cb, Fl_Callback_User_Data *p, bool auto_free)
Sets the current callback function and managed user data for the widget.
Definition Fl_Widget.H:759
void w(int v)
Internal use only.
Definition Fl_Widget.H:154
void callback(Fl_Callback *cb, void *p)
Sets the current callback function and data for the widget.
Definition Fl_Widget.H:747
uchar damage() const
Returns non-zero if draw() needs to be called.
Definition Fl_Widget.H:1146
int image_bound() const
Returns whether the image is managed by the widget.
Definition Fl_Widget.H:649
int horizontal_label_margin()
Get the spacing between the label and the horizontal edge of the widget.
Definition Fl_Widget.H:715
void labelfont(Fl_Font f)
Sets the font to use.
Definition Fl_Widget.H:574
uchar type() const
Gets the widget type.
Definition Fl_Widget.H:351
void set_active()
Marks the widget as active without sending events or changing focus.
Definition Fl_Widget.H:1018
bool needs_keyboard() const
Returns whether this widget needs a keyboard.
Definition Fl_Widget.H:325
unsigned int active() const
Returns whether the widget is active.
Definition Fl_Widget.H:920
unsigned int visible_focus() const
Checks whether this widget has a visible focus.
Definition Fl_Widget.H:1053
void size(int W, int H)
Changes the size of the widget.
Definition Fl_Widget.H:418
void draw_focus() const
Draws a focus rectangle around the widget.
Definition Fl_Widget.H:211
unsigned int takesevents() const
Returns if the widget is able to take events.
Definition Fl_Widget.H:976
void color2(unsigned a)
For back compatibility only.
Definition Fl_Widget.H:1258
void y(int v)
Internal use only.
Definition Fl_Widget.H:152
void clear_flag(unsigned int c)
Clears a flag in the flags mask.
Definition Fl_Widget.H:162
void h(int v)
Internal use only.
Definition Fl_Widget.H:156
int x() const
Gets the widget position in its window.
Definition Fl_Widget.H:361
int use_accents_menu()
Returns non zero if MAC_USE_ACCENTS_MENU flag is set, 0 otherwise.
Definition Fl_Widget.H:1248
unsigned int changed() const
Checks if the widget value changed since the last callback.
Definition Fl_Widget.H:996
void clear_damage(uchar c=0)
Clears or sets the damage flags.
Definition Fl_Widget.H:1160
void do_callback(Fl_Callback_Reason reason=FL_REASON_UNKNOWN)
Calls the widget callback function with default arguments.
Definition Fl_Widget.H:1089
This widget produces an actual window.
Definition Fl_Window.H:55
unsigned char uchar
unsigned char
Definition fl_types.h:30
opaque fl_intptr_t
An integral type large enough to store a pointer or a long value.
Definition platform_types.h:31
This struct stores all information for a text or mixed graphics label.
Definition Fl_Widget.H:49
uchar type
type of label.
Definition Fl_Widget.H:65
Fl_Image * deimage
optional image for a deactivated label
Definition Fl_Widget.H:55
void measure(int &w, int &h) const
Measures the size of the label.
Definition fl_labeltype.cxx:102
Fl_Fontsize size
size of label font
Definition Fl_Widget.H:59
const char * value
label text
Definition Fl_Widget.H:51
Fl_Align align_
alignment of label
Definition Fl_Widget.H:63
Fl_Color color
text color
Definition Fl_Widget.H:61
signed char v_margin_
Spacing between label and the vertically aligned side of the widget.
Definition Fl_Widget.H:69
signed char h_margin_
Spacing between label and the horizontally aligned side of the widget.
Definition Fl_Widget.H:67
uchar spacing
Spacing between an image and the label text.
Definition Fl_Widget.H:71
Fl_Image * image
optional image for an active label
Definition Fl_Widget.H:53
Fl_Font font
label font used in text
Definition Fl_Widget.H:57