Re: [fltk.bugs] [MOD] STR #2862: Fl_Table keyboard nav issue: can't use tab to navigate off the widget

2013-03-23 Thread Greg Ercolano

DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR Active]

Link: http://www.fltk.org/str.php?L2862
Version: 1.3-current
Fix Version: 1.3-current


Fixed in Subversion repository.

Fixed (a) and (b) in r9843.

Partial changes for (c): examples/table-spreadsheet.cxx

Regarding (a): by default FLTK uses Tab to navigate widgets.
   However, one can enable the new Fl_Table::tab_cell_nav()
   flag to allow Tab to navigate table cells.

Regarding (c): the examples/table-spreadsheet.cxx example was
   modified to make use of this new feature,
   and the example works better/more predictably.

   More to come as other table examples are modified.

The new Fl_Table::tab_cell_nav() method breaks ABI,
so to to access it in FLTK 1.3.x, YOU MUST UNCOMMENT the
FLTK_ABI_VERSION macro at the top of the FL/Enumerations.H file
before rebuilding FLTK.


Link: http://www.fltk.org/str.php?L2862
Version: 1.3-current
Fix Version: 1.3-current

___
fltk-bugs mailing list
fltk-bugs@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-bugs


Re: [fltk.bugs] [MOD] STR #2862: Fl_Table keyboard nav issue: can't use tab to navigate off the widget

2013-03-23 Thread Greg Ercolano

DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR Active]

Link: http://www.fltk.org/str.php?L2862
Version: 1.3-current
Fix Version: 1.3-current


Looks like Fl_Table_Row needs some fixes as well to support keyboard
navigation. So still todo:

e) Fl_Table_Row should heed new tab_cell_nav()

f) Fl_Table_Row needs a row focus box, similar to Fl_Browser,
   so user can toggle-select rows in MULTI select mode

g) Fl_Table_Row needs to support things like SHIFT-Home, etc
   to extend selections, and other key combos to toggle selection,
   etc.


Link: http://www.fltk.org/str.php?L2862
Version: 1.3-current
Fix Version: 1.3-current

___
fltk-bugs mailing list
fltk-bugs@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-bugs


Re: [fltk.bugs] [MOD] STR #2862: Fl_Table keyboard nav issue: can't use tab to navigate off the widget

2013-03-23 Thread Greg Ercolano

DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR Active]

Link: http://www.fltk.org/str.php?L2862
Version: 1.3-current
Fix Version: 1.3-current


Made small change in r9844 so that Tab can navigate to/from the input
field in foo_v2.cxx attached in this STR when the ABI feature is
/disabled/. (It worked OK when ABI feature was enabled)

This also fixes the test/table app, which previously had trouble
with tab navigation.

With r9844, status of issues is:
  (a) Done
  (b) Done
  (c) Tested:
-- OK --
 test/table  -- OK: tab navigates to/from inputs
 examples/table-as-container -- OK: tab navigates table widgets
-- FAILED --
 examples/table-sort -- FAIL: because Fl_Table_Row (WIP)
 examples/table-with-keynav  -- FAIL: can't nav to checkbox+Output
-- NOT APPLICABLE --
 examples/table-spreadsheet  -- N/A: no other widgets to tab to
 examples/table-simple   -- N/A: read only, 
 examples/table-spreadsheet-with-keynav -- will be obsolete
   (d) TODO
   (e) TODO
   (f) TODO
   (g) TODO


Link: http://www.fltk.org/str.php?L2862
Version: 1.3-current
Fix Version: 1.3-current

___
fltk-bugs mailing list
fltk-bugs@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-bugs


Re: [fltk.bugs] [MOD] STR #2862: Fl_Table keyboard nav issue: can't use tab to navigate off the widget

2013-03-23 Thread Greg Ercolano

DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR Active]

Link: http://www.fltk.org/str.php?L2862
Version: 1.3-current
Fix Version: 1.3-current


Adding another item to the issues list:

(h) Both Fl_Table and Fl_Table_Row will need to heed
Fl_Widget::visible_focus() (when focus box is added)


Link: http://www.fltk.org/str.php?L2862
Version: 1.3-current
Fix Version: 1.3-current

