[fltk.development] [RFE] STR #2672: Updated Gleam patch against FLTK1.3.x-r8816

2011-06-18 Thread Edmanuel Torres
DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

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


Updated gleam patch to work with the main branch FLTK 1.3.x. I think this
patch should be included in FLTK 1.3. This is only the patch to include
Gleam in FLTK. Gleam itself can be found at
http://ergoeclectic.com/projects/fltk-gleam.html.


Link: http://www.fltk.org/str.php?L2672
Version: 1.3-featureIndex: src/makedepend
===
--- src/makedepend  (revision 8818)
+++ src/makedepend  (working copy)
@@ -814,6 +814,9 @@
 fl_font.o: ../FL/Fl_Preferences.H ../FL/Fl_Image.H ../FL/Fl_Bitmap.H
 fl_font.o: ../FL/Fl_Image.H ../FL/Fl_Pixmap.H ../FL/Fl_RGB_Image.H Fl_Font.H
 fl_font.o: fl_font_xft.cxx
+fl_gleam.o: fl_gleam.cxx ../FL/Fl.H ../FL/Enumerations.H \
+  ../FL/Fl_Export.H ../FL/fl_draw.H flstring.h ../FL/Fl_Export.H \
+  ../config.h
 fl_gtk.o: ../FL/Fl.H ../FL/fl_utf8.h ../FL/Fl_Export.H ../FL/fl_types.h
 fl_gtk.o: ../FL/Xutf8.h ../FL/Enumerations.H ../FL/fl_draw.H ../FL/x.H
 fl_gtk.o: ../FL/Fl_Window.H ../FL/Enumerations.H ../FL/Fl_Window.H
Index: src/fl_boxtype.cxx
===
--- src/fl_boxtype.cxx  (revision 8818)
+++ src/fl_boxtype.cxx  (working copy)
@@ -302,6 +302,14 @@
   {fl_down_box,1,1,2,2,0}, // _FL_GTK_THIN_ROUND_DOWN_BOX,
   {fl_up_box,  2,2,4,4,0}, // _FL_GTK_ROUND_UP_BOX,
   {fl_down_box,2,2,4,4,0}, // _FL_GTK_ROUND_DOWN_BOX,
+  {fl_up_box,  2,2,3,3,0}, // _FL_GLEAM_UP_BOX,
+  {fl_down_box,2,2,3,3,0}, // _FL_GLEAM_DOWN_BOX,
+  {fl_up_frame,2,2,3,3,0}, // _FL_GLEAM_UP_FRAME,
+  {fl_down_frame,  2,2,3,3,0}, // _FL_GLEAM_DOWN_FRAME,
+  {fl_up_box,  1,1,1,1,0}, // _FL_GLEAM_THIN_UP_BOX,
+  {fl_down_box,1,1,1,1,0}, // _FL_GLEAM_THIN_DOWN_BOX,
+  {fl_up_box,  2,2,3,3,0}, // _FL_GLEAM_ROUND_UP_BOX,
+  {fl_down_box,2,2,3,3,0}, // _FL_GLEAM_ROUND_DOWN_BOX,
   {fl_up_box,  3,3,6,6,0}, // FL_FREE_BOX+0
   {fl_down_box,3,3,6,6,0}, // FL_FREE_BOX+1
   {fl_up_box,  3,3,6,6,0}, // FL_FREE_BOX+2
Index: src/Fl_get_system_colors.cxx
===
--- src/Fl_get_system_colors.cxx(revision 8818)
+++ src/Fl_get_system_colors.cxx(working copy)
@@ -235,9 +235,8 @@
   if (Fl::first_window()) key1 = Fl::first_window()->xclass();
   if (!key1) key1 = "fltk";
   if (!fl_bg2_set) getsyscolor("Text","background",fl_bg2, "#ff", 
Fl::background2);
-  if (!fl_fg_set) getsyscolor(key1,  "foreground", fl_fg,  "#00", 
Fl::foreground);
-  if (!fl_bg_set) getsyscolor(key1,  "background", fl_bg,  "#c0c0c0", 
Fl::background);
-  getsyscolor("Text", "selectBackground", 0, "#80", set_selection_color);
+  if (!fl_bg_set) getsyscolor(key1,  "background",fl_bg,  "#e4e4e4", 
Fl::background);
+  getsyscolor("Text", "selectBackground", 0, "#3465a4", set_selection_color);
 }
 
 #endif
@@ -386,6 +385,28 @@
 
 // Use slightly thinner scrollbars...
 Fl::scrollbar_size(15);
