From 130a1c21a7e36371f8da993c50ac7f9982c5768a Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Sat, 4 Feb 2023 19:21:53 +0100 Subject: 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 a/examples/table-spreadsheet-with-keyboard-nav.cxx b/examples/table-spreadsheet-with-keyboard-nav.cxx index 8b6dd7510..8e2e5e8f9 100644 --- a/examples/table-spreadsheet-with-keyboard-nav.cxx +++ b/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 #include #include @@ -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 a/examples/table-spreadsheet.cxx b/examples/table-spreadsheet.cxx index 2b792231b..0389bf645 100644 --- a/examples/table-spreadsheet.cxx +++ b/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 } -- cgit v1.2.3