1998-10-20 17:25:25 +04:00
|
|
|
//
|
2005-02-25 00:55:12 +03:00
|
|
|
// "$Id$"
|
1998-10-20 17:25:25 +04:00
|
|
|
//
|
|
|
|
// Tile test program for the Fast Light Tool Kit (FLTK).
|
|
|
|
//
|
2014-10-19 18:17:47 +04:00
|
|
|
// Copyright 1998-2014 by Bill Spitzak and others.
|
1998-10-20 17:25:25 +04:00
|
|
|
//
|
2011-07-19 08:49:30 +04:00
|
|
|
// 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
|
1998-10-20 17:25:25 +04:00
|
|
|
//
|
2005-04-16 04:13:17 +04:00
|
|
|
// Please report all bugs and problems on the following page:
|
|
|
|
//
|
|
|
|
// http://www.fltk.org/str.php
|
1998-10-20 17:25:25 +04:00
|
|
|
//
|
|
|
|
|
1998-10-06 22:21:25 +04:00
|
|
|
#include <FL/Fl.H>
|
|
|
|
#include <FL/Fl_Double_Window.H>
|
|
|
|
#include <FL/Fl_Tile.H>
|
|
|
|
#include <FL/Fl_Box.H>
|
|
|
|
|
2008-10-05 21:21:08 +04:00
|
|
|
//#define TEST_INACTIVE
|
|
|
|
|
1998-10-06 22:21:25 +04:00
|
|
|
int main(int argc, char** argv) {
|
2009-04-21 13:09:37 +04:00
|
|
|
Fl_Double_Window window(300,300);
|
1998-10-06 22:21:25 +04:00
|
|
|
window.box(FL_NO_BOX);
|
|
|
|
window.resizable(window);
|
2014-10-19 18:17:47 +04:00
|
|
|
|
|
|
|
int dx = 20, dy = dx; // border width of resizable() - see below
|
1998-10-06 22:21:25 +04:00
|
|
|
Fl_Tile tile(0,0,300,300);
|
2014-10-19 18:17:47 +04:00
|
|
|
|
1998-10-06 22:21:25 +04:00
|
|
|
Fl_Box box0(0,0,150,150,"0");
|
|
|
|
box0.box(FL_DOWN_BOX);
|
|
|
|
box0.color(9);
|
|
|
|
box0.labelsize(36);
|
|
|
|
box0.align(FL_ALIGN_CLIP);
|
2014-10-19 18:17:47 +04:00
|
|
|
|
2009-04-21 13:09:37 +04:00
|
|
|
Fl_Double_Window w1(150,0,150,150,"1");
|
1998-10-06 22:21:25 +04:00
|
|
|
w1.box(FL_NO_BOX);
|
2014-10-19 18:17:47 +04:00
|
|
|
Fl_Box box1(0,0,150,150,"1\nThis is a child window");
|
1998-10-06 22:21:25 +04:00
|
|
|
box1.box(FL_DOWN_BOX);
|
|
|
|
box1.color(19);
|
|
|
|
box1.labelsize(18);
|
2014-10-19 18:17:47 +04:00
|
|
|
box1.align(FL_ALIGN_CLIP|FL_ALIGN_INSIDE|FL_ALIGN_WRAP);
|
1998-10-06 22:21:25 +04:00
|
|
|
w1.resizable(box1);
|
|
|
|
w1.end();
|
|
|
|
|
|
|
|
// Fl_Tile tile2(0,150,150,150);
|
|
|
|
Fl_Box box2a(0,150,70,150,"2a");
|
|
|
|
box2a.box(FL_DOWN_BOX);
|
|
|
|
box2a.color(12);
|
|
|
|
box2a.labelsize(36);
|
|
|
|
box2a.align(FL_ALIGN_CLIP);
|
2014-10-19 18:17:47 +04:00
|
|
|
|
1998-10-06 22:21:25 +04:00
|
|
|
Fl_Box box2b(70,150,80,150,"2b");
|
|
|
|
box2b.box(FL_DOWN_BOX);
|
|
|
|
box2b.color(13);
|
|
|
|
box2b.labelsize(36);
|
|
|
|
box2b.align(FL_ALIGN_CLIP);
|
|
|
|
//tile2.end();
|
|
|
|
|
|
|
|
//Fl_Tile tile3(150,150,150,150);
|
|
|
|
Fl_Box box3a(150,150,150,70,"3a");
|
|
|
|
box3a.box(FL_DOWN_BOX);
|
|
|
|
box3a.color(12);
|
|
|
|
box3a.labelsize(36);
|
|
|
|
box3a.align(FL_ALIGN_CLIP);
|
2014-10-19 18:17:47 +04:00
|
|
|
|
1998-10-06 22:21:25 +04:00
|
|
|
Fl_Box box3b(150,150+70,150,80,"3b");
|
|
|
|
box3b.box(FL_DOWN_BOX);
|
|
|
|
box3b.color(13);
|
|
|
|
box3b.labelsize(36);
|
|
|
|
box3b.align(FL_ALIGN_CLIP);
|
|
|
|
//tile3.end();
|
2014-10-19 18:17:47 +04:00
|
|
|
|
|
|
|
// create the symmetrical resize box with dx and dy pixels distance, resp.
|
|
|
|
// from the borders of the Fl_Tile widget
|
|
|
|
Fl_Box r(tile.x()+dx,tile.y()+dy,tile.w()-2*dx,tile.h()-2*dy);
|
1998-10-06 22:21:25 +04:00
|
|
|
tile.resizable(r);
|
|
|
|
// r.box(FL_BORDER_FRAME);
|
|
|
|
|
|
|
|
tile.end();
|
|
|
|
window.end();
|
2014-10-19 18:17:47 +04:00
|
|
|
|
|
|
|
#ifdef TEST_INACTIVE // test inactive case
|
2008-10-05 21:21:08 +04:00
|
|
|
tile.deactivate();
|
|
|
|
#endif
|
2014-10-19 18:17:47 +04:00
|
|
|
|
1998-10-06 22:21:25 +04:00
|
|
|
w1.show();
|
2007-06-18 13:35:42 +04:00
|
|
|
window.show(argc,argv);
|
1998-10-06 22:21:25 +04:00
|
|
|
return Fl::run();
|
|
|
|
}
|
1998-10-20 17:25:25 +04:00
|
|
|
|
|
|
|
//
|
2005-02-25 00:55:12 +03:00
|
|
|
// End of "$Id$".
|
1998-10-20 17:25:25 +04:00
|
|
|
//
|