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
This commit is contained in:
Fabien Costantini
2008-12-05 14:59:10 +00:00
parent abfba16040
commit 655f7c41a2
+54 -30
View File
@@ -1,74 +1,98 @@
# data file for the Fltk User Interface Designer (fluid) # data file for the Fltk User Interface Designer (fluid)
version 1.0100 version 1.0300
header_name {.h} header_name {.h}
code_name {.cxx} code_name {.cxx}
gridx 10 Function {button_cb(Fl_Button *b, void *)} {
gridy 5 comment {Buttons test callback} open private return_type void
snap 3 } {
code {char msg[256];
sprintf(msg, "Label: '%s'\\nValue: %d", b->label(),b->value());
cb_info->value(msg);
cb_info->redraw();} {}
}
Function {} {open Function {} {open
} { } {
Fl_Window {} {open Fl_Window {} {open
xywh {447 255 369 214} visible xywh {463 67 369 214} type Double visible
} { } {
Fl_Button {} { Fl_Button {} {
label Fl_Button label {Fl_Button &A1}
xywh {20 10 160 30} 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 {} { Fl_Return_Button {} {
label Fl_Return_Button label {Fl_Return_Button &B}
xywh {20 50 160 30} 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 {} { Fl_Light_Button {} {
label Fl_Light_Button label {Fl_Light_Button &C}
xywh {20 90 160 30} 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 {} { Fl_Check_Button {} {
label Fl_Check_Button label {Fl_Check_Button &D}
xywh {20 130 160 30} down_box DOWN_BOX 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 {} { Fl_Round_Button {} {
label Fl_Round_Button selected label {Fl_Round_Button &E}
xywh {20 170 160 30} down_box ROUND_DOWN_BOX 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 xywh {190 10 70 120} box THIN_UP_FRAME
} { } {
Fl_Round_Button {} { Fl_Round_Button {} {
label radio label {radio &1}
xywh {190 10 70 30} type Radio down_box ROUND_DOWN_BOX 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 {} { Fl_Round_Button {} {
label radio label {radio &2}
xywh {190 40 70 30} type Radio down_box ROUND_DOWN_BOX 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 {} { Fl_Round_Button {} {
label radio label {radio &3}
xywh {190 70 70 30} type Radio down_box ROUND_DOWN_BOX 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 {} { Fl_Round_Button {} {
label radio label {radio &4}
xywh {190 100 70 30} type Radio down_box ROUND_DOWN_BOX 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 Fl_Group {} {open
xywh {270 10 90 115} box THIN_UP_BOX xywh {270 10 90 120} box THIN_UP_BOX
} { } {
Fl_Button {} { Fl_Button {} {
label radio 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 {} { Fl_Button {} {
label radio 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 {} { Fl_Button {} {
label radio 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 {} { Fl_Button {} {
label radio 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);}
}
} }
} }