summaryrefslogtreecommitdiff
path: root/test/tabs.fl
blob: fa329174570162e32324f99a977ee72c6aab9a01 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
# data file for the Fltk User Interface Designer (fluid)
version 1.0500
header_name {.h}
code_name {.cxx}
Function {} {open
} {
  Fl_Window foo_window {
    label {Comparison of Fl_Tab (left) vs. Fl_Wizard (right)} open
    xywh {330 402 660 400} type Double resizable visible
  } {
    Fl_Box {} {
      label {class Fl_Tabs}
      xywh {95 0 130 35} labeltype ENGRAVED_LABEL labelfont 1
    }
    Fl_Tabs tabs_group {
      callback {Fl_Widget *sel_tab = o->value();
if (sel_tab) {
  printf("Callback called for tab \\"%s\\"\\n", sel_tab->label());
} else {
  printf("Callback called\\n");
}} open selected
      tooltip {the various index cards test different aspects of the Fl_Tabs widget} xywh {10 35 315 260} selection_color 4 labelcolor 7 resizable
      code0 {// tabs_group->handle_overflow(Fl_Tabs::OVERFLOW_PULLDOWN);}
    } {
      Fl_Group {} {
        label {Label&1}
        callback {if (Fl::callback_reason()==FL_REASON_CLOSED)
  o->parent()->remove(o);}
        tooltip {this tab tests correct keyboard navigation between text input fields} xywh {10 60 315 235} selection_color 1 when 16 resizable
      } {
        Fl_Input {} {
          label {input:}
          tooltip {This is the first input field} xywh {70 80 240 40}
        }
        Fl_Input {} {
          label {input2:}
          xywh {70 120 240 30}
          code0 {o->tooltip("");}
        }
        Fl_Input {} {
          label {input3:}
          xywh {70 150 240 80}
        }
      }
      Fl_Group {} {
        label {tab&2}
        callback {if (Fl::callback_reason()==FL_REASON_CLOSED)
  o->parent()->remove(o);}
        tooltip {tab2 tests among other things the cooperation of modal windows and tabs} xywh {10 60 315 235} selection_color 2 when 16 hide
      } {
        Fl_Button {} {
          label button1
          callback {fl_message("Test to see if this modal window prevents you from "
           "changing the tabs. It should.");}
          xywh {20 85 100 30}
          code0 {\#include <FL/fl_ask.H>}
        }
        Fl_Input {} {
          label {input in box2}
          xywh {130 130 175 30}
        }
        Fl_Button {} {
          label {This is stuff inside the Fl_Group "tab2"}
          xywh {25 170 280 30}
        }
        Fl_Button {} {
          label {Test event blocking by modal window}
          callback {fl_message("Make sure you cannot change the tabs while this modal window is up");}
          xywh {25 200 280 30}
          code0 {\#include <FL/fl_ask.H>}
        }
      }
      Fl_Group {} {
        label {tab&3}
        callback {if (Fl::callback_reason()==FL_REASON_CLOSED)
  o->parent()->remove(o);}
        tooltip {tab3 checks for correct keyboard navigation} xywh {10 60 315 235} selection_color 3 when 16 hide
      } {
        Fl_Button {} {
          label button2
          xywh {20 80 60 80}
        }
        Fl_Button {} {
          label button
          xywh {80 80 60 80}
        }
        Fl_Button {} {
          label button
          xywh {140 80 60 80}
        }
      }
      Fl_Group {} {
        label {&tab4}
        callback {if (Fl::callback_reason()==FL_REASON_CLOSED)
  o->parent()->remove(o);}
        tooltip {this tab shows the issue of indicating a selected tab if the tab layouts are very similar} xywh {10 60 315 235} selection_color 5 labeltype ENGRAVED_LABEL labelfont 2 when 16 hide
      } {
        Fl_Button {} {
          label button2
          xywh {20 80 60 120}
        }
        Fl_Button {} {
          label button
          xywh {80 80 60 120}
        }
        Fl_Button {} {
          label button
          xywh {140 80 60 120}
        }
      }
      Fl_Group {} {
        label {@fileprint  &print}
        tooltip {tab5 verifies if visibility requests are handled correctly} xywh {10 60 315 235} hide
      } {
        Fl_Button {} {
          label button2
          tooltip {button2 has a different tooltip than tab5} xywh {20 80 60 80}
        }
        Fl_Button {} {
          label button
          xywh {90 80 60 80}
        }
        Fl_Clock {} {
          label {Make sure this clock does not use processor time when this tab is hidden or window is iconized}
          xywh {185 80 120 120} box OSHADOW_BOX color 238 selection_color 0 labelfont 8 labelsize 10 align 130
        }
        Fl_Group {} {open
          xywh {20 190 40 55} box THIN_DOWN_BOX color 173 align 16
          class Fl_Window
        } {}
        Fl_Group {} {
          label {subwindows:} open
          xywh {65 190 40 55} box THIN_DOWN_BOX color 167
          class Fl_Window
        } {}
        Fl_Group {} {open
          xywh {110 190 40 55} box THIN_DOWN_BOX color 239 align 16
          class Fl_Window
        } {}
      }
    }
    Fl_Box {} {
      label {class Fl_Wizard}
      xywh {410 0 130 35} labeltype ENGRAVED_LABEL labelfont 1
    }
    Fl_Wizard wWizard {open
      xywh {330 35 320 260}
    } {
      Fl_Group {} {
        label Label1
        tooltip {this tab tests correct keyboard navigation between text input fields} xywh {330 60 320 235} selection_color 1 hide resizable
      } {
        Fl_Input {} {
          label {input:}
          tooltip {This is the first input field} xywh {390 80 240 40}
        }
        Fl_Input {} {
          label {input2:}
          xywh {390 120 240 30}
          code0 {o->tooltip("");}
        }
        Fl_Input {} {
          label {input3:}
          xywh {390 150 240 80}
        }
      }
      Fl_Group {} {
        label tab2
        tooltip {tab2 tests among other things the cooperation of modal windows and tabs} xywh {330 60 320 235} selection_color 2
      } {
        Fl_Button {} {
          label button1
          callback {fl_message("Test to see if this modal window prevents you from "
           "changing the tabs. It should.");}
          xywh {350 85 100 30}
          code0 {\#include <FL/fl_ask.H>}
        }
        Fl_Input {} {
          label {input in box2}
          xywh {455 130 175 30}
        }
        Fl_Button {} {
          label {This is stuff inside the Fl_Group "tab2"}
          xywh {350 170 280 30}
        }
        Fl_Button {} {
          label {Test event blocking by modal window}
          callback {fl_message("Make sure you cannot change the tabs while this modal window is up");}
          xywh {350 200 280 30}
          code0 {\#include <FL/fl_ask.H>}
        }
      }
      Fl_Group {} {
        label tab3
        tooltip {tab3 checks for correct keyboard navigation} xywh {330 60 320 235} selection_color 3 hide
      } {
        Fl_Button {} {
          label button2
          xywh {350 80 60 80}
        }
        Fl_Button {} {
          label button
          xywh {410 80 60 80}
        }
        Fl_Button {} {
          label button
          xywh {470 80 60 80}
        }
      }
      Fl_Group {} {
        label tab4
        tooltip {this tab shows the issue of indicating a selected tab if the tab layouts are very similar} xywh {330 60 320 235} selection_color 5 labelfont 2 hide
      } {
        Fl_Button {} {
          label button2
          xywh {350 80 60 120}
        }
        Fl_Button {} {
          label button
          xywh {410 80 60 120}
        }
        Fl_Button {} {
          label button
          xywh {470 80 60 120}
        }
      }
      Fl_Group {} {
        label {     tab5      } open
        tooltip {tab5 verifies if visibility requests are handled correctly} xywh {330 60 320 235} labeltype ENGRAVED_LABEL hide
      } {
        Fl_Button {} {
          label button2
          tooltip {button2 has a different tooltip than tab5} xywh {350 80 60 80}
        }
        Fl_Button {} {
          label button
          xywh {420 80 60 80}
        }
        Fl_Clock {} {
          label {Make sure this clock does not use processor time when this tab is hidden or window is iconized}
          xywh {510 80 120 120} box OSHADOW_BOX color 238 selection_color 0 labelfont 8 labelsize 10 align 130
        }
        Fl_Group {} {open
          xywh {350 190 40 55} box THIN_DOWN_BOX color 173 align 16
          class Fl_Window
        } {}
        Fl_Group {} {
          label {subwindows:} open
          xywh {395 190 40 55} box THIN_DOWN_BOX color 167
          class Fl_Window
        } {}
        Fl_Group {} {open
          xywh {440 190 40 55} box THIN_DOWN_BOX color 239 align 16
          class Fl_Window
        } {}
      }
    }
    Fl_Group {} {
      xywh {410 305 130 25}
    } {
      Fl_Button {} {
        label {@|<}
        callback {wWizard->value(wWizard->child(0));}
        tooltip {go to first page [Home]} xywh {410 305 30 25} shortcut 0xff50
      }
      Fl_Button {} {
        label {@<}
        callback {wWizard->prev();}
        tooltip {go to previous page [left arrow]} xywh {440 305 30 25} shortcut 0xff51
      }
      Fl_Button {} {
        label {@>}
        callback {wWizard->next();}
        tooltip {go to next page in wizard [right arrow]} xywh {480 305 30 25} shortcut 0xff53
      }
      Fl_Button {} {
        label {@>|}
        callback {int last = wWizard->children()-1;
wWizard->value(wWizard->child(last));}
        tooltip {go to last page [End]} xywh {510 305 30 25} shortcut 0xff57
      }
    }
    Fl_Button {} {
      label {add tab}
      callback {static int n = 6;
int X = tabs_group->x(), Y = tabs_group->y()+25;
int W = tabs_group->w(), H = tabs_group->h()-25;
Fl_Group::current(NULL);
char buf[64];
snprintf(buf, 62, "tab%d", n);
Fl_Group* new_tab = new Fl_Group(X, Y, W, H);
new_tab->copy_label(buf);
new_tab->when(FL_WHEN_CLOSED);
new_tab->callback((Fl_Callback*)cb_tab);
snprintf(buf, 62, "Empty tab %d.", n);
Fl_Box* box = new Fl_Box(X+5, Y+5, W-10, H-10);
box->copy_label(buf);
box->align(Fl_Align(FL_ALIGN_CENTER|FL_ALIGN_INSIDE));
tabs_group->add(new_tab);
n++;}
      tooltip {Add more tabs to check overflow handling.} xywh {60 309 70 25}
    }
    Fl_Choice {} {
      label {overflow:} open
      tooltip {Change how Fl_Tabs handles more tabs than fit into the tabs space.} xywh {212 309 95 25} down_box BORDER_BOX
    } {
      MenuItem {} {
        label compress
        callback {tabs_group->handle_overflow(Fl_Tabs::OVERFLOW_COMPRESS);}
        xywh {0 0 31 20}
      }
      MenuItem {} {
        label clip
        callback {tabs_group->handle_overflow(Fl_Tabs::OVERFLOW_CLIP);}
        xywh {0 0 31 20}
      }
      MenuItem {} {
        label pulldown
        callback {tabs_group->handle_overflow(Fl_Tabs::OVERFLOW_PULLDOWN);}
        xywh {0 0 31 20}
      }
      MenuItem {} {
        label drag
        callback {tabs_group->handle_overflow(Fl_Tabs::OVERFLOW_DRAG);}
        xywh {0 0 31 20}
      }
    }
    Fl_Input {} {
      label {input:}
      xywh {60 345 250 25}
    }
    Fl_Button {} {
      label cancel
      callback {exit(1);}
      xywh {490 345 70 30}
      code0 {\#include <stdlib.h>}
    }
    Fl_Return_Button {} {
      label OK
      callback {exit(0);}
      xywh {570 345 70 30}
      code0 {\#include <stdlib.h>}
    }
  }
}