FLTK logo

Fl_Table 3.10

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 
 Back To Listings  ]
 
Category:Wiki/Software/WidgetsRating:
5.93 
Name:Fl_TablePopularity:15%
Version:3.10License:LGPL
Author:Greg ErcolanoEMail:erco
Created:Mar 30, 2003
Updated:May 11, 2012
Home Page:http://www.seriss.com/people/erco/fltk/Fl_Table/ (5371 visits)
Download:http://www.seriss.com/people/erco/fltk/Fl_Table/ (2748 visits)
Description:

Inspired by the Flvw 'table' widget, which appears to no longer be maintained, so I rewrote it from scratch. Tested with fltk-1.1.3.

A generic table widget for rows + columns. Has several simple example programs showing how to use it.

A clean implementation (IMHO) with complete documentation. Hopefully can be added to FLTK someday. Very easy to include in a program, Makefiles for all supported platforms (Windows/Linux/MacOSX/Irix). Screenshots and documentation.

UPDATE May 10, 2012:

    In 2009, Fl_Table was added to FLTK 1.3.x. So, for the latest version of this widget, use the one inside FLTK. This is where all new development will be focused.


Articles

Submit Article | View All ]
ID Title Last Modified Comment(s)  
  155Fl_Table 1.20Apr 09, 20130  
 

A generic table widget for rows + columns. Has several simple example programs showing how to use it.

 
     

Comments

Submit Comment ]

From Anonymous, 14:26 May 08, 2003 (score=3)

Nice widget!  I was waiting for something like this.  I have a few suggestions, though:

1.  Why can't the Fl_Table draw the cells?  All widgets have draw() functions, so I see no reason that the table just call these itself. 

2.  Scrolling causes a lot of flickering on my computer (WinXP).  Why not just do what Fl_Scroll does and call fl_scroll, so the cells' draw() members have to be called as little as possible? 

3.  It would be nice if selection of rows and columns by clicking the headers was built in.  Perhaps a callback could be called for each widget as it was selected or deselected (to allow them to change their background color, etc.).  The Fl_Table could keep track of which were selected so this could be queried. 

4.  Copying of selected widgets to the clipboard would be nice.  If the cell could be "dynamic_cast"ed to an Fl_Input or and Fl_Output, it's string could be copied.  Columns are separated by tabs and rows by line feeds.  This would allow the contents to be copied and pasted into an MS Excel spreadsheet (and possibly other spreadsheets). 

My goals here are to make this widget very useful and versatile with as little subclassing as possible.  Thanks for reading this.
Reply ]

From Greg Ercolano, 23:50 May 17, 2003 (score=2)

> 1. Why can't the Fl_Table draw the cells? 

To draw the cells would imply Fl_Table needs to know how to access your data, and how to draw it (color, font, bgcolor, etc).

By making this all managed by the user via the callback, you can store the data any way you want, and manage as little or as much info for each cell as you want.

The examples show how to draw the cells. At some point, higher level widgets will be available to make it easier to do particular types of things. Fl_Table is a /low level widget/ that enables people to create enormous tables of information with very little limitations.

> 2. Scrolling causes a lot of flickering on my computer (WinXP). > Why not just do what Fl_Scroll does and call fl_scroll, > so the cells' draw() members have to be called as little as > possible? 

I'm not sure how Fl_Scroll does this, unless it's doing block moves of screen memory. Certainly enabling double buffering should solve this. Take this to the fltk.general group, and we can work out the problem you're seeing.

> 3.  It would be nice if selection of rows and columns by > clicking the headers was built in.

Hmm, that's supposed to be working, but I just looked, and noticed some code was added that oddly disabled this. Try version 2.13; you should be able to select rows by dragging over the cells, or using the usual CTRL- and SHIFT key combos.

> 4.  Copying of selected widgets to the clipboard would be nice.  If > the cell could be "dynamic_cast"ed to an Fl_Input or and Fl_Output, > it's string could be copied.

You should be able to do any kind of copy/pasting you want. It's up to you to implement though, as there's various ways to implement stitching together the a multicell selection into the paste buffer. This would be something for a higher level widget.

As it is, you should be able to copy/paste from e.g the Fl_Input widgets in the widgettable.cxx example.
Reply ]

From Greg Ercolano, 01:48 May 18, 2003 (score=4)

> 2. Scrolling causes a lot of flickering on my computer (WinXP).

If you change the Fl_Window to Fl_Double_Window, the flickering should stop.

The reason the examples use Fl_Window is so I can actually /see/ the redraw behavior; it helps me find problems I don't see when double buffering is on.

I should probably change it to use Fl_Double_Window by default.
Reply ]

From Anonymous, 18:12 May 03, 2003 (score=3)

Unable to connect to web site!
Reply ]

From Amanjit Gill (amanjit.gill, 00:43 May 04, 2003 (score=3)

Yeah, It was up day-before yesterday or so. The table widget is good, far better than wxwindows' table (you can easily place other controls in table). Hope the site will be up again, soon.
Reply ]

From Greg Ercolano, 23:55 May 17, 2003 (score=1)

Yes, 3dsite.com was down for a few days while the equipment was being moved to a new location. That's the only time it's been down for many years; guess you got lucky :/
Reply ]

From 4MAN, 13:16 May 07, 2007 (score=2)

Hi,

I am unable to open the download file under Windows XP.  Am I doing something wrong?

Thanks Bill
Reply ]

From greg.ercolano, 13:39 May 07, 2007 (score=3)

Details? What link are you clicking on, what error message are you getting?

I just now went into Internet Explorer on my WinXP box and clicked on the 'Version 3.12 (04/02/2006)' link: http://www.seriss.com/people/erco/fltk/Fl_Table/Fl_Table-3.12.tar.gz ..and it downloaded fine.


Reply ]

From 4MAN, 10:01 May 08, 2007 (score=3)

Thanks for responding so quickly.  I am able to download, but I get the following message when I try to open the file: error reading header after processing 0 entries.
Reply ]

From 4MAN, 10:44 May 08, 2007 (score=3)

Mystery solved.  For some reason the download produces a tar.tar extension.  When I change the extension to tar.gz everything works fine.

Thanks again.
Reply ]

From Anonymous, 17:41 May 05, 2003 (score=2)

This is the type of widget I was waiting for in FLTK (even voted for it in the poll section). I would love to have stringgrid(Delphi) like functionality. But the problem is (following cut from readme):

"This widget does not handle the data in the table. The draw_cell() method must be overridden by a subclass to manage drawing the contents of the cells."

I am not sure how to do this. I looked at the example code and it looks complicated. Would be great if we could set or get with something like stringgrid[0][1].value("A") and have automatic redraw.
Reply ]

From Greg Ercolano, 23:54 May 17, 2003 (score=3)

> But the problem is (following cut from readme): > "This widget does not handle the data in the table. > The draw_cell() method must be overridden by a subclass to > manage drawing the contents of the cells." > > I am not sure how to do this. I looked at the example code > and it looks complicated.

Hmm, look at testtablerow.cxx; it's just two pages of code (120 lines) and implements two full tables.

As mentioned, Fl_Table is a low level widget. To implement higher level widgets, people can derive classes from it.

The idea of Fl_Table was to get the hard stuff out of the way, yet make it flexible enough to use for the wide and weird variety of ways one needs a table.
Reply ]

 
 

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'.