+  } else if (scheme_ && !strcasecmp(scheme_, "gleam")) {
+// Use a Gleam look-and-feel, similar to Clearlooks Glossy, made by Colin 
Jones
+if (scheme_bg_) {
+  delete scheme_bg_;
+  scheme_bg_ = (Fl_Image *)0;
+}
+
+set_boxtype(FL_UP_FRAME,FL_GLEAM_UP_FRAME);
+set_boxtype(FL_DOWN_FRAME,  FL_GLEAM_DOWN_FRAME);
+set_boxtype(FL_THIN_UP_FRAME,   FL_GLEAM_UP_FRAME);
+set_boxtype(FL_THIN_DOWN_FRAME, FL_GLEAM_DOWN_FRAME);
+
+set_boxtype(FL_UP_BOX,  FL_GLEAM_UP_BOX);
+set_boxtype(FL_DOWN_BOX,FL_GLEAM_DOWN_BOX);
+set_boxtype(FL_THIN_UP_BOX, FL_GLEAM_THIN_UP_BOX);
+set_boxtype(FL_THIN_DOWN_BOX,   FL_GLEAM_THIN_DOWN_BOX);
+set_boxtype(_FL_ROUND_UP_BOX,   FL_GLEAM_ROUND_UP_BOX);
+set_boxtype(_FL_ROUND_DOWN_BOX, FL_GLEAM_ROUND_DOWN_BOX);
+
+// Use slightly thinner scrollbars...
+Fl::scrollbar_size(10);
+
   } else {
 // Use the standard FLTK look-n-feel...
 if (scheme_bg_) {
Index: src/Makefile
===
--- src/Makefile(revision 8818)
+++ src/Makefile(working copy)
@@ -143,6 +143,7 @@
fl_engraved_label.cxx \
fl_file_dir.cxx \
fl_font.cxx \
+   fl_gleam.cxx \
fl_gtk.cxx \
fl_labeltype.cxx \
fl_line_style.cxx \
Index: FL/Enumerations.H
===
--- FL/Enumerations.H   (revision 8818)
+++ FL/Enumerations.H   (working copy)
@@ -511,6 +511,14 @@
   _FL_GTK_THIN_DOWN_FRAME, ///< gtk+ version of FL_THIN_DOWN_FRAME
   _FL_GTK_ROUND_UP_BOX,///< gtk+ version of FL_ROUND_UP_BOX
   _FL_GTK_ROUND_DOWN_BOX,  ///< gtk+ version of FL_ROUND_DOWN_BO

Re: [fltk.development] [RFE] STR #2672: Updated Gleam patch against FLTK1.3.x-r8816

2011-12-10 Thread Edmanuel Torres
DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2672
Version: 1.4-feature


Attached file "fl_gleam-4.3.2-fltk-1.3-rev9209.patch"...


Link: http://www.fltk.org/str.php?L2672
Version: 1.4-featureIndex: src/fl_gleam.cxx
===
--- src/fl_gleam.cxx(revision 0)
+++ src/fl_gleam.cxx(revision 0)
@@ -0,0 +1,148 @@
+//
+// "Gleam" drawing routines for the Fast Light Tool Kit (FLTK).
+//
+// These box types provide a sort of Clearlooks Glossy scheme
+// for FLTK.
+//
+// Copyright 2001-2005 by Colin Jones.
+//
+// Modified 2011 by Edmanuel Torres
+// This is a new version of the fl_gleam. The gradients are on the top
+// an the bottom, the text area looks like in the classic FLTK way.
+//
+// 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
+//
+
+// Box drawing code for an obscure box type.
+// These box types are in seperate files so they are not linked
+// in if not used.
+
+#include 
+#include 
+#include 
+
+using namespace std;
+
+static void gleam_color(Fl_Color c) {
+  if (Fl::draw_box_active()) fl_color(c);
+  else fl_color(fl_inactive(c));
+}
+
+static void shade_rect(int x, int y, int w, int h, Fl_Color fg1, Fl_Color fg2, 
float th) {
+  // Draws the shiny
+  int h_top  = h/2;
+  int h_bottom = h/6;
+  int h_flat = h-(h_top+h_bottom);
+  int j = 0;
+  float step_size_top = (0.999/(float)(h_top));
+  float step_size_bottom = (0.999/(float)(h_bottom));
+  // This loop generates the gradient at the top of the widget
+  for (float k = 1; k >= 0; k -= step_size_top){
+gleam_color(fl_color_average(fl_color_average(fg1, fg2, th), fg1, k));
+fl_line(x, y+j, x+w, y+j);
+j++;
+  }
+  gleam_color(fg1);
+  fl_rectf(x, y+h_top, w+1, h_flat);
+  // This loop generates the gradient at the bottom of the widget
+  for (float k = 1; k >= 0; k -= step_size_bottom){
+gleam_color(fl_color_average(fg1,fl_color_average(fg1, fg2, th), k));
+fl_line(x, y+j+h_flat-1, x+w, y+j+h_flat-1);
+j++;
+  }
+}
+
+static void shade_rect_up(int x, int y, int w, int h, Fl_Color bc, float th) {
+  shade_rect(x,y,w,h,bc,FL_WHITE,th);
+}
+
+static void shade_rect_down(int x, int y, int w, int h, Fl_Color bc, float th) 
{
+  shade_rect(x,y,w,h,bc,FL_BLACK,th);
+}
+
+static void frame_rect(int x, int y, int w, int h, Fl_Color fg1, Fl_Color fg2) 
{
+  gleam_color(fg1);
+  fl_line(x, y+h-1, x, y+1); //Go from bottom to top left side
+  fl_line(x+w, y+h-1, x+w, y+1); //Go from bottom to top right side
+  fl_line(x+1, y, x+w-1, y); //Go across the top
+  fl_line(x+1, y+h, x+w-1, y+h); //Go across the bottom
+  gleam_color(fg2);
+  fl_line(x+1, y+h-2, x+1, y+2); //Go from bottom to top left side
+  fl_line(x+w-1, y+h-2, x+w-1, y+2); //Go from bottom to top right side
+}
+
+static void frame_rect_up(int x, int y, int w, int h, Fl_Color bc, float th1, 
float th2) {
+  frame_rect(x,y,w,h,fl_color_average(fl_darker(bc), FL_BLACK, 
th1),fl_color_average(bc, FL_WHITE, th2));
+}
+
+static void frame_rect_down(int x, int y, int w, int h, Fl_Color bc, float 
th1, float th2) {
+  frame_rect(x,y,w,h,fl_color_average(bc, FL_WHITE, 
th2),fl_color_average(FL_BLACK, bc, th1));
+}
+
+static void up_frame(int x, int y, int w, int h, Fl_Color c) {
+  frame_rect_up(x, y, w-1, h-1, c, 0.15f, 0.15f);
+  // frame decoration
+  gleam_color(fl_darker(c));
+  fl_line(x+2, y+1, x+w-3, y+1); //Go across the top
+  fl_line(x+2, y+h-2, x+w-3, y+h-2); //Go across the bottom
+}
+
+static void up_box(int x, int y, int w, int h, Fl_Color c) {
+  shade_rect_up(x+2, y+1, w-5, h-3, c, 0.15f);
+  frame_rect_up(x, y, w-1, h-1, c, 0.15f, 0.15f);
+}
+
+static void thin_up_box(int x, int y, int w, int h, Fl_Color c) {
+  shade_rect_up(x+2, y+1, w-5, h-3, c, 0.25f);
+  frame_rect_up(x, y, w-1, h-1, c, 0.25f, 0.25f);
+}
+
+static void down_frame(int x, int y, int w, int h, Fl_Color c) {
+  frame_rect_down(x, y, w-1, h-1, c, 0.75f, 0.35f);
+  // frame decoration
+  gleam_color(fl_darker(c));
+  fl_line(x+2, y+1, x+w-3, y+1); //Go across the top
+  fl_line(x+2, y+h-2, x+w-3, y+h-2); //Go across the bottom
+}
+
+static void down_box(int x,

Re: [fltk.development] [RFE] STR #2672: Updated Gleam patch against FLTK1.3.x-r8816

2011-12-10 Thread Edmanuel Torres
DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2672
Version: 1.4-feature


Attached file "fl_gleam-4.3.3-fltk-1.3-rev9209.patch"...


Link: http://www.fltk.org/str.php?L2672
Version: 1.4-featureIndex: src/fl_gleam.cxx
===
--- src/fl_gleam.cxx(revision 0)
+++ src/fl_gleam.cxx(revision 0)
@@ -0,0 +1,148 @@
+//
+// "Gleam" drawing routines for the Fast Light Tool Kit (FLTK).
+//
+// These box types provide a sort of Clearlooks Glossy scheme
+// for FLTK.
+//
+// Copyright 2001-2005 by Colin Jones.
+//
+// Modified 2011 by Edmanuel Torres
+// This is a new version of the fl_gleam. The gradients are on the top
+// an the bottom, the text area looks like in the classic FLTK way.
+//
+// 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
+//
+
+// Box drawing code for an obscure box type.
+// These box types are in seperate files so they are not linked
+// in if not used.
+
+#include 
+#include 
+#include 
+
+using namespace std;
+
+static void gleam_color(Fl_Color c) {
+  if (Fl::draw_box_active()) fl_color(c);
+  else fl_color(fl_inactive(c));
+}
+
+static void shade_rect(int x, int y, int w, int h, Fl_Color fg1, Fl_Color fg2, 
float th) {
+  // Draws the shiny
+  int h_top  = h/2;
+  int h_bottom = h/6;
+  int h_flat = h-(h_top+h_bottom);
+  int j = 0;
+  float step_size_top = (0.999/(float)(h_top));
+  float step_size_bottom = (0.999/(float)(h_bottom));
+  // This loop generates the gradient at the top of the widget
+  for (float k = 1; k >= 0; k -= step_size_top){
+gleam_color(fl_color_average(fl_color_average(fg1, fg2, th), fg1, k));
+fl_line(x, y+j, x+w, y+j);
+j++;
+  }
+  gleam_color(fg1);
+  fl_rectf(x, y+h_top, w+1, h_flat);
+  // This loop generates the gradient at the bottom of the widget
+  for (float k = 1; k >= 0; k -= step_size_bottom){
+gleam_color(fl_color_average(fg1,fl_color_average(fg1, fg2, th), k));
+fl_line(x, y+j+h_flat-1, x+w, y+j+h_flat-1);
+j++;
+  }
+}
+
+static void shade_rect_up(int x, int y, int w, int h, Fl_Color bc, float th) {
+  shade_rect(x,y,w,h,bc,FL_WHITE,th);
+}
+
+static void shade_rect_down(int x, int y, int w, int h, Fl_Color bc, float th) 
{
+  shade_rect(x,y,w,h,bc,FL_BLACK,th);
+}
+
+static void frame_rect(int x, int y, int w, int h, Fl_Color fg1, Fl_Color fg2) 
{
+  gleam_color(fg1);
+  fl_line(x, y+h-1, x, y+1); //Go from bottom to top left side
+  fl_line(x+w, y+h-1, x+w, y+1); //Go from bottom to top right side
+  fl_line(x+1, y, x+w-1, y); //Go across the top
+  fl_line(x+1, y+h, x+w-1, y+h); //Go across the bottom
+  gleam_color(fg2);
+  fl_line(x+1, y+h-2, x+1, y+2); //Go from bottom to top left side
+  fl_line(x+w-1, y+h-2, x+w-1, y+2); //Go from bottom to top right side
+}
+
+static void frame_rect_up(int x, int y, int w, int h, Fl_Color bc, float th1, 
float th2) {
+  frame_rect(x,y,w,h,fl_color_average(fl_darker(bc), FL_BLACK, 
th1),fl_color_average(bc, FL_WHITE, th2));
+}
+
+static void frame_rect_down(int x, int y, int w, int h, Fl_Color bc, float 
th1, float th2) {
+  frame_rect(x,y,w,h,fl_color_average(bc, FL_WHITE, 
th2),fl_color_average(FL_BLACK, bc, th1));
+}
+
+static void up_frame(int x, int y, int w, int h, Fl_Color c) {
+  frame_rect_up(x, y, w-1, h-1, c, 0.15f, 0.15f);
+  // frame decoration
+  gleam_color(fl_darker(c));
+  fl_line(x+2, y+1, x+w-3, y+1); //Go across the top
+  fl_line(x+2, y+h-2, x+w-3, y+h-2); //Go across the bottom
+}
+
+static void up_box(int x, int y, int w, int h, Fl_Color c) {
+  shade_rect_up(x+2, y+1, w-5, h-3, c, 0.15f);
+  frame_rect_up(x, y, w-1, h-1, c, 0.15f, 0.15f);
+}
+
+static void thin_up_box(int x, int y, int w, int h, Fl_Color c) {
+  shade_rect_up(x+2, y+1, w-5, h-3, c, 0.25f);
+  frame_rect_up(x, y, w-1, h-1, c, 0.25f, 0.25f);
+}
+
+static void down_frame(int x, int y, int w, int h, Fl_Color c) {
+  frame_rect_down(x, y, w-1, h-1, c, 0.75f, 0.35f);
+  // frame decoration
+  gleam_color(fl_darker(c));
+  fl_line(x+2, y+1, x+w-3, y+1); //Go across the top
+  fl_line(x+2, y+h-2, x+w-3, y+h-2); //Go across the bottom
+}
+
+static void down_box(int x,

Re: [fltk.development] [RFE] STR #2672: Updated Gleam patch against FLTK1.3.x-r8816

2011-12-10 Thread Edmanuel Torres

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

[STR New]

Link: http://www.fltk.org/str.php?L2672
Version: 1.4-feature


Patch updated. The modification to Fl_get_system_colors.cxx were removed.
The gleam test program is created by fluid at build time.


Link: http://www.fltk.org/str.php?L2672
Version: 1.4-feature

___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] [RFE] STR #2672: Updated Gleam patch against FLTK1.3.x-r8816

2011-12-10 Thread Edmanuel Torres

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

[STR New]

Link: http://www.fltk.org/str.php?L2672
Version: 1.4-feature


The only necessary file is fl_gleam-4.3.3-fltk-1.3-rev9209.patch to use the
Gleam theme.


Link: http://www.fltk.org/str.php?L2672
Version: 1.4-feature

___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] [RFE] STR #2672: Updated Gleam patch against FLTK1.3.x-r8816

2013-03-07 Thread Edmanuel Torres
DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2672
Version: 1.4-feature


Attached file "fltk-1.3.2-gleam-4.3.patch"...


Link: http://www.fltk.org/str.php?L2672
Version: 1.4-featureIndex: src/fl_gleam.cxx
===
--- src/fl_gleam.cxx(revision 0)
+++ src/fl_gleam.cxx(revision 0)
@@ -0,0 +1,140 @@
+//
+// "Gleam" drawing routines for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2010 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
+//
+// These box types provide a sort of Clearlooks Glossy scheme
+// for FLTK.
+//
+// Copyright 2001-2005 by Colin Jones.
+//
+// Modified 2012 by Edmanuel Torres
+// This is a new version of the fl_gleam. The gradients are on the top
+// an the bottom, the text area looks like in the classic FLTK way.
+//
+// Box drawing code for an obscure box type.
+// These box types are in seperate files so they are not linked
+// in if not used.
+
+#include 
+#include 
+#include 
+
+using namespace std;
+
+static void gleam_color(Fl_Color c) {
+  if (Fl::draw_box_active()) fl_color(c);
+  else fl_color(fl_inactive(c));
+}
+
+static void shade_rect(int x, int y, int w, int h, Fl_Color fg1, Fl_Color fg2, 
float th) {
+  // Draws the shiny
+  int h_top  = h/2;
+  int h_bottom = h/6;
+  int h_flat = h-(h_top+h_bottom);
+  int j = 0;
+  float step_size_top = (0.999/(float)(h_top));
+  float step_size_bottom = (0.999/(float)(h_bottom));
+  // This loop generates the gradient at the top of the widget
+  for (float k = 1; k >= 0; k -= step_size_top){
+gleam_color(fl_color_average(fl_color_average(fg1, fg2, th), fg1, k));
+fl_line(x, y+j, x+w, y+j);
+j++;
+  }
+  gleam_color(fg1);
+  fl_rectf(x, y+h_top, w+1, h_flat);
+  // This loop generates the gradient at the bottom of the widget
+  for (float k = 1; k >= 0; k -= step_size_bottom){
+gleam_color(fl_color_average(fg1,fl_color_average(fg1, fg2, th), k));
+fl_line(x, y+j+h_flat-1, x+w, y+j+h_flat-1);
+j++;
+  }
+}
+
+static void shade_rect_up(int x, int y, int w, int h, Fl_Color bc, float th) {
+  shade_rect(x,y,w,h,bc,FL_WHITE,th);
+}
+
+static void shade_rect_down(int x, int y, int w, int h, Fl_Color bc, float th) 
{
+  shade_rect(x,y,w,h,bc,FL_BLACK,th);
+}
+
+static void frame_rect(int x, int y, int w, int h, Fl_Color fg1, Fl_Color fg2) 
{
+  gleam_color(fg1);
+  fl_line(x, y+h-1, x, y+1); //Go from bottom to top left side
+  fl_line(x+w, y+h-1, x+w, y+1); //Go from bottom to top right side
+  fl_line(x+1, y, x+w-1, y); //Go across the top
+  fl_line(x+1, y+h, x+w-1, y+h); //Go across the bottom
+  gleam_color(fg2);
+  fl_line(x+1, y+h-2, x+1, y+2); //Go from bottom to top left side
+  fl_line(x+w-1, y+h-2, x+w-1, y+2); //Go from bottom to top right side
+}
+
+static void frame_rect_up(int x, int y, int w, int h, Fl_Color bc, float th1, 
float th2) {
+  frame_rect(x,y,w,h,fl_color_average(fl_darker(bc), FL_BLACK, 
th1),fl_color_average(bc, FL_WHITE, th2));
+}
+
+static void frame_rect_down(int x, int y, int w, int h, Fl_Color bc, float 
th1, float th2) {
+  frame_rect(x,y,w,h,fl_color_average(bc, FL_WHITE, 
th2),fl_color_average(FL_BLACK, bc, th1));
+}
+
+static void up_frame(int x, int y, int w, int h, Fl_Color c) {
+  frame_rect_up(x, y, w-1, h-1, c, 0.15f, 0.15f);
+  // frame decoration
+  gleam_color(fl_darker(c));
+  fl_line(x+2, y+1, x+w-3, y+1); //Go across the top
+  fl_line(x+2, y+h-2, x+w-3, y+h-2); //Go across the bottom
+}
+
+static void up_box(int x, int y, int w, int h, Fl_Color c) {
+  shade_rect_up(x+2, y+1, w-5, h-3, c, 0.15f);
+  frame_rect_up(x, y, w-1, h-1, c, 0.15f, 0.15f);
+}
+
+static void thin_up_box(int x, int y, int w, int h, Fl_Color c) {
+  shade_rect_up(x+2, y+1, w-5, h-3, c, 0.25f);
+  frame_rect_up(x, y, w-1, h-1, c, 0.25f, 0.25f);
+}
+
+static void down_frame(int x, int y, int w, int h, Fl_Color c) {
+  frame_rect_down(x, y, w-1, h-1, c, 0.75f, 0.35f);
+  // frame decoration
+  gleam_color(fl_darker(c));
+  fl_line(x+2, y+1, x+w-3, y+1); //Go across the top
+  fl_line(x+2, y+h-2, x+w-3, y+h-2); //Go across the bottom
+}
+
+static void down_box(int x, int y, int w, int h, Fl_Color c) {
+  shade_rect_down(x+1, y+1, w-3, h-3, c, 0.25f);
+  frame_rect_down(x, y, w-1, h-1, fl_darker(c), 0.65f, 0.35f);
+}
+
+static void thin_down_box(int x, int y, int w, int h, Fl_Color c) {
+  shade_rect_down(x+1, y+1, w-3, h-3, c, 0.35f);
+  frame_rect_down(x, y, w-1, h-1, fl_darker(c), 0.65f, 0.55f);
+}
+
+extern void fl_internal_boxtype(Fl_Boxtype, Fl_Box_Draw_F*);
+
+Fl_Boxtype fl_define_FL_GLEAM_UP_BOX() {
+  fl_

Re: [fltk.development] [RFE] STR #2672: Updated Gleam patch against FLTK1.3.x-r8816

2013-03-07 Thread Edmanuel Torres

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

[STR New]

Link: http://www.fltk.org/str.php?L2672
Version: 1.4-feature


Here a Gleam 4.3 patch for the fltk-1.3.2. Here the steps to use it;

1) get fltk-1.3.2-source.tar.gz

2) untar it

$ tar -xvzf fltk-1.3.2-source.tar.gz

3) copy the patch file fltk-1.3.2-gleam-4.3.patch to the fltk-1.3.2
directory

4) patch it:

$ patch -p0 < fltk-1.3.2-gleam-4.3.patch

5) then compile it with make and run the example:

$ ./test/gleam

6) enjoy


Link: http://www.fltk.org/str.php?L2672
Version: 1.4-feature

___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] [RFE] STR #2672: Updated Gleam patch against FLTK1.3.x-r8816

2013-03-07 Thread Greg Ercolano

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

[STR New]

Link: http://www.fltk.org/str.php?L2672
Version: 1.4-feature


Hi Edmanuel,

Thanks for the great work -- can I suggest attaching a screenshot
showing what glean does? It would help motivate a merge.


Link: http://www.fltk.org/str.php?L2672
Version: 1.4-feature

___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] [RFE] STR #2672: Updated Gleam patch against FLTK1.3.x-r8816

2013-03-07 Thread Greg Ercolano

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

[STR New]

Link: http://www.fltk.org/str.php?L2672
Version: 1.4-feature


Question about this patch: I noticed this line in the patch
that adds the scheme "gleam" to fluid:

+ Fl::scheme("gleam");

..but support of the Fl::scheme() name 'gleam' is not actually
implemented by the patch, is that correct?
>From what I can tell by a brief look at the patch, it seems to
show it adds the new FL_GLEAM* box types, but I don't think
I see it handling Fl::scheme() yet.. is that correct?

For instance, I tried running: test/unittests -s gleam
..and didn't see a difference.


Link: http://www.fltk.org/str.php?L2672
Version: 1.4-feature

___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] [RFE] STR #2672: Updated Gleam patch against FLTK1.3.x-r8816

2013-03-07 Thread Edmanuel Torres

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

[STR New]

Link: http://www.fltk.org/str.php?L2672
Version: 1.4-feature


Yes, you are right, I will fix that asap!

// + Fl::scheme("gleam");
//..but support of the Fl::scheme() name 'gleam' is not actually
//implemented by the patch, is that correct?
//From what I can tell by a brief look at the patch, it seems to
//show it adds the new FL_GLEAM* box types, but I don't think
//I see it handling Fl::scheme() yet.. is that correct?


Link: http://www.fltk.org/str.php?L2672
Version: 1.4-feature

___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] [RFE] STR #2672: Updated Gleam patch against FLTK1.3.x-r8816