___
fltk-bugs mailing list
fltk-bugs@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-bugs


Re: [fltk.bugs] [MOD] STR #2862: Fl_Table keyboard nav issue: can't use tab to navigate off the widget

2012-07-19 Thread Greg Ercolano
DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2862
Version: 1.3-current


Attached file foo.cxx...


Link: http://www.fltk.org/str.php?L2862
Version: 1.3-current//
// $Id: table-simple.cxx 9086 2011-09-29 21:10:59Z greg.ercolano $
//
//Simple example of using Fl_Table - Greg Ercolano 11/29/2010
//
//Demonstrates the simplest use of Fl_Table possible.
//Display a 10x10 array of integers with row/col headers.
//No interaction; simple display of data only.
//See other examples for more complex interactions with the table.
//
// Copyright 2010 Greg Ercolano.
// Copyright 1998-2010 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
// file is missing or damaged, see the license at:
//
// http://www.fltk.org/COPYING.php
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
// 
#include FL/Fl.H
#include FL/Fl_Double_Window.H
#include FL/Fl_Table.H
#include FL/Fl_Input.H
#include FL/fl_draw.H

#define MAX_ROWS 30
#define MAX_COLS 26 // A-Z

// Derive a class from Fl_Table
class MyTable : public Fl_Table {

  int data[MAX_ROWS][MAX_COLS]; // data array for cells

  // Draw the row/col headings
  //Make this a dark thin upbox with the text inside.
  //
  void DrawHeader(const char *s, int X, int Y, int W, int H) {
fl_push_clip(X,Y,W,H);
  fl_draw_box(FL_THIN_UP_BOX, X,Y,W,H, row_header_color());
  fl_color(FL_BLACK);
  fl_draw(s, X,Y,W,H, FL_ALIGN_CENTER);
fl_pop_clip();
  } 
  // Draw the cell data
  //Dark gray text on white background with subtle border
  //
  void DrawData(const char *s, int X, int Y, int W, int H) {
fl_push_clip(X,Y,W,H);
  // Draw cell bg
  fl_color(FL_WHITE); fl_rectf(X,Y,W,H);
  // Draw cell data
  fl_color(FL_GRAY0); fl_draw(s, X,Y,W,H, FL_ALIGN_CENTER);
  // Draw box border
  fl_color(color()); fl_rect(X,Y,W,H);
fl_pop_clip();
  } 
  // Handle drawing table's cells
  // Fl_Table calls this function to draw each visible cell in the table.
  // It's up to us to use FLTK's drawing functions to draw the cells the 
way we want.
  //
  void draw_cell(TableContext context, int ROW=0, int COL=0, int X=0, int Y=0, 
int W=0, int H=0) {
static char s[40];
switch ( context ) {
  case CONTEXT_STARTPAGE:   // before page is drawn..
fl_font(FL_HELVETICA, 16);  // set the font for our drawing 
operations
return; 
  case CONTEXT_COL_HEADER:  // Draw column headers
sprintf(s,%c,'A'+COL);// A, B, C, etc.
DrawHeader(s,X,Y,W,H);
return; 
  case CONTEXT_ROW_HEADER:  // Draw row headers
sprintf(s,%03d:,ROW); // 001:, 002:, etc
DrawHeader(s,X,Y,W,H);
return; 
  case CONTEXT_CELL:// Draw data in cells
sprintf(s,%d,data[ROW][COL]);
DrawData(s,X,Y,W,H);
return;
  default:
return;
}
  }
public:
  // Constructor
  // Make our data array, and initialize the table options.
  //
  MyTable(int X, int Y, int W, int H, const char *L=0) : Fl_Table(X,Y,W,H,L) {
// Fill data array
for ( int r=0; rMAX_ROWS; r++ )
  for ( int c=0; cMAX_COLS; c++ )
data[r][c] = 1000+(r*1000)+c;
// Rows
rows(MAX_ROWS); // how many rows
row_header(1);  // enable row headers (along left)
row_height_all(20); // default height of rows
row_resize(0);  // disable row resizing
// Cols
cols(MAX_COLS); // how many columns
col_header(1);  // enable column headers (along top)
col_width_all(80);  // default width of columns
col_resize(1);  // enable column resizing
end();  // end the Fl_Table group
  }
  ~MyTable() { }
};

