1 // generated by Fast Light User Interface Designer (fluid) version 1.0300
2
3 #include "radio.h"
4
5 /**
6 Buttons test callback
7 */
button_cb(Fl_Button * b,void *)8 static void button_cb(Fl_Button *b, void *) {
9 char msg[256];
10 sprintf(msg, "Label: '%s'\nValue: %d", b->label(),b->value());
11 cb_info->value(msg);
12 cb_info->redraw();
13 printf("%s\n",msg);
14 }
15
16 Fl_Output *cb_info=(Fl_Output *)0;
17
main(int argc,char ** argv)18 int main(int argc, char **argv) {
19 Fl_Double_Window* w;
20 { Fl_Double_Window* o = new Fl_Double_Window(369, 214);
21 w = o;
22 { Fl_Button* o = new Fl_Button(20, 10, 160, 30, "&Fl_Button A1");
23 o->tooltip("Normal button (callback called only when released)");
24 o->labelsize(13);
25 o->callback((Fl_Callback*) button_cb);
26 } // Fl_Button* o
27 { Fl_Button* o = new Fl_Button(20, 44, 160, 30, "Fl_Button &A2");
28 o->tooltip("Normal button with callback called when changed (push and released)");
29 o->labelsize(13);
30 o->when(FL_WHEN_CHANGED);
31 o->callback((Fl_Callback*) button_cb);
32 } // Fl_Button* o
33 { Fl_Return_Button* o = new Fl_Return_Button(20, 78, 160, 30, "Fl_Return_Button &B");
34 o->tooltip("Button with Return key as default shortcut");
35 o->labelsize(13);
36 o->callback((Fl_Callback*) button_cb);
37 } // Fl_Return_Button* o
38 { Fl_Light_Button* o = new Fl_Light_Button(20, 113, 160, 30, "Fl_Light_Button &C");
39 o->tooltip("Button with toggle state and a visual indicator of the current state");
40 o->labelsize(13);
41 o->callback((Fl_Callback*) button_cb);
42 } // Fl_Light_Button* o
43 { Fl_Check_Button* o = new Fl_Check_Button(20, 148, 160, 30, "Fl_Check_Button &D");
44 o->tooltip("Check button with toggle state");
45 o->down_box(FL_DOWN_BOX);
46 o->labelsize(13);
47 o->callback((Fl_Callback*) button_cb);
48 } // Fl_Check_Button* o
49 { Fl_Round_Button* o = new Fl_Round_Button(20, 178, 160, 30, "Fl_Round_Button &E");
50 o->tooltip("Round Button with toggle state");
51 o->down_box(FL_ROUND_DOWN_BOX);
52 o->labelsize(13);
53 o->callback((Fl_Callback*) button_cb);
54 } // Fl_Round_Button* o
55 { Fl_Group* o = new Fl_Group(190, 10, 70, 120);
56 o->box(FL_THIN_UP_FRAME);
57 { Fl_Round_Button* o = new Fl_Round_Button(190, 10, 70, 30, "radio &1");
58 o->tooltip("Radio button, only one button is set at a time, in the corresponding group.");
59 o->type(102);
60 o->down_box(FL_ROUND_DOWN_BOX);
61 o->callback((Fl_Callback*) button_cb);
62 } // Fl_Round_Button* o
63 { Fl_Round_Button* o = new Fl_Round_Button(190, 40, 70, 30, "radio &2");
64 o->tooltip("Radio button, only one button is set at a time, in the corresponding group.");
65 o->type(102);
66 o->down_box(FL_ROUND_DOWN_BOX);
67 o->callback((Fl_Callback*) button_cb);
68 } // Fl_Round_Button* o
69 { Fl_Round_Button* o = new Fl_Round_Button(190, 70, 70, 30, "radio &3");
70 o->tooltip("Radio button, only one button is set at a time, in the corresponding group.");
71 o->type(102);
72 o->down_box(FL_ROUND_DOWN_BOX);
73 o->callback((Fl_Callback*) button_cb);
74 } // Fl_Round_Button* o
75 { Fl_Round_Button* o = new Fl_Round_Button(190, 100, 70, 30, "radio &4");
76 o->tooltip("Radio button, only one button is set at a time, in the corresponding group.");
77 o->type(102);
78 o->down_box(FL_ROUND_DOWN_BOX);
79 o->callback((Fl_Callback*) button_cb);
80 } // Fl_Round_Button* o
81 o->end();
82 } // Fl_Group* o
83 { Fl_Group* o = new Fl_Group(270, 10, 90, 120);
84 o->box(FL_THIN_UP_BOX);
85 { Fl_Button* o = new Fl_Button(280, 20, 20, 20, "radio");
86 o->tooltip("Custom look button, only one button is set at a time, in the corresponding gr\
87 oup.");
88 o->type(102);
89 o->selection_color((Fl_Color)1);
90 o->align(Fl_Align(FL_ALIGN_RIGHT));
91 } // Fl_Button* o
92 { Fl_Button* o = new Fl_Button(280, 45, 20, 20, "radio");
93 o->tooltip("Custom look button, only one button is set at a time, in the corresponding gr\
94 oup.");
95 o->type(102);
96 o->selection_color((Fl_Color)1);
97 o->align(Fl_Align(FL_ALIGN_RIGHT));
98 } // Fl_Button* o
99 { Fl_Button* o = new Fl_Button(280, 70, 20, 20, "radio");
100 o->tooltip("Custom look button, only one button is set at a time, in the corresponding gr\
101 oup.");
102 o->type(102);
103 o->selection_color((Fl_Color)1);
104 o->align(Fl_Align(FL_ALIGN_RIGHT));
105 } // Fl_Button* o
106 { Fl_Button* o = new Fl_Button(280, 95, 20, 20, "radio");
107 o->tooltip("Custom look button, only one button is set at a time, in the corresponding gr\
108 oup.");
109 o->type(102);
110 o->selection_color((Fl_Color)1);
111 o->align(Fl_Align(FL_ALIGN_RIGHT));
112 } // Fl_Button* o
113 o->end();
114 } // Fl_Group* o
115 { cb_info = new Fl_Output(190, 148, 170, 62, "callback:");
116 cb_info->type(12);
117 cb_info->textsize(12);
118 cb_info->align(Fl_Align(133));
119 } // Fl_Output* cb_info
120 o->end();
121 } // Fl_Double_Window* o
122 w->show(argc, argv);
123 return Fl::run();
124 }
125