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.

125 lines
4.9KB

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