int main(int argc, char **argv) {
  Fl_Double_Window win(900, 400, Simple Table);
  MyTable table(10,10,880,350);
  Fl_Input in(100,360,100,25,Input);
  win.end();
  win.resizable(table);
  win.show(argc,argv);
  return(Fl::run());
}

//
// End of $Id: table-simple.cxx 9086 2011-09-29 21:10:59Z greg.ercolano $.
//
___
fltk-bugs mailing list
fltk-bugs@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-bugs


Re: [fltk.bugs] [MOD] STR #2862: Fl_Table keyboard nav issue: can't use tab to navigate off the widget

2012-07-19 Thread Greg Ercolano
DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2862
Version: 1.3-current


Attached file foo_v2.cxx...


Link: http://www.fltk.org/str.php?L2862
Version: 1.3-current//
// $Id: table-simple.cxx 9086 2011-09-29 21:10:59Z greg.ercolano $
//
//Simple example of using Fl_Table - Greg Ercolano 11/29/2010
//
//Demonstrates the simplest use of Fl_Table possible.
//Display a 10x10 array of integers with row/col headers.
//No interaction; simple display of data only.
//See other examples for more complex interactions with the table.
//
// Copyright 2010 Greg Ercolano.
// Copyright 1998-2010 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
// file is missing or damaged, see the license at:
//
// http://www.fltk.org/COPYING.php
//
// Please report all bugs and problems on the following page:
//
// http://www.fltk.org/str.php
// 
#include FL/Fl.H
#include FL/Fl_Double_Window.H
#include FL/Fl_Table.H
#include FL/Fl_Input.H
#include FL/fl_draw.H

#define MAX_ROWS 30
#define MAX_COLS 26 // A-Z

// Derive a class from Fl_Table
class MyTable : public Fl_Table {

  int data[MAX_ROWS][MAX_COLS]; // data array for cells

  // Draw the row/col headings
  //Make this a dark thin upbox with the text inside.
  //
  void DrawHeader(const char *s, int X, int Y, int W, int H) {
fl_push_clip(X,Y,W,H);
  fl_draw_box(FL_THIN_UP_BOX, X,Y,W,H, row_header_color());
  fl_color(FL_BLACK);
  fl_draw(s, X,Y,W,H, FL_ALIGN_CENTER);
fl_pop_clip();
  } 
  // Draw the cell data
  //Dark gray text on white background with subtle border
  //
  void DrawData(const char *s, int X, int Y, int W, int H, int ROW, int COL) {
fl_push_clip(X,Y,W,H);
  // Draw cell bg
   fl_color( is_selected(ROW,COL) ? FL_YELLOW : FL_WHITE);
   fl_rectf(X,Y,W,H);
  // Draw cell data
  fl_color(FL_GRAY0); fl_draw(s, X,Y,W,H, FL_ALIGN_CENTER);
  // Draw box border
  fl_color(color()); fl_rect(X,Y,W,H);
fl_pop_clip();
  } 
  // Handle drawing table's cells
  // Fl_Table calls this function to draw each visible cell in the table.
  // It's up to us to use FLTK's drawing functions to draw the cells the 
way we want.
  //
  void draw_cell(TableContext context, int ROW=0, int COL=0, int X=0, int Y=0, 
int W=0, int H=0) {
static char s[40];
switch ( context ) {
  case CONTEXT_STARTPAGE:   // before page is drawn..
fl_font(FL_HELVETICA, 16);  // set the font for our drawing 
operations
return; 
  case CONTEXT_COL_HEADER:  // Draw column headers
sprintf(s,%c,'A'+COL);// A, B, C, etc.
DrawHeader(s,X,Y,W,H);
return; 
  case CONTEXT_ROW_HEADER:  // Draw row headers
sprintf(s,%03d:,ROW); // 001:, 002:, etc
DrawHeader(s,X,Y,W,H);
return; 
  case CONTEXT_CELL:// Draw data in cells
sprintf(s,%d,data[ROW][COL]);
DrawData(s,X,Y,W,H,ROW,COL);
return;
  default:
return;
}
  }
public:
  // Constructor
  // Make our data array, and initialize the table options.
  //
  MyTable(int X, int Y, int W, int H, const char *L=0) : Fl_Table(X,Y,W,H,L) {
// Fill data array
for ( int r=0; rMAX_ROWS; r++ )
  for ( int c=0; cMAX_COLS; c++ )
data[r][c] = 1000+(r*1000)+c;
// Rows
rows(MAX_ROWS); // how many rows
row_header(1);  // enable row headers (along left)
row_height_all(20); // default height of rows
row_resize(0);  // disable row resizing
// Cols
cols(MAX_COLS); // how many columns
col_header(1);  // enable column headers (along top)
col_width_all(80);  // default width of columns
col_resize(1);  // enable column resizing
end();  // end the Fl_Table group
  }
  ~MyTable() { }
};

