summaryrefslogtreecommitdiff
path: root/test/tree.fl
diff options
context:
space:
mode:
authorGreg Ercolano <erco@seriss.com>2010-11-25 18:52:37 +0000
committerGreg Ercolano <erco@seriss.com>2010-11-25 18:52:37 +0000
commitd3e0d030f0646f1b67f2850520b95d76958fab64 (patch)
tree0aa555146e6e03c08621111e52db7b3b14760599 /test/tree.fl
parent7eb27fa4bd313e4c9f83df5aa8b774f54a7aaca2 (diff)
Changes to solve STR#2426;
1) Hitting ENTER to select an item should make sure the item is displayed if off-screen (Mayank Malik, pointing out similar behavior in Fl_Browser_) 2) show_item() without a positional argument will invoke show_item_top() if the item is off-screen. 3) Added new method displayed() (to match Fl_Browser_'s) git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7893 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'test/tree.fl')
-rw-r--r--test/tree.fl30
1 files changed, 20 insertions, 10 deletions
diff --git a/test/tree.fl b/test/tree.fl
index bb15058a5..a184e6c91 100644
--- a/test/tree.fl
+++ b/test/tree.fl
@@ -142,7 +142,7 @@ Function {} {open
} {
Fl_Window window {
label tree open
- xywh {1099 53 580 695} type Double visible
+ xywh {1153 115 580 695} type Double visible
} {
Fl_Group tree {
user_data 1234
@@ -538,38 +538,49 @@ switch ( whenmode_chooser->value() ) {
Fl_Box showitem_box {
label {show_item()
}
- xywh {468 423 60 77} box GTK_DOWN_BOX color 47 labelsize 11 align 1
+ xywh {480 425 70 82} box GTK_DOWN_BOX color 47 labelsize 11 align 1
+ }
+ Fl_Button {} {
+ label Show
+ callback {Fl_Tree_Item *item = tree->next_selected_item();
+tree->show_item(item);} selected
+ tooltip {Tests show_item() with no position specified.
+Makes the selected item visible IF it is off-screen.
+No change made if it is not off-screen.} xywh {495 434 40 17} labelsize 11
}
Fl_Button {} {
label Top
callback {Fl_Tree_Item *item = tree->next_selected_item();
tree->show_item_top(item);}
- tooltip {Scrolls selected item to the top of the display
+ tooltip {Test show_item_top().
+Scrolls selected item to the top of the display
(only works if scrollbar showing)
To use:
1) open '500 items'
2) select item 0010
-3) Hit Top/Mid/Bot} xywh {478 433 40 16} labelsize 11
+3) Hit Top/Mid/Bot} xywh {495 451 40 16} labelsize 11
}
Fl_Button {} {
label Mid
callback {Fl_Tree_Item *item = tree->next_selected_item();
tree->show_item_middle(item);}
- tooltip {Scrolls the selected item to the middle of the display
+ tooltip {Tests show_item_middle().
+Scrolls the selected item to the middle of the display
To use:
1) open '500 items'
2) select 'item 0010'
- 3) Hit Top/Mid/Bot} xywh {478 453 40 16} labelsize 11
+ 3) Hit Top/Mid/Bot} xywh {495 467 40 16} labelsize 11
}
Fl_Button {} {
label Bot
callback {Fl_Tree_Item *item = tree->next_selected_item();
tree->show_item_bottom(item);}
- tooltip {Scrolls the selected item to the bottom of the display
+ tooltip {Tests show_item_bottom().
+Scrolls the selected item to the bottom of the display
To use:
1) open '500 items'
2) select 'item 0010'
- 3) Hit Top/Mid/Bot} xywh {478 473 40 16} labelsize 11
+ 3) Hit Top/Mid/Bot} xywh {495 483 40 16} labelsize 11
}
Fl_Box docallback_box {
label {Selection State Changes}
@@ -848,6 +859,5 @@ window->size_range(window->w(), window->h(), 0, 0);
if ( tree->when() == FL_WHEN_CHANGED ) whenmode_chooser->value(0);
else if ( tree->when() == FL_WHEN_RELEASE ) whenmode_chooser->value(1);
-else if ( tree->when() == FL_WHEN_NEVER ) whenmode_chooser->value(2);} {selected
- }
+else if ( tree->when() == FL_WHEN_NEVER ) whenmode_chooser->value(2);} {}
}