diff options
| author | Fabien Costantini <fabien@onepost.net> | 2008-12-05 14:59:10 +0000 |
|---|---|---|
| committer | Fabien Costantini <fabien@onepost.net> | 2008-12-05 14:59:10 +0000 |
| commit | 655f7c41a26b4fd32d1081308951886643253bb8 (patch) | |
| tree | 723569d59b3150e2271ca18437a1f2f9265af867 | |
| parent | abfba160407394e25026af8546504ebd22c5b688 (diff) | |
Added functionalities to the radio (Button) test program so that we can use it as a more complete test case:
+ Added shortcuts
+ Added Tooltips to help user understand what differs in each example
+ Added a button callback and a text output to visualize it in the demo
+ Added a Normal button with a changed state as we did not test that before
This is going to be immediately useful for STR#2026 review and fix.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6544 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
| -rw-r--r-- | test/radio.fl | 84 |
1 files changed, 54 insertions, 30 deletions
diff --git a/test/radio.fl b/test/radio.fl index 680636857..8ce48dfb5 100644 --- a/test/radio.fl +++ b/test/radio.fl @@ -1,74 +1,98 @@ # data file for the Fltk User Interface Designer (fluid) -version 1.0100 +version 1.0300 header_name {.h} -code_name {.cxx} -gridx 10 -gridy 5 -snap 3 +code_name {.cxx} +Function {button_cb(Fl_Button *b, void *)} { + comment {Buttons test callback} open private return_type void +} { + code {char msg[256]; +sprintf(msg, "Label: '%s'\\nValue: %d", b->label(),b->value()); +cb_info->value(msg); +cb_info->redraw();} {} +} + Function {} {open } { Fl_Window {} {open - xywh {447 255 369 214} visible + xywh {463 67 369 214} type Double visible } { Fl_Button {} { - label Fl_Button - xywh {20 10 160 30} + label {Fl_Button &A1} + tooltip {Normal button (callback called only when released)} xywh {20 10 160 30} labelsize 13 + code0 {o->callback((Fl_Callback*) button_cb);} } Fl_Return_Button {} { - label Fl_Return_Button - xywh {20 50 160 30} + label {Fl_Return_Button &B} + tooltip {Button with Return key as default shortcut} xywh {20 78 160 30} labelsize 13 + code0 {o->callback((Fl_Callback*) button_cb);} } Fl_Light_Button {} { - label Fl_Light_Button - xywh {20 90 160 30} + label {Fl_Light_Button &C} + tooltip {Button with toggle state and a visual indicator of the current state} xywh {20 113 160 30} labelsize 13 + code0 {o->callback((Fl_Callback*) button_cb);} } Fl_Check_Button {} { - label Fl_Check_Button - xywh {20 130 160 30} down_box DOWN_BOX + label {Fl_Check_Button &D} + tooltip {Check button with toggle state} xywh {20 148 160 30} down_box DOWN_BOX labelsize 13 + code0 {o->callback((Fl_Callback*) button_cb);} } Fl_Round_Button {} { - label Fl_Round_Button selected - xywh {20 170 160 30} down_box ROUND_DOWN_BOX + label {Fl_Round_Button &E} + tooltip {Round Button with toggle state} xywh {20 178 160 30} down_box ROUND_DOWN_BOX labelsize 13 + code0 {o->callback((Fl_Callback*) button_cb);} } - Fl_Group {} { + Fl_Group {} {open xywh {190 10 70 120} box THIN_UP_FRAME } { Fl_Round_Button {} { - label radio - xywh {190 10 70 30} type Radio down_box ROUND_DOWN_BOX + label {radio &1} + tooltip {Radio button, only one button is set at a time, in the corresponding group.} xywh {190 10 70 30} type Radio down_box ROUND_DOWN_BOX + code0 {o->callback((Fl_Callback*) button_cb);} } Fl_Round_Button {} { - label radio - xywh {190 40 70 30} type Radio down_box ROUND_DOWN_BOX + label {radio &2} + tooltip {Radio button, only one button is set at a time, in the corresponding group.} xywh {190 40 70 30} type Radio down_box ROUND_DOWN_BOX + code0 {o->callback((Fl_Callback*) button_cb);} } Fl_Round_Button {} { - label radio - xywh {190 70 70 30} type Radio down_box ROUND_DOWN_BOX + label {radio &3} + tooltip {Radio button, only one button is set at a time, in the corresponding group.} xywh {190 70 70 30} type Radio down_box ROUND_DOWN_BOX + code0 {o->callback((Fl_Callback*) button_cb);} } Fl_Round_Button {} { - label radio - xywh {190 100 70 30} type Radio down_box ROUND_DOWN_BOX + label {radio &4} + tooltip {Radio button, only one button is set at a time, in the corresponding group.} xywh {190 100 70 30} type Radio down_box ROUND_DOWN_BOX + code0 {o->callback((Fl_Callback*) button_cb);} } } Fl_Group {} {open - xywh {270 10 90 115} box THIN_UP_BOX + xywh {270 10 90 120} box THIN_UP_BOX } { Fl_Button {} { label radio - xywh {280 20 20 20} type Radio selection_color 1 align 8 + tooltip {Custom look button, only one button is set at a time, in the corresponding group.} xywh {280 20 20 20} type Radio selection_color 1 align 8 } Fl_Button {} { label radio - xywh {280 45 20 20} type Radio selection_color 1 align 8 + tooltip {Custom look button, only one button is set at a time, in the corresponding group.} xywh {280 45 20 20} type Radio selection_color 1 align 8 } Fl_Button {} { label radio - xywh {280 70 20 20} type Radio selection_color 1 align 8 + tooltip {Custom look button, only one button is set at a time, in the corresponding group.} xywh {280 70 20 20} type Radio selection_color 1 align 8 } Fl_Button {} { label radio - xywh {280 95 20 20} type Radio selection_color 1 align 8 + tooltip {Custom look button, only one button is set at a time, in the corresponding group.} xywh {280 95 20 20} type Radio selection_color 1 align 8 } } + Fl_Output cb_info { + label {callback:} selected + xywh {190 148 170 62} type Multiline align 133 textsize 12 + } + Fl_Button {} { + label {Fl_Button &A2} + tooltip {Normal button with callback called when changed (push and released)} xywh {20 44 160 30} labelsize 13 when 1 + code0 {o->callback((Fl_Callback*) button_cb);} + } } } |
