Author: greg.ercolano
Date: 2010-12-15 15:21:32 -0800 (Wed, 15 Dec 2010)
New Revision: 8043
Log:
Added toggle button to 'navigation' test program to control 
new arrow focus behavior.



Modified:
   branches/branch-1.3/test/navigation.cxx

Modified: branches/branch-1.3/test/navigation.cxx
===================================================================
--- branches/branch-1.3/test/navigation.cxx     2010-12-15 20:14:58 UTC (rev 
8042)
+++ branches/branch-1.3/test/navigation.cxx     2010-12-15 23:21:32 UTC (rev 
8043)
@@ -33,14 +33,23 @@
 #include <FL/Fl.H>
 #include <FL/Fl_Window.H>
 #include <FL/Fl_Input.H>
+#include <FL/Fl_Light_Button.H>
 
 #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:

_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit

Reply via email to