27 #ifndef Fl_Input_Choice_H 28 #define Fl_Input_Choice_H 31 #include <FL/Fl_Group.H> 32 #include <FL/Fl_Input.H> 33 #include <FL/Fl_Menu_Button.H> 101 int xc = x()+w()/2, yc=y()+h()/2;
106 InputMenuButton(
int X,
int Y,
int W,
int H,
const char*L=0) :
111 InputMenuButton *menu_;
114 static void menu_cb(
Fl_Widget*,
void *data) {
119 if (!strcmp(o->inp_->
value(), o->menu_->text()))
121 o->Fl_Widget::clear_changed();
127 o->inp_->
value(o->menu_->text());
129 o->Fl_Widget::set_changed();
136 if (o->
callback() != default_callback)
138 o->Fl_Widget::clear_changed();
144 static void inp_cb(
Fl_Widget*,
void *data) {
148 o->Fl_Widget::set_changed();
152 o->Fl_Widget::clear_changed();
159 if (o->
callback() != default_callback)
160 o->Fl_Widget::clear_changed();
164 inline int inp_x() {
return(x() +
Fl::box_dx(box())); }
165 inline int inp_y() {
return(y() +
Fl::box_dy(box())); }
166 inline int inp_w() {
return(w() -
Fl::box_dw(box()) - 20); }
167 inline int inp_h() {
return(h() -
Fl::box_dh(box())); }
169 inline int menu_x() {
return(x() + w() - 20 -
Fl::box_dx(box())); }
170 inline int menu_y() {
return(y() +
Fl::box_dy(box())); }
171 inline int menu_w() {
return(20); }
172 inline int menu_h() {
return(h() -
Fl::box_dh(box())); }
193 void add(
const char *s) { menu_->add(s); }
217 void resize(
int X,
int Y,
int W,
int H) {
219 inp_->
resize(inp_x(), inp_y(), inp_w(), inp_h());
220 menu_->resize(menu_x(), menu_y(), menu_w(), menu_h());
243 inp_->
value(menu_->text(val));
264 #endif // !Fl_Input_Choice_H
Do the callback when the button or key is released and the value changes.
Definition: Enumerations.H:443
static Fl_Widget * focus()
Gets the current Fl::focus() widget.
Definition: Fl.H:838
static int box_dw(Fl_Boxtype)
Returns the width offset for the given boxtype.
Definition: fl_boxtype.cxx:391
Do the callback whenever the user interacts with the widget.
Definition: Enumerations.H:442
void fl_color(Fl_Color c)
Sets the color for all subsequent drawing operations.
Definition: fl_draw.H:52
static int box_dy(Fl_Boxtype)
Returns the Y offset for the given boxtype.
Definition: fl_boxtype.cxx:385
Do the callback only when the widget value changes.
Definition: Enumerations.H:441
Fl_Boxtype
Definition: Enumerations.H:603
see figure 1
Definition: Enumerations.H:607
The Fl_Group class is the FLTK container widget.
Definition: Fl_Group.H:41
static int box_dx(Fl_Boxtype)
Returns the X offset for the given boxtype.
Definition: fl_boxtype.cxx:360
FL_EXPORT Fl_Color fl_inactive(Fl_Color c)
Returns the inactive, dimmed version of the given color.
Definition: fl_color.cxx:423
int Fl_Fontsize
Size of a font in pixels.
Definition: Enumerations.H:906
static int box_dh(Fl_Boxtype)
Returns the height offset for the given boxtype.
Definition: fl_boxtype.cxx:397
void resize(int, int, int, int)
Resizes the Fl_Group widget and all of its children.
Definition: Fl_Group.cxx:634
utility header to pull drawing functions together
unsigned int Fl_Color
An FLTK color value; see also Colors.
Definition: Enumerations.H:934
int Fl_Font
A font number is an index into the internal font table.
Definition: Enumerations.H:877
void fl_polygon(int x, int y, int x1, int y1, int x2, int y2)
Fills a 3-sided polygon.
Definition: fl_draw.H:244