2013-03-07 Thread Edmanuel Torres
DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2672
Version: 1.4-feature


Attached file "fltk-1.3.2-gleam-4.3b.patch"...


Link: http://www.fltk.org/str.php?L2672
Version: 1.4-featureIndex: src/fl_gleam.cxx
===
--- src/fl_gleam.cxx(revision 0)
+++ src/fl_gleam.cxx(revision 0)
@@ -0,0 +1,137 @@
+//
+// "Gleam" drawing routines for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2010 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
+//
+// These box types provide a sort of Clearlooks Glossy scheme
+// for FLTK.
+//
+// Copyright 2001-2005 by Colin Jones.
+//
+// Modified 2012 by Edmanuel Torres
+// This is a new version of the fl_gleam. The gradients are on the top
+// an the bottom, the text area looks like in the classic FLTK way.
+//
+
+#include 
+#include 
+#include 
+
+using namespace std;
+
+static void gleam_color(Fl_Color c) {
+  if (Fl::draw_box_active()) fl_color(c);
+  else fl_color(fl_inactive(c));
+}
+
+static void shade_rect(int x, int y, int w, int h, Fl_Color fg1, Fl_Color fg2, 
float th) {
+  // Draws the shiny
+  int h_top  = h/2;
+  int h_bottom = h/6;
+  int h_flat = h-(h_top+h_bottom);
+  int j = 0;
+  float step_size_top = (0.999/(float)(h_top));
+  float step_size_bottom = (0.999/(float)(h_bottom));
+  // This loop generates the gradient at the top of the widget
+  for (float k = 1; k >= 0; k -= step_size_top){
+gleam_color(fl_color_average(fl_color_average(fg1, fg2, th), fg1, k));
+fl_line(x, y+j, x+w, y+j);
+j++;
+  }
+  gleam_color(fg1);
+  fl_rectf(x, y+h_top, w+1, h_flat);
+  // This loop generates the gradient at the bottom of the widget
+  for (float k = 1; k >= 0; k -= step_size_bottom){
+gleam_color(fl_color_average(fg1,fl_color_average(fg1, fg2, th), k));
+fl_line(x, y+j+h_flat-1, x+w, y+j+h_flat-1);
+j++;
+  }
+}
+
+static void shade_rect_up(int x, int y, int w, int h, Fl_Color bc, float th) {
+  shade_rect(x,y,w,h,bc,FL_WHITE,th);
+}
+
+static void shade_rect_down(int x, int y, int w, int h, Fl_Color bc, float th) 
{
+  shade_rect(x,y,w,h,bc,FL_BLACK,th);
+}
+
+static void frame_rect(int x, int y, int w, int h, Fl_Color fg1, Fl_Color fg2) 
{
+  gleam_color(fg1);
+  fl_line(x, y+h-1, x, y+1); //Go from bottom to top left side
+  fl_line(x+w, y+h-1, x+w, y+1); //Go from bottom to top right side
+  fl_line(x+1, y, x+w-1, y); //Go across the top
+  fl_line(x+1, y+h, x+w-1, y+h); //Go across the bottom
+  gleam_color(fg2);
+  fl_line(x+1, y+h-2, x+1, y+2); //Go from bottom to top left side
+  fl_line(x+w-1, y+h-2, x+w-1, y+2); //Go from bottom to top right side
+}
+
+static void frame_rect_up(int x, int y, int w, int h, Fl_Color bc, float th1, 
float th2) {
+  frame_rect(x,y,w,h,fl_color_average(fl_darker(bc), FL_BLACK, 
th1),fl_color_average(bc, FL_WHITE, th2));
+}
+
+static void frame_rect_down(int x, int y, int w, int h, Fl_Color bc, float 
th1, float th2) {
+  frame_rect(x,y,w,h,fl_color_average(bc, FL_WHITE, 
th2),fl_color_average(FL_BLACK, bc, th1));
+}
+
+static void up_frame(int x, int y, int w, int h, Fl_Color c) {
+  frame_rect_up(x, y, w-1, h-1, c, 0.15f, 0.15f);
+  // frame decoration
+  gleam_color(fl_darker(c));
+  fl_line(x+2, y+1, x+w-3, y+1); //Go across the top
+  fl_line(x+2, y+h-2, x+w-3, y+h-2); //Go across the bottom
+}
+
+static void up_box(int x, int y, int w, int h, Fl_Color c) {
+  shade_rect_up(x+2, y+1, w-5, h-3, c, 0.15f);
+  frame_rect_up(x, y, w-1, h-1, c, 0.15f, 0.15f);
+}
+
+static void thin_up_box(int x, int y, int w, int h, Fl_Color c) {
+  shade_rect_up(x+2, y+1, w-5, h-3, c, 0.25f);
+  frame_rect_up(x, y, w-1, h-1, c, 0.25f, 0.25f);
+}
+
+static void down_frame(int x, int y, int w, int h, Fl_Color c) {
+  frame_rect_down(x, y, w-1, h-1, c, 0.75f, 0.35f);
+  // frame decoration
+  gleam_color(fl_darker(c));
+  fl_line(x+2, y+1, x+w-3, y+1); //Go across the top
+  fl_line(x+2, y+h-2, x+w-3, y+h-2); //Go across the bottom
+}
+
+static void down_box(int x, int y, int w, int h, Fl_Color c) {
+  shade_rect_down(x+1, y+1, w-3, h-3, c, 0.25f);
+  frame_rect_down(x, y, w-1, h-1, fl_darker(c), 0.65f, 0.35f);
+}
+
+static void thin_down_box(int x, int y, int w, int h, Fl_Color c) {
+  shade_rect_down(x+1, y+1, w-3, h-3, c, 0.35f);
+  frame_rect_down(x, y, w-1, h-1, fl_darker(c), 0.65f, 0.55f);
+}
+
+extern void fl_internal_boxtype(Fl_Boxtype, Fl_Box_Draw_F*);
+
+Fl_Boxtype fl_define_FL_GLEAM_UP_BOX() {
+  fl_internal_boxtype(_FL_GLEAM_UP_BOX, up_box);
+  fl_internal_boxtype(_FL_GLEAM_DOWN_BOX, down_box);
+  fl_internal_boxtype(_FL_GLEAM

Re: [fltk.development] [RFE] STR #2672: Updated Gleam patch against FLTK1.3.x-r8816

2013-03-07 Thread Edmanuel Torres

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

[STR New]

Link: http://www.fltk.org/str.php?L2672
Version: 1.4-feature


Thank Greg for your feedback. I just updated the patch, hopefully
Fl::scheme() is working now.


Link: http://www.fltk.org/str.php?L2672
Version: 1.4-feature

___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] [RFE] STR #2672: Updated Gleam patch against FLTK1.3.x-r8816

2013-03-07 Thread L Michaels
DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2672
Version: 1.4-feature


Attached file "patchscheme.diff"...


Link: http://www.fltk.org/str.php?L2672
Version: 1.4-featurediff -Naurp src/fltk-1.3.2/src/fl_gleam-3.0.cxx 
tmp/fltk-1.3.2/src/fl_gleam-3.0.cxx
--- src/fltk-1.3.2/src/fl_gleam-3.0.cxx 1969-12-31 19:00:00 -0500
+++ tmp/fltk-1.3.2/src/fl_gleam-3.0.cxx 
@@ -0,0 +1,181 @@
+//
+// "Gleam" drawing routines for the Fast Light Tool Kit (FLTK).
+//
+// These box types provide a sort of Clearlooks Glossy scheme
+// for FLTK.
+//
+// Copyright 2001-2005 by Colin Jones.
+//
+// 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
+//
+
+// Box drawing code for an obscure box type.
+// These box types are in seperate files so they are not linked
+// in if not used.
+
+#include 
+#include 
+
+static void gleam_color(Fl_Color c) {
+  if (Fl::draw_box_active()) fl_color(c);
+  else fl_color(fl_inactive(c));
+}
+ static void frame_rect(int x, int y, int w, int h, Fl_Color bc) {
+
+// Draw the outline around the perimeter of the box
+gleam_color(bc);
+fl_line(x, y, x + w, y);
+fl_line(x + w, y, x + w, y + h);
+fl_line(x + w, y +h, x, y + h);
+fl_line(x, y +h, x, y);
+  
+}
+
+ static void shade_rect_up(int x, int y, int w, int h, Fl_Color bc) {
+ // Draws the shiny
+  int half = h / 2;
+  //gleam_color(bc);
+  //fl_rectf(x, y, w, h);
+
+  gleam_color(fl_color_average(bc, FL_WHITE, .50f));  
+  fl_rectf(x, y, w, half + 1);
+
+  floatstep_size=0.10;
+  int j = 0;
+  step_size = (1.0 / (float)half);
+   //printf("1 / %i = %f \n", half, (1.0/half));
+
+/**
+* This loop generates the nice gradient at the bottom of the
+* widget
+**/
+   for (float k = 1; k >= 0; k -= step_size)
+   {
+   j++;
+   gleam_color(fl_color_average(bc, FL_WHITE, k));  
+   fl_line(x, y+j+half-1, x + w -1, y+j+half-1);
+   }
+  
+}
+
+static void frame_rect_up(int x, int y, int w, int h, Fl_Color bc) {
+
+// Draw the outline around the perimeter of the box
+gleam_color(bc);
+fl_line(x + 1, y, x + w - 1, y); //Go across.
+fl_line(x, y + (h/2), x, y + 1); //Go to top
+fl_line(x + w, y + (h/2), x + w, y + 1); //Go to top
+
+gleam_color(fl_darker(bc));
+fl_line(x + 1, y +h, x + w - 1, y + h); //Go across again!
+fl_line(x, y + (h/2), x, y + h - 1); //Go to top
+fl_line(x + w, y + (h/2), x + w, y + h  - 1); //Go to top
+  
+}
+
+static void frame_rect_down(int x, int y, int w, int h, Fl_Color bc) {
+
+   // Draw the outline around the perimeter of the box
+   gleam_color(fl_darker(bc));
+   fl_line(x + 1, y, x + w - 1, y); //Go across.
+   fl_line(x, y + (h/2), x, y + 1); //Go to top
+   fl_line(x + w, y + (h/2), x + w, y + 1); //Go to top
+
+   //gleam_color(bc);
+   fl_line(x + 1, y +h, x + w - 1, y + h); //Go across again!
+   fl_line(x, y + (h/2), x, y + h - 1); //Go to top
+   fl_line(x + w, y + (h/2), x + w, y + h  - 1); //Go to top
+  
+}
+
+
+ static void shade_rect_down(int x, int y, int w, int h, Fl_Color bc) {
+  
+  gleam_color(bc);  
+  Fl_Color color = fl_color();
+  fl_rectf(x, y, w, h);
+  gleam_color(fl_color_average(bc, fl_darker(color), 0.65));  
+  fl_line(x, y+1, x + w, y+1);
+  fl_line(x, y+1, x, y+h-2);
+  gleam_color(fl_color_average(bc, fl_darker(color), 0.85));  
+  fl_line(x+1, y+2, x + w, y+2);
+  fl_line(x+1, y+2, x +1, y + h-2);
+
+}
+
+
+ static void up_frame(int x, int y, int w, int h, Fl_Color c) {
+  frame_rect_up(x, y, w - 1, h - 1, fl_darker(c));
+}
+
+
+ static void thin_up_box(int x, int y, int w, int h, Fl_Color c) {
+
+shade_rect_up(x + 1, y, w - 2, h - 1,  c);
+frame_rect(x + 1, y + 1, w - 3, h - 3, fl_color_average(c, FL_WHITE, 
.25f));   
+frame_rect_up(x, y, w - 1, h - 1, fl_darker(c));
+ 
+}
+
+
+
+
+ static void up_box(int x, int y, int w, int h, Fl_Color c) {
+shade_rect_up(x + 1, y, w - 2, h - 1,  c);
+frame_rect_up(x, y, w - 1, h - 1, fl_darker(c));
+//draw the inner rect.
+frame_rect(x + 1, y + 1, w - 3, h - 3, fl_color_average(c, FL_WHITE, 
.25f));
+
+}
+
+
+s

Re: [fltk.development] [RFE] STR #2672: Updated Gleam patch against FLTK1.3.x-r8816

2013-03-07 Thread L Michaels

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

[STR New]

Link: http://www.fltk.org/str.php?L2672
Version: 1.4-feature


patchscheme.diff includes patches for both gleam and grad1 themes and works
against FLTK version 1.3.2.


Link: http://www.fltk.org/str.php?L2672
Version: 1.4-feature

___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] [RFE] STR #2672: Updated Gleam patch against FLTK1.3.x-r8816

2013-03-08 Thread Greg Ercolano

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

[STR New]

Link: http://www.fltk.org/str.php?L2672
Version: 1.4-feature


Note: STR #2675 may be in conflict; it is suggesting a patch
that is a combo of gleam and grad schemes.

Both STRs are currently active; L Michaels just updated that
patch today.

I guess we need to either combine or sync these two STRs.

BTW, would like to suggest we integrate your gleam test program
into the unittests program, and set it up so that can test ALL
of our schemes (so we can check for artifacts across platforms).

This would also avoid us having to create new Visual Studio
project files for the new test program, and avoid adding the new
project to all the fltk.dsw/fltk.sln files.


Link: http://www.fltk.org/str.php?L2672
Version: 1.4-feature

___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] [RFE] STR #2672: Updated Gleam patch against FLTK1.3.x-r8816

2013-03-08 Thread Greg Ercolano

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

[STR New]

Link: http://www.fltk.org/str.php?L2672
Version: 1.4-feature


> BTW, would like to suggest we integrate your gleam test program
> into the unittests program..

Oh, and I'll do that -- don't worry, not asking you to do it for us ;)
Just letting you know we might implement it that way.


Link: http://www.fltk.org/str.php?L2672
Version: 1.4-feature

