DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2856
Version: 1.3-feature


Attached file "fullscreen-screeninfo1.patch"...


Link: http://www.fltk.org/str.php?L2856
Version: 1.3-feature
Index: test/fullscreen.cxx
===================================================================
--- test/fullscreen.cxx (revision 9598)
+++ test/fullscreen.cxx (arbetskopia)
@@ -59,6 +59,7 @@
 #include <FL/Fl_Toggle_Light_Button.H>
 #include <FL/math.h>
 #include <FL/fl_ask.H>
+#include <FL/Fl_Browser.H>
 #include <stdio.h>
 
 #if HAVE_GL
@@ -190,13 +191,36 @@
   }
 }
 
+void update_screeninfo(Fl_Widget *b, void *p) {
+    Fl_Browser *browser = (Fl_Browser *)p;
+    int x, y, w, h;
+    char line[128];
+    browser->clear();
+
+    sprintf(line, "Main screen work area: %dx%d@%d,%d", Fl::w(), Fl::h(), 
Fl::x(), Fl::y());
+    browser->add(line);
+    Fl::screen_work_area(x, y, w, h);
+    sprintf(line, "Mouse screen work area: %dx%d@%d,%d", w, h, x, y);
+    browser->add(line);
+    for (int n = 0; n < Fl::screen_count(); n++) {
+       int x, y, w, h;
+       Fl::screen_xywh(x, y, w, h, n);
+       sprintf(line, "Screen %d: %dx%d@%d,%d", n, w, h, x, y);
+       browser->add(line);
+       Fl::screen_work_area(x, y, w, h, n);
+       sprintf(line, "Work area %d: %dx%d@%d,%d", n, w, h, x, y);
+       browser->add(line);
+    }
+}
+
+
 #include <stdlib.h>
 
 void exit_cb(Fl_Widget *, void *) {
   exit(0);
 }
 
-#define NUMB 6
+#define NUMB 7
 
 int twowindow = 0;
 int initfull = 0;
@@ -212,9 +236,9 @@
   if (Fl::args(argc,argv,i,arg) < argc)
     Fl::fatal("Options are:\n -2 = 2 windows\n -f = startup 
fullscreen\n%s",Fl::help);
 
-  fullscreen_window window(300,300+30*NUMB); window.end();
+  fullscreen_window window(400,400+30*NUMB); window.end();
 
-  shape_window sw(10,10,window.w()-20,window.h()-30*NUMB-20);
+  shape_window sw(10,10,window.w()-20,window.h()-30*NUMB-120);
 
 #if HAVE_GL
   sw.mode(FL_RGB);
@@ -235,7 +259,7 @@
 
   window.begin();
 
-  int y = window.h()-30*NUMB-5;
+  int y = window.h()-30*NUMB-105;
   Fl_Hor_Slider slider(50,y,window.w()-60,30,"Sides:");
   slider.align(FL_ALIGN_LEFT);
   slider.callback(sides_cb,&sw);
@@ -265,6 +289,14 @@
   eb.callback(exit_cb);
   y+=30;
 
+  Fl_Browser *browser = new Fl_Browser(50,y,window.w()-60,100);
+  update_screeninfo(0, browser);
+  y+=100;
+
+  Fl_Button update(50,y,window.w()-60,30,"Update");
+  update.callback(update_screeninfo, browser);
+  y+=30;
+
   if (initfull) {window.b3->set(); window.b3->do_callback();}
 
   window.end();
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to