Tuesday, September 26, 2006

SWT: table vertical header

Matrex RC1 introduced a vertical header column in the matrix editor table, to show the row index or, if needed, to show a vector as a vertical ruler.

The SWT table does not allow to have a vertical header column as needed for Matrex, i.e. such that:
  • is a fixed column in the table (it remains always visible scrolling horizontally)
  • has cells with raised border to distinguish it from the other columns.

In version RC1 I decided to not loose so much time verifying if there was a work around, so I simply used as vertical header the first column of the table and giving it a gray color to distinguish it from the others.

In version 1.0 final I want to have a vertical header in other two tables, the matrix viewer and the presentation viewer, just to show the row index.
Therefore I started to see if there is a better solution than the one implemented in version RC1.

So I tested the SWT snippet 2 which should solve the problem using as vertical header a different table with only one column, synchronized with the original one.
This is a good idea, but has these problems:
  • the vertical header table appears with a vertical scrollbar, which lets it appear disconnected from the main table. The scrollbar can be hidden, but I'm not sure it can be done on any platform.
  • the cells have no raised border.
  • sometimes the rows in the two tables appear slightly unsynchronized. This happens because the main table shows its first row only partially.
These problems (expecially the last one) make this solution not very usable and definitely do not give a professional look to the application.
Therefore by now I keep the solution used in version RC1. I'll see in the future if there will be other possibilities.

No comments: