From 0cd57058de08f9cb2f988cb85b3eb4e8b7e1e9d1 Mon Sep 17 00:00:00 2001 From: Greg Ercolano Date: Wed, 15 Dec 2010 23:21:32 +0000 Subject: [PATCH] Added toggle button to 'navigation' test program to control new arrow focus behavior. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8043 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- test/navigation.cxx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/test/navigation.cxx b/test/navigation.cxx index ded919ec2..da7678424 100644 --- a/test/navigation.cxx +++ b/test/navigation.cxx @@ -33,14 +33,23 @@ #include #include #include +#include #define WIDTH 600 #define HEIGHT 300 #define GRID 25 +void ToggleArrowFocus_CB(Fl_Widget *w, void*) { + Fl_Light_Button *b = (Fl_Light_Button*)w; + Fl::option(Fl::OPTION_ARROW_FOCUS, b->value() ? true : false); +} int main(int argc, char **argv) { if (argc > 1) srand(atoi(argv[1])); - Fl_Window window(WIDTH,HEIGHT,argv[0]); + Fl_Window window(WIDTH,HEIGHT+40,argv[0]); + // Include a toggle button to control arrow focus + Fl_Light_Button arrowfocus_butt(10,HEIGHT+10,130,20," Arrow Focus"); + arrowfocus_butt.callback(ToggleArrowFocus_CB); + arrowfocus_butt.value(Fl::option(Fl::OPTION_ARROW_FOCUS) ? 1 : 0); // use default window.end(); // don't auto-add children for (int i = 0; i<10000; i++) { // make up a random size of widget: