1998-10-20 17:25:25 +04:00
|
|
|
//
|
2003-05-19 02:12:24 +04:00
|
|
|
// "$Id: boxtype.cxx,v 1.4.2.3.2.4 2003/05/18 22:12:24 easysw Exp $"
|
1998-10-20 17:25:25 +04:00
|
|
|
//
|
|
|
|
// Boxtype test program for the Fast Light Tool Kit (FLTK).
|
|
|
|
//
|
2003-01-31 00:46:07 +03:00
|
|
|
// Copyright 1998-2003 by Bill Spitzak and others.
|
1998-10-20 17:25:25 +04:00
|
|
|
//
|
|
|
|
// 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.
|
|
|
|
//
|
2000-06-06 01:21:24 +04:00
|
|
|
// Please report all bugs and problems to "fltk-bugs@fltk.org".
|
1998-10-20 17:25:25 +04:00
|
|
|
//
|
1998-10-06 22:21:25 +04:00
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <FL/Fl.H>
|
|
|
|
#include <FL/Fl_Single_Window.H>
|
|
|
|
#include <FL/Fl_Box.H>
|
|
|
|
|
|
|
|
int N = 0;
|
2003-05-19 02:12:24 +04:00
|
|
|
#define W 200
|
1998-10-06 22:21:25 +04:00
|
|
|
#define H 50
|
2003-05-19 02:12:24 +04:00
|
|
|
#define ROWS 10
|
1998-10-06 22:21:25 +04:00
|
|
|
|
|
|
|
Fl_Window *window;
|
|
|
|
|
|
|
|
void bt(const char *name, Fl_Boxtype type, int square=0) {
|
|
|
|
int x = N%4;
|
|
|
|
int y = N/4;
|
|
|
|
N++;
|
|
|
|
x = x*W+10;
|
|
|
|
y = y*H+10;
|
|
|
|
Fl_Box *b = new Fl_Box(type,x,y,square ? H-20 : W-20,H-20,name);
|
|
|
|
b->labelsize(11);
|
|
|
|
if (square) b->align(FL_ALIGN_RIGHT);
|
|
|
|
}
|
|
|
|
|
|
|
|
int main(int argc, char ** argv) {
|
|
|
|
window = new Fl_Single_Window(4*W,ROWS*H);
|
|
|
|
window->box(FL_FLAT_BOX);
|
|
|
|
window->color(12);// light blue
|
|
|
|
bt("FL_NO_BOX",FL_NO_BOX);
|
|
|
|
bt("FL_FLAT_BOX",FL_FLAT_BOX);
|
|
|
|
N += 2; // go to start of next row to line up boxes & frames
|
|
|
|
bt("FL_UP_BOX",FL_UP_BOX);
|
|
|
|
bt("FL_DOWN_BOX",FL_DOWN_BOX);
|
|
|
|
bt("FL_UP_FRAME",FL_UP_FRAME);
|
|
|
|
bt("FL_DOWN_FRAME",FL_DOWN_FRAME);
|
|
|
|
bt("FL_THIN_UP_BOX",FL_THIN_UP_BOX);
|
|
|
|
bt("FL_THIN_DOWN_BOX",FL_THIN_DOWN_BOX);
|
|
|
|
bt("FL_THIN_UP_FRAME",FL_THIN_UP_FRAME);
|
|
|
|
bt("FL_THIN_DOWN_FRAME",FL_THIN_DOWN_FRAME);
|
|
|
|
bt("FL_ENGRAVED_BOX",FL_ENGRAVED_BOX);
|
|
|
|
bt("FL_EMBOSSED_BOX",FL_EMBOSSED_BOX);
|
|
|
|
bt("FL_ENGRAVED_FRAME",FL_ENGRAVED_FRAME);
|
|
|
|
bt("FL_EMBOSSED_FRAME",FL_EMBOSSED_FRAME);
|
|
|
|
bt("FL_BORDER_BOX",FL_BORDER_BOX);
|
|
|
|
bt("FL_SHADOW_BOX",FL_SHADOW_BOX);
|
|
|
|
bt("FL_BORDER_FRAME",FL_BORDER_FRAME);
|
|
|
|
bt("FL_SHADOW_FRAME",FL_SHADOW_FRAME);
|
|
|
|
bt("FL_ROUNDED_BOX",FL_ROUNDED_BOX);
|
|
|
|
bt("FL_RSHADOW_BOX",FL_RSHADOW_BOX);
|
|
|
|
bt("FL_ROUNDED_FRAME",FL_ROUNDED_FRAME);
|
|
|
|
bt("FL_RFLAT_BOX",FL_RFLAT_BOX);
|
|
|
|
bt("FL_OVAL_BOX",FL_OVAL_BOX);
|
|
|
|
bt("FL_OSHADOW_BOX",FL_OSHADOW_BOX);
|
|
|
|
bt("FL_OVAL_FRAME",FL_OVAL_FRAME);
|
|
|
|
bt("FL_OFLAT_BOX",FL_OFLAT_BOX);
|
|
|
|
bt("FL_ROUND_UP_BOX",FL_ROUND_UP_BOX);
|
|
|
|
bt("FL_ROUND_DOWN_BOX",FL_ROUND_DOWN_BOX);
|
|
|
|
bt("FL_DIAMOND_UP_BOX",FL_DIAMOND_UP_BOX);
|
|
|
|
bt("FL_DIAMOND_DOWN_BOX",FL_DIAMOND_DOWN_BOX);
|
2001-11-29 00:37:35 +03:00
|
|
|
bt("FL_PLASTIC_UP_BOX",FL_PLASTIC_UP_BOX);
|
|
|
|
bt("FL_PLASTIC_DOWN_BOX",FL_PLASTIC_DOWN_BOX);
|
|
|
|
bt("FL_PLASTIC_UP_FRAME",FL_PLASTIC_UP_FRAME);
|
|
|
|
bt("FL_PLASTIC_DOWN_FRAME",FL_PLASTIC_DOWN_FRAME);
|
2003-05-19 02:12:24 +04:00
|
|
|
bt("FL_PLASTIC_THIN_UP_BOX",FL_PLASTIC_THIN_UP_BOX);
|
|
|
|
bt("FL_PLASTIC_THIN_DOWN_BOX",FL_PLASTIC_THIN_DOWN_BOX);
|
1998-10-06 22:21:25 +04:00
|
|
|
window->resizable(window);
|
|
|
|
window->end();
|
2003-05-19 02:12:24 +04:00
|
|
|
// window->show(argc,argv);
|
|
|
|
window->show();
|
1998-10-06 22:21:25 +04:00
|
|
|
return Fl::run();
|
|
|
|
}
|
1998-10-20 17:25:25 +04:00
|
|
|
|
|
|
|
//
|
2003-05-19 02:12:24 +04:00
|
|
|
// End of "$Id: boxtype.cxx,v 1.4.2.3.2.4 2003/05/18 22:12:24 easysw Exp $".
|
1998-10-20 17:25:25 +04:00
|
|
|
//
|