___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] [RFE] STR #2672: Updated Gleam patch against FLTK1.3.x-r8816

2013-03-08 Thread Greg Ercolano

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

[STR Active]

Link: http://www.fltk.org/str.php?L2672
Version: 1.4-feature





Link: http://www.fltk.org/str.php?L2672
Version: 1.4-feature

___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] [RFE] STR #2672: Updated Gleam patch against FLTK1.3.x-r8816

2013-03-08 Thread Edmanuel Torres

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

[STR Pending]

Link: http://www.fltk.org/str.php?L2672
Version: 1.4-feature


// Oh, and I'll do that -- don't worry, not asking you to do it for us ;)
// Just letting you know we might implement it that way.

Anyway, I am glad to help, but great! :D


Link: http://www.fltk.org/str.php?L2672
Version: 1.4-feature

___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] [RFE] STR #2672: Updated Gleam patch against FLTK1.3.x-r8816

2013-03-08 Thread Greg Ercolano

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

[STR Pending]

Link: http://www.fltk.org/str.php?L2672
Version: 1.4-feature


Checking your latest patch, and will start work on modifying unittests to
integrate your test program into it.

I have a vote up on fltk.development asking the other devs if they'll vote
to apply this patch. If we get a few +1's, it'll become part of FLTK.


Link: http://www.fltk.org/str.php?L2672
Version: 1.4-feature

___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] [RFE] STR #2672: Updated Gleam patch against FLTK1.3.x-r8816

2013-03-08 Thread Edmanuel Torres

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

[STR Pending]

Link: http://www.fltk.org/str.php?L2672
Version: 1.4-feature


// A possible solution, hoping you can implement: perhaps when the
// gradient area's height is larger than some amount, the gradient
// doesn't scale quite as large, so that a line of text at the top
// can still be readable? Or perhaps scale the brightness of the
// starting edge color a bit when the area height exceeds e.g.
// 100 pixels or some such.

I will work on a fix using either of your approaches.


Link: http://www.fltk.org/str.php?L2672
Version: 1.4-feature

___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] [RFE] STR #2672: Updated Gleam patch against FLTK1.3.x-r8816

2013-03-08 Thread Greg Ercolano
DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR Pending]

Link: http://www.fltk.org/str.php?L2672
Version: 1.4-feature


Attached file "unittest-mods.png"...


Link: http://www.fltk.org/str.php?L2672
Version: 1.4-feature<>___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] [RFE] STR #2672: Updated Gleam patch against FLTK1.3.x-r8816

2013-03-08 Thread Greg Ercolano
DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR Pending]

Link: http://www.fltk.org/str.php?L2672
Version: 1.4-feature


Attaching a patch for test/unittests that implements the test/gleam program
code into it. (unittests-schemes.patch)

Also, attached screenshot (unittest-mods.png) showing the result.


Link: http://www.fltk.org/str.php?L2672
Version: 1.4-featureIndex: test/Makefile
===
--- test/Makefile   (revision 0)
+++ test/Makefile   (revision 0)
@@ -274,8 +274,9 @@
 # General demos...
 unittests$(EXEEXT): unittests.o
 
-unittests.cxx: unittest_about.cxx unittest_points.cxx unittest_lines.cxx 
unittest_circles.cxx \
-   unittest_rects.cxx unittest_text.cxx unittest_viewport.cxx 
unittest_images.cxx
+unittests.o: unittests.cxx unittest_about.cxx unittest_points.cxx 
unittest_lines.cxx unittest_circles.cxx \
+   unittest_rects.cxx unittest_text.cxx unittest_viewport.cxx 
unittest_images.cxx \
+   unittest_schemes.cxx
 
 adjuster$(EXEEXT): adjuster.o
 
