Jump to content


IVO GELOV

Member Since 28 Apr 2009
Offline Last Active Apr 10 2010 10:35 PM
-----

Topics I've Started

Workaround for wrong horizontal scroll bar

01 May 2009 - 01:27 PM

I noticed another bug. It can be reproduced in this way:
1. Create a new application in Delphi
2. Place a NextGrid component on the main form
3. Create 3 textual columns - first column should be AutoSize, and last column should be Invisible
4. Now run the application
The bug is that there is a horizontal scroll-bar although the last column is invisible.
Here is a screenshot:
Attached File  wrong.gif   9.99KB   1 downloads

The workaround (I am too lazy to dive into the source code to make a fix) is to manually set
the "Options" property of the grid inside OnFormCreate handler, like this:
....
myGrid.Options:=myGrid.Options;
....

2 small fixes

29 April 2009 - 12:54 PM

I suggest 2 small fixes:

1. Fix wrong painting of header captions with Alignment = taCenter when the column is resized below the caption text width

Change the code on line 631 in file "Sources/Next Grid/NxDisplays.pas" from

CODE
taCenter: TextPos.X := R.Left + (R.Right - R.Left) div 2 - CaptionWidth div 2;


to

CODE
taCenter: if CaptionWidth<(R.Right - R.Left) then TextPos.X := R.Left + ((R.Right - R.Left - CaptionWidth) shr 1);


2. Fix the bug with not calling DoDeselectCell from DeleteRow procedure

Change the code on line 940 in file "Sources/Next Grid/NxGrid.pas" from

CODE
if SelectedRow >= FLastVisibleRow then SetSelectedCell(SelectedColumn, FLastVisibleRow);


to

CODE
  if SelectedRow >= FLastVisibleRow then
  begin
      DoDeselectCell(SelectedColumn,SelectedRow);
      SetSelectedCell(SelectedColumn, FLastVisibleRow);
  end;