2 // "$Id: boxtype.cxx 7903 2010-11-28 21:06:39Z matt $"
4 // Boxtype test program for the Fast Light Tool Kit (FLTK).
6 // Copyright 1998-2010 by Bill Spitzak and others.
8 // This library is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU Library General Public
10 // License as published by the Free Software Foundation; either
11 // version 2 of the License, or (at your option) any later version.
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Library General Public License for more details.
18 // You should have received a copy of the GNU Library General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
23 // Please report all bugs and problems on the following page:
25 // http://www.fltk.org/str.php
31 #include <FL/Fl_Double_Window.H>
32 #include <FL/Fl_Box.H>
39 Fl_Double_Window
*window
;
41 void bt(const char *name
, Fl_Boxtype type
, int square
=0) {
47 Fl_Box
*b
= new Fl_Box(type
,x
,y
,square
? H
-20 : W
-20,H
-20,name
);
49 if (square
) b
->align(FL_ALIGN_RIGHT
);
52 int main(int argc
, char ** argv
) {
53 window
= new Fl_Double_Window(4*W
,ROWS
*H
);
54 window
->box(FL_FLAT_BOX
);
55 #if 0 // this code uses the command line arguments to set arbitrary color schemes
57 Fl::get_system_colors();
58 #elif 0 // this code uses a single color to define a scheme
60 Fl::get_system_colors();
61 Fl::background(113,113,198);
62 #else // this code uses the nice bright blue background to show box vs. frame types
64 Fl::get_system_colors();
65 window
->color(12);// light blue
67 bt("FL_NO_BOX",FL_NO_BOX
);
68 bt("FL_FLAT_BOX",FL_FLAT_BOX
);
69 N
+= 2; // go to start of next row to line up boxes & frames
70 bt("FL_UP_BOX",FL_UP_BOX
);
71 bt("FL_DOWN_BOX",FL_DOWN_BOX
);
72 bt("FL_UP_FRAME",FL_UP_FRAME
);
73 bt("FL_DOWN_FRAME",FL_DOWN_FRAME
);
74 bt("FL_THIN_UP_BOX",FL_THIN_UP_BOX
);
75 bt("FL_THIN_DOWN_BOX",FL_THIN_DOWN_BOX
);
76 bt("FL_THIN_UP_FRAME",FL_THIN_UP_FRAME
);
77 bt("FL_THIN_DOWN_FRAME",FL_THIN_DOWN_FRAME
);
78 bt("FL_ENGRAVED_BOX",FL_ENGRAVED_BOX
);
79 bt("FL_EMBOSSED_BOX",FL_EMBOSSED_BOX
);
80 bt("FL_ENGRAVED_FRAME",FL_ENGRAVED_FRAME
);
81 bt("FL_EMBOSSED_FRAME",FL_EMBOSSED_FRAME
);
82 bt("FL_BORDER_BOX",FL_BORDER_BOX
);
83 bt("FL_SHADOW_BOX",FL_SHADOW_BOX
);
84 bt("FL_BORDER_FRAME",FL_BORDER_FRAME
);
85 bt("FL_SHADOW_FRAME",FL_SHADOW_FRAME
);
86 bt("FL_ROUNDED_BOX",FL_ROUNDED_BOX
);
87 bt("FL_RSHADOW_BOX",FL_RSHADOW_BOX
);
88 bt("FL_ROUNDED_FRAME",FL_ROUNDED_FRAME
);
89 bt("FL_RFLAT_BOX",FL_RFLAT_BOX
);
90 bt("FL_OVAL_BOX",FL_OVAL_BOX
);
91 bt("FL_OSHADOW_BOX",FL_OSHADOW_BOX
);
92 bt("FL_OVAL_FRAME",FL_OVAL_FRAME
);
93 bt("FL_OFLAT_BOX",FL_OFLAT_BOX
);
94 bt("FL_ROUND_UP_BOX",FL_ROUND_UP_BOX
);
95 bt("FL_ROUND_DOWN_BOX",FL_ROUND_DOWN_BOX
);
96 bt("FL_DIAMOND_UP_BOX",FL_DIAMOND_UP_BOX
);
97 bt("FL_DIAMOND_DOWN_BOX",FL_DIAMOND_DOWN_BOX
);
99 bt("FL_ASYM_BOX",FL_ASYM_BOX
);
100 bt("FL_ASYM_FLAT_BOX",FL_ASYM_FLAT_BOX
);
101 bt("FL_PLASTIC_UP_FRAME",FL_PLASTIC_UP_FRAME
);
102 bt("FL_PLASTIC_DOWN_FRAME",FL_PLASTIC_DOWN_FRAME
);
103 bt("FL_PLASTIC_THIN_UP_BOX",FL_PLASTIC_THIN_UP_BOX
);
104 bt("FL_PLASTIC_THIN_DOWN_BOX",FL_PLASTIC_THIN_DOWN_BOX
);
106 bt("FL_PLASTIC_ROUND_UP_BOX",FL_PLASTIC_ROUND_UP_BOX
);
107 bt("FL_PLASTIC_ROUND_DOWN_BOX",FL_PLASTIC_ROUND_DOWN_BOX
);
110 bt("FL_GTK_UP_BOX",FL_GTK_UP_BOX
);
111 bt("FL_GTK_DOWN_BOX",FL_GTK_DOWN_BOX
);
112 bt("FL_GTK_UP_FRAME",FL_GTK_UP_FRAME
);
113 bt("FL_GTK_DOWN_FRAME",FL_GTK_DOWN_FRAME
);
114 bt("FL_GTK_THIN_UP_BOX",FL_GTK_THIN_UP_BOX
);
115 bt("FL_GTK_THIN_DOWN_BOX",FL_GTK_THIN_DOWN_BOX
);
116 bt("FL_GTK_THIN_UP_FRAME",FL_GTK_THIN_UP_FRAME
);
117 bt("FL_GTK_THIN_DOWN_FRAME",FL_GTK_THIN_DOWN_FRAME
);
118 bt("FL_GTK_ROUND_UP_BOX",FL_GTK_ROUND_UP_BOX
);
119 bt("FL_GTK_ROUND_DOWN_BOX",FL_GTK_ROUND_DOWN_BOX
);
120 window
->resizable(window
);
127 // End of "$Id: boxtype.cxx 7903 2010-11-28 21:06:39Z matt $".