Author: manolo
Date: 2011-02-08 12:59:46 -0800 (Tue, 08 Feb 2011)
New Revision: 8405
Log:
Fix STR #2558: use more consistently FL_NORMAL_SIZE to define the default font 
size
of interface elements.

Modified:
   branches/branch-1.3/FL/Fl_Tooltip.H
   branches/branch-1.3/src/Fl_File_Chooser2.cxx
   branches/branch-1.3/src/Fl_Tooltip.cxx
   branches/branch-1.3/src/fl_ask.cxx
   branches/branch-1.3/src/fl_font_mac.cxx

Modified: branches/branch-1.3/FL/Fl_Tooltip.H
===================================================================
--- branches/branch-1.3/FL/Fl_Tooltip.H 2011-02-08 20:37:53 UTC (rev 8404)
+++ branches/branch-1.3/FL/Fl_Tooltip.H 2011-02-08 20:59:46 UTC (rev 8405)
@@ -3,7 +3,7 @@
 //
 // Tooltip header file for the Fast Light Tool Kit (FLTK).
 //
-// Copyright 1998-2010 by Bill Spitzak and others.
+// Copyright 1998-2011 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
@@ -72,7 +72,7 @@
   /**    Sets the typeface for the tooltip text.  */
   static void font(Fl_Font i) { font_ = i; }
   /**    Gets the size of the tooltip text.  */
-  static Fl_Fontsize size() { return size_; }
+  static Fl_Fontsize size() { return (size_ == -1 ? FL_NORMAL_SIZE : size_); }
   /**    Sets the size of the tooltip text.  */
   static void size(Fl_Fontsize s) { size_ = s; }
   /** Gets the background color for tooltips. The default background color is 
a pale yellow.  */

Modified: branches/branch-1.3/src/Fl_File_Chooser2.cxx
===================================================================
--- branches/branch-1.3/src/Fl_File_Chooser2.cxx        2011-02-08 20:37:53 UTC 
(rev 8404)
+++ branches/branch-1.3/src/Fl_File_Chooser2.cxx        2011-02-08 20:59:46 UTC 
(rev 8405)
@@ -3,7 +3,7 @@
 //
 // More Fl_File_Chooser routines.
 //
-// Copyright 1999-2010 by Michael Sweet.
+// Copyright 1999-2011 by Michael Sweet.
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Library General Public
@@ -1410,7 +1410,7 @@
       // Show the first 1k of text...
       int size = previewBox->h() / 20;
       if (size < 6) size = 6;
-      else if (size > 14) size = 14;
+      else if (size > FL_NORMAL_SIZE) size = FL_NORMAL_SIZE;
 
       previewBox->label(preview_text_);
       previewBox->align((Fl_Align)(FL_ALIGN_CLIP | FL_ALIGN_INSIDE |

Modified: branches/branch-1.3/src/Fl_Tooltip.cxx
===================================================================
--- branches/branch-1.3/src/Fl_Tooltip.cxx      2011-02-08 20:37:53 UTC (rev 
8404)
+++ branches/branch-1.3/src/Fl_Tooltip.cxx      2011-02-08 20:59:46 UTC (rev 
8405)
@@ -3,7 +3,7 @@
 //
 // Tooltip source file for the Fast Light Tool Kit (FLTK).
 //
-// Copyright 1998-2010 by Bill Spitzak and others.
+// Copyright 1998-2011 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
@@ -39,7 +39,7 @@
                                                   FL_NUM_BLUE - 2);
 Fl_Color       Fl_Tooltip::textcolor_ = FL_BLACK;
 Fl_Font         Fl_Tooltip::font_ = FL_HELVETICA;
-Fl_Fontsize     Fl_Tooltip::size_ = FL_NORMAL_SIZE;
+Fl_Fontsize     Fl_Tooltip::size_ = -1;
 
 #define MAX_WIDTH 400
 

Modified: branches/branch-1.3/src/fl_ask.cxx
===================================================================
--- branches/branch-1.3/src/fl_ask.cxx  2011-02-08 20:37:53 UTC (rev 8404)
+++ branches/branch-1.3/src/fl_ask.cxx  2011-02-08 20:59:46 UTC (rev 8405)
@@ -3,7 +3,7 @@
 //
 // Standard dialog functions for the Fast Light Tool Kit (FLTK).
 //
-// Copyright 1998-2010 by Bill Spitzak and others.
+// Copyright 1998-2011 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
@@ -55,7 +55,7 @@
 static int ret_val;
 static const char *iconlabel = "?";
 Fl_Font fl_message_font_ = FL_HELVETICA;
-Fl_Fontsize fl_message_size_ = 14;
+Fl_Fontsize fl_message_size_ = -1;
 #ifdef __APPLE__
 extern "C" void NSBeep(void);
 #endif
@@ -127,7 +127,7 @@
   int  x, w, h, max_w, max_h;
        const int icon_size = 50;
 
-  fl_font(fl_message_font_, fl_message_size_);
+  fl_font(message->labelfont(), message->labelsize());
   message_w = message_h = 0;
   fl_measure(message->label(), message_w, message_h);
 
@@ -211,7 +211,10 @@
   }
 
   message->labelfont(fl_message_font_);
-  message->labelsize(fl_message_size_);
+  if (fl_message_size_ == -1)
+    message->labelsize(FL_NORMAL_SIZE);
+  else
+    message->labelsize(fl_message_size_);
   if (b0) {button[0]->show(); button[0]->label(b0); 
button[1]->position(210,70);}
   else {button[0]->hide(); button[1]->position(310,70);}
   if (b1) {button[1]->show(); button[1]->label(b1);}

Modified: branches/branch-1.3/src/fl_font_mac.cxx
===================================================================
--- branches/branch-1.3/src/fl_font_mac.cxx     2011-02-08 20:37:53 UTC (rev 
8404)
+++ branches/branch-1.3/src/fl_font_mac.cxx     2011-02-08 20:59:46 UTC (rev 
8405)
@@ -31,7 +31,7 @@
 extern unsigned fl_utf8toUtf16(const char* src, unsigned srclen, unsigned 
short* dst, unsigned dstlen);
 
 // if no font has been selected yet by the user, get one.
-#define check_default_font() {if (!fl_fontsize) fl_font(0, 12);}
+#define check_default_font() {if (!fl_fontsize) fl_font(FL_HELVETICA, 
FL_NORMAL_SIZE);}
 
 static CGAffineTransform font_mx = { 1, 0, 0, -1, 0, 0 };
 #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5

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

Reply via email to