FLTK logo

[master] b12ed61 - Remove obsolete (dead) code from Fl_Group.cxx

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Library      Forums      Links      Apps     Login 
 All Forums  |  Back to fltk.commit  ]
 
Previous Message ]Next Message ]

[master] b12ed61 - Remove obsolete (dead) code from Fl_Group.cxx "Albrecht Schlosser" Jan 08, 2022  
 
commit b12ed6154814a345a9396d5f0a09d951ea628eb2
Author:     Albrecht Schlosser <albrechts.fltk@online.de>
AuthorDate: Sat Jan 8 16:23:01 2022 +0100
Commit:     Albrecht Schlosser <albrechts.fltk@online.de>
CommitDate: Sat Jan 8 16:23:01 2022 +0100

    Remove obsolete (dead) code from Fl_Group.cxx
    
    This code had been inactive at least since Mar 29, 2018.

 src/Fl_Group.cxx | 31 ++++---------------------------
 1 file changed, 4 insertions(+), 27 deletions(-)

diff --git src/Fl_Group.cxx src/Fl_Group.cxx
index 541c841..99b442a 100644
--- src/Fl_Group.cxx
+++ src/Fl_Group.cxx
@@ -1,7 +1,7 @@
 //
 // Group widget for the Fast Light Tool Kit (FLTK).
 //
-// Copyright 1998-2020 by Bill Spitzak and others.
+// Copyright 1998-2022 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
@@ -14,7 +14,8 @@
 //     https://www.fltk.org/bugs.php
 //
 
-// The Fl_Group is the only defined container type in FLTK.
+// Fl_Group is the basic container type in FLTK. Other container types
+// (classes) are usually subclasses of Fl_Group.
 
 // Fl_Window itself is a subclass of this, and most of the event
 // handling is designed so windows themselves work correctly.
@@ -301,16 +302,6 @@ int Fl_Group::handle(int event) {
   }
 }
 
-//void Fl_Group::focus(Fl_Widget *o) {Fl::focus(o); o->handle(FL_FOCUS);}
-
-#if 0
-const char *nameof(Fl_Widget *o) {
-  if (!o) return "NULL";
-  if (!o->label()) return "<no label>";
-  return o->label();
-}
-#endif
-
 // try to move the focus in response to a keystroke:
 int Fl_Group::navigation(int key) {
   if (children() <= 1) return 0;
@@ -800,19 +791,7 @@ void Fl_Group::resize(int X, int Y, int W, int H) {
       int T = p->y();
       int B = T + p->h();
 
-#if 0 // old widget resizing code: used up to FLTK 1.3.x, deactivated 29 Mar 2018
-      // FIXME: This should be removed before the release of FLTK 1.4.0
-
-      if (L >= RR) L += dw;
-      else if (L > RL) L = RL+((L-RL)*(RR+dw-RL)+(RR-RL)/2)/(RR-RL);
-      if (R >= RR) R += dw;
-      else if (R > RL) R = RL+((R-RL)*(RR+dw-RL)+(RR-RL)/2)/(RR-RL);
-      if (T >= RB) T += dh;
-      else if (T > RT) T = RT+((T-RT)*(RB+dh-RT)+(RB-RT)/2)/(RB-RT);
-      if (B >= RB) B += dh;
-      else if (B > RT) B = RT+((B-RT)*(RB+dh-RT)+(RB-RT)/2)/(RB-RT);
-
-#else // much simpler code from Francois Ostiguy: since FLTK 1.4.0
+      // widget resizing code from Francois Ostiguy (since FLTK 1.4.0)
 
       if (L >= RR) L += dw;
       else if (L > RL) L += dw * (L-RL) / (RR-RL);
@@ -823,8 +802,6 @@ void Fl_Group::resize(int X, int Y, int W, int H) {
       if (B >= RB) B += dh;
       else if (B > RT) B += dh * (B-RT) / (RB-RT);
 
-#endif // old / new (1.4.0++) widget resizing code
-
       o->resize(L+dx, T+dy, R-L, B-T);
     }
   }
Direct Link to Message ]
 
     
Previous Message ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2025 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.