diff options
| author | Michael R Sweet <michael.r.sweet@gmail.com> | 1998-12-02 15:39:39 +0000 |
|---|---|---|
| committer | Michael R Sweet <michael.r.sweet@gmail.com> | 1998-12-02 15:39:39 +0000 |
| commit | 849e11623e44a62599d62ba9425f7e96146f555d (patch) | |
| tree | d36643917eb5f059da6073b8eb07f202d24b0105 | |
| parent | db1205b420680cd6ee13372628cb4bbbb06f1e06 (diff) | |
Changes from Carl to get rid of default_ variables...
git-svn-id: file:///fltk/svn/fltk/trunk@106 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
| -rw-r--r-- | FL/Fl_Input_.H | 14 | ||||
| -rw-r--r-- | FL/Fl_Menu_.H | 11 | ||||
| -rw-r--r-- | FL/Fl_Widget.H | 12 | ||||
| -rw-r--r-- | FL/fl_draw.H | 5 | ||||
| -rw-r--r-- | configure.in | 23 | ||||
| -rw-r--r-- | src/Fl_Browser.cxx | 11 | ||||
| -rw-r--r-- | src/Fl_Browser_.cxx | 9 | ||||
| -rw-r--r-- | src/Fl_Choice.cxx | 6 | ||||
| -rw-r--r-- | src/Fl_Counter.cxx | 10 | ||||
| -rw-r--r-- | src/Fl_Input.cxx | 8 | ||||
| -rw-r--r-- | src/Fl_Input_.cxx | 6 | ||||
| -rw-r--r-- | src/Fl_Menu.cxx | 11 | ||||
| -rw-r--r-- | src/Fl_Menu_.cxx | 6 | ||||
| -rw-r--r-- | src/Fl_Output.cxx | 8 | ||||
| -rw-r--r-- | src/Fl_Value_Output.cxx | 10 | ||||
| -rw-r--r-- | src/Fl_Value_Slider.cxx | 8 | ||||
| -rw-r--r-- | src/fl_ask.cxx | 7 | ||||
| -rw-r--r-- | src/fl_file_chooser.cxx | 12 | ||||
| -rw-r--r-- | src/fl_font.cxx | 9 | ||||
| -rw-r--r-- | src/fl_font_win32.cxx | 9 | ||||
| -rw-r--r-- | src/fl_labeltype.cxx | 13 | ||||
| -rw-r--r-- | test/Makefile | 11 | ||||
| -rw-r--r-- | test/menubar.cxx | 18 | ||||
| -rw-r--r-- | test/style.C | 198 | ||||
| -rw-r--r-- | test/style_ui.fl | 343 |
25 files changed, 92 insertions, 686 deletions
diff --git a/FL/Fl_Input_.H b/FL/Fl_Input_.H index ec6da5f40..133b0a762 100644 --- a/FL/Fl_Input_.H +++ b/FL/Fl_Input_.H @@ -1,5 +1,5 @@ // -// "$Id: Fl_Input_.H,v 1.3 1998/10/21 14:19:15 mike Exp $" +// "$Id: Fl_Input_.H,v 1.4 1998/12/02 15:39:26 mike Exp $" // // Input base class header file for the Fast Light Tool Kit (FLTK). // @@ -62,9 +62,6 @@ class Fl_Input_ : public Fl_Widget { void minimal_update(int p); void put_in_buffer(int newsize); - static Fl_Boxtype default_box_; - static Fl_Font default_font_; - static int default_size_; void setfont() const; protected: @@ -118,17 +115,10 @@ public: void textcolor(uchar n) {textcolor_ = n;} Fl_Color cursor_color() const {return (Fl_Color)cursor_color_;} void cursor_color(uchar n) {cursor_color_ = n;} - - static void default_box(Fl_Boxtype b) {default_box_ = b;} - static Fl_Boxtype default_box() {return default_box_;} - static void default_font(Fl_Font b) {default_font_ = b;} - static Fl_Font default_font() {return default_font_;} - static void default_size(int b) {default_size_ = b;} - static int default_size() {return default_size_;} }; #endif // -// End of "$Id: Fl_Input_.H,v 1.3 1998/10/21 14:19:15 mike Exp $". +// End of "$Id: Fl_Input_.H,v 1.4 1998/12/02 15:39:26 mike Exp $". // diff --git a/FL/Fl_Menu_.H b/FL/Fl_Menu_.H index 61da9ec59..69165ef8e 100644 --- a/FL/Fl_Menu_.H +++ b/FL/Fl_Menu_.H @@ -1,5 +1,5 @@ // -// "$Id: Fl_Menu_.H,v 1.3 1998/10/21 14:19:18 mike Exp $" +// "$Id: Fl_Menu_.H,v 1.4 1998/12/02 15:39:27 mike Exp $" // // Menu base class header file for the Fast Light Tool Kit (FLTK). // @@ -35,8 +35,6 @@ class Fl_Menu_ : public Fl_Widget { Fl_Menu_Item *menu_; const Fl_Menu_Item *value_; - static Fl_Font default_font_; - static int default_size_; protected: @@ -83,11 +81,6 @@ public: Fl_Color textcolor() const {return (Fl_Color)textcolor_;} void textcolor(uchar c) {textcolor_=c;} - static void default_font(Fl_Font b) {default_font_ = b;} - static Fl_Font default_font() {return default_font_;} - static void default_size(int b) {default_size_ = b;} - static int default_size() {return default_size_;} - Fl_Boxtype down_box() const {return (Fl_Boxtype)down_box_;} void down_box(Fl_Boxtype b) {down_box_ = b;} @@ -99,5 +92,5 @@ public: #endif // -// End of "$Id: Fl_Menu_.H,v 1.3 1998/10/21 14:19:18 mike Exp $". +// End of "$Id: Fl_Menu_.H,v 1.4 1998/12/02 15:39:27 mike Exp $". // diff --git a/FL/Fl_Widget.H b/FL/Fl_Widget.H index 651943144..4fe429902 100644 --- a/FL/Fl_Widget.H +++ b/FL/Fl_Widget.H @@ -1,5 +1,5 @@ // -// "$Id: Fl_Widget.H,v 1.3 1998/10/21 14:19:42 mike Exp $" +// "$Id: Fl_Widget.H,v 1.4 1998/12/02 15:39:27 mike Exp $" // // Widget header file for the Fast Light Tool Kit (FLTK). // @@ -86,9 +86,6 @@ protected: void draw_label() const; void draw_label(int, int, int, int) const; - static Fl_Font default_font_; - static int default_size_; - public: virtual ~Fl_Widget(); @@ -142,11 +139,6 @@ public: Fl_When when() const {return (Fl_When)when_;} void when(uchar i) {when_ = i;} - static void default_font(Fl_Font b) {default_font_ = b;} - static Fl_Font default_font() {return default_font_;} - static void default_size(int b) {default_size_ = b;} - static int default_size() {return default_size_;} - int visible() const {return !(flags_&INVISIBLE);} int visible_r() const; void show(); @@ -198,5 +190,5 @@ public: #endif // -// End of "$Id: Fl_Widget.H,v 1.3 1998/10/21 14:19:42 mike Exp $". +// End of "$Id: Fl_Widget.H,v 1.4 1998/12/02 15:39:27 mike Exp $". // diff --git a/FL/fl_draw.H b/FL/fl_draw.H index 2d95499fc..e0531dbe5 100644 --- a/FL/fl_draw.H +++ b/FL/fl_draw.H @@ -1,5 +1,5 @@ // -// "$Id: fl_draw.H,v 1.3 1998/10/21 14:19:45 mike Exp $" +// "$Id: fl_draw.H,v 1.4 1998/12/02 15:39:28 mike Exp $" // // Portable drawing function header file for the Fast Light Tool Kit (FLTK). // @@ -108,7 +108,6 @@ void fl_transformed_vertex(double x, double y); // current font: void fl_font(int face, int size); -void fl_font(int face, int size, Fl_Font default_font, int default_size); extern int fl_font_; inline int fl_font() {return fl_font_;} extern int fl_size_; inline int fl_size() {return fl_size_;} @@ -157,5 +156,5 @@ int fl_add_symbol(const char* name, void (*drawit)(Fl_Color), int scalable); #endif // -// End of "$Id: fl_draw.H,v 1.3 1998/10/21 14:19:45 mike Exp $". +// End of "$Id: fl_draw.H,v 1.4 1998/12/02 15:39:28 mike Exp $". // diff --git a/configure.in b/configure.in index 1498b41f0..3fefcb05f 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ dnl# -*- sh -*- dnl# the "configure" script is made from this by running GNU "autoconf" dnl# -dnl# "$Id: configure.in,v 1.12 1998/11/05 16:17:39 mike Exp $" +dnl# "$Id: configure.in,v 1.13 1998/12/02 15:39:25 mike Exp $" dnl# dnl# Configuration script for the Fast Light Tool Kit (FLTK). dnl# @@ -36,7 +36,7 @@ else LIBCOMMAND="ar crs" fi -DEBUGFLAG="-O2" +DEBUGFLAG="" AC_ARG_ENABLE(debug, [ --enable-debug turn on debugging [default=no]],if eval "test x$enable_debug = xyes"; then DEBUGFLAG="-g" @@ -118,14 +118,19 @@ AC_CHECK_LIB(GL, glXMakeCurrent, AC_DEFINE(HAVE_GL) GLLIB=" -lGLU -lGL", \ -lX11 -lXext $X_EXTRA_LIBS -lm) AC_SUBST(GLLIB) -AC_CHECK_HEADER(X11/extensions/Xdbe.h, AC_DEFINE(HAVE_XDBE)) +AC_CHECK_HEADER(X11/extensions/Xdbe.h, \ + if [ `uname -s` = "SunOS" ]; then + echo Xdbe supported, but SunOS Xdbe is broken. + else + AC_DEFINE(HAVE_XDBE)) + fi) AC_CACHE_CHECK("for X overlay visuals", ac_cv_have_overlay, -if xprop -root 2>/dev/null | grep -c "SERVER_OVERLAY_VISUALS" >/dev/null; then - ac_cv_have_overlay=yes -else - ac_cv_have_overlay=no -fi) + if xprop -root 2>/dev/null | grep -c "SERVER_OVERLAY_VISUALS" >/dev/null; then + ac_cv_have_overlay=yes + else + ac_cv_have_overlay=no + fi) if test "$ac_cv_have_overlay" = yes; then AC_DEFINE(HAVE_OVERLAY) fi @@ -162,5 +167,5 @@ AC_CONFIG_HEADER(config.h:configh.in) AC_OUTPUT(makeinclude) dnl# -dnl# End of "$Id: configure.in,v 1.12 1998/11/05 16:17:39 mike Exp $". +dnl# End of "$Id: configure.in,v 1.13 1998/12/02 15:39:25 mike Exp $". dnl# diff --git a/src/Fl_Browser.cxx b/src/Fl_Browser.cxx index c6a7d1e70..816782a8b 100644 --- a/src/Fl_Browser.cxx +++ b/src/Fl_Browser.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Browser.cxx,v 1.3 1998/10/21 14:19:56 mike Exp $" +// "$Id: Fl_Browser.cxx,v 1.4 1998/12/02 15:39:29 mike Exp $" // // Browser widget for the Fast Light Tool Kit (FLTK). // @@ -29,7 +29,6 @@ #include <string.h> #include <stdlib.h> #include <math.h> -#include <FL/Fl_Input_.H> // for default_font // I modified this from the original Forms data to use a linked list // so that the number of items in the browser and size of those items @@ -213,7 +212,7 @@ int Fl_Browser::item_height(void* lv) const { case 'm': case 'M': t = 20; break; case 's': case 'S': t = 13; break; } - return t + Fl_Input_::default_size(); + return t; } int Fl_Browser::item_width(void* v) const { @@ -258,7 +257,7 @@ int Fl_Browser::item_width(void* v) const { break; } - fl_font(font, size, Fl_Input_::default_font(), Fl_Input_::default_size()); + fl_font(font, size); return w + int(fl_width(str)) + 6; } @@ -330,7 +329,7 @@ void Fl_Browser::item_draw(void* v, int x, int y, int w, int h) const { } } BREAK: - fl_font(font, size, Fl_Input_::default_font(), Fl_Input_::default_size()); + fl_font(font, size); if (!active_r()) lcol = inactive(lcol); if (((FL_BLINE*)v)->flags & SELECTED) lcol = contrast(lcol, selection_color()); @@ -441,5 +440,5 @@ int Fl_Browser::value() const { } // -// End of "$Id: Fl_Browser.cxx,v 1.3 1998/10/21 14:19:56 mike Exp $". +// End of "$Id: Fl_Browser.cxx,v 1.4 1998/12/02 15:39:29 mike Exp $". // diff --git a/src/Fl_Browser_.cxx b/src/Fl_Browser_.cxx index c8238984d..1cab16e53 100644 --- a/src/Fl_Browser_.cxx +++ b/src/Fl_Browser_.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Browser_.cxx,v 1.5 1998/11/08 15:05:45 mike Exp $" +// "$Id: Fl_Browser_.cxx,v 1.6 1998/12/02 15:39:29 mike Exp $" // // Base Browser widget class for the Fast Light Tool Kit (FLTK). // @@ -27,7 +27,6 @@ #include <FL/Fl_Widget.H> #include <FL/Fl_Browser_.H> #include <FL/fl_draw.H> -#include <FL/Fl_Input_.H> // for default_font // This is the base class for browsers. To be useful it must be // subclassed and several virtual functions defined. The @@ -66,7 +65,7 @@ int Fl_Browser_::scrollbar_width_ = 17; // return where to draw the actual box: void Fl_Browser_::bbox(int& X, int& Y, int& W, int& H) const { - Fl_Boxtype b = box() ? box() : Fl_Input_::default_box(); + Fl_Boxtype b = box() ? box() : FL_DOWN_BOX; X = x()+Fl::box_dx(b); Y = y()+Fl::box_dy(b); W = w()-Fl::box_dw(b); @@ -225,7 +224,7 @@ void Fl_Browser_::display(void* x) { void Fl_Browser_::draw() { int drawsquare = 0; if (damage() & FL_DAMAGE_ALL) { // redraw the box if full redraw - Fl_Boxtype b = box() ? box() : Fl_Input_::default_box(); + Fl_Boxtype b = box() ? box() : FL_DOWN_BOX; draw_box(b, x(), y(), w(), h(), color()); drawsquare = 1; } @@ -627,5 +626,5 @@ void Fl_Browser_::item_select(void*, int) {} int Fl_Browser_::item_selected(void* l) const {return l==selection_;} // -// End of "$Id: Fl_Browser_.cxx,v 1.5 1998/11/08 15:05:45 mike Exp $". +// End of "$Id: Fl_Browser_.cxx,v 1.6 1998/12/02 15:39:29 mike Exp $". // diff --git a/src/Fl_Choice.cxx b/src/Fl_Choice.cxx index 45f5f172f..5ab4b9cc6 100644 --- a/src/Fl_Choice.cxx +++ b/src/Fl_Choice.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Choice.cxx,v 1.4 1998/11/10 14:40:17 mike Exp $" +// "$Id: Fl_Choice.cxx,v 1.5 1998/12/02 15:39:30 mike Exp $" // // Choice widget for the Fast Light Tool Kit (FLTK). // @@ -38,7 +38,7 @@ void Fl_Choice::draw() { if (box() == FL_FLAT_BOX) return; // for XForms compatability int H = labelsize()/2+1; draw_box(FL_THIN_UP_BOX,x()+w()-3*H,y()+(h()-H)/2,2*H,H,color()); - fl_font(textfont(),textsize(),default_font(),default_size()); + fl_font(textfont(),textsize()); fl_color(active_r() ? textcolor() : inactive(textcolor())); fl_draw_shortcut = 2; // hack value to make '&' disappear int BW = Fl::box_dx(box()); @@ -85,5 +85,5 @@ int Fl_Choice::handle(int e) { } // -// End of "$Id: Fl_Choice.cxx,v 1.4 1998/11/10 14:40:17 mike Exp $". +// End of "$Id: Fl_Choice.cxx,v 1.5 1998/12/02 15:39:30 mike Exp $". // diff --git a/src/Fl_Counter.cxx b/src/Fl_Counter.cxx index 23899ef91..99bc92a32 100644 --- a/src/Fl_Counter.cxx +++ b/src/Fl_Counter.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Counter.cxx,v 1.4 1998/10/21 14:20:01 mike Exp $" +// "$Id: Fl_Counter.cxx,v 1.5 1998/12/02 15:39:30 mike Exp $" // // Counter widget for the Fast Light Tool Kit (FLTK). // @@ -26,13 +26,12 @@ #include <FL/Fl.H> #include <FL/Fl_Counter.H> #include <FL/fl_draw.H> -#include <FL/Fl_Input.H> // for default_font void Fl_Counter::draw() { int i; Fl_Boxtype boxtype[5]; boxtype[0] = box(); - if (boxtype[0] == FL_UP_BOX) boxtype[0] = Fl_Input::default_box(); + if (boxtype[0] == FL_UP_BOX) boxtype[0] = FL_DOWN_BOX; for (i=1; i<5; i++) if (mouseobj == i) boxtype[i] = down(box()); @@ -55,8 +54,7 @@ void Fl_Counter::draw() { } draw_box(boxtype[0], xx[0], y(), ww[0], h(), FL_WHITE); - fl_font(textfont(), textsize(), - Fl_Input::default_font(), Fl_Input::default_size()); + fl_font(textfont(), textsize()); fl_color(active_r() ? textcolor() : inactive(textcolor())); char str[128]; format(str); fl_draw(str, xx[0], y(), ww[0], h(), FL_ALIGN_CENTER); @@ -161,5 +159,5 @@ Fl_Counter::Fl_Counter(int x, int y, int w, int h, const char* l) } // -// End of "$Id: Fl_Counter.cxx,v 1.4 1998/10/21 14:20:01 mike Exp $". +// End of "$Id: Fl_Counter.cxx,v 1.5 1998/12/02 15:39:30 mike Exp $". // diff --git a/src/Fl_Input.cxx b/src/Fl_Input.cxx index 02e4513e6..88f4d7152 100644 --- a/src/Fl_Input.cxx +++ b/src/Fl_Input.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Input.cxx,v 1.4 1998/10/21 14:20:08 mike Exp $" +// "$Id: Fl_Input.cxx,v 1.5 1998/12/02 15:39:31 mike Exp $" // // Input widget for the Fast Light Tool Kit (FLTK). // @@ -38,7 +38,7 @@ void Fl_Input::draw() { if (type() == FL_HIDDEN_INPUT) return; - Fl_Boxtype b = box() ? box() : default_box(); + Fl_Boxtype b = box() ? box() : FL_DOWN_BOX; if (damage() & FL_DAMAGE_ALL) draw_box(b, color()); Fl_Input_::drawtext(x()+Fl::box_dx(b)+3, y()+Fl::box_dy(b), w()-Fl::box_dw(b)-6, h()-Fl::box_dh(b)); @@ -312,7 +312,7 @@ int Fl_Input::handle(int event) { if (Fl::event_button() == 2) return 0; break; } - Fl_Boxtype b = box() ? box() : default_box(); + Fl_Boxtype b = box() ? box() : FL_DOWN_BOX; return Fl_Input_::handletext(event, x()+Fl::box_dx(b)+3, y()+Fl::box_dy(b), w()-Fl::box_dw(b)-6, h()-Fl::box_dh(b)); @@ -322,5 +322,5 @@ Fl_Input::Fl_Input(int x, int y, int w, int h, const char *l) : Fl_Input_(x, y, w, h, l) {} // -// End of "$Id: Fl_Input.cxx,v 1.4 1998/10/21 14:20:08 mike Exp $". +// End of "$Id: Fl_Input.cxx,v 1.5 1998/12/02 15:39:31 mike Exp $". // diff --git a/src/Fl_Input_.cxx b/src/Fl_Input_.cxx index 72a06e249..db50e4e75 100644 --- a/src/Fl_Input_.cxx +++ b/src/Fl_Input_.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Input_.cxx,v 1.9 1998/11/18 17:26:43 mike Exp $" +// "$Id: Fl_Input_.cxx,v 1.10 1998/12/02 15:39:31 mike Exp $" // // Common input widget routines for the Fast Light Tool Kit (FLTK). // @@ -128,7 +128,7 @@ static double up_down_pos; static int was_up_down; void Fl_Input_::setfont() const { - fl_font(textfont(), textsize(), default_font(), default_size()); + fl_font(textfont(), textsize()); } void Fl_Input_::drawtext(int X, int Y, int W, int H) { @@ -727,5 +727,5 @@ Fl_Input_::~Fl_Input_() { } // -// End of "$Id: Fl_Input_.cxx,v 1.9 1998/11/18 17:26:43 mike Exp $". +// End of "$Id: Fl_Input_.cxx,v 1.10 1998/12/02 15:39:31 mike Exp $". // diff --git a/src/Fl_Menu.cxx b/src/Fl_Menu.cxx index 067fdffc0..8e37b8171 100644 --- a/src/Fl_Menu.cxx +++ b/src/Fl_Menu.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Menu.cxx,v 1.6 1998/11/10 14:40:17 mike Exp $" +// "$Id: Fl_Menu.cxx,v 1.7 1998/12/02 15:39:32 mike Exp $" // // Menu code for the Fast Light Tool Kit (FLTK). // @@ -111,9 +111,7 @@ int Fl_Menu_Item::measure(int* hp, const Fl_Menu_* m) const { l.value = text; l.type = labeltype_; l.font = labelsize_ ? labelfont_ : uchar(m ? m->textfont() : FL_HELVETICA); - if (l.font < 4) l.font = (Fl_Font)(l.font | Fl_Menu_::default_font()); l.size = labelsize_ ? labelsize_ : m ? m->textsize() : FL_NORMAL_SIZE; - l.size += Fl_Menu_::default_size(); l.color = labelcolor_; fl_draw_shortcut = 1; int w = 0; int h = 0; l.measure(w, hp ? *hp : h); @@ -128,9 +126,7 @@ void Fl_Menu_Item::draw(int x, int y, int w, int h, const Fl_Menu_* m, l.value = text; l.type = labeltype_; l.font = labelsize_ ? labelfont_ : uchar(m ? m->textfont() : FL_HELVETICA); - if (l.font < 4) l.font = (Fl_Font)(l.font | Fl_Menu_::default_font()); l.size = labelsize_ ? labelsize_ : m ? m->textsize() : FL_NORMAL_SIZE; - l.size += Fl_Menu_::default_size(); l.color = !active() ? (labelcolor_|8) : labelcolor_; Fl_Color color = m ? m->color() : FL_GRAY; if (selected) { @@ -311,8 +307,7 @@ void menuwindow::drawentry(const Fl_Menu_Item* m, int i, int erase) { fl_polygon(x+w-13, y1+2, x+w-13, y1+2+10, x+w-3, y1+2+5); } else if (m->shortcut_) { Fl_Font f = button ? button->textfont() : FL_HELVETICA; - fl_font(f, button ? button->textsize() : FL_NORMAL_SIZE, - Fl_Menu_::default_font(), Fl_Menu_::default_size()); + fl_font(f, button ? button->textsize() : FL_NORMAL_SIZE); fl_draw(fl_shortcut_label(m->shortcut_), x, y, w-3, h, FL_ALIGN_RIGHT); } @@ -708,5 +703,5 @@ const Fl_Menu_Item* Fl_Menu_Item::test_shortcut() const { } // -// End of "$Id: Fl_Menu.cxx,v 1.6 1998/11/10 14:40:17 mike Exp $". +// End of "$Id: Fl_Menu.cxx,v 1.7 1998/12/02 15:39:32 mike Exp $". // diff --git a/src/Fl_Menu_.cxx b/src/Fl_Menu_.cxx index 9b0e736d3..9e9b8b20b 100644 --- a/src/Fl_Menu_.cxx +++ b/src/Fl_Menu_.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Menu_.cxx,v 1.3 1998/10/21 14:20:11 mike Exp $" +// "$Id: Fl_Menu_.cxx,v 1.4 1998/12/02 15:39:32 mike Exp $" // // Common menu code for the Fast Light Tool Kit (FLTK). // @@ -34,8 +34,6 @@ #include <FL/Fl_Menu_.H> #include <stdlib.h> -Fl_Font Fl_Menu_::default_font_; -int Fl_Menu_::default_size_; int Fl_Menu_::value(const Fl_Menu_Item* m) { clear_changed(); @@ -117,5 +115,5 @@ Fl_Menu_::~Fl_Menu_() { } // -// End of "$Id: Fl_Menu_.cxx,v 1.3 1998/10/21 14:20:11 mike Exp $". +// End of "$Id: Fl_Menu_.cxx,v 1.4 1998/12/02 15:39:32 mike Exp $". // diff --git a/src/Fl_Output.cxx b/src/Fl_Output.cxx index 826d197d0..fb1cf3b07 100644 --- a/src/Fl_Output.cxx +++ b/src/Fl_Output.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Output.cxx,v 1.4 1998/10/21 14:20:15 mike Exp $" +// "$Id: Fl_Output.cxx,v 1.5 1998/12/02 15:39:33 mike Exp $" // // Output widget for the Fast Light Tool Kit (FLTK). // @@ -31,7 +31,7 @@ #include <FL/fl_draw.H> void Fl_Output::draw() { - Fl_Boxtype b = box() ? box() : default_box(); + Fl_Boxtype b = box() ? box() : FL_DOWN_BOX; if (damage() & FL_DAMAGE_ALL) draw_box(b, color()); Fl_Input_::drawtext(x()+Fl::box_dx(b)+3, y()+Fl::box_dy(b), w()-Fl::box_dw(b)-6, h()-Fl::box_dh(b)); @@ -39,12 +39,12 @@ void Fl_Output::draw() { int Fl_Output::handle(int event) { if (event == FL_FOCUS) return 0; - Fl_Boxtype b = box() ? box() : default_box(); + Fl_Boxtype b = box() ? box() : FL_DOWN_BOX; return Fl_Input_::handletext(event, x()+Fl::box_dx(b)+3, y()+Fl::box_dy(b), w()-Fl::box_dw(b)-6, h()-Fl::box_dh(b)); } // -// End of "$Id: Fl_Output.cxx,v 1.4 1998/10/21 14:20:15 mike Exp $". +// End of "$Id: Fl_Output.cxx,v 1.5 1998/12/02 15:39:33 mike Exp $". // diff --git a/src/Fl_Value_Output.cxx b/src/Fl_Value_Output.cxx index 54fd90bc2..0276f921b 100644 --- a/src/Fl_Value_Output.cxx +++ b/src/Fl_Value_Output.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Value_Output.cxx,v 1.4 1998/10/21 14:20:25 mike Exp $" +// "$Id: Fl_Value_Output.cxx,v 1.5 1998/12/02 15:39:34 mike Exp $" // // Value output widget for the Fast Light Tool Kit (FLTK). // @@ -30,10 +30,9 @@ #include <FL/Fl.H> #include <FL/Fl_Value_Output.H> #include <FL/fl_draw.H> -#include <FL/Fl_Input.H> // for default_font void Fl_Value_Output::draw() { - Fl_Boxtype b = box() ? box() : Fl_Input::default_box(); + Fl_Boxtype b = box() ? box() : FL_DOWN_BOX; int X = x()+Fl::box_dx(b); int Y = y()+Fl::box_dy(b); int W = w()-Fl::box_dw(b); @@ -47,8 +46,7 @@ void Fl_Value_Output::draw() { char buf[128]; format(buf); fl_color(active_r() ? textcolor() : inactive(textcolor())); - fl_font(textfont(), textsize(), - Fl_Input::default_font(), Fl_Input::default_size()); + fl_font(textfont(), textsize()); fl_draw(buf,X+3,Y,W-6,H,FL_ALIGN_LEFT); } @@ -96,5 +94,5 @@ Fl_Value_Output::Fl_Value_Output(int x,int y,int w,int h,const char *l) } // -// End of "$Id: Fl_Value_Output.cxx,v 1.4 1998/10/21 14:20:25 mike Exp $". +// End of "$Id: Fl_Value_Output.cxx,v 1.5 1998/12/02 15:39:34 mike Exp $". // diff --git a/src/Fl_Value_Slider.cxx b/src/Fl_Value_Slider.cxx index a035d5d2c..26c39cee0 100644 --- a/src/Fl_Value_Slider.cxx +++ b/src/Fl_Value_Slider.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Value_Slider.cxx,v 1.3 1998/10/21 14:20:25 mike Exp $" +// "$Id: Fl_Value_Slider.cxx,v 1.4 1998/12/02 15:39:34 mike Exp $" // // Value slider widget for the Fast Light Tool Kit (FLTK). // @@ -27,7 +27,6 @@ #include <FL/Fl_Value_Slider.H> #include <FL/fl_draw.H> #include <math.h> -#include <FL/Fl_Input_.H> // for default_font Fl_Value_Slider::Fl_Value_Slider(int x,int y,int w,int h, const char*l) : Fl_Slider(x,y,w,h,l) { @@ -49,8 +48,7 @@ void Fl_Value_Slider::draw() { draw_box(box(),bxx,byy,bww,bhh,color()); char buf[128]; format(buf); - fl_font(textfont(), textsize(), - Fl_Input_::default_font(), Fl_Input_::default_size()); + fl_font(textfont(), textsize()); fl_color(active_r() ? textcolor() : inactive(textcolor())); fl_draw(buf, bxx, byy, bww, bhh, FL_ALIGN_CLIP); } @@ -66,5 +64,5 @@ int Fl_Value_Slider::handle(int event) { } // -// End of "$Id: Fl_Value_Slider.cxx,v 1.3 1998/10/21 14:20:25 mike Exp $". +// End of "$Id: Fl_Value_Slider.cxx,v 1.4 1998/12/02 15:39:34 mike Exp $". // diff --git a/src/fl_ask.cxx b/src/fl_ask.cxx index 81d6b7b1d..e6a9d8e8c 100644 --- a/src/fl_ask.cxx +++ b/src/fl_ask.cxx @@ -1,5 +1,5 @@ // -// "$Id: fl_ask.cxx,v 1.5 1998/11/12 14:16:57 mike Exp $" +// "$Id: fl_ask.cxx,v 1.6 1998/12/02 15:39:35 mike Exp $" // // Standard dialog functions for the Fast Light Tool Kit (FLTK). // @@ -95,9 +95,8 @@ static int innards(const char* fmt, va_list ap, message->label(buffer); } Fl_Font f = (Fl_Font)fl_message_font_; - if (!f) f = Fl_Input_::default_font(); message->labelfont(f); - message->labelsize(fl_message_size_ + Fl_Input::default_size()); + message->labelsize(fl_message_size_); if (b0) {button[0]->show();button[0]->label(b0);button[1]->position(210,70);} else {button[0]->hide(); button[1]->position(310,70);} if (b1) {button[1]->show(); button[1]->label(b1);} @@ -196,5 +195,5 @@ const char *fl_password(const char *fmt, const char *defstr, ...) { } // -// End of "$Id: fl_ask.cxx,v 1.5 1998/11/12 14:16:57 mike Exp $". +// End of "$Id: fl_ask.cxx,v 1.6 1998/12/02 15:39:35 mike Exp $". // diff --git a/src/fl_file_chooser.cxx b/src/fl_file_chooser.cxx index 6ea787e07..a6c89d6ac 100644 --- a/src/fl_file_chooser.cxx +++ b/src/fl_file_chooser.cxx @@ -1,5 +1,5 @@ // -// "$Id: fl_file_chooser.cxx,v 1.7 1998/11/18 18:39:13 mike Exp $" +// "$Id: fl_file_chooser.cxx,v 1.8 1998/12/02 15:39:35 mike Exp $" // // File chooser widget for the Fast Light Tool Kit (FLTK). // @@ -192,13 +192,13 @@ void FCB::item_draw(void* v, int x, int y, int, int h) const { if (checkdir(p, (char*)e)) e++; if (v == selection()) fl_color(contrast(textcolor(), selection_color())); else fl_color(textcolor()); - fl_font(textfont(), textsize(), default_font(), default_size()); + fl_font(textfont(), textsize()); fl_draw(p->d_name, e-p->d_name, x+4, y+h-3); } int FCB::item_width(const dirent* p) const { const char* e = end_of_name(p); if (*e == '/') e++; - fl_font(textfont(), textsize(), default_font(), default_size()); + fl_font(textfont(), textsize()); return (int)fl_width(p->d_name, e-p->d_name)+4; } @@ -341,10 +341,10 @@ void FCB::draw() { if (full_height() > 0) return; message = "No matching files"; } - Fl_Boxtype b = box(); if (!b) b = Fl_Input_::default_box(); + Fl_Boxtype b = box(); if (!b) b = FL_DOWN_BOX; draw_box(b,color()); fl_color(FL_INACTIVE_COLOR); - fl_font(textfont(), textsize(), default_font(), default_size()); + fl_font(textfont(), textsize()); fl_draw(message, x()+7, y()+3, w(), h()-3, FL_ALIGN_TOP_LEFT); // insure scrollbars are redrawn if error message goes away: scrollbar.redraw(); @@ -614,5 +614,5 @@ char* fl_file_chooser(const char* message, const char* pat, const char* fname) } // -// End of "$Id: fl_file_chooser.cxx,v 1.7 1998/11/18 18:39:13 mike Exp $". +// End of "$Id: fl_file_chooser.cxx,v 1.8 1998/12/02 15:39:35 mike Exp $". // diff --git a/src/fl_font.cxx b/src/fl_font.cxx index 3faa852a5..d8b0a6ac3 100644 --- a/src/fl_font.cxx +++ b/src/fl_font.cxx @@ -1,5 +1,5 @@ // -// "$Id: fl_font.cxx,v 1.3 1998/10/21 14:20:51 mike Exp $" +// "$Id: fl_font.cxx,v 1.4 1998/12/02 15:39:36 mike Exp $" // // Font selection code for the Fast Light Tool Kit (FLTK). // @@ -250,11 +250,6 @@ void fl_font(int fnum, int size) { if (f != fl_current_xfont) {fl_current_xfont = f; font_gc = 0;} } -void fl_font(int fnum, int size, Fl_Font default_font, int default_size) { - if (fnum<4) fnum |= default_font; - fl_font(fnum, size + default_size); -} - int fl_height() { return (fl_current_xfont->font->ascent + fl_current_xfont->font->descent); } @@ -305,5 +300,5 @@ void fl_draw(const char *str, int x, int y) { #endif // -// End of "$Id: fl_font.cxx,v 1.3 1998/10/21 14:20:51 mike Exp $". +// End of "$Id: fl_font.cxx,v 1.4 1998/12/02 15:39:36 mike Exp $". // diff --git a/src/fl_font_win32.cxx b/src/fl_font_win32.cxx index 707b73a90..c37acac17 100644 --- a/src/fl_font_win32.cxx +++ b/src/fl_font_win32.cxx @@ -1,5 +1,5 @@ // -// "$Id: fl_font_win32.cxx,v 1.5 1998/10/21 14:20:52 mike Exp $" +// "$Id: fl_font_win32.cxx,v 1.6 1998/12/02 15:39:36 mike Exp $" // // WIN32 font selection routines for the Fast Light Tool Kit (FLTK). // @@ -140,11 +140,6 @@ void fl_font(int fnum, int size) { fl_current_xfont = find(fnum, size); } -void fl_font(int fnum, int size, Fl_Font default_font, int default_size) { - if (fnum<4) fnum |= default_font; - fl_font(fnum, size + default_size); -} - int fl_height() { return (fl_current_xfont->metr.tmAscent + fl_current_xfont->metr.tmDescent); } @@ -180,5 +175,5 @@ void fl_draw(const char *str, int x, int y) { } // -// End of "$Id: fl_font_win32.cxx,v 1.5 1998/10/21 14:20:52 mike Exp $". +// End of "$Id: fl_font_win32.cxx,v 1.6 1998/12/02 15:39:36 mike Exp $". // diff --git a/src/fl_labeltype.cxx b/src/fl_labeltype.cxx index d094a2759..b9f8ace53 100644 --- a/src/fl_labeltype.cxx +++ b/src/fl_labeltype.cxx @@ -1,5 +1,5 @@ // -// "$Id: fl_labeltype.cxx,v 1.3 1998/10/21 14:20:53 mike Exp $" +// "$Id: fl_labeltype.cxx,v 1.4 1998/12/02 15:39:37 mike Exp $" // // Label drawing routines for the Fast Light Tool Kit (FLTK). // @@ -102,17 +102,12 @@ void Fl_Widget::draw_label(int X, int Y, int W, int H) const { draw_label(X,Y,W,H,align()); } -Fl_Font Fl_Widget::default_font_; -int Fl_Widget::default_size_; - // Anybody can call this to force the label to draw anywhere: extern char fl_draw_shortcut; void Fl_Widget::draw_label(int X, int Y, int W, int H, Fl_Align a) const { if (flags()&SHORTCUT_LABEL) fl_draw_shortcut = 1; Fl_Label l1 = label_; if (!active_r()) l1.color |= 8; - if (l1.font<4) l1.font |= default_font_; - l1.size += default_size_; l1.draw(X,Y,W,H,a); fl_draw_shortcut = 0; } @@ -121,10 +116,6 @@ void Fl_Widget::draw_label(int X, int Y, int W, int H, Fl_Align a) const { // Fl_Input_ code: #include <FL/Fl_Input_.H> -Fl_Boxtype Fl_Input_::default_box_ = FL_DOWN_BOX; -Fl_Font Fl_Input_::default_font_; -int Fl_Input_::default_size_; - // -// End of "$Id: fl_labeltype.cxx,v 1.3 1998/10/21 14:20:53 mike Exp $". +// End of "$Id: fl_labeltype.cxx,v 1.4 1998/12/02 15:39:37 mike Exp $". // diff --git a/test/Makefile b/test/Makefile index b8f435851..0057258c6 100644 --- a/test/Makefile +++ b/test/Makefile @@ -1,5 +1,5 @@ # -# "$Id: Makefile,v 1.11 1998/10/21 22:03:53 mike Exp $" +# "$Id: Makefile,v 1.12 1998/12/02 15:39:38 mike Exp $" # # Test/example program makefile for the Fast Light Tool Kit (FLTK). # @@ -33,7 +33,7 @@ CPPFILES =\ minimum.C navigation.C output.C overlay.C pixmap.C \ pixmap_browser.C radio.C resizebox.C scroll.C shape.C shiny.C \ subwindow.C symbols.C tabs.C tile.C valuators.C fast_slow.C \ - resize.C pack.C inactive.C style.C + resize.C pack.C inactive.C ALL = adjuster arc ask bitmap boxtype browser button buttons checkers \ clock colbrowser color_chooser cube cursor curve demo doublebuffer \ @@ -41,7 +41,7 @@ ALL = adjuster arc ask bitmap boxtype browser button buttons checkers \ hello iconize image input keyboard label list_visuals mandelbrot \ menubar message minimum navigation output overlay pixmap \ pixmap_browser radio resizebox scroll shape shiny subwindow \ - symbols tabs tile valuators fast_slow resize pack inactive style + symbols tabs tile valuators fast_slow resize pack inactive all: $(ALL) @@ -94,9 +94,6 @@ keyboard: keyboard.C keyboard_ui.C mandelbrot: mandelbrot.C mandelbrot_ui.C @echo $@: @$(CXX) -I.. $(CXXFLAGS) mandelbrot.C -L../lib -lfltk $(LDLIBS) -o $@ -style: style.C style_ui.C - @echo $@: - @$(CXX) -I.. $(CXXFLAGS) style.C -L../lib -lfltk $(LDLIBS) -o $@ # If you have libjpeg installed, you might want to try this test program: @@ -114,5 +111,5 @@ install: @echo Nothing to install in test directory. # -# End of "$Id: Makefile,v 1.11 1998/10/21 22:03:53 mike Exp $". +# End of "$Id: Makefile,v 1.12 1998/12/02 15:39:38 mike Exp $". # diff --git a/test/menubar.cxx b/test/menubar.cxx index 9296d29e5..f94d37e5c 100644 --- a/test/menubar.cxx +++ b/test/menubar.cxx @@ -1,5 +1,5 @@ // -// "$Id: menubar.cxx,v 1.3 1998/10/21 14:21:34 mike Exp $" +// "$Id: menubar.cxx,v 1.4 1998/12/02 15:39:38 mike Exp $" // // Menubar test program for the Fast Light Tool Kit (FLTK). // @@ -167,11 +167,17 @@ Fl_Menu_* menus[4]; // turn MicroSoft style on/off void button_cb(Fl_Widget* w, void*) { if (((Fl_Button*)w)->value()) { - Fl::set_color(FL_SELECTION_COLOR, 0, 36, 127); - Fl_Menu_::default_font(FL_HELVETICA); + for (int i = 0; i < 4; i++) { + menus[i]->down_box(FL_FLAT_BOX); + menus[i]->selection_color(137); + menus[i]->textfont(FL_HELVETICA); + } } else { - Fl::set_color(FL_SELECTION_COLOR, 170, 170, 170); - Fl_Menu_::default_font(FL_HELVETICA_BOLD_ITALIC); + for (int i = 0; i < 4; i++) { + menus[i]->down_box(FL_NO_BOX); + menus[i]->selection_color(FL_WHITE); + menus[i]->textfont(FL_BOLD|FL_ITALIC); + } } menus[0]->parent()->redraw(); } @@ -207,5 +213,5 @@ int main(int argc, char **argv) { } // -// End of "$Id: menubar.cxx,v 1.3 1998/10/21 14:21:34 mike Exp $". +// End of "$Id: menubar.cxx,v 1.4 1998/12/02 15:39:38 mike Exp $". // diff --git a/test/style.C b/test/style.C deleted file mode 100644 index 7d9a0efa9..000000000 --- a/test/style.C +++ /dev/null @@ -1,198 +0,0 @@ -// -// "$Id: style.C,v 1.4 1998/11/08 15:05:48 mike Exp $" -// -// Style demo for the Fast Light Tool Kit (FLTK). -// -// Demo of a control panel for Fltk "style" changes. -// -// You can use this as-is, or modify it to your needs. -// -// To save & restore a style you should write the data to a file of -// your own design. Most likely your program has it's own configuration -// that you want to save as well, and it is user friendly to put all -// this into the same file. -// -// Copyright 1998 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// 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 to "fltk-bugs@easysw.com". -// - -//////////////////////////////////////////////////////////////// -// This is the part you want to copy to another program. The -// program should call "show_style_panel()" in response to a button -// that the user presses. - -#include "style_ui.C" -#include <FL/Fl_Color_Chooser.H> -#include <FL/fl_draw.H> -#include <config.h> -#include <string.h> - -Fl_Menu_Item* font_menu() { - static Fl_Menu_Item* menu; - if (menu) return menu; - int k = Fl::set_fonts(/*"*"*/); - menu = new Fl_Menu_Item[k+1]; - memset(menu, 0, (k+1)*sizeof(Fl_Menu_Item)); - for (int i = 0; i < k; i++) { - int t; const char *name = Fl::get_font_name((Fl_Font)i,&t); - char buf[256]; - strcpy(buf, name); - if (t & FL_BOLD) strcat(buf," bold"); - if (t & FL_ITALIC) strcat(buf," italic"); - menu[i].text = strdup(buf); - } - return menu; -} - -void font_cb(Fl_Choice* c, long i) { - Fl_Font n = Fl_Font(c->value()); - switch (i) { - case 2: Fl_Menu_::default_font(n); break; - case 1: Fl_Input_::default_font(n); break; - default: Fl_Widget::default_font(n); break; - } - Fl::redraw(); -} - -void font_size_cb(Fl_Value_Input* c, long i) { - int n = int(c->value()); if (n <= 0) n = 1; n -= FL_NORMAL_SIZE; - switch (i) { - case 2: Fl_Menu_::default_size(n); break; - case 1: Fl_Input_::default_size(n); break; - default: Fl_Widget::default_size(n); break; - } - Fl::redraw(); -} - -void color_button_cb(Fl_Button* w, void*) { - Fl_Color c = w->color(); - uchar r,g,b; Fl::get_color(c, r,g,b); - if (fl_color_chooser(0,r,g,b)) { - if (c == FL_GRAY) Fl::background(r,g,b); - else Fl::set_color(c,r,g,b); - Fl::redraw(); - } -} - -// functions hidden inside fl_boxtype.C: -void fl_thin_down_frame(int, int, int, int, Fl_Color); -void fl_thin_up_frame(int, int, int, int, Fl_Color); -void fl_thin_down_box(int, int, int, int, Fl_Color); -void fl_thin_up_box(int, int, int, int, Fl_Color); -void fl_down_frame(int, int, int, int, Fl_Color); -void fl_up_frame(int, int, int, int, Fl_Color); -void fl_down_box(int, int, int, int, Fl_Color); -void fl_up_box(int, int, int, int, Fl_Color); - -#if BORDER_WIDTH == 3 - -#define fl_3_up_frame fl_up_frame -#define fl_3_up_box fl_up_box -#define fl_3_down_frame fl_down_frame -#define fl_3_down_box fl_down_box - -// define the 2-pixel boxes: -void fl_2_up_frame(int x, int y, int w, int h, Fl_Color) { - fl_frame2("AAUWMMSS",x,y,w,h); -} -void fl_2_up_box(int x, int y, int w, int h, Fl_Color c) { - fl_2_up_frame(x,y,w,h,c); - fl_color(c); fl_rectf(x+2, y+2, w-4, h-4); -} -void fl_2_down_frame(int x, int y, int w, int h, Fl_Color) { - fl_frame2("UWMMPPAA",x,y,w,h); -} -void fl_2_down_box(int x, int y, int w, int h, Fl_Color c) { - fl_2_down_frame(x,y,w,h,c); - fl_color(c); fl_rectf(x+2, y+2, w-4, h-4); -} - -#else - -#define fl_2_up_frame fl_up_frame -#define fl_2_up_box fl_up_box -#define fl_2_down_frame fl_down_frame -#define fl_2_down_box fl_down_box - -// define the 3-pixel boxes: -void fl_3_up_frame(int x, int y, int w, int h, Fl_Color) { - fl_frame("AAAAWUJJUSNN",x,y,w,h); -} -void fl_3_up_box(int x, int y, int w, int h, Fl_Color c) { - fl_3_up_frame(x,y,w,h,c); - fl_color(c); fl_rectf(x+3, y+3, w-6, h-6); -} -void fl_3_down_frame(int x, int y, int w, int h, Fl_Color) { - fl_frame("NNSUJJUWAAAA",x,y,w,h); -} -void fl_3_down_box(int x, int y, int w, int h, Fl_Color c) { - fl_3_down_frame(x,y,w,h,c); - fl_color(c); fl_rectf(x+3, y+3, w-6, h-6); -} - -#endif - -void box_thickness_cb(Fl_Value_Slider*v, void*) { - switch (int(v->value())) { - case 1: - Fl::set_boxtype(FL_UP_BOX, fl_thin_up_box, 1,1,2,2); - Fl::set_boxtype(FL_DOWN_BOX, fl_thin_down_box, 1,1,2,2); - Fl::set_boxtype(FL_UP_FRAME, fl_thin_up_frame, 1,1,2,2); - Fl::set_boxtype(FL_DOWN_FRAME, fl_thin_down_frame, 1,1,2,2); - break; - case 2: - Fl::set_boxtype(FL_UP_BOX, fl_2_up_box, 2,2,4,4); - Fl::set_boxtype(FL_DOWN_BOX, fl_2_down_box, 2,2,4,4); - Fl::set_boxtype(FL_UP_FRAME, fl_2_up_frame, 2,2,4,4); - Fl::set_boxtype(FL_DOWN_FRAME, fl_2_down_frame, 2,2,4,4); - break; - default: - Fl::set_boxtype(FL_UP_BOX, fl_3_up_box, 3,3,6,6); - Fl::set_boxtype(FL_DOWN_BOX, fl_3_down_box, 3,3,6,6); - Fl::set_boxtype(FL_UP_FRAME, fl_3_up_frame, 3,3,6,6); - Fl::set_boxtype(FL_DOWN_FRAME, fl_3_down_frame, 3,3,6,6); - break; - } - Fl::redraw(); -} - -void text_box_thickness_cb(Fl_Value_Slider* v, void*) { - int n = int(v->value()); - switch (n) { - case 0: Fl_Input_::default_box(FL_FLAT_BOX); break; - case 1: Fl_Input_::default_box(FL_THIN_DOWN_BOX); break; - case 2: Fl_Input_::default_box(FL_DOWN_BOX); break; - } - Fl::redraw(); -} - -void scrollbar_thickness_cb(Fl_Value_Slider* v, void*) { - Fl_Browser::scrollbar_width(int(v->value())); - Fl::redraw(); -} - -#include <FL/fl_ask.H> - -void defaults_cb(Fl_Button*, void*) { - fl_alert("Sorry, I didn't implement that"); -} - -// -// End of "$Id: style.C,v 1.4 1998/11/08 15:05:48 mike Exp $". -// diff --git a/test/style_ui.fl b/test/style_ui.fl deleted file mode 100644 index 7eb67ef15..000000000 --- a/test/style_ui.fl +++ /dev/null @@ -1,343 +0,0 @@ -# data file for the Fltk User Interface Designer (fluid) -version 0.99 -header_name {.H} -code_name {.C} -gridx 5 -gridy 5 -snap 3 -decl {Fl_Menu_Item* font_menu();} {} - -Function {show_style_panel()} {open -} { - codeblock {if (!style_panel)} {open - } { - Fl_Window style_panel { - label style - xywh {767 205 335 425} type Double visible - } { - Fl_Choice {} { - label {labels:} - user_data 0 user_data_type long - callback font_cb open - xywh {60 155 220 25} - code0 {o->menu(font_menu());} - } {} - Fl_Value_Input {} { - user_data 0 user_data_type long - callback font_size_cb - xywh {280 155 50 25} when 4 minimum 1 maximum 128 step 1 value 14 - } - Fl_Choice {} { - label {text:} - user_data 1 user_data_type long - callback font_cb open - xywh {60 190 220 25} - code0 {o->menu(font_menu());} - } {} - Fl_Value_Input {} { - user_data 1 user_data_type long - callback font_size_cb - xywh {280 190 50 25} when 4 minimum 1 maximum 128 step 1 value 14 - } - Fl_Choice {} { - label {menus:} - user_data 2 user_data_type long - callback font_cb open - xywh {60 225 220 25} - code0 {o->menu(font_menu());} - } {} - Fl_Value_Input {} { - user_data 2 user_data_type long - callback font_size_cb - xywh {280 225 50 25} when 4 minimum 1 maximum 128 step 1 value 14 - } - Fl_Button {} { - label {background:} - callback color_button_cb - xywh {255 30 75 25} box ENGRAVED_BOX align 4 - } - Fl_Button {} { - label {foreground:} - callback color_button_cb - xywh {255 60 75 25} box ENGRAVED_BOX color 0 align 4 - } - Fl_Button {} { - label {text background:} - callback color_button_cb - xywh {255 90 75 25} box ENGRAVED_BOX color 7 align 4 - } - Fl_Button {} { - label {selection:} - callback color_button_cb - xywh {255 120 75 25} box ENGRAVED_BOX color 15 align 4 - } - Fl_Return_Button {} { - label OK - callback {o->window()->hide();} - xywh {260 395 70 25} - } - Fl_Button {} { - label defaults - callback defaults_cb - xywh {175 395 70 25} - } - Fl_Value_Slider {} { - label {box thickness:} - callback box_thickness_cb - xywh {235 260 95 25} type Horizontal align 4 minimum 1 maximum 3 step 1 value 3 slider_size 0.3333 - } - Fl_Value_Slider {} { - label {text box thickness:} - callback text_box_thickness_cb - xywh {235 295 95 25} type Horizontal align 4 maximum 2 step 1 value 2 slider_size 0.3333 - } - Fl_Value_Slider {} { - label {scrollbar thickness:} - callback scrollbar_thickness_cb - xywh {235 335 95 25} type Horizontal align 4 minimum 3 maximum 30 step 1 value 17 - } - } - } - code {style_panel->show();} {} -} - -Function {} {open -} { - Fl_Window {} {open - xywh {356 409 445 435} type Double resizable visible - } { - Fl_Group {} { - label {Packed buttons:} - xywh {270 35 140 75} align 4 - } { - Fl_Button {} { - label A - xywh {270 35 35 25} type Radio - } - Fl_Button {} { - label A - xywh {305 35 35 25} type Radio - } - Fl_Button {} { - label A - xywh {340 35 35 25} type Radio - } - Fl_Button {} { - label A - xywh {375 35 35 25} type Radio - } - Fl_Button {} { - label A - xywh {270 60 35 25} type Radio - } - Fl_Button {} { - label A - xywh {305 60 35 25} type Radio - } - Fl_Button {} { - label A - xywh {340 60 35 25} type Radio - } - Fl_Button {} { - label A - xywh {375 60 35 25} type Radio - } - Fl_Button {} { - label A - xywh {270 85 35 25} type Radio - } - Fl_Button {} { - label A - xywh {305 85 35 25} type Radio - } - Fl_Button {} { - label A - xywh {340 85 35 25} type Radio - } - Fl_Button {} { - label A - xywh {375 85 35 25} type Radio - } - } - Fl_Adjuster {} { - xywh {105 90 75 25} labeltype ENGRAVED_LABEL align 4 - } - Fl_Counter {} { - label counter - xywh {20 120 170 25} minimum -1e+06 maximum 1e+06 - } - Fl_Adjuster {} { - label {adjuster:} - xywh {80 40 25 75} labeltype SYMBOL_LABEL align 4 - } - Fl_Group {} { - label {Inactive buttons:} - xywh {270 130 140 75} align 4 deactivate - } { - Fl_Button {} { - label A - xywh {270 130 35 25} type Radio - } - Fl_Button {} { - label A - xywh {305 130 35 25} type Radio - } - Fl_Button {} { - label A - xywh {340 130 35 25} type Radio - } - Fl_Button {} { - label A - xywh {375 130 35 25} type Radio - } - Fl_Button {} { - label A - xywh {270 155 35 25} type Radio - } - Fl_Button {} { - label A - xywh {305 155 35 25} type Radio - } - Fl_Button {} { - label A - xywh {340 155 35 25} type Radio - } - Fl_Button {} { - label A - xywh {375 155 35 25} type Radio - } - Fl_Button {} { - label A - xywh {270 180 35 25} type Radio - } - Fl_Button {} { - label A - xywh {305 180 35 25} type Radio - } - Fl_Button {} { - label A - xywh {340 180 35 25} type Radio - } - Fl_Button {} { - label A - xywh {375 180 35 25} type Radio - } - } - Fl_Input {} { - label {input:} - xywh {65 175 200 25} - code0 {o->static_value("This is a text input field");} - } - Fl_Output {} { - label {output:} - xywh {65 200 200 25} - code0 {o->static_value("This is a text output field");} - } - Fl_Menu_Bar {} { - xywh {0 0 445 30} - } { - submenu {} { - label File - xywh {0 0 100 20} - } { - menuitem {} { - label Open - xywh {0 0 100 20} shortcut 0x8006f - } - menuitem {} { - label Save - xywh {10 10 100 20} shortcut 0x80073 - } - menuitem {} { - label Merge - xywh {20 20 100 20} - } - menuitem {} { - label Quit - callback {exit(0);} - xywh {30 30 100 20} shortcut 0x80071 - code0 {\#include <stdlib.h>} - } - } - submenu {} { - label Edit open - xywh {0 0 100 20} - } { - menuitem {} { - label Undo - xywh {75 75 100 20} shortcut 0x8007a - } - menuitem {} { - label Cut - xywh {45 45 100 20} shortcut 0x80078 - } - menuitem {} { - label Copy - xywh {55 55 100 20} shortcut 0x80076 - } - menuitem {} { - label Paste - xywh {65 65 100 20} shortcut 0x80076 - } - } - submenu {} { - label Font - xywh {10 10 100 20} - } { - menuitem {} { - label Normal - xywh {0 0 100 20} - } - menuitem {} { - label Bold - xywh {10 10 100 20} labelfont 1 - } - menuitem {} { - label Italic - xywh {20 20 100 20} labelfont 2 - } - menuitem {} { - label {Bold Italic} - xywh {30 30 100 20} - } - menuitem {} { - label Engrave - xywh {40 40 100 20} labeltype ENGRAVED_LABEL - } - menuitem {} { - label Emboss - xywh {50 50 100 20} labeltype EMBOSSED_LABEL - } - menuitem {} { - label {@->} - xywh {60 60 100 20} labeltype SYMBOL_LABEL - } - menuitem {} { - label Small - xywh {70 70 100 20} labelsize 10 - } - } - submenu {} { - label Other - xywh {20 20 100 20} - } { - menuitem {} { - label {help!} - xywh {0 0 100 20} - } - } - } - Fl_Browser {} { - xywh {0 235 440 200} type Multi resizable - code0 {o->load("browser.C");} - code1 {o->position(0);} - } - Fl_Button {} { - label {click this to set style} - callback {show_style_panel();} - xywh {235 2 170 25} color 12 selection_color 12 - } - } - code {Fl::visual(FL_RGB);} {selected - } -} |
