From 6ba7b49baf11e526d1ed19aef491db2cd120e55e Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Mon, 16 Oct 2023 10:53:18 +0200 Subject: 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. --- test/tile.cxx | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'test') 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 #include -//#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(); -- cgit v1.2.3