int main(int argc, char **argv) {
  Fl_Double_Window win(900, 400, Simple Table);
MyTable table(10,10,880,350);
table.end();
Fl_Input in(100,360,100,25,Input);
  win.end();
  win.resizable(table);
  win.show(argc,argv);
  return(Fl::run());
}

//
// End of $Id: table-simple.cxx 9086 2011-09-29 21:10:59Z greg.ercolano $.
//
___
fltk-bugs mailing list
fltk-bugs@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-bugs


Re: [fltk.bugs] [MOD] STR #2862: Fl_Table keyboard nav issue: can't use tab to navigate off the widget

2012-07-19 Thread Greg Ercolano

DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2862
Version: 1.3-current


Added a v2 of the test program to this STR to fix a few things in the
trivial first version:

1) Needed to end() the table to prevent the input field from becoming
   a child of the table.

2) Added code to show the selection state of the cells, as this is
   relevant; apparently the table is using tab navigation for its
   cells; hitting tab shows it walks the cells from left-to-right,
   and when it hits the end, focus moves on to the input field.

Probably like the Fl_Input_ widget, Fl_Table needs something like the
tab_nav() method which controls how the table responds to tab navigation
specifically.

Also, an odd behavior was noticed in v2; assuming the table were
had a tab_nav() method and it were disabled (so that tab navigation
doesn't move to other widgets, causing the table to use it for itself):

Tab navigates cells forward (OK)
Shift-Tab navigates cells in reverse (OK) but also does a
multi-cell selection (BAD)

IMHO, the behavior should work this way:

tab_nav() enabled: tab + shift-tab navigate widgets, table does not
   use tab for its own cell navigation. Only arrow key
   navigation can be used to navigate cells (dependent
   on the OPTION_ARROW_FOCUS setting), and SHIFT can be
   used for multicell selection.

tab_nav() disabled: tab + shift-tab navigate /cells/ forward or reverse.
(No multi-select behavior for Tab)
Arrows should also work, and Shift-Arrows should
do multiselect, dependent on OPTION_ARROW_FOCUS.

Perhaps too, there should be an Fl_Table method (if there isn't one now)
to control whether multicell selection should be allowed or not. I imagine
there might be cases where an app doesn't want multi-cell selection, or
might not want interactive cell selection at all via mouse or keyboard.
(eg. a 'read only' interface, where only the program can select cells)


Link: http://www.fltk.org/str.php?L2862
Version: 1.3-current

___
fltk-bugs mailing list
fltk-bugs@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-bugs


Re: [fltk.bugs] [MOD] STR #2862: Fl_Table keyboard nav issue: can't use tab to navigate off the widget

2012-07-19 Thread Greg Ercolano

DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2862
Version: 1.3-current


 Also, an odd behavior was noticed in v2; assuming the table were
 had a tab_nav() method and it were disabled (so that tab navigation
 doesn't move to other widgets, causing the table to use it for itself):

Good grief, grammar. Too bad we can't edit bugs.
That should have been:

Also, an odd behavior was noticed in v2; assuming the table had a
tab_nav() method, and the flag was disabled so that tab navigation
doesn't move to other widgets and the table can use Tab for itself:


Link: http://www.fltk.org/str.php?L2862
Version: 1.3-current

___
fltk-bugs mailing list
fltk-bugs@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-bugs