From f09e17c3c564e8310125a10c03397cbf473ff643 Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Wed, 1 Jul 2020 18:03:10 +0200 Subject: Remove $Id$ tags, update URL's, and more - remove obsolete svn '$Id$' tags from all source files - update .fl files and generated files accordingly - replace 'http://www.fltk.org' URL's with 'https://...' - replace bug report URL 'str.php' with 'bugs.php' - remove trailing whitespace - fix other whitespace errors flagged by Git - add and/or fix missing or wrong standard headers - convert tabs to spaces in all source files The only relevant code changes are in the fluid/ folder where some .fl files and other source files were used to generate the '$Id' headers and footers. --- examples/tree-as-container.cxx | 60 +++++++++++++++++++----------------------- 1 file changed, 27 insertions(+), 33 deletions(-) (limited to 'examples/tree-as-container.cxx') diff --git a/examples/tree-as-container.cxx b/examples/tree-as-container.cxx index e704d7a0b..d8cac5205 100644 --- a/examples/tree-as-container.cxx +++ b/examples/tree-as-container.cxx @@ -1,7 +1,5 @@ // -// "$Id$" -// -// Fl_Tree as a container of FLTK widgets. - erco 04/15/2012 +// Fl_Tree as a container of FLTK widgets. - erco 04/15/2012 // // Copyright 2010,2012 Greg Ercolano. // Copyright 1998-2010 by Bill Spitzak and others. @@ -10,11 +8,11 @@ // 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 +// https://www.fltk.org/COPYING.php // -// Please report all bugs and problems on the following page: +// Please see the following page on how to report bugs and issues: // -// http://www.fltk.org/str.php +// https://www.fltk.org/bugs.php // #include #include @@ -32,18 +30,18 @@ class MyData : public Fl_Group { Fl_Input *fields[MAX_FIELDS]; public: MyData(int X,int Y,int W,int H) : Fl_Group(X,Y,W,H) { - static unsigned int colors[MAX_FIELDS] = { - 0xffffdd00, 0xffdddd00, 0xddffff00, 0xddffdd00, 0xddddff00 - }; + static unsigned int colors[MAX_FIELDS] = { + 0xffffdd00, 0xffdddd00, 0xddffff00, 0xddffdd00, 0xddddff00 + }; for ( int t=0; tcolor(Fl_Color(colors[t])); - } - end(); + fields[t] = new Fl_Input(X+t*FIELD_WIDTH,Y,FIELD_WIDTH,H); + fields[t]->color(Fl_Color(colors[t])); + } + end(); } void SetData(int col, const char *val) { if ( col >= 0 && col < MAX_FIELDS ) - fields[col]->value(val); + fields[col]->value(val); } }; @@ -53,7 +51,7 @@ int main(int argc, char *argv[]) { { // Create the tree Fl_Tree *tree = new Fl_Tree(10, 10, win->w()-20, win->h()-20); - tree->showroot(0); // don't show root of tree + tree->showroot(0); // don't show root of tree // Add some regular text nodes tree->add("Foo/Bar/001"); tree->add("Foo/Bar/002"); @@ -63,20 +61,20 @@ int main(int argc, char *argv[]) { for ( int t=0; tadd(s); - // Reconfigure item to be an FLTK widget (MyData) - tree->begin(); - { - MyData *data = new MyData(0,0,FIELD_WIDTH*MAX_FIELDS, FIELD_HEIGHT); - item->widget(data); - // Initialize widget data - for ( int c=0; cSetData(c,s); - } - } - tree->end(); + sprintf(s, "FLTK Widgets/%d", t); + Fl_Tree_Item *item = tree->add(s); + // Reconfigure item to be an FLTK widget (MyData) + tree->begin(); + { + MyData *data = new MyData(0,0,FIELD_WIDTH*MAX_FIELDS, FIELD_HEIGHT); + item->widget(data); + // Initialize widget data + for ( int c=0; cSetData(c,s); + } + } + tree->end(); } } win->end(); @@ -84,7 +82,3 @@ int main(int argc, char *argv[]) { win->show(argc, argv); return(Fl::run()); } - -// -// End of "$Id$". -// -- cgit v1.2.3