summaryrefslogtreecommitdiff
path: root/test/tile.cxx
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2023-10-16 10:53:18 +0200
committerAlbrecht Schlosser <albrechts.fltk@online.de>2023-10-16 13:33:40 +0200
commit6ba7b49baf11e526d1ed19aef491db2cd120e55e (patch)
tree1a13b19b4496ccc4d7552e7fc80a8f9234808e31 /test/tile.cxx
parentda5331b59210769b4e15f24a0b5237a7ec5bfc4d (diff)
Improve subclassing cababilities of Fl_Tile (STR 2791)
- remove static variables and functions - make move_intersection() virtual - add (protected) cursor access methods These changes were inspired by STR 2791 where the user proposing an enhancement was not able to subclass Fl_Tile properly. This commit fixes the mentioned issues and enables subclassing without copying internal code.
Diffstat (limited to 'test/tile.cxx')
-rw-r--r--test/tile.cxx17
1 files changed, 9 insertions, 8 deletions
diff --git a/test/tile.cxx b/test/tile.cxx
index 2b6485ef2..e8b1d6318 100644
--- a/test/tile.cxx
+++ b/test/tile.cxx
@@ -1,7 +1,7 @@
//
// Fl_Tile test program for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2016 by Bill Spitzak and others.
+// Copyright 1998-2023 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
@@ -19,18 +19,19 @@
#include <FL/Fl_Tile.H>
#include <FL/Fl_Box.H>
-//#define TEST_INACTIVE
+// #define TEST_INACTIVE
int main(int argc, char** argv) {
- Fl_Double_Window window(300,300);
+ Fl_Double_Window window(300, 300);
window.box(FL_NO_BOX);
window.resizable(window);
- int dx = 20, dy = dx; // border width of resizable() - see below
- Fl_Tile tile(0,0,300,300);
+ Fl_Tile tile(0, 0, 300, 300);
// create the symmetrical resize box with dx and dy pixels distance, resp.
// from the borders of the Fl_Tile widget before all other children
+
+ int dx = 20, dy = dx; // border width of resizable()
Fl_Box r(tile.x()+dx,tile.y()+dy,tile.w()-2*dx,tile.h()-2*dy);
tile.resizable(r);
@@ -62,9 +63,9 @@ int main(int argc, char** argv) {
box2b.color(13);
box2b.labelsize(36);
box2b.align(FL_ALIGN_CLIP);
- //tile2.end();
+ // tile2.end();
- //Fl_Tile tile3(150,150,150,150);
+ // Fl_Tile tile3(150,150,150,150);
Fl_Box box3a(150,150,150,70,"3a");
box3a.box(FL_DOWN_BOX);
box3a.color(12);
@@ -76,7 +77,7 @@ int main(int argc, char** argv) {
box3b.color(13);
box3b.labelsize(36);
box3b.align(FL_ALIGN_CLIP);
- //tile3.end();
+ // tile3.end();
tile.end();
window.end();