Fix STR #2558: use more consistently FL_NORMAL_SIZE to define the default font size

of interface elements.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8405 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Manolo Gouy 2011-02-08 20:59:46 +00:00
parent 95db2790d6
commit 5dab14dafa
5 changed files with 14 additions and 11 deletions

View File

@ -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 @@ public:
/** 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. */

View File

@ -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 @@ Fl_File_Chooser::update_preview()
// 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 |

View File

@ -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_Color Fl_Tooltip::color_ = fl_color_cube(FL_NUM_RED - 1,
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

View File

@ -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 Fl_Input *input;
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 @@ void resizeform() {
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,6 +211,9 @@ static int innards(const char* fmt, va_list ap,
}
message->labelfont(fl_message_font_);
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);}

View File

@ -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