FLTK logo

[master] 130a1c2 - Fix deprecated warnings in examples/table* demo programs

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

[master] 130a1c2 - Fix deprecated warnings in examples/table* demo programs "Albrecht Schlosser" Feb 04, 2023  
 
commit 130a1c21a7e36371f8da993c50ac7f9982c5768a
Author:     Albrecht Schlosser <albrechts.fltk@online.de>
AuthorDate: Sat Feb 4 19:21:53 2023 +0100
Commit:     Albrecht Schlosser <albrechts.fltk@online.de>
CommitDate: Sat Feb 4 19:21:53 2023 +0100

    Fix deprecated warnings in examples/table* demo programs
    
    Also: adjust comments, update copyright year

 examples/table-spreadsheet-with-keyboard-nav.cxx | 24 +++++++++++++-----------
 examples/table-spreadsheet.cxx                   |  8 ++++----
 2 files changed, 17 insertions(+), 15 deletions(-)

diff --git examples/table-spreadsheet-with-keyboard-nav.cxx examples/table-spreadsheet-with-keyboard-nav.cxx
index 8b6dd75..8e2e5e8 100644
--- examples/table-spreadsheet-with-keyboard-nav.cxx
+++ examples/table-spreadsheet-with-keyboard-nav.cxx
@@ -1,15 +1,8 @@
 //
-//      Simple example of an interactive spreadsheet using Fl_Table.
-//      Uses Mr. Satan's technique of instancing an Fl_Input around.
-//      Modified to test Jean-Marc's mods for keyboard nav and mouse selection.
+// Simple example of an interactive spreadsheet using Fl_Table.
+// Uses Mr. Satan's technique of instancing an Fl_Input around.
 //
-//      Fl_Table[1.00/LGPL] 04/18/03 Mister Satan      -- Initial implementation, submitted to erco for Fl_Table
-//      Fl_Table[1.10/LGPL] 05/17/03 Greg Ercolano     -- Small mods to follow changes to Fl_Table
-//      Fl_Table[1.20/LGPL] 02/22/04 Jean-Marc Lienher -- Keyboard nav and mouse selection
-//      Fl_Table[1.21/LGPL] 02/22/04 Greg Ercolano     -- Small reformatting mods, comments
-//         FLTK[1.3.0/LGPL] 10/26/10 Greg Ercolano     -- Moved from Fl_Table to FLTK 1.3.x, CMP compliance
-//
-// Copyright 1998-2010 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
@@ -21,6 +14,15 @@
 //
 //     https://www.fltk.org/bugs.php
 //
+
+// Modified to test Jean-Marc's mods for keyboard nav and mouse selection.
+//
+//   Fl_Table[1.00/LGPL] 04/18/03 Mister Satan      -- Initial implementation, submitted to erco for Fl_Table
+//   Fl_Table[1.10/LGPL] 05/17/03 Greg Ercolano     -- Small mods to follow changes to Fl_Table
+//   Fl_Table[1.20/LGPL] 02/22/04 Jean-Marc Lienher -- Keyboard nav and mouse selection
+//   Fl_Table[1.21/LGPL] 02/22/04 Greg Ercolano     -- Small reformatting mods, comments
+//      FLTK[1.3.0/LGPL] 10/26/10 Greg Ercolano     -- Moved from Fl_Table to FLTK 1.3.x, CMP compliance
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <FL/Fl.H>
@@ -102,7 +104,7 @@ public:
     input->resize(X,Y,W,H);                             // Move Fl_Input widget there
     char s[30]; sprintf(s, "%d", values[R][C]);         // Load input widget with cell's current value
     input->value(s);
-    input->position(0,int(strlen(s)));                  // Select entire input field
+    input->insert_position(0, int(strlen(s)));          // Select entire input field
     input->show();                                      // Show the input widget, now that we've positioned it
     input->take_focus();
   }
diff --git examples/table-spreadsheet.cxx examples/table-spreadsheet.cxx
index 2b79223..0389bf6 100644
--- examples/table-spreadsheet.cxx
+++ examples/table-spreadsheet.cxx
@@ -1,8 +1,8 @@
 //
-//      Simple example of an interactive spreadsheet using Fl_Table.
-//      Uses Mr. Satan's technique of instancing an Fl_Input around.
+// Simple example of an interactive spreadsheet using Fl_Table.
+// Uses Mr. Satan's technique of instancing an Fl_Input around.
 //
-// Copyright 1998-2010 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
@@ -79,7 +79,7 @@ public:
     input->resize(X,Y,W,H);                             // Move Fl_Input widget there
     char s[30]; sprintf(s, "%d", values[R][C]);         // Load input widget with cell's current value
     input->value(s);
-    input->position(0, int(strlen(s)));                 // Select entire input field
+    input->insert_position(0, int(strlen(s)));          // Select entire input field
     input->show();                                      // Show the input widget, now that we've positioned it
     input->take_focus();                                // Put keyboard focus into the input widget
   }
Direct Link to Message ]
 
     
Previous Message ]Next Message ]
 
 

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