diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2015-01-29 16:56:12 +0000 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2015-01-29 16:56:12 +0000 |
| commit | a26f08bb618d3af3e7509c4db8e7233ea515da08 (patch) | |
| tree | e80486ad481acd49718130ac43ea43f2bd7b666d | |
| parent | 01296095a672565ed8d1f6a6c5e999fa6d6b1ba7 (diff) | |
Use Fl::is_scheme() where appropriate.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10542 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
| -rw-r--r-- | src/Fl_Choice.cxx | 4 | ||||
| -rw-r--r-- | src/Fl_Light_Button.cxx | 10 | ||||
| -rw-r--r-- | src/Fl_Menu.cxx | 18 | ||||
| -rw-r--r-- | src/Fl_Scrollbar.cxx | 6 | ||||
| -rw-r--r-- | src/Fl_Slider.cxx | 6 | ||||
| -rw-r--r-- | src/Fl_get_system_colors.cxx | 4 | ||||
| -rw-r--r-- | src/fl_boxtype.cxx | 2 |
7 files changed, 25 insertions, 25 deletions
diff --git a/src/Fl_Choice.cxx b/src/Fl_Choice.cxx index e78bad126..41bbce372 100644 --- a/src/Fl_Choice.cxx +++ b/src/Fl_Choice.cxx @@ -3,7 +3,7 @@ // // Choice widget for the Fast Light Tool Kit (FLTK). // -// Copyright 1998-2010 by Bill Spitzak and others. +// Copyright 1998-2015 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 @@ -40,7 +40,7 @@ void Fl_Choice::draw() { draw_box(FL_UP_BOX, color()); fl_color(active_r() ? labelcolor() : fl_inactive(labelcolor())); - if (!strcmp(Fl::scheme(), "plastic")) { + if (Fl::is_scheme("plastic")) { // Show larger up/down arrows... fl_polygon(x1, y1 + 3, x1 + w1, y1 + w1 + 3, x1 + 2 * w1, y1 + 3); fl_polygon(x1, y1 + 1, x1 + w1, y1 - w1 + 1, x1 + 2 * w1, y1 + 1); diff --git a/src/Fl_Light_Button.cxx b/src/Fl_Light_Button.cxx index b2327d96a..3044f802a 100644 --- a/src/Fl_Light_Button.cxx +++ b/src/Fl_Light_Button.cxx @@ -3,7 +3,7 @@ // // Lighted button widget for the Fast Light Tool Kit (FLTK). // -// Copyright 1998-2010 by Bill Spitzak and others. +// Copyright 1998-2015 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 @@ -51,7 +51,7 @@ void Fl_Light_Button::draw() { // Check box... draw_box(down_box(), x()+dx, y()+dy, W, W, FL_BACKGROUND2_COLOR); if (value()) { - if (Fl::scheme() && !strcmp(Fl::scheme(), "gtk+")) { + if (Fl::is_scheme("gtk+")) { fl_color(FL_SELECTION_COLOR); } else { fl_color(col); @@ -77,7 +77,7 @@ void Fl_Light_Button::draw() { int tdx = dx + (W - tW) / 2; int tdy = dy + (W - tW) / 2; - if (Fl::scheme() && !strcmp(Fl::scheme(), "gtk+")) { + if (Fl::is_scheme("gtk+")) { fl_color(FL_SELECTION_COLOR); tW --; fl_pie(x() + tdx - 1, y() + tdy - 1, tW + 3, tW + 3, 0.0, 360.0); @@ -110,7 +110,7 @@ void Fl_Light_Button::draw() { break; } - if (Fl::scheme() && !strcmp(Fl::scheme(), "gtk+")) { + if (Fl::is_scheme("gtk+")) { fl_color(fl_color_average(FL_WHITE, FL_SELECTION_COLOR, 0.5)); fl_arc(x() + tdx, y() + tdy, tW + 1, tW + 1, 60.0, 180.0); } @@ -126,7 +126,7 @@ void Fl_Light_Button::draw() { int ww = W/2+1; int xx = dx; if (w()<ww+2*xx) xx = (w()-ww)/2; - if (Fl::scheme() && !strcmp(Fl::scheme(), "plastic")) { + if (Fl::is_scheme("plastic")) { col = active_r() ? selection_color() : fl_inactive(selection_color()); fl_color(value() ? col : fl_color_average(col, FL_BLACK, 0.5f)); fl_pie(x()+xx, y()+dy+1, ww, hh, 0, 360); diff --git a/src/Fl_Menu.cxx b/src/Fl_Menu.cxx index fd0017c38..7493087f2 100644 --- a/src/Fl_Menu.cxx +++ b/src/Fl_Menu.cxx @@ -3,7 +3,7 @@ // // Menu code for the Fast Light Tool Kit (FLTK). // -// Copyright 1998-2010 by Bill Spitzak and others. +// Copyright 1998-2015 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 @@ -189,13 +189,11 @@ void Fl_Menu_Item::draw(int x, int y, int w, int h, const Fl_Menu_* m, int tW = (W - Fl::box_dw(FL_ROUND_DOWN_BOX)) / 2 + 1; if ((W - tW) & 1) tW++; // Make sure difference is even to center int td = (W - tW) / 2; - if (Fl::scheme()) { - if (!strcmp(Fl::scheme(), "gtk+")) { - fl_color(FL_SELECTION_COLOR); - tW --; - fl_pie(x + td + 1, y + d + td - 1, tW + 3, tW + 3, 0.0, 360.0); - fl_color(fl_color_average(FL_WHITE, FL_SELECTION_COLOR, 0.2f)); - } else fl_color(labelcolor_); + if (Fl::is_scheme("gtk+")) { + fl_color(FL_SELECTION_COLOR); + tW --; + fl_pie(x + td + 1, y + d + td - 1, tW + 3, tW + 3, 0.0, 360.0); + fl_color(fl_color_average(FL_WHITE, FL_SELECTION_COLOR, 0.2f)); } else fl_color(labelcolor_); switch (tW) { @@ -224,7 +222,7 @@ void Fl_Menu_Item::draw(int x, int y, int w, int h, const Fl_Menu_* m, break; } - if (Fl::scheme() && !strcmp(Fl::scheme(), "gtk+")) { + if (Fl::is_scheme("gtk+")) { fl_color(fl_color_average(FL_WHITE, FL_SELECTION_COLOR, 0.5)); fl_arc(x + td + 2, y + d + td, tW + 1, tW + 1, 60.0, 180.0); } @@ -232,7 +230,7 @@ void Fl_Menu_Item::draw(int x, int y, int w, int h, const Fl_Menu_* m, } else { fl_draw_box(FL_DOWN_BOX, x+2, y+d, W, W, FL_BACKGROUND2_COLOR); if (value()) { - if (Fl::scheme() && !strcmp(Fl::scheme(), "gtk+")) { + if (Fl::is_scheme("gtk+")) { fl_color(FL_SELECTION_COLOR); } else { fl_color(labelcolor_); diff --git a/src/Fl_Scrollbar.cxx b/src/Fl_Scrollbar.cxx index 5e50cdb06..a659e8e14 100644 --- a/src/Fl_Scrollbar.cxx +++ b/src/Fl_Scrollbar.cxx @@ -3,7 +3,7 @@ // // Scroll bar widget for the Fast Light Tool Kit (FLTK). // -// Copyright 1998-2010 by Bill Spitzak and others. +// Copyright 1998-2015 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 @@ -218,7 +218,7 @@ void Fl_Scrollbar::draw() { int w1 = (H-4)/3; if (w1 < 1) w1 = 1; int x1 = X+(H-w1-1)/2; int yy1 = Y+(H-2*w1-1)/2; - if (Fl::scheme_ && !strcmp(Fl::scheme_, "gtk+")) { + if (Fl::is_scheme("gtk+")) { fl_polygon(x1, yy1+w1, x1+w1, yy1+2*w1, x1+w1-1, yy1+w1, x1+w1, yy1); x1 += (W-H); fl_polygon(x1, yy1, x1+1, yy1+w1, x1, yy1+2*w1, x1+w1, yy1+w1); @@ -243,7 +243,7 @@ void Fl_Scrollbar::draw() { int w1 = (W-4)/3; if (w1 < 1) w1 = 1; int x1 = X+(W-2*w1-1)/2; int yy1 = Y+(W-w1-1)/2; - if (Fl::scheme_ && !strcmp(Fl::scheme_, "gtk+")) { + if (Fl::is_scheme("gtk+")) { fl_polygon(x1, yy1+w1, x1+w1, yy1+w1-1, x1+2*w1, yy1+w1, x1+w1, yy1); yy1 += H-W; fl_polygon(x1, yy1, x1+w1, yy1+1, x1+w1, yy1+w1); diff --git a/src/Fl_Slider.cxx b/src/Fl_Slider.cxx index 648e3ce4f..705dc9692 100644 --- a/src/Fl_Slider.cxx +++ b/src/Fl_Slider.cxx @@ -3,7 +3,7 @@ // // Slider widget for the Fast Light Tool Kit (FLTK). // -// Copyright 1998-2011 by Bill Spitzak and others. +// Copyright 1998-2015 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 @@ -163,8 +163,8 @@ void Fl_Slider::draw(int X, int Y, int W, int H) { } else { if (wsl>0 && hsl>0) draw_box(box1, xsl, ysl, wsl, hsl, selection_color()); - if (type()!=FL_HOR_FILL_SLIDER && type() != FL_VERT_FILL_SLIDER && - Fl::scheme_ && !strcmp(Fl::scheme_, "gtk+")) { + if (type() != FL_HOR_FILL_SLIDER && type() != FL_VERT_FILL_SLIDER && + Fl::is_scheme("gtk+")) { if (W>H && wsl>(hsl+8)) { // Draw horizontal grippers int yy, hh; diff --git a/src/Fl_get_system_colors.cxx b/src/Fl_get_system_colors.cxx index e9b7b4b5d..49c7ff899 100644 --- a/src/Fl_get_system_colors.cxx +++ b/src/Fl_get_system_colors.cxx @@ -3,7 +3,7 @@ // // System color support for the Fast Light Tool Kit (FLTK). // -// Copyright 1998-2010 by Bill Spitzak and others. +// Copyright 1998-2015 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 @@ -280,6 +280,8 @@ static Fl_Pixmap tile(tile_xpm); If the resulting scheme name is not defined, the default scheme will be used and Fl::scheme() will return NULL. + + \see Fl::is_scheme() */ int Fl::scheme(const char *s) { if (!s) { diff --git a/src/fl_boxtype.cxx b/src/fl_boxtype.cxx index 71fbe3e72..7a8a134f2 100644 --- a/src/fl_boxtype.cxx +++ b/src/fl_boxtype.cxx @@ -3,7 +3,7 @@ // // Box drawing code for the Fast Light Tool Kit (FLTK). // -// Copyright 1998-2010 by Bill Spitzak and others. +// Copyright 1998-2015 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 |