Index: test/unittest_schemes.cxx
===
--- test/unittest_schemes.cxx   (revision 0)
+++ test/unittest_schemes.cxx   (revision 0)
@@ -0,0 +1,270 @@
+//
+// "$Id: unittest_schemes.cxx 8864 2011-07-19 04:49:30Z greg.ercolano $"
+//
+// Unit tests for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2010 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
+//
+
+#include 
+
+// needed by Edmanuel's test layout
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+class SchemesTest : public Fl_Group {
+  Fl_Choice *schemechoice;
+  static void SchemeChoice_CB(Fl_Widget*,void *data) {
+SchemesTest *st = (SchemesTest*)data;
+const char *name = st->schemechoice->text();
+if ( name ) {
+  Fl::scheme(name);// change scheme
+  st->window()->redraw();  // redraw window
+}
+  }
+public: 
+  static Fl_Widget *create() {
+return new SchemesTest(TESTAREA_X, TESTAREA_Y, TESTAREA_W, TESTAREA_H);
+  }
+  SchemesTest(int X,int Y,int W,int H) : Fl_Group(X,Y,W,H) { 
+schemechoice = new Fl_Choice(X+125,Y,140,25,"FLTK Scheme");
+schemechoice->add("none");
+schemechoice->add("plastic");
+schemechoice->add("gtk+");
+schemechoice->add("gleam");
+schemechoice->value(0);
+schemechoice->labelfont(FL_HELVETICA_BOLD);
+const char *name = Fl::scheme();
+if ( name ) {
+   if ( strcmp(name, "plastic") == 0) { schemechoice->value(1); }
+  else if ( strcmp(name, "gtk+")== 0) { schemechoice->value(2); }
+  else if ( strcmp(name, "gleam")   == 0) { schemechoice->value(3); }
+}
+schemechoice->callback(SchemeChoice_CB, (void*)this);
+
+Fl_Window *subwin = new Fl_Window(X,Y+30,W,H-30);
+subwin->begin();
+{
+  // Pasted from Edmanuel's gleam test app
+  { Fl_Button* o = new Fl_Button(10, 9, 90, 25, "button");
+   o->box(FL_UP_BOX);
+   o->color((Fl_Color)101);
+   o->labelfont(5);
+  } // Fl_Button* o
+  { Fl_Button* o = new Fl_Button(10, 36, 90, 25, "button");
+   o->box(FL_UP_BOX);
+   o->color((Fl_Color)179);
+   o->labelfont(4);
+   o->labelcolor(FL_BACKGROUND2_COLOR);
+  } // Fl_Button* o
+  { Fl_Button* o = new Fl_Button(10, 63, 90, 25, "button");
+   o->box(FL_UP_BOX);
+   o->color((Fl_Color)91);
+  } // Fl_Button* o
+  { Fl_Button* o = new Fl_Button(10, 90, 90, 25, "button");
+   o->box(FL_UP_BOX);
+   o->color(FL_INACTIVE_COLOR);
+   o->labelcolor(FL_BACKGROUND2_COLOR);
+  } // Fl_Button* o
+  { Fl_Tabs* o = new Fl_Tabs(10, 120, 320, 215);
+   o->color(FL_DARK1);
+   o->selection_color(FL_DARK1);
+   { Fl_Group* o = new Fl_Group(14, 141, 310, 190, "tab1");
+ o->box(FL_THIN_UP_BOX);
+ o->color(FL_DARK1);
+ o->selection_color((Fl_Color)23);
+ o->hide();
+ { Fl_Clock* o = new Fl_Clock(24, 166, 130, 124);
+   o->box(FL_THIN_UP_BOX);
+   o->color((Fl_Color)12);
+   o->selection_color(FL_BACKGROUND2_COLOR);
+   o->labelcolor(FL_BACKGROUND2_COLOR);
+ } // Fl_Clock* o
+ { new Fl_Progress(22, 306, 290, 20);
+ } // Fl_Progress* o
+ { Fl_Clock* o = new Fl_Clock(179, 166, 130, 130);
+   o->box(FL_THIN_DOWN_BOX);
+   o->color((Fl_Color)26);
+ } // Fl_Clock* o
+   

Re: [fltk.development] [RFE] STR #2672: Updated Gleam patch against FLTK1.3.x-r8816

2013-03-08 Thread Edmanuel Torres
DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR Pending]

Link: http://www.fltk.org/str.php?L2672
Version: 1.4-feature


Attached file "fltk-1.3.2-gleam-4.3c.patch"...


Link: http://www.fltk.org/str.php?L2672
Version: 1.4-featureIndex: src/fl_gleam.cxx
===
--- src/fl_gleam.cxx(revision 0)
+++ src/fl_gleam.cxx(revision 0)
@@ -0,0 +1,136 @@
+//
+// "Gleam" drawing routines for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2010 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
+//
+// These box types provide a sort of Clearlooks Glossy scheme
+// for FLTK.
+//
+// Copyright 2001-2005 by Colin Jones.
+//
+// Modified 2012 by Edmanuel Torres
+// This is a new version of the fl_gleam. The gradients are on the top
+// an the bottom, the text area looks like in the classic FLTK way.
+//
+
+#include 
+#include 
+#include 
+
+using namespace std;
+
+static void gleam_color(Fl_Color c) {
+  if (Fl::draw_box_active()) fl_color(c);
+  else fl_color(fl_inactive(c));
+}
+
+static void shade_rect(int x, int y, int w, int h, Fl_Color fg1, Fl_Color fg2, 
float th) {
+  // Draws the shiny but use maximum limits
+  int h_top  = min(h/2,20);
+  int h_bottom = min(h/6,20);
+  int h_flat = h-(h_top+h_bottom);
+  int j = 0;
+  float step_size_top = (0.999/(float)(h_top));
+  float step_size_bottom = (0.999/(float)(h_bottom));
+  // This loop generates the gradient at the top of the widget
+  for (float k = 1; k >= 0; k -= step_size_top){
+gleam_color(fl_color_average(fl_color_average(fg1, fg2, th), fg1, k));
+fl_line(x, y+j, x+w, y+j);
+j++;
+  }
+  gleam_color(fg1);
+  fl_rectf(x, y+h_top, w+1, h_flat);
+  // This loop generates the gradient at the bottom of the widget
+  for (float k = 1; k >= 0; k -= step_size_bottom){
+gleam_color(fl_color_average(fg1,fl_color_average(fg1, fg2, th), k));
+fl_line(x, y+j+h_flat-1, x+w, y+j+h_flat-1);
+j++;
+  }
+}
+
+static void shade_rect_up(int x, int y, int w, int h, Fl_Color bc, float th) {
+  shade_rect(x,y,w,h,bc,FL_WHITE,th);
+}
+
+static void shade_rect_down(int x, int y, int w, int h, Fl_Color bc, float th) 
{
+  shade_rect(x,y,w,h,bc,FL_BLACK,th);
+}
+
+static void frame_rect(int x, int y, int w, int h, Fl_Color fg1, Fl_Color fg2) 
{
+  gleam_color(fg1);
+  fl_line(x, y+h-1, x, y+1); //Go from bottom to top left side
+  fl_line(x+w, y+h-1, x+w, y+1); //Go from bottom to top right side
+  fl_line(x+1, y, x+w-1, y); //Go across the top
+  fl_line(x+1, y+h, x+w-1, y+h); //Go across the bottom
+  gleam_color(fg2);
+  fl_line(x+1, y+h-2, x+1, y+2); //Go from bottom to top left side
+  fl_line(x+w-1, y+h-2, x+w-1, y+2); //Go from bottom to top right side
+}
+
+static void frame_rect_up(int x, int y, int w, int h, Fl_Color bc, float th1, 
float th2) {
+  frame_rect(x,y,w,h,fl_color_average(fl_darker(bc), FL_BLACK, 
th1),fl_color_average(bc, FL_WHITE, th2));
+}
+
+static void frame_rect_down(int x, int y, int w, int h, Fl_Color bc, float 
th1, float th2) {
+  frame_rect(x,y,w,h,fl_color_average(bc, FL_WHITE, 
th2),fl_color_average(FL_BLACK, bc, th1));
+}
+
+static void up_frame(int x, int y, int w, int h, Fl_Color c) {
+  frame_rect_up(x, y, w-1, h-1, c, 0.15f, 0.15f);
+  // frame decoration
+  gleam_color(fl_darker(c));
+  fl_line(x+2, y+1, x+w-3, y+1); //Go across the top
+  fl_line(x+2, y+h-2, x+w-3, y+h-2); //Go across the bottom
+}
+
+static void up_box(int x, int y, int w, int h, Fl_Color c) {
+  shade_rect_up(x+2, y+1, w-5, h-3, c, 0.15f);
+  frame_rect_up(x, y, w-1, h-1, c, 0.15f, 0.15f);
+}
+
+static void thin_up_box(int x, int y, int w, int h, Fl_Color c) {
+  shade_rect_up(x+2, y+1, w-5, h-3, c, 0.25f);
+  frame_rect_up(x, y, w-1, h-1, c, 0.25f, 0.25f);
+}
+
+static void down_frame(int x, int y, int w, int h, Fl_Color c) {
+  frame_rect_down(x, y, w-1, h-1, c, 0.75f, 0.35f);
+  // frame decoration
+  gleam_color(fl_darker(c));
+  fl_line(x+2, y+1, x+w-3, y+1); //Go across the top
+  fl_line(x+2, y+h-2, x+w-3, y+h-2); //Go across the bottom
+}
+
+static void down_box(int x, int y, int w, int h, Fl_Color c) {
+  shade_rect_down(x+1, y+1, w-3, h-3, c, 0.25f);
+  frame_rect_down(x, y, w-1, h-1, fl_darker(c), 0.65f, 0.35f);
+}
+
+static void thin_down_box(int x, int y, int w, int h, Fl_Color c) {
+  shade_rect_down(x+1, y+1, w-3, h-3, c, 0.35f);
+  frame_rect_down(x, y, w-1, h-1, fl_darker(c), 0.65f, 0.55f);
+}
+
+extern void fl_internal_boxtype(Fl_Boxtype, Fl_Box_Draw_F*);
+
+Fl_Boxtype fl_define_FL_GLEAM_UP_BOX() {
+  fl_internal_boxtype(_FL_GLEAM_UP_BOX, up_box);
+  fl_i

Re: [fltk.development] [RFE] STR #2672: Updated Gleam patch against FLTK1.3.x-r8816

2013-03-08 Thread Edmanuel Torres

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

[STR Pending]

Link: http://www.fltk.org/str.php?L2672
Version: 1.4-feature


Here the fixed patch, the first approach worked like a charm, thanks Greg.
I removed the test program, so to test with: unittests -s gleam


Link: http://www.fltk.org/str.php?L2672
Version: 1.4-feature

___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] [RFE] STR #2672: Updated Gleam patch against FLTK1.3.x-r8816

2013-03-09 Thread Albrecht Schlosser

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

[STR Pending]

Link: http://www.fltk.org/str.php?L2672
Version: 1.4-feature


BUG REPORT
--
System: Linux Ubuntu 12.04
FLTK 1.3.2 svn -r 9834
with patch http://www.fltk.org/strfiles/2672/fltk-1.3.2-gleam-4.3c.patch
(uncommented gleam entries in test/unittest_gleam.fl/.cxx, but this
probably doesn't matter, but makes testing easier).

Warning: testing this hogs the cpu, and the app becomes unresponsive - I
could not even close the app with the window's close button. CTRL-C from
the console that started the app can stop it though.

Test: run test/unittests -s gleam, then go to the scroll size test and try
to move the top right "A: Scroll Size" scrollbar. The app hangs. Stop it.

Start again, w/o "-s gleam", go to the same test, move that scrollbar to a
value like 10 (that works), select "schemes test", select the gleam scheme,
select "scrollbar size" test again, click on the slider in the same scroll
bar, and move it step by step with the left arrow key down until the app
hangs. This happens when you try to go from 2 to 1, at least for me.
Assumption: box drawing goes into an endless loop when the box width is
too small.


Link: http://www.fltk.org/str.php?L2672
Version: 1.4-feature

___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] [RFE] STR #2672: Updated Gleam patch against FLTK1.3.x-r8816

2013-03-09 Thread Albrecht Schlosser

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

[STR Pending]

Link: http://www.fltk.org/str.php?L2672
Version: 1.4-feature


Other than the mentioned bug, I like this gleam patch, but would like to
ask for your opinions. Although it looks good, I can't seem to "interpret"
the boxes well as up and/or down boxes.

ISTR that I once learned that we (our brain) usually interpret(s) flat
drawings as 3-dimensional according to some light effects, so that our
impression of "up and down" is best, if the light seems to come from top
left. This is used in the standard box types, and it seems to be utilized
in widgets of other apps (e.g. firefox).

The clue is that...
 - for an UP box, the top and left side are brighter, the bottom and right
side are darker
- for a DOWN box, this is just the opposite.

In the gleam patch, there is only the top-down gradient (not left-right),
but this would be okay, IMHO. However, could we (Edmanuel ?) try to change
the patch so that it is like described above ? I'd like to see that as an
example, to be able to decide if this is better.

OTOH, if this is not intended, then I'm also okay with the patch as-is.
Just wanted to ask for a possible improvement or other opinions.


Link: http://www.fltk.org/str.php?L2672
Version: 1.4-feature

___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] [RFE] STR #2672: Updated Gleam patch against FLTK1.3.x-r8816

2013-03-09 Thread Albrecht Schlosser

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

[STR Pending]

Link: http://www.fltk.org/str.php?L2672
Version: 1.4-feature


Well, here are more test results. In the test/unittests "schemes test"
(BTW: big thanks to Edmanuel for the code and Greg for inclusion - this is
a nice new test) I see:

(1) The white selection box(es) seem too dark at the top and at the
bottom. Wouldn't it be better to make them only some kinda gray, but not
black at the border? In general: should the darkest color be something
like fl_darker(original_color, FL_BLACK, some-value) instead of FL_BLACK?
Note that I wrote this w/o looking at the code, I may be wrong, but this
is what it looks like.

(2) The colored buttons become black'n'white (gray) when clicked, i.e.
they lose ther colors. Wouldn't it be better if they only changed their
up-down-box, but not the color? Again, this is what I see, not something I
read in the code.


Link: http://www.fltk.org/str.php?L2672
Version: 1.4-feature

___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] [RFE] STR #2672: Updated Gleam patch against FLTK1.3.x-r8816

2013-03-09 Thread Edmanuel Torres
DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR Pending]

Link: http://www.fltk.org/str.php?L2672
Version: 1.4-feature


Attached file "fltk-1.3.2-gleam-4.3d.patch"...


Link: http://www.fltk.org/str.php?L2672
Version: 1.4-featureIndex: src/fl_gleam.cxx
===
--- src/fl_gleam.cxx(revision 0)
+++ src/fl_gleam.cxx(revision 0)
@@ -0,0 +1,136 @@
+//
+// "Gleam" drawing routines for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2010 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
+//
+// These box types provide a sort of Clearlooks Glossy scheme
+// for FLTK.
+//
+// Copyright 2001-2005 by Colin Jones.
+//
+// Modified 2012 by Edmanuel Torres
+// This is a new version of the fl_gleam. The gradients are on the top
+// an the bottom, the text area looks like in the classic FLTK way.
+//
+
+#include 
+#include 
+#include 
+
+using namespace std;
+
+static void gleam_color(Fl_Color c) {
+  if (Fl::draw_box_active()) fl_color(c);
+  else fl_color(fl_inactive(c));
+}
+
+static void shade_rect(int x, int y, int w, int h, Fl_Color fg1, Fl_Color fg2, 
float th) {
+  // Draws the shiny but use maximum limits
+  int h_top  = min(h/2,20);
+  int h_bottom = min(h/6,20);
+  int h_flat = h-(h_top+h_bottom);
+  int j = 0;
+  float step_size_top = h_top>1?(0.999/(float)(h_top)):1;
+  float step_size_bottom = h_bottom>1?(0.999/(float)(h_bottom)):1;
+  // This loop generates the gradient at the top of the widget
+  for (float k = 1; k >= 0; k -= step_size_top){
+gleam_color(fl_color_average(fl_color_average(fg1, fg2, th), fg1, k));
+fl_line(x, y+j, x+w, y+j);
+j++;
+  }
+  gleam_color(fg1);
+  fl_rectf(x, y+h_top, w+1, h_flat);
+  // This loop generates the gradient at the bottom of the widget
+  for (float k = 1; k >= 0; k -= step_size_bottom){
+gleam_color(fl_color_average(fg1,fl_color_average(fg1, fg2, th), k));
+fl_line(x, y+j+h_flat-1, x+w, y+j+h_flat-1);
+j++;
+  }
+}
+
+static void shade_rect_up(int x, int y, int w, int h, Fl_Color bc, float th) {
+  shade_rect(x,y,w,h,bc,FL_WHITE,th);
+}
+
+static void shade_rect_down(int x, int y, int w, int h, Fl_Color bc, float th) 
{
+  shade_rect(x,y,w,h,bc,FL_BLACK,th);
+}
+
+static void frame_rect(int x, int y, int w, int h, Fl_Color fg1, Fl_Color fg2) 
{
+  gleam_color(fg1);
+  fl_line(x, y+h-1, x, y+1); //Go from bottom to top left side
+  fl_line(x+w, y+h-1, x+w, y+1); //Go from bottom to top right side
+  fl_line(x+1, y, x+w-1, y); //Go across the top
+  fl_line(x+1, y+h, x+w-1, y+h); //Go across the bottom
+  gleam_color(fg2);
+  fl_line(x+1, y+h-2, x+1, y+2); //Go from bottom to top left side
+  fl_line(x+w-1, y+h-2, x+w-1, y+2); //Go from bottom to top right side
+}
+
+static void frame_rect_up(int x, int y, int w, int h, Fl_Color bc, float th1, 
float th2) {
+  frame_rect(x,y,w,h,fl_color_average(fl_darker(bc), FL_BLACK, 
th1),fl_color_average(bc, FL_WHITE, th2));
+}
+
+static void frame_rect_down(int x, int y, int w, int h, Fl_Color bc, float 
th1, float th2) {
+  frame_rect(x,y,w,h,fl_color_average(bc, FL_WHITE, 
th2),fl_color_average(FL_BLACK, bc, th1));
+}
+
+static void up_frame(int x, int y, int w, int h, Fl_Color c) {
+  frame_rect_up(x, y, w-1, h-1, c, 0.15f, 0.15f);
+  // frame decoration
+  gleam_color(fl_darker(c));
+  fl_line(x+2, y+1, x+w-3, y+1); //Go across the top
+  fl_line(x+2, y+h-2, x+w-3, y+h-2); //Go across the bottom
+}
+
+static void up_box(int x, int y, int w, int h, Fl_Color c) {
+  shade_rect_up(x+2, y+1, w-5, h-3, c, 0.15f);
+  frame_rect_up(x, y, w-1, h-1, c, 0.15f, 0.15f);
+}
+
+static void thin_up_box(int x, int y, int w, int h, Fl_Color c) {
+  shade_rect_up(x+2, y+1, w-5, h-3, c, 0.25f);
+  frame_rect_up(x, y, w-1, h-1, c, 0.25f, 0.25f);
+}
+
+static void down_frame(int x, int y, int w, int h, Fl_Color c) {
+  frame_rect_down(x, y, w-1, h-1, c, 0.75f, 0.35f);
+  // frame decoration
+  gleam_color(fl_darker(c));
+  fl_line(x+2, y+1, x+w-3, y+1); //Go across the top
+  fl_line(x+2, y+h-2, x+w-3, y+h-2); //Go across the bottom
+}
+
+static void down_box(int x, int y, int w, int h, Fl_Color c) {
+  shade_rect_down(x+1, y+1, w-3, h-3, c, 0.35f);
+  frame_rect_down(x, y, w-1, h-1, fl_darker(c), 0.65f, 0.35f);
+}
+
+static void thin_down_box(int x, int y, int w, int h, Fl_Color c) {
+  shade_rect_down(x+1, y+1, w-3, h-3, c, 0.45f);
+  frame_rect_down(x, y, w-1, h-1, fl_darker(c), 0.65f, 0.55f);
+}
+
+extern void fl_internal_boxtype(Fl_Boxtype, Fl_Box_Draw_F*);
+
+Fl_Boxtype fl_define_FL_GLEAM_UP_BOX() {
+  fl_internal_boxtype(_FL_GLEAM_U

Re: [fltk.development] [RFE] STR #2672: Updated Gleam patch against FLTK1.3.x-r8816

2013-03-09 Thread Edmanuel Torres

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

[STR Pending]

Link: http://www.fltk.org/str.php?L2672
Version: 1.4-feature


Fixed the bug reported by Albrecht (04:32 Mar 09, 2013)

The gleam uses front light 3d effect. I didn’t work on that for a while,
but I will work in some improvements.

I will include left-right gradients, I think it would be nice and it will
be small piece of code.

IMHO, I think the front light effect looks more modern.

// (1) The white selection box(es) seem too dark at the top and at the
bottom. 

I have made some improvement to this.

// (2) The colored buttons become black'n'white (gray) when clicked, i.e.
they lose ther colors. Wouldn't it be better if they only changed their
up-down-box, but not the color? Again, this is what I see, not something I
read in the code.

This seems to be the default behaviour of FLTK.


Link: http://www.fltk.org/str.php?L2672
Version: 1.4-feature

___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] [RFE] STR #2672: Updated Gleam patch against FLTK1.3.x-r8816

2013-03-10 Thread Albrecht Schlosser

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

[STR Pending]

Link: http://www.fltk.org/str.php?L2672
Version: 1.4-feature


Thanks for fixing the bug so quickly, I can confirm that it works now.

WRT "front light 3d effect" being "more modern": I'm not a 3d expert, and
I don't know much about what is "modern" in GUI design. My PERSONAL
opinion is that I don't like this because I don't get a correct "3d
impression". However, as I said before, if this is intendend, and if
others want this scheme to be included, then I won't object. Maybe it
needs some more fine tuning, but we should first think about including it
in the FLTK core before there is too much work done... Thanks for your
efforts, Edmanuel.

Looking forward to seeing the left-right gradients, too.

I can see the difference in white box backgrounds in your new patch
(4.3d), and I believe it's better now, but IMHO it could still be a little
brighter...

I can also confirm that colored buttons become black..gray..white (or get
the default system color?) when pressed in other schemes (gtk+, none,
plastic), but I wonder why this is so and whether it could be changed (a)
generally, or (b) for the gleam scheme?


Link: http://www.fltk.org/str.php?L2672
Version: 1.4-feature

___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] [RFE] STR #2672: Updated Gleam patch against FLTK1.3.x-r8816

2013-03-10 Thread Edmanuel Torres
DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR Pending]

Link: http://www.fltk.org/str.php?L2672
Version: 1.4-feature


Attached file "fltk-1.3.2-gleam-4.3e.patch"...


