Skip to main content



      Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Calculating/Getting the number of visible rows in a Table
Calculating/Getting the number of visible rows in a Table [message #371031] Tue, 17 June 2003 05:24 Go to next message
Eclipse UserFriend
I need to know the amount of visible rows in a table, but i can't seem to
get the formula right.

I have a Shell, which a menu and it contains a table.
I need to know the amount of visible rows, so i tried the following :

int itemHeight =
table.getItemHeight()+table.getGridLineWidth();
_visibleRows =
(shell.getClientArea().height-table.getBorderWidth()-table.g etHeaderHeight()
)/itemHeight;

When the shell i large it calculates too few rows, and then the shell is
very small it calculates to many rows.

Hope you can help

/Ruben Hesselbaek
Re: Calculating/Getting the number of visible rows in a Table [message #371048 is a reply to message #371031] Tue, 17 June 2003 10:03 Go to previous message
Eclipse UserFriend
Originally posted by: steve_northover.ca.ibm.com

Why not start at table.getTopIndex() and use item.getBounds() for each item
and compare the rect with table.getClientArea()? How about a snippet?

"Ruben Hesselb
Previous Topic:about ProgressBar
Next Topic:Multi Line Labels/Text Fields
Goto Forum:
  


Current Time: Thu Nov 06 13:52:13 EST 2025

Powered by FUDForum. Page generated in 0.03775 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top