Author: ianmacarthur
Date: 2012-03-27 02:04:02 -0700 (Tue, 27 Mar 2012)
New Revision: 9306
Log:
More test1 fltk-1 compat tweaks

This commit only adjusts demo.menu to re-enable the colbrowser demo 
and to bring the fullscreen demo up to match the version shipped in 
fltk-1.3 as at r9301.

No material code changes to the library are made.



Modified:
   branches/branch-3.0/test1/demo.menu
   branches/branch-3.0/test1/fullscreen.cxx

Modified: branches/branch-3.0/test1/demo.menu
===================================================================
--- branches/branch-3.0/test1/demo.menu 2012-03-27 08:47:29 UTC (rev 9305)
+++ branches/branch-3.0/test1/demo.menu 2012-03-27 09:04:02 UTC (rev 9306)
@@ -58,6 +58,7 @@
 @main:Fluid\n(UI design tool):../fluid1/fluid valuators.fl
 
 @main:Cool\nDemos...:@e
+       @e:X Color\nBrowser:colbrowser
        @e:Mandelbrot:mandelbrot
        @e:Fractals:fractals
        @e:Puzzle:glpuzzle

Modified: branches/branch-3.0/test1/fullscreen.cxx
===================================================================
--- branches/branch-3.0/test1/fullscreen.cxx    2012-03-27 08:47:29 UTC (rev 
9305)
+++ branches/branch-3.0/test1/fullscreen.cxx    2012-03-27 09:04:02 UTC (rev 
9306)
@@ -1,6 +1,22 @@
 //
 // "$Id$"
 //
+
+//
+// Copyright 1998-2012 by Bill Spitzak and others.
+//
+// This library is free software. Distribution and use rights are outlined in
+// the file "COPYING" which should have been included with this file.  If this
+// file is missing or damaged, see the license at:
+//
+//     http://www.fltk.org/COPYING.php
+//
+// Please report all bugs and problems on the following page:
+//
+//     http://www.fltk.org/str.php
+//
+
+//
 // Fullscreen test program for the Fast Light Tool Kit (FLTK).
 //
 // This demo shows how to do many of the window manipulations that
@@ -33,35 +49,16 @@
 // will cause the window to raise, deiconize, and possibly move.  You
 // can avoid this by making the Fl_Gl_Window a child of a normal
 // window.
-//
-// Copyright 1998-2010 by Bill Spitzak and others.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Library General Public
-// License as published by the Free Software Foundation; either
-// version 2 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Library General Public License for more details.
-//
-// You should have received a copy of the GNU Library General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-// USA.
-//
-// Please report all bugs and problems on the following page:
-//
-//     http://www.fltk.org/str.php
-//
 
 #include <config.h>
 #include <FL/Fl.H>
 #include <FL/Fl_Single_Window.H>
 #include <FL/Fl_Hor_Slider.H>
+#include <FL/Fl_Input.H>
+#include <FL/Fl_Menu_Button.H>
 #include <FL/Fl_Toggle_Light_Button.H>
 #include <FL/math.h>
+#include <FL/fl_ask.H>
 #include <stdio.h>
 
 #if HAVE_GL
@@ -124,6 +121,27 @@
 
 #endif
 
+class fullscreen_window : public Fl_Single_Window {
+  public:
+  fullscreen_window(int W, int H, const char *t=0);
+  int handle (int e);
+  Fl_Toggle_Light_Button *b3;
+
+};
+
+fullscreen_window::fullscreen_window(int W, int H, const char *t) : 
Fl_Single_Window(W, H, t) {
+
+}
+
+int fullscreen_window::handle(int e) {
+  if (e == FL_FULLSCREEN) {
+    printf("Received FL_FULLSCREEN event\n");
+    b3->value(fullscreen_active());
+  }
+  if (Fl_Single_Window::handle(e)) return 1;
+  return 0;
+}
+
 void sides_cb(Fl_Widget *o, void *p) {
   shape_window *sw = (shape_window *)p;
   sw->sides = int(((Fl_Slider *)o)->value());
@@ -161,13 +179,14 @@
     py = w->y();
     pw = w->w();
     ph = w->h();
-#ifndef WIN32//necessary because fullscreen removes border
-       border_button->value(0);
-       border_button->do_callback();
+    w->fullscreen();
+    w->override();
+#ifndef WIN32 // update our border state in case border was turned off
+    border_button->value(w->border());
 #endif
-    w->fullscreen();
   } else {
-    w->fullscreen_off(px,py,pw,ph);
+    //w->fullscreen_off(px,py,pw,ph);
+    w->fullscreen_off();
   }
 }
 
@@ -177,7 +196,7 @@
   exit(0);
 }
 
-#define NUMB 5
+#define NUMB 6
 
 int twowindow = 0;
 int initfull = 0;
@@ -193,9 +212,10 @@
   if (Fl::args(argc,argv,i,arg) < argc)
     Fl::fatal("Options are:\n -2 = 2 windows\n -f = startup 
fullscreen\n%s",Fl::help_text());
 
-  Fl_Single_Window window(300,300+30*NUMB); window.end();
+  fullscreen_window window(300,300+30*NUMB); window.end();
 
   shape_window sw(10,10,window.w()-20,window.h()-30*NUMB-20);
+
 #if HAVE_GL
   sw.mode(FL_RGB);
 #endif
@@ -228,21 +248,24 @@
   b1.callback(double_cb,&sw);
   y+=30;
 
+  Fl_Input i1(50,y,window.w()-60,30, "Input");
+  y+=30;
+
   Fl_Toggle_Light_Button b2(50,y,window.w()-60,30,"Border");
   b2.callback(border_cb,w);
   b2.set();
   border_button = &b2;
   y+=30;
 
-  Fl_Toggle_Light_Button b3(50,y,window.w()-60,30,"FullScreen");
-  b3.callback(fullscreen_cb,w);
+  window.b3 = new Fl_Toggle_Light_Button(50,y,window.w()-60,30,"FullScreen");
+  window.b3->callback(fullscreen_cb,w);
   y+=30;
 
   Fl_Button eb(50,y,window.w()-60,30,"Exit");
   eb.callback(exit_cb);
   y+=30;
 
-  if (initfull) {b3.set(); b3.do_callback();}
+  if (initfull) {window.b3->set(); window.b3->do_callback();}
 
   window.end();
   window.show(argc,argv);

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

Reply via email to