Link: http://www.fltk.org/str.php?L2672
Version: 1.4-featureIndex: src/fl_gleam.cxx
===
--- src/fl_gleam.cxx(revision 0)
+++ src/fl_gleam.cxx(revision 0)
@@ -0,0 +1,160 @@
+//
+// "Gleam" drawing routines for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2010 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
+//
+// These box types provide a sort of Clearlooks Glossy scheme
+// for FLTK.
+//
+// Copyright 2001-2005 by Colin Jones.
+//
+// Modified 2012 by Edmanuel Torres
+// This is a new version of the fl_gleam. The gradients are on the top
+// an the bottom, the text area looks like in the classic FLTK way.
+//
+
+#include 
+#include 
+#include 
+
+using namespace std;
+
+static void gleam_color(Fl_Color c) {
+  if (Fl::draw_box_active()) fl_color(c);
+  else fl_color(fl_inactive(c));
+}
+
+static void shade_rect_top_bottom(int x, int y, int w, int h, Fl_Color fg1, 
Fl_Color fg2, float th) {
+  // Draws the shiny but use maximum limits
+  int h_top  = min(h/2,20);
+  int h_bottom = min(h/6,20);
+  int h_flat = h-(h_top+h_bottom);
+  int j = 0;
+  float step_size_top = h_top>1?(0.999/(float)(h_top)):1;
+  float step_size_bottom = h_bottom>1?(0.999/(float)(h_bottom)):1;
+  // This loop generates the gradient at the top of the widget
+  for (float k = 1; k >= 0; k -= step_size_top){
+gleam_color(fl_color_average(fl_color_average(fg1, fg2, th), fg1, k));
+fl_line(x, y+j, x+w, y+j);
+j++;
+  }
+  gleam_color(fg1);
+  fl_rectf(x, y+h_top, w+1, h_flat);
+  // This loop generates the gradient at the bottom of the widget
+  for (float k = 1; k >= 0; k -= step_size_bottom){
+gleam_color(fl_color_average(fg1,fl_color_average(fg1, fg2, th), k));
+fl_line(x, y+j+h_flat-1, x+w, y+j+h_flat-1);
+j++;
+  }
+}
+
+static void shade_rect_left_right(int x, int y, int w, int h, Fl_Color fg1, 
Fl_Color fg2, float th) {
+  // Draws the shiny useing maximum limits
+  int w_left  = min(w/8,10);
+  int w_right = min(w/8,10);
+  int w_flat = w-(w_left+w_right);
+  int j = 0;
+  float step_size_left = w_left>1?(0.999/(float)(w_left)):1;
+  float step_size_right = w_right>1?(0.999/(float)(w_right)):1;
+  // This loop generates the gradient on the left side of the widget
+  for (float k = 1; k >= 0; k -= step_size_left){
+gleam_color(fl_color_average(fl_color_average(fg1, fg2, th), fg1, k));
+fl_line(x+j, y, x+j, y+h);
+j++;
+  }
+  gleam_color(fg1);
+  fl_rectf(x+w_left, y, w_flat, h+1);
+  // This loop generates the gradient on the right side of the widget
+  for (float k = 1; k >= 0; k -= step_size_right){
+gleam_color(fl_color_average(fg1,fl_color_average(fg1, fg2, th), k));
+fl_line(x+j+w_flat-1, y, x+j+w_flat-1, y+h);
+j++;
+  }
+}
+
+static void shade_rect_top_bottom_up(int x, int y, int w, int h, Fl_Color bc, 
float th) {
+  shade_rect_top_bottom(x,y,w,h,bc,FL_WHITE,th);
+}
+
+static void shade_rect_top_bottom_down(int x, int y, int w, int h, Fl_Color 
bc, float th) {
+  shade_rect_top_bottom(x,y,w,h,bc,FL_BLACK,th);
+}
+
+static void frame_rect(int x, int y, int w, int h, Fl_Color fg1, Fl_Color fg2) 
{
+  gleam_color(fg1);
+  fl_line(x, y+h-1, x, y+1); //Go from bottom to top left side
+  fl_line(x+w, y+h-1, x+w, y+1); //Go from bottom to top right side
+  fl_line(x+1, y, x+w-1, y); //Go across the top
+  fl_line(x+1, y+h, x+w-1, y+h); //Go across the bottom
+  gleam_color(fg2);
+  fl_line(x+1, y+h-2, x+1, y+2); //Go from bottom to top left side
+  fl_line(x+w-1, y+h-2, x+w-1, y+2); //Go from bottom to top right side
+}
+
+static void frame_rect_up(int x, int y, int w, int h, Fl_Color bc, float th1, 
float th2) {
+  frame_rect(x,y,w,h,fl_color_average(fl_darker(bc), FL_BLACK, 
th1),fl_color_average(bc, FL_WHITE, th2));
+}
+
+static void frame_rect_down(int x, int y, int w, int h, Fl_Color bc, float 
th1, float th2) {
+  frame_rect(x,y,w,h,fl_color_average(bc, FL_WHITE, 
th2),fl_color_average(FL_BLACK, bc, th1));
+}
+
+static void up_frame(int x, int y, int w, int h, Fl_Color c) {
+  frame_rect_up(x, y, w-1, h-1, c, 0.15f, 0.15f);
+  // frame decoration
+  gleam_color(fl_darker(c));
+  fl_line(x+2, y+1, x+w-3, y+1); //Go across the top
+  fl_line(x+2, y+h-2, x+w-3, y+h-2); //Go across the bottom
+}
+
+static void up_box(int x, int y, int w, int h, Fl_Color c) {
+  shade_rect_top_bottom_up(x+2, y+1, w-5, h-3, c, 0.15f);
+  frame_r

Re: [fltk.development] [RFE] STR #2672: Updated Gleam patch against FLTK1.3.x-r8816

2013-03-10 Thread Edmanuel Torres

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

[STR Pending]

Link: http://www.fltk.org/str.php?L2672
Version: 1.4-feature


// Looking forward to seeing the left-right gradients, too.

Done, but you need to change shade_rect_top_bottom to
shade_rect_left_right in src/fl_gleam.cxx

// I can see the difference in white box backgrounds in your new patch
(4.3d), and I believe it's better now, but IMHO it could still be a little
brighter...

Now it is a bit brighter.


Link: http://www.fltk.org/str.php?L2672
Version: 1.4-feature

___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] [RFE] STR #2672: Updated Gleam patch against FLTK1.3.x-r8816

2013-03-16 Thread Edmanuel Torres
DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR Pending]

Link: http://www.fltk.org/str.php?L2672
Version: 1.4-feature


Attached file "fltk-1.3.x-r9835-gleam-4.3.patch"...


Link: http://www.fltk.org/str.php?L2672
Version: 1.4-featureIndex: src/fl_gleam.cxx
===
--- src/fl_gleam.cxx(revision 0)
+++ src/fl_gleam.cxx(revision 0)
@@ -0,0 +1,131 @@
+//
+// "Gleam" drawing routines for the Fast Light Tool Kit (FLTK).
+//
+// Copyright 1998-2010 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
+//
+// These box types provide a sort of Clearlooks Glossy scheme
+// for FLTK.
+//
+// Copyright 2001-2005 by Colin Jones.
+//
+// Modified 2012-2013 by Edmanuel Torres
+// This is a new version of the fl_gleam. The gradients are on the top
+// an the bottom, the text area looks like in the classic FLTK way.
+//
+
+#include 
+#include 
+#include 
+
+using namespace std;
+
+static void gleam_color(Fl_Color c) {
+  if (Fl::draw_box_active()) fl_color(c);
+  else fl_color(fl_inactive(c));
+}
+
+static void shade_rect_top_bottom(int x, int y, int w, int h, Fl_Color fg1, 
Fl_Color fg2, float th) {
+  // Draws the shiny using maximum limits
+  int h_top  = min(h/2,20);
+  int h_bottom = min(h/6,15);
+  int h_flat = h-(h_top+h_bottom);
+  int j = 0;
+  float step_size_top = h_top>1?(0.999/(float)(h_top)):1;
+  float step_size_bottom = h_bottom>1?(0.999/(float)(h_bottom)):1;
+  // This loop generates the gradient at the top of the widget
+  for (float k = 1; k >= 0; k -= step_size_top){
+gleam_color(fl_color_average(fl_color_average(fg1, fg2, th), fg1, k));
+fl_line(x, y+j, x+w, y+j);
+j++;
+  }
+  gleam_color(fg1);
+  fl_rectf(x, y+h_top, w+1, h_flat);
+  // This loop generates the gradient at the bottom of the widget
+  for (float k = 1; k >= 0; k -= step_size_bottom){
+gleam_color(fl_color_average(fg1,fl_color_average(fg1, fg2, th), k));
+fl_line(x, y+j+h_flat-1, x+w, y+j+h_flat-1);
+j++;
+  }
+}
+
+static void shade_rect_top_bottom_up(int x, int y, int w, int h, Fl_Color bc, 
float th) {
+  shade_rect_top_bottom(x,y,w,h,bc,FL_WHITE,th);
+}
+
+static void shade_rect_top_bottom_down(int x, int y, int w, int h, Fl_Color 
bc, float th) {
+  shade_rect_top_bottom(x,y,w,h,bc,FL_BLACK,th);
+}
+
+static void frame_rect(int x, int y, int w, int h, Fl_Color fg1, Fl_Color fg2, 
Fl_Color lc) {
+  gleam_color(fg1);
+  fl_line(x, y+h-1, x, y+1); //Go from bottom to top left side
+  fl_line(x+w, y+h-1, x+w, y+1); //Go from bottom to top right side
+  fl_line(x+1, y, x+w-1, y); //Go across the top
+  fl_line(x+1, y+h, x+w-1, y+h); //Go across the bottom
+  gleam_color(fg2);
+  fl_line(x+1, y+h-2, x+1, y+2); //Go from bottom to top left side
+  fl_line(x+w-1, y+h-2, x+w-1, y+2); //Go from bottom to top right side
+  gleam_color(lc);
+  fl_line(x+2, y+1, x+w-3, y+1); //Go across the top
+  fl_line(x+2, y+h-1, x+w-3, y+h-1); //Go across the bottom
+}
+
+static void frame_rect_up(int x, int y, int w, int h, Fl_Color bc, Fl_Color 
lc, float th1, float th2) {
+  frame_rect(x,y,w,h,fl_color_average(fl_darker(bc), FL_BLACK, 
th1),fl_color_average(bc, FL_WHITE, th2),lc);
+}
+
+static void frame_rect_down(int x, int y, int w, int h, Fl_Color bc, Fl_Color 
lc, float th1, float th2) {
+  frame_rect(x,y,w,h,fl_color_average(bc, FL_WHITE, 
th1),fl_color_average(FL_BLACK, bc, th2),lc);
+}
+
+static void up_frame(int x, int y, int w, int h, Fl_Color c) {
+  frame_rect_up(x, y, w-1, h-1, c, fl_color_average(c, FL_WHITE, .25f), .55f, 
.05f);
+}
+
+static void up_box(int x, int y, int w, int h, Fl_Color c) {
+  shade_rect_top_bottom_up(x+2, y+1, w-5, h-3, c, .15f);
+  frame_rect_up(x, y, w-1, h-1, c, fl_color_average(c, FL_WHITE, .05f), .15f, 
.05f);
+}
+
+static void thin_up_box(int x, int y, int w, int h, Fl_Color c) {
+  shade_rect_top_bottom_up(x+2, y+1, w-5, h-3, c, .25f);
+  frame_rect_up(x, y, w-1, h-1, c, fl_color_average(c, FL_WHITE, .45f), .25f, 
.15f);
+}
+
+static void down_frame(int x, int y, int w, int h, Fl_Color c) {
+  frame_rect_down(x, y, w-1, h-1, fl_darker(c), fl_darker(c), .25f, .95f);
+}
+
+static void down_box(int x, int y, int w, int h, Fl_Color c) {
+  shade_rect_top_bottom_down(x+1, y+1, w-3, h-3, c, .65f);
+  frame_rect_down(x, y, w-1, h-1, c, fl_color_average(c, FL_BLACK, .05f), 
.05f, .95f);
+}
+
+static void thin_down_box(int x, int y, int w, int h, Fl_Color c) {
+  shade_rect_top_bottom_down(x+1, y+1, w-3, h-3, c, .85f);
+  frame_rect_down(x, y, w-1, h-1, c, fl_color_average(c, FL_BLACK, .45f), 
.35f, 0.85f);
+}
+
+extern void f

Re: [fltk.development] [RFE] STR #2672: Updated Gleam patch against FLTK1.3.x-r8816

2013-03-16 Thread Edmanuel Torres

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

[STR Pending]

Link: http://www.fltk.org/str.php?L2672
Version: 1.4-feature


Gleam 4.3 against fltk-1.3.x-r9835 with some improvements as suggested by
Albrecht.


Link: http://www.fltk.org/str.php?L2672
Version: 1.4-feature

___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] [RFE] STR #2672: Updated Gleam patch against FLTK1.3.x-r8816

2011-06-19 Thread Greg Ercolano

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

[STR New]

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


This sounds really cool.. and the patch is small and the code is small.
Sounds great -- my initial reaction is +1 to add it, but I want to
withhold comment until I have time to actually try it out.

I'll try to play with it soon, as I hope other devs will as well.


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

___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] [RFE] STR #2672: Updated Gleam patch against FLTK1.3.x-r8816

2011-06-19 Thread Edmanuel Torres

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

[STR New]

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


I am working on Gleam to make it more FLTK-like feel and look, and
considering more modern theme appealing.


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

___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] [RFE] STR #2672: Updated Gleam patch against FLTK1.3.x-r8816

2011-06-20 Thread Edmanuel Torres

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

[STR New]

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


Here there is the modified version of fl_gleam. I think it looks better
with the gradients on the top and the bottom, so the the middle area of
the widgets it is no strongly affected. Here an screen shot:

https://sites.google.com/site/eetorres/fl_gleam

The new gleam can be found here

https://github.com/eetorres/fl_gleam/blob/master/fl_gleam.cxx


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

___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] [RFE] STR #2672: Updated Gleam patch against FLTK1.3.x-r8816

2011-06-20 Thread Ian MacArthur

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

[STR New]

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


A few minor comments:

- It looks to me as if the patch changes the behaviour of
Fl_get_system_colors for all schemes, not just for the gleam patch.
I don't think that's acceptable, as it may have backwards compatability
issues and so forth (or at least may unexpectedly change the appearance of
apps that do not use the new scheme.)

- The patch needs to include a mod to test/demo.cxx to make the new scheme
selectable in testing; actually, I'm surprised that is missing, as it would
make it very easy to exercise the new scheme on a variety of different
widget styles.

- Should we bump this to 1.4 for now? Or is it OK to be a 1.3 RFE now that
1.3.0 is out?

