You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

316 lines
12KB

  1. // generated by Fast Light User Interface Designer (fluid) version 1.0300
  2. #include "tabs.h"
  3. Fl_Double_Window *foo_window=(Fl_Double_Window *)0;
  4. static void cb_button1(Fl_Button*, void*) {
  5. fl_message("Test to see if this modal window prevents you from "
  6. "changing the tabs. It should.");
  7. }
  8. static void cb_Test(Fl_Button*, void*) {
  9. fl_message("Make sure you cannot change the tabs while this modal window is up");
  10. }
  11. Fl_Wizard *wWizard=(Fl_Wizard *)0;
  12. static void cb_button11(Fl_Button*, void*) {
  13. fl_message("Test to see if this modal window prevents you from "
  14. "changing the tabs. It should.");
  15. }
  16. static void cb_Test1(Fl_Button*, void*) {
  17. fl_message("Make sure you cannot change the tabs while this modal window is up");
  18. }
  19. static void cb_(Fl_Button*, void*) {
  20. wWizard->value(wWizard->child(0));
  21. }
  22. static void cb_1(Fl_Button*, void*) {
  23. wWizard->prev();
  24. }
  25. static void cb_2(Fl_Button*, void*) {
  26. wWizard->next();
  27. }
  28. static void cb_3(Fl_Button*, void*) {
  29. int last = wWizard->children()-1;
  30. wWizard->value(wWizard->child(last));
  31. }
  32. static void cb_cancel(Fl_Button*, void*) {
  33. exit(1);
  34. }
  35. static void cb_OK(Fl_Return_Button*, void*) {
  36. exit(0);
  37. }
  38. int main(int argc, char **argv) {
  39. { foo_window = new Fl_Double_Window(642, 337, "Comparison of Fl_Tab (left) vs. Fl_Wizard (right)");
  40. { Fl_Box* o = new Fl_Box(95, 0, 130, 35, "class Fl_Tabs");
  41. o->labeltype(FL_ENGRAVED_LABEL);
  42. o->labelfont(1);
  43. } // Fl_Box* o
  44. { Fl_Tabs* o = new Fl_Tabs(10, 35, 300, 205);
  45. o->tooltip("the various index cards test different aspects of the Fl_Tabs widget");
  46. o->selection_color((Fl_Color)4);
  47. o->labelcolor(FL_BACKGROUND2_COLOR);
  48. { Fl_Group* o = new Fl_Group(10, 60, 300, 180, "Label&1");
  49. o->tooltip("this Tab tests correct keyboard navigation between text input fields");
  50. o->selection_color((Fl_Color)1);
  51. { Fl_Input* o = new Fl_Input(60, 80, 240, 40, "input:");
  52. o->tooltip("This is the first input field");
  53. } // Fl_Input* o
  54. { Fl_Input* o = new Fl_Input(60, 120, 240, 30, "input2:");
  55. o->tooltip("");
  56. } // Fl_Input* o
  57. { new Fl_Input(60, 150, 240, 80, "input3:");
  58. } // Fl_Input* o
  59. o->end();
  60. Fl_Group::current()->resizable(o);
  61. } // Fl_Group* o
  62. { Fl_Group* o = new Fl_Group(10, 60, 300, 180, "tab&2");
  63. o->tooltip("tab2 tests among other things the cooperation of modal windows and tabs");
  64. o->selection_color((Fl_Color)2);
  65. o->hide();
  66. { Fl_Button* o = new Fl_Button(20, 90, 100, 30, "button1");
  67. o->callback((Fl_Callback*)cb_button1);
  68. } // Fl_Button* o
  69. { new Fl_Input(140, 130, 100, 30, "input in box2");
  70. } // Fl_Input* o
  71. { new Fl_Button(30, 170, 260, 30, "This is stuff inside the Fl_Group \"tab2\"");
  72. } // Fl_Button* o
  73. { Fl_Button* o = new Fl_Button(30, 200, 260, 30, "Test event blocking by modal window");
  74. o->callback((Fl_Callback*)cb_Test);
  75. } // Fl_Button* o
  76. o->end();
  77. } // Fl_Group* o
  78. { Fl_Group* o = new Fl_Group(10, 60, 300, 180, "tab&3");
  79. o->tooltip("tab3 checks for correct keyboard navigation");
  80. o->selection_color((Fl_Color)3);
  81. o->hide();
  82. { new Fl_Button(20, 90, 60, 80, "button2");
  83. } // Fl_Button* o
  84. { new Fl_Button(80, 90, 60, 80, "button");
  85. } // Fl_Button* o
  86. { new Fl_Button(140, 90, 60, 80, "button");
  87. } // Fl_Button* o
  88. o->end();
  89. } // Fl_Group* o
  90. { Fl_Group* o = new Fl_Group(10, 60, 300, 180, "&tab4");
  91. o->tooltip("this tab show the issue of indicating a selcted tab if the tab layouts are ve\
  92. ry similar");
  93. o->selection_color((Fl_Color)5);
  94. o->labeltype(FL_ENGRAVED_LABEL);
  95. o->labelfont(2);
  96. o->hide();
  97. { new Fl_Button(20, 80, 60, 110, "button2");
  98. } // Fl_Button* o
  99. { new Fl_Button(80, 80, 60, 110, "button");
  100. } // Fl_Button* o
  101. { new Fl_Button(140, 80, 60, 110, "button");
  102. } // Fl_Button* o
  103. o->end();
  104. } // Fl_Group* o
  105. { Fl_Group* o = new Fl_Group(10, 60, 300, 180, "@fileprint &print");
  106. o->tooltip("tab5 verifies if visibility requests are handled correctly");
  107. o->hide();
  108. { Fl_Button* o = new Fl_Button(20, 75, 60, 80, "button2");
  109. o->tooltip("button2 has a different tooltp than tab5");
  110. } // Fl_Button* o
  111. { new Fl_Button(90, 75, 60, 80, "button");
  112. } // Fl_Button* o
  113. { Fl_Window* o = new Fl_Window(20, 175, 40, 55);
  114. o->box(FL_THIN_DOWN_BOX);
  115. o->color((Fl_Color)173);
  116. o->selection_color(FL_BACKGROUND_COLOR);
  117. o->labeltype(FL_NORMAL_LABEL);
  118. o->labelfont(0);
  119. o->labelsize(14);
  120. o->labelcolor(FL_FOREGROUND_COLOR);
  121. o->align(Fl_Align(FL_ALIGN_CENTER|FL_ALIGN_INSIDE));
  122. o->when(FL_WHEN_RELEASE);
  123. o->end();
  124. } // Fl_Window* o
  125. { Fl_Window* o = new Fl_Window(65, 175, 40, 55, "subwindows:");
  126. o->box(FL_THIN_DOWN_BOX);
  127. o->color((Fl_Color)167);
  128. o->selection_color(FL_BACKGROUND_COLOR);
  129. o->labeltype(FL_NORMAL_LABEL);
  130. o->labelfont(0);
  131. o->labelsize(14);
  132. o->labelcolor(FL_FOREGROUND_COLOR);
  133. o->align(Fl_Align(FL_ALIGN_TOP));
  134. o->when(FL_WHEN_RELEASE);
  135. o->end();
  136. } // Fl_Window* o
  137. { Fl_Window* o = new Fl_Window(110, 175, 40, 55);
  138. o->box(FL_THIN_DOWN_BOX);
  139. o->color((Fl_Color)239);
  140. o->selection_color(FL_BACKGROUND_COLOR);
  141. o->labeltype(FL_NORMAL_LABEL);
  142. o->labelfont(0);
  143. o->labelsize(14);
  144. o->labelcolor(FL_FOREGROUND_COLOR);
  145. o->align(Fl_Align(FL_ALIGN_CENTER|FL_ALIGN_INSIDE));
  146. o->when(FL_WHEN_RELEASE);
  147. o->end();
  148. } // Fl_Window* o
  149. o->end();
  150. } // Fl_Group* o
  151. o->end();
  152. Fl_Group::current()->resizable(o);
  153. } // Fl_Tabs* o
  154. { Fl_Box* o = new Fl_Box(410, 0, 130, 35, "class Fl_Wizard");
  155. o->labeltype(FL_ENGRAVED_LABEL);
  156. o->labelfont(1);
  157. } // Fl_Box* o
  158. { wWizard = new Fl_Wizard(325, 60, 300, 180);
  159. { Fl_Group* o = new Fl_Group(325, 60, 300, 180, "Label1");
  160. o->tooltip("this Tab tests correct keyboard navigation between text input fields");
  161. o->selection_color((Fl_Color)1);
  162. { Fl_Input* o = new Fl_Input(375, 80, 240, 40, "input:");
  163. o->tooltip("This is the first input field");
  164. } // Fl_Input* o
  165. { Fl_Input* o = new Fl_Input(375, 120, 240, 30, "input2:");
  166. o->tooltip("");
  167. } // Fl_Input* o
  168. { new Fl_Input(375, 150, 240, 80, "input3:");
  169. } // Fl_Input* o
  170. o->end();
  171. Fl_Group::current()->resizable(o);
  172. } // Fl_Group* o
  173. { Fl_Group* o = new Fl_Group(325, 60, 300, 180, "tab2");
  174. o->tooltip("tab2 tests among other things the cooperation of modal windows and tabs");
  175. o->selection_color((Fl_Color)2);
  176. o->hide();
  177. { Fl_Button* o = new Fl_Button(335, 90, 100, 30, "button1");
  178. o->callback((Fl_Callback*)cb_button11);
  179. } // Fl_Button* o
  180. { new Fl_Input(455, 130, 100, 30, "input in box2");
  181. } // Fl_Input* o
  182. { new Fl_Button(345, 170, 260, 30, "This is stuff inside the Fl_Group \"tab2\"");
  183. } // Fl_Button* o
  184. { Fl_Button* o = new Fl_Button(345, 200, 260, 30, "Test event blocking by modal window");
  185. o->callback((Fl_Callback*)cb_Test1);
  186. } // Fl_Button* o
  187. o->end();
  188. } // Fl_Group* o
  189. { Fl_Group* o = new Fl_Group(325, 60, 300, 180, "tab3");
  190. o->tooltip("tab3 checks for correct keyboard navigation");
  191. o->selection_color((Fl_Color)3);
  192. o->hide();
  193. { new Fl_Button(335, 90, 60, 80, "button2");
  194. } // Fl_Button* o
  195. { new Fl_Button(395, 90, 60, 80, "button");
  196. } // Fl_Button* o
  197. { new Fl_Button(455, 90, 60, 80, "button");
  198. } // Fl_Button* o
  199. o->end();
  200. } // Fl_Group* o
  201. { Fl_Group* o = new Fl_Group(325, 60, 300, 180, "tab4");
  202. o->tooltip("this tab show the issue of indicating a selcted tab if the tab layouts are ve\
  203. ry similar");
  204. o->selection_color((Fl_Color)5);
  205. o->labelfont(2);
  206. o->hide();
  207. { new Fl_Button(335, 80, 60, 110, "button2");
  208. } // Fl_Button* o
  209. { new Fl_Button(395, 80, 60, 110, "button");
  210. } // Fl_Button* o
  211. { new Fl_Button(455, 80, 60, 110, "button");
  212. } // Fl_Button* o
  213. o->end();
  214. } // Fl_Group* o
  215. { Fl_Group* o = new Fl_Group(325, 60, 300, 180, " tab5 ");
  216. o->tooltip("tab5 verifies if visibility requests are handled correctly");
  217. o->labeltype(FL_ENGRAVED_LABEL);
  218. o->hide();
  219. { Fl_Button* o = new Fl_Button(335, 75, 60, 80, "button2");
  220. o->tooltip("button2 has a different tooltp than tab5");
  221. } // Fl_Button* o
  222. { new Fl_Button(405, 75, 60, 80, "button");
  223. } // Fl_Button* o
  224. { Fl_Window* o = new Fl_Window(335, 175, 40, 55);
  225. o->box(FL_THIN_DOWN_BOX);
  226. o->color((Fl_Color)173);
  227. o->selection_color(FL_BACKGROUND_COLOR);
  228. o->labeltype(FL_NORMAL_LABEL);
  229. o->labelfont(0);
  230. o->labelsize(14);
  231. o->labelcolor(FL_FOREGROUND_COLOR);
  232. o->align(Fl_Align(FL_ALIGN_CENTER|FL_ALIGN_INSIDE));
  233. o->when(FL_WHEN_RELEASE);
  234. o->end();
  235. } // Fl_Window* o
  236. { Fl_Window* o = new Fl_Window(380, 175, 40, 55, "subwindows:");
  237. o->box(FL_THIN_DOWN_BOX);
  238. o->color((Fl_Color)167);
  239. o->selection_color(FL_BACKGROUND_COLOR);
  240. o->labeltype(FL_NORMAL_LABEL);
  241. o->labelfont(0);
  242. o->labelsize(14);
  243. o->labelcolor(FL_FOREGROUND_COLOR);
  244. o->align(Fl_Align(FL_ALIGN_TOP));
  245. o->when(FL_WHEN_RELEASE);
  246. o->end();
  247. } // Fl_Window* o
  248. { Fl_Window* o = new Fl_Window(425, 175, 40, 55);
  249. o->box(FL_THIN_DOWN_BOX);
  250. o->color((Fl_Color)239);
  251. o->selection_color(FL_BACKGROUND_COLOR);
  252. o->labeltype(FL_NORMAL_LABEL);
  253. o->labelfont(0);
  254. o->labelsize(14);
  255. o->labelcolor(FL_FOREGROUND_COLOR);
  256. o->align(Fl_Align(FL_ALIGN_CENTER|FL_ALIGN_INSIDE));
  257. o->when(FL_WHEN_RELEASE);
  258. o->end();
  259. } // Fl_Window* o
  260. o->end();
  261. } // Fl_Group* o
  262. wWizard->end();
  263. } // Fl_Wizard* wWizard
  264. { Fl_Group* o = new Fl_Group(410, 245, 130, 25);
  265. { Fl_Button* o = new Fl_Button(410, 245, 30, 25, "@|<");
  266. o->tooltip("go to first page [Home]");
  267. o->shortcut(0xff50);
  268. o->callback((Fl_Callback*)cb_);
  269. } // Fl_Button* o
  270. { Fl_Button* o = new Fl_Button(440, 245, 30, 25, "@<");
  271. o->tooltip("go to previous page [left arrow]");
  272. o->shortcut(0xff51);
  273. o->callback((Fl_Callback*)cb_1);
  274. } // Fl_Button* o
  275. { Fl_Button* o = new Fl_Button(480, 245, 30, 25, "@>");
  276. o->tooltip("go to next page in wizard [right arrow]");
  277. o->shortcut(0xff53);
  278. o->callback((Fl_Callback*)cb_2);
  279. } // Fl_Button* o
  280. { Fl_Button* o = new Fl_Button(510, 245, 30, 25, "@>|");
  281. o->tooltip("go to last page [End]");
  282. o->shortcut(0xff57);
  283. o->callback((Fl_Callback*)cb_3);
  284. } // Fl_Button* o
  285. o->end();
  286. } // Fl_Group* o
  287. { new Fl_Input(60, 255, 130, 25, "inputA:");
  288. } // Fl_Input* o
  289. { new Fl_Input(60, 285, 250, 25, "inputB:");
  290. } // Fl_Input* o
  291. { Fl_Button* o = new Fl_Button(475, 295, 70, 30, "cancel");
  292. o->callback((Fl_Callback*)cb_cancel);
  293. } // Fl_Button* o
  294. { Fl_Return_Button* o = new Fl_Return_Button(555, 295, 70, 30, "OK");
  295. o->callback((Fl_Callback*)cb_OK);
  296. } // Fl_Return_Button* o
  297. foo_window->end();
  298. } // Fl_Double_Window* foo_window
  299. foo_window->show(argc, argv);
  300. return Fl::run();
  301. }