-- 
Ian


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

___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] [RFE] STR #2672: Updated Gleam patch against FLTK1.3.x-r8816

2011-06-20 Thread Michael Sweet

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

[STR New]

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


For a strict adherence to the CMP, all features need to be pushed to 1.4 or
later.


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

___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] [RFE] STR #2672: Updated Gleam patch against FLTK1.3.x-r8816

2011-06-20 Thread Edmanuel Torres
DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

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


Attached file "gleam-fltk-1.3.x-rev8836.patch"...


Link: http://www.fltk.org/str.php?L2672
Version: 1.3-featureIndex: src/fl_gleam.cxx
===
--- src/fl_gleam.cxx(revision 0)
+++ src/fl_gleam.cxx(revision 0)
@@ -0,0 +1,158 @@
+//
+// "Gleam" drawing routines for the Fast Light Tool Kit (FLTK).
+//
+// These box types provide a sort of Clearlooks Glossy scheme
+// for FLTK.
+//
+// Copyright 2001-2005 by Colin Jones.
+//
+// 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
+//
+
+// Box drawing code for an obscure box type.
+// These box types are in seperate files so they are not linked
+// in if not used.
+
+#include 
+#include 
+
+static void gleam_color(Fl_Color c) {
+  if (Fl::draw_box_active()) fl_color(c);
+  else fl_color(fl_inactive(c));
+}
+
+static void shade_rect_up(int x, int y, int w, int h, Fl_Color bc, float th) {
+  // Draws the shiny
+  int h_top  = h/4;
+  int h_bottom = h/6;
+  float h_flat = h-(float)(h_top+h_bottom);
+  gleam_color(bc);
+  fl_rectf(x, y+h_top, w, h_flat+1);
+
+  float step_size_top=0.10;
+  float step_size_bottom=0.10;
+  int j = 0;
+  step_size_top = (1.0/(float)h_top);
+  step_size_bottom = (1.0/(float)h_bottom);
+
+  // This loop generates the gradient at the top of the widget
+  for (float k = 1; k >= 0; k -= step_size_top){
+j++;
+gleam_color(fl_color_average(fl_color_average(bc, FL_WHITE, th), bc, k));  
+fl_line(x, y+j, x+w-1, y+j);
+  }
+  // This loop generates the gradient at the bottom of the widget
+  for (float k = 1; k >= 0; k -= step_size_bottom){
+ j++;
+ gleam_color(fl_color_average(bc, fl_color_average(bc, FL_WHITE, th), k));
+ fl_line(x, y+j+h_flat-3, x+w-1, y+j+h_flat-3);
+  }
+}
+
+static void shade_rect_down(int x, int y, int w, int h, Fl_Color bc, float th) 
{
+  // Draws the shiny
+  int h_top  = h/4;
+  int h_bottom = h/6;
+  float h_flat = h-(float)(h_top+h_bottom);
+  gleam_color(bc);
+  fl_rectf(x, y+h_top, w, h_flat+1);
+
+  float step_size_top=0.10;
+  float step_size_bottom=0.10;
+  int j = 0;
+  step_size_top = (1.0/(float)h_top);
+  step_size_bottom = (1.0/(float)h_bottom);
+
+  // This loop generates the gradient at the top of the widget
+  for (float k = 1; k >= 0; k -= step_size_top){
+j++;
+gleam_color(fl_color_average(fl_color_average(bc, FL_BLACK, th), bc, k));
+fl_line(x, y+j, x+w-1, y+j);
+  }
+  // This loop generates the gradient at the bottom of the widget
+  for (float k = 1; k >= 0; k -= step_size_bottom){
+ j++;
+ gleam_color(fl_color_average(bc, fl_color_average(bc, FL_BLACK, th), k));
+ fl_line(x, y+j+h_flat-3, x+w-1, y+j+h_flat-3);
+  }
+}
+
+static void frame_rect_up(int x, int y, int w, int h, Fl_Color bc, float th) {
+  // Draw the outline around the perimeter of the box
+  gleam_color(fl_color_average(bc, FL_WHITE, th));
+  fl_line(x+1, y, x+w-1, y); //Go across.
+  fl_line(x, y+h-1, x, y+1); //Go to top
+  gleam_color(fl_color_average(bc, FL_BLACK, th));
+  fl_line(x+1, y+h, x+w-1, y+h); //Go across again!
+  fl_line(x+w, y+h-1, x+w, y+1); //Go to top
+}
+
+static void frame_rect_down(int x, int y, int w, int h, Fl_Color bc, float th) 
{
+  // Draw the outline around the perimeter of the box
+  gleam_color(fl_color_average(fl_darker(bc), FL_BLACK, th));
+  fl_line(x+1, y, x+w-1, y); //Go across.
+  fl_line(x, y+h-1, x, y+1); //Go to top
+  gleam_color(fl_color_average(bc, FL_WHITE, th));
+  fl_line(x+1, y+h, x+w-1, y+h); //Go across again!
+  fl_line(x+w, y+h-1, x+w, y+1); //Go to top
+}
+
+static void up_frame(int x, int y, int w, int h, Fl_Color c) {
+  frame_rect_up(x, y, w-1, h-1, fl_darker(c),0.35);
+}
+
+static void up_box(int x, int y, int w, int h, Fl_Color c) {
+  shade_rect_up(x+1, y, w-2, h-1, c, 0.25f);
+  frame_rect_up(x, y, w-1, h-1, fl_darker(c),0.35);
+}
+
+static void thin_up_box(int x, int y, int w, int h, Fl_Color c) {
+  shade_rect_up(x+1, y, w-2, h-1, c, 0.65f);
+  frame_rect_up(x, y, w-1, h-1, fl_darker(c),0.85);
+}
+
+static void down_

Re: [fltk.development] [RFE] STR #2672: Updated Gleam patch against FLTK1.3.x-r8816

2011-06-20 Thread Edmanuel Torres

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

[STR New]

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


I have added a complete fl_gleam patch for FLTK-1.3.x rev8836. It contains
gleam with a better shading theme. The thin option of the widgets is
implemented. There is a demo called gleam in the test directory, gleam is
also included in the demo form.

There is a new screen shot at:

https://sites.google.com/site/eetorres/fl_gleam

The one labeled fl_gleam-4.1.cxx


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

___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] [RFE] STR #2672: Updated Gleam patch against FLTK1.3.x-r8816

2011-06-21 Thread Ian MacArthur

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

[STR New]

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


Comments on revised patch:

- the copyright attribution in fl_gleam.cxx needs to be thought about; it
attributes Colin Jones as the copyright holder - this is unlikley to be
accpetable for fltk, and is also probably wrong - if we have not used any
of his code directly (and I imagine we have not) then it is probably more
appropriate to acknowledge that the design was inspired by him, rather
than attributing the copyright in the sources to him.


- I'm still not happy about the changes to Fl_get_system_colors.cxx as
regards setting the default colours.

- if the test program is created by fluid it is approporaite to only
configure the .fl file and generate the .cxx/.h at build time; they do not
need to be (usually should not be) configured (fluid and the fltk lib
itself violate this rule in a few places since they are built before fluid
can exist - all test programs are built after fluid exists and so should
always use fluid.)


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

___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] [RFE] STR #2672: Updated Gleam patch against FLTK1.3.x-r8816

2011-06-21 Thread Edmanuel Torres

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

[STR New]

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


This is not Colin's code. I rewrote the whole drawing code, FLTK only needs
to acknowledge Colin for the inspiring work.


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

___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] [RFE] STR #2672: Updated Gleam patch against FLTK1.3.x-r8816

2011-06-23 Thread Matthias Melcher

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

[STR New]

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


I am considering making Gleam 3 the default look for FLTK 3. Would that be
OK?


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

___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] [RFE] STR #2672: Updated Gleam patch against FLTK1.3.x-r8816

2011-06-23 Thread Nikita Egorov
>
> I am considering making Gleam 3 the default look for FLTK 3. Would that be
> OK?

I would do it later. After some improving. I just built FLTK with the
gleam patch and tried to make a simple radio button (via FLUID). I
think it's awfully, don't you?

PS. To be honest I don't like all down boxes which are supported by gleam3.
-- 
Best Regards
Nikita Egorov

___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] [RFE] STR #2672: Updated Gleam patch against FLTK1.3.x-r8816

2011-06-23 Thread Michael Sweet

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

[STR New]

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


I preferred the up boxes from v3; the down boxes in v4.1 are pretty good -
perhaps we can combine the two?

As for updating the default look - no objections as long as the old box
types are still available.


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

___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] [RFE] STR #2672: Updated Gleam patch against FLTK1.3.x-r8816

2011-06-23 Thread Edmanuel Torres

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

[STR New]

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


The reason why I remove the shiny from the text area, it is because it
makes it a bit hard to read the text. I think it can be eye tiring with
the time. The buttons of Gleam 3.0 look great but not the boxes. I think
the thin box of gleam 4.1 does a better job in this case. Maybe it is
better idea to keep both.


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

___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] [RFE] STR #2672: Updated Gleam patch against FLTK1.3.x-r8816

2011-06-23 Thread Edmanuel Torres

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

[STR New]

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


Another good think of gleam 4.1 it is that with a little bit more coding
can be themed, so everyone will have control on the shading. Then gleam
3.0 and 4.1 can be just themes, I think is worth. I would do that if you
agree. You can leave either or a mix by default for FLTK.


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

___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] [RFE] STR #2672: Updated Gleam patch against FLTK1.3.x-r8816

2011-06-28 Thread Edmanuel Torres
DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

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


Attached file "gleam-4.2-fltk-1.3-rev8842.patch"...


Link: http://www.fltk.org/str.php?L2672
Version: 1.3-featureIndex: src/fl_gleam.cxx
===
--- src/fl_gleam.cxx(revision 0)
+++ src/fl_gleam.cxx(revision 0)
@@ -0,0 +1,163 @@
+//
+// "Gleam" drawing routines for the Fast Light Tool Kit (FLTK).
+//
+// These box types provide a sort of Clearlooks Glossy scheme
+// for FLTK.
+//
+// Copyright 2001-2005 by Colin Jones.
+//
+// Modified 2011 by Edmanuel Torres
+// This is a new fl_gleam theme. The gradients are on the top an the
+// bottom so the text area looks like in the classic FLTK way.
+//
+// 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
+//
+
+// Box drawing code for an obscure box type.
+// These box types are in seperate files so they are not linked
+// in if not used.
+
+#include 
+#include 
+#include 
+
+using namespace std;
+
+static void gleam_color(Fl_Color c) {
+  if (Fl::draw_box_active()) fl_color(c);
+  else fl_color(fl_inactive(c));
+}
+
+static void shade_rect_up(int x, int y, int w, int h, Fl_Color bc, float th) {
+  // Draws the shiny
+  int h_top  = h/3;
+  int h_bottom = h/3;
+  int h_flat = h-(h_top+h_bottom);
+  int j = 0;
+  float step_size_top = (0.999/(float)(h_top));
+  float step_size_bottom = (0.999/(float)(h_bottom));
+
+  // This loop generates the gradient at the top of the widget
+  for (float k = 1; k >= 0; k -= step_size_top){
+gleam_color(fl_color_average(fl_color_average(bc, FL_WHITE, th), bc, k));  
+fl_line(x, y+j, x+w, y+j);
+j++;
+  }
+  gleam_color(bc);
+  fl_rectf(x, y+h_top, w+1, h_flat);
+  // This loop generates the gradient at the bottom of the widget
+  for (float k = 1; k >= 0; k -= step_size_bottom){
+ //gleam_color(fl_color_average(bc, fl_color_average(bc, FL_WHITE, th), 
k));
+ gleam_color(fl_color_average(bc,fl_color_average(bc, FL_BLACK, th), k));
+ fl_line(x, y+j+h_flat-1, x+w, y+j+h_flat-1);
+ j++;
+  }
+}
+
+static void shade_rect_down(int x, int y, int w, int h, Fl_Color bc, float th) 
{
+  // Draws the shiny
+  int h_top  = (int)h/3;
+  int h_bottom = (int)h/3;
+  float h_flat = h-(h_top+h_bottom);
+  int j = 0;
+  float step_size_top = (0.999/(float)h_top);
+  float step_size_bottom = (0.999/(float)h_bottom);
+
+  // This loop generates the gradient at the top of the widget
+  for (float k = 1; k >= 0; k -= step_size_top){
+gleam_color(fl_color_average(fl_color_average(bc, FL_BLACK, th), bc, k));
+//gleam_color(fl_color_average(fl_color_average(bc, FL_WHITE, th), bc, k));
+fl_line(x, y+j, x+w, y+j);
+j++;
+  }
+  gleam_color(bc);
+  fl_rectf(x, y+h_top, w+1, h_flat);
+  // This loop generates the gradient at the bottom of the widget
+  for (float k = 1; k >= 0; k -= step_size_bottom){
+ gleam_color(fl_color_average(bc, fl_color_average(bc, FL_BLACK, th), k));
+ fl_line(x, y+j+h_flat-1, x+w, y+j+h_flat-1);
+ j++;
+  }
+}
+
+static void frame_rect_up(int x, int y, int w, int h, Fl_Color bc, float th) {
+  // Draw the outline around the perimeter of the box
+  //gleam_color(FL_BLACK);
+  gleam_color(fl_color_average(bc, FL_WHITE, th)); 
+  fl_line(x+1, y, x+w-1, y); //Go across the top
+  fl_line(x, y+h-1, x, y+1); //Go from bottom to top left side
+  gleam_color(fl_color_average(fl_darker(bc), FL_BLACK, th));
+  fl_line(x+1, y+h, x+w-1, y+h); //Go across the bottom
+  fl_line(x+w, y+h-1, x+w, y+1); //Go from bottom to top right side
+}
+
+static void frame_rect_down(int x, int y, int w, int h, Fl_Color bc, float th) 
{
+  // Draw the outline around the perimeter of the box
+  //gleam_color(FL_BLACK);
+  gleam_color(fl_color_average(fl_darker(bc), FL_BLACK, th));
+  fl_line(x+1, y, x+w-1, y); //Go across the top
+  fl_line(x, y+h-1, x, y+1); //Go from bottom to top left side
+  gleam_color(fl_color_average(bc, FL_WHITE, th));
+  fl_line(x+1, y+h, x+w-1, y+h); //Go across the bottom
+  fl_line(x+w, y+h-1, x+w, y+1); //Go from bottom to top right side
+}
+
+static void up_frame(int 

Re: [fltk.development] [RFE] STR #2672: Updated Gleam patch against FLTK1.3.x-r8816

2011-06-28 Thread Edmanuel Torres

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

[STR New]

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


New improvements to Gleam in the patch gleam-4.2-fltk-1.3-rev8842.patch. I
have debugged and cleaned up the code.


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

___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] [RFE] STR #2672: Updated Gleam patch against FLTK1.3.x-r8816

2011-06-28 Thread Edmanuel Torres

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

[STR New]

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


Check the screen shot of fl_gleam-4.2:

https://sites.google.com/site/eetorres/fl_gleam


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

___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] [RFE] STR #2672: Updated Gleam patch against FLTK1.3.x-r8816

2011-06-30 Thread Edmanuel Torres

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

[STR New]

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


I have put full gradient, I think it really looks better.


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

___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] [RFE] STR #2672: Updated Gleam patch against FLTK1.3.x-r8816

2011-06-30 Thread Edmanuel Torres
DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

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


Attached file "fl_gleam-4.2.1-fltk-1.3-rev8842.patch"...


Link: http://www.fltk.org/str.php?L2672
Version: 1.3-featureIndex: src/fl_gleam.cxx
===
--- src/fl_gleam.cxx(revision 0)
+++ src/fl_gleam.cxx(revision 0)
@@ -0,0 +1,163 @@
+//
+// "Gleam" drawing routines for the Fast Light Tool Kit (FLTK).
+//
+// These box types provide a sort of Clearlooks Glossy scheme
+// for FLTK.
+//
+// Copyright 2001-2005 by Colin Jones.
+//
+// Modified 2011 by Edmanuel Torres
+// This is a new fl_gleam theme. The gradients are on the top an the
+// bottom so the text area looks like in the classic FLTK way.
+//
+// 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
+//
+
+// Box drawing code for an obscure box type.
+// These box types are in seperate files so they are not linked
+// in if not used.
+
+#include 
+#include 
+#include 
+
+using namespace std;
+
+static void gleam_color(Fl_Color c) {
+  if (Fl::draw_box_active()) fl_color(c);
+  else fl_color(fl_inactive(c));
+}
+
+static void shade_rect_up(int x, int y, int w, int h, Fl_Color bc, float th) {
+  // Draws the shiny
+  int h_top  = h/2;
+  int h_bottom = h/2;
+  int h_flat = h-(h_top+h_bottom);
+  int j = 0;
+  float step_size_top = (0.999/(float)(h_top));
+  float step_size_bottom = (0.999/(float)(h_bottom));
+
+  // This loop generates the gradient at the top of the widget
+  for (float k = 1; k >= 0; k -= step_size_top){
+gleam_color(fl_color_average(fl_color_average(bc, FL_WHITE, th), bc, k));  
+fl_line(x, y+j, x+w, y+j);
+j++;
+  }
+  gleam_color(bc);
+  fl_rectf(x, y+h_top, w+1, h_flat);
+  // This loop generates the gradient at the bottom of the widget
+  for (float k = 1; k >= 0; k -= step_size_bottom){
+ //gleam_color(fl_color_average(bc, fl_color_average(bc, FL_WHITE, th), 
k));
+ gleam_color(fl_color_average(bc,fl_color_average(bc, FL_BLACK, th), k));
+ fl_line(x, y+j+h_flat-1, x+w, y+j+h_flat-1);
+ j++;
+  }
+}
+
+static void shade_rect_down(int x, int y, int w, int h, Fl_Color bc, float th) 
{
+  // Draws the shiny
+  int h_top  = (int)h/2;
+  int h_bottom = (int)h/2;
+  float h_flat = h-(h_top+h_bottom);
+  int j = 0;
+  float step_size_top = (0.999/(float)h_top);
+  float step_size_bottom = (0.999/(float)h_bottom);
+
+  // This loop generates the gradient at the top of the widget
+  for (float k = 1; k >= 0; k -= step_size_top){
+gleam_color(fl_color_average(fl_color_average(bc, FL_BLACK, th), bc, k));
+//gleam_color(fl_color_average(fl_color_average(bc, FL_WHITE, th), bc, k));
+fl_line(x, y+j, x+w, y+j);
+j++;
+  }
+  gleam_color(bc);
+  fl_rectf(x, y+h_top, w+1, h_flat);
+  // This loop generates the gradient at the bottom of the widget
+  for (float k = 1; k >= 0; k -= step_size_bottom){
+ gleam_color(fl_color_average(bc, fl_color_average(bc, FL_BLACK, th), k));
+ fl_line(x, y+j+h_flat-1, x+w, y+j+h_flat-1);
+ j++;
+  }
+}
+
+static void frame_rect_up(int x, int y, int w, int h, Fl_Color bc, float th) {
+  // Draw the outline around the perimeter of the box
+  //gleam_color(FL_BLACK);
+  gleam_color(fl_color_average(bc, FL_WHITE, th)); 
+  fl_line(x+1, y, x+w-1, y); //Go across the top
+  fl_line(x, y+h-1, x, y+1); //Go from bottom to top left side
+  gleam_color(fl_color_average(fl_darker(bc), FL_BLACK, th));
+  fl_line(x+1, y+h, x+w-1, y+h); //Go across the bottom
+  fl_line(x+w, y+h-1, x+w, y+1); //Go from bottom to top right side
+}
+
+static void frame_rect_down(int x, int y, int w, int h, Fl_Color bc, float th) 
{
+  // Draw the outline around the perimeter of the box
+  //gleam_color(FL_BLACK);
+  gleam_color(fl_color_average(fl_darker(bc), FL_BLACK, th));
+  fl_line(x+1, y, x+w-1, y); //Go across the top
+  fl_line(x, y+h-1, x, y+1); //Go from bottom to top left side
+  gleam_color(fl_color_average(bc, FL_WHITE, th));
+  fl_line(x+1, y+h, x+w-1, y+h); //Go across the bottom
+  fl_line(x+w, y+h-1, x+w, y+1); //Go from bottom to top right side
+}
+
+static void up_frame

Re: [fltk.development] [RFE] STR #2672: Updated Gleam patch against FLTK1.3.x-r8816

2011-08-04 Thread Edmanuel Torres
DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

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


Attached file "fl_gleam-4.3-fltk-1.3-rev8914.patch"...


Link: http://www.fltk.org/str.php?L2672
Version: 1.3-featureIndex: src/fl_gleam.cxx
===
--- src/fl_gleam.cxx(revision 0)
+++ src/fl_gleam.cxx(revision 0)
@@ -0,0 +1,175 @@
+//
+// "Gleam" drawing routines for the Fast Light Tool Kit (FLTK).
+//
+// These box types provide a sort of Clearlooks Glossy scheme
+// for FLTK.
+//
+// Copyright 2001-2005 by Colin Jones.
+//
+// Modified 2011 by Edmanuel Torres
+// This is a new fl_gleam theme. The gradients are on the top an the
+// bottom so the text area looks like in the classic FLTK way.
+//
+// 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
+//
+
+// Box drawing code for an obscure box type.
+// These box types are in seperate files so they are not linked
+// in if not used.
+
+#include 
+#include 
+#include 
+
+using namespace std;
+
+static void gleam_color(Fl_Color c) {
+  if (Fl::draw_box_active()) fl_color(c);
+  else fl_color(fl_inactive(c));
+}
+
+static void shade_rect_up(int x, int y, int w, int h, Fl_Color bc, float th) {
+  // Draws the shiny
+  int h_top  = h/2;
+  int h_bottom = h/6;
+  int h_flat = h-(h_top+h_bottom);
+  int j = 0;
+  float step_size_top = (0.999/(float)(h_top));
+  float step_size_bottom = (0.999/(float)(h_bottom));
+
+  // This loop generates the gradient at the top of the widget
+  for (float k = 1; k >= 0; k -= step_size_top){
+gleam_color(fl_color_average(fl_color_average(bc, FL_WHITE, th), bc, k));  
+//gleam_color(fl_color_average(FL_WHITE, bc, k));  
+fl_line(x, y+j, x+w, y+j);
+j++;
+  }
+  gleam_color(bc);
+  fl_rectf(x, y+h_top, w+1, h_flat);
+  // This loop generates the gradient at the bottom of the widget
+  for (float k = 1; k >= 0; k -= step_size_bottom){
+ //gleam_color(fl_color_average(bc, fl_color_average(bc, FL_WHITE, th), 
k));
+ gleam_color(fl_color_average(bc,fl_color_average(bc, FL_WHITE, th), k));
+ //gleam_color(fl_color_average(bc, FL_WHITE, k));
+ fl_line(x, y+j+h_flat-1, x+w, y+j+h_flat-1);
+ j++;
+  }
+}
+
+static void shade_rect_down(int x, int y, int w, int h, Fl_Color bc, float th) 
{
+  // Draws the shiny
+  int h_top  = (int)h/2;
+  int h_bottom = (int)h/6;
+  float h_flat = h-(h_top+h_bottom);
+  int j = 0;
+  float step_size_top = (0.999/(float)h_top);
+  float step_size_bottom = (0.999/(float)h_bottom);
+
+  // This loop generates the gradient at the top of the widget
+  for (float k = 1; k >= 0; k -= step_size_top){
+gleam_color(fl_color_average(fl_color_average(bc, FL_BLACK, th), bc, k));
+//gleam_color(fl_color_average(fl_color_average(bc, FL_WHITE, th), bc, k));
+fl_line(x, y+j, x+w, y+j);
+j++;
+  }
+  gleam_color(bc);
+  fl_rectf(x, y+h_top, w+1, h_flat);
+  // This loop generates the gradient at the bottom of the widget
+  for (float k = 1; k >= 0; k -= step_size_bottom){
+ //gleam_color(fl_color_average(fl_color_average(bc, FL_WHITE, th), bc, 
k));
+ gleam_color(fl_color_average(bc, fl_color_average(bc, FL_BLACK, th), k));
+ fl_line(x, y+j+h_flat-1, x+w, y+j+h_flat-1);
+ j++;
+  }
+}
+
+static void frame_rect_up(int x, int y, int w, int h, Fl_Color bc, float th1, 
float th2) {
+  // Draw the outline around the perimeter of the box
+  gleam_color(fl_color_average(fl_darker(bc), FL_BLACK, th1));
+  fl_line(x+1, y, x+w-1, y); //Go across the top
+  fl_line(x+1, y+h, x+w-1, y+h); //Go across the bottom
+  
+  gleam_color(fl_color_average(FL_BLACK, bc, th1));
+  fl_line(x, y+h-1, x, y+1); //Go from bottom to top left side
+  fl_line(x+w, y+h-1, x+w, y+1); //Go from bottom to top right side
+  //
+  gleam_color(fl_color_average(bc, FL_WHITE, th2));
+  fl_line(x+1, y+h-2, x+1, y+2); //Go from bottom to top left side
+  //gleam_color(fl_color_average(bc, FL_WHITE, th2));
+  fl_line(x+w-1, y+h-2, x+w-1, y+2); //Go from bottom to top right side
+}
+
+static void frame_rect_down(int x, int y, int w, int h, Fl_Color bc, float 
th1, float th2) {
+  // Draw th

Re: [fltk.development] [RFE] STR #2672: Updated Gleam patch against FLTK1.3.x-r8816

2011-08-04 Thread Edmanuel Torres

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

[STR New]

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


Updated Gleam patch to Gleam 4.3.


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

___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] [RFE] STR #2672: Updated Gleam patch against FLTK1.3.x-r8816

2011-09-09 Thread Colin Jones

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

[STR New]

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


Hello all,

I'm the original developer of the FLTK Gleam patch, and I just wanted to
explain a bit of my reasoning for doing things.

The patch does modify the FL_get_system_colours to change the default
colours, but I can easily remove this. I originally changed this because I
also found that the gleam was a bit hard on the eyes otherwise, but I've
more recently figured out how to change the widget colours through the
Xresources.

The reasoning for the gradient in the middle is so that it fits in better
with the Clearlooks GTK+ theme and other widget schemes use on my desktop.

Thanks,
Colin


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

___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] [RFE] STR #2672: Updated Gleam patch against FLTK1.3.x-r8816

2011-10-01 Thread Matthias Melcher

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

[STR New]

Link: http://www.fltk.org/str.php?L2672
Version: 1.4-feature


Thanks very much for sending this in. I will consider it for the next
version. Right now, we have to release two urgent fixes in 1.3.1 and 1.3.2
. After that, I am open to new features.

Again, thanks. Looks very pretty!


Link: http://www.fltk.org/str.php?L2672
Version: 1.4-feature

___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev


Re: [fltk.development] [RFE] STR #2672: Updated Gleam patch against FLTK1.3.x-r8816

2011-10-02 Thread Edmanuel Torres

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

[STR New]

Link: http://www.fltk.org/str.php?L2672
Version: 1.4-feature


Good to know. I am working in a slightly more rounded corners version, I am
keeping the code small and fast as possible, as the original GLEAM does! I
am removing the part that modify Fl_get_system_colors.cxx. I will only add
the .fl and then let FLUID generate the .cxx/.h at building time.


Link: http://www.fltk.org/str.php?L2672
Version: 1.4-feature

___
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev