Scrolling with Hidden rows
#21
Posted 09 September 2007 - 03:30 PM
Regards,
Deon
#22
Posted 09 September 2007 - 03:33 PM
I need now to solve problem with PageUp/PageDown and I am not sure if this will be done in one day and what may go to bad
But, I am thinking that I am on right track.
Best regards
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
#23
Posted 12 September 2007 - 09:10 AM
I got the pre-release you sent me - thanks.
Unfortunately there are still so many code gaps that I can't test anything (the grid always loads only the first row - nothing else).
I will wait a few more days until you have a working version for me to test.
Regards,
Deon
#24
Posted 12 September 2007 - 10:40 AM
Can you please modify this sample which I use to help me with finding this gaps:
Select_Hidden_Rows.zip 2.37KB 5 downloads
Best regards
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
#25
Posted 12 September 2007 - 07:58 PM
After applying the FLastAddedRow fix you sent me, the loading of the grid is fine now. The scrolling also seems to be working very well now
There is still one (specific) situation where I noticed that the scrolling does not work. I will try to find the steps to recreate it now, and will let you know.
Regards,
Deon
#26
Posted 12 September 2007 - 08:00 PM
I am glad that things go better
I hope that everything will be done untill September 14-15.
If you can reproduce this situation this will be great.
Best regards
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
#27
Posted 12 September 2007 - 08:20 PM
It is very hard to pinpoint. It looks like the problem occurs only if you set a filter (hide some rows) before the grid was ever clicked.
On the attached demo:
1. Run the program.
Click on any row in the grid.
Click on Set Filter.
Now scroll the grid --> Everything is fine.
2. Run the program.
Don't click on the grid --> just go straight to Set Filter.
Now scroll the grid --> you will see the problem.
Like I said, it is hard to poinpoint, but if you don't click on the grid first, it seems to happen (more or less) every time...
Regards,
Attached Files
#28
Posted 12 September 2007 - 10:08 PM
I didn't find a difference, but I see now that line
Didn't scroll grid correcltly. I will see now why this happen.
Best regards
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
#29
Posted 12 September 2007 - 10:14 PM
Please try to change this procedure (NxGrid.pas):
ARowHeight: Integer;
begin
if RowVisible[Index] <> Value then
begin
FCells.ShowRow(Index, Value);
case GridStyle of
gsReport: ARowHeight := GetRowHeight(Index);
else ARowHeight := SlideSize;
end;
ShowRow(Index, ARowHeight, Value, False);
if Index = FFirstRow then Dec(FFirstRow);
inherited;
end;
end;
You may send me more reports and I will work on them.
Best regards
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
#30
Posted 13 September 2007 - 08:53 AM
The new fix causes List Index Out of Bounds errors. Try to sort any column and you will see.
What is the difference between FFirstRow and FFirstVisibleRow?
Regards,
#31
Posted 13 September 2007 - 10:32 AM
Change this procedure too (NxGrid.pas):
var
ASortKind: TSortKind;
ASelectedRow: TRow;
begin
inherited;
ASelectedRow := nil;
if coCanSort in AColumn.Options then
begin
FFirstVisibleRow := GetFirstVisible(0);
FLastVisibleRow := GetLastVisible(Pred(RowCount));
{ TODO 3 -oBoki -cMedium Bug : Update FirstRow after InverseSort. }
if Asending then ASortKind := skAscending else ASortKind := skDescending;
{ Remember selected row }
if RowExist(SelectedRow) then ASelectedRow := FCells.Row[SelectedRow];
FCells.SortColumn(AColumn.Index, AColumn.SortType, ASortKind);
{ Find old selected row (after sorting) and set it active }
if Assigned(ASelectedRow) then SetSelectedCell(SelectedColumn, FCells.GetRowIndex(ASelectedRow));
if SelectedRow > -1 then ScrollToRow(SelectedRow);
RefreshArea(gaBody);
if goIndicator in Options then
RefreshArea(gaIndicator);
DoAfterSort(AColumn.Index);
end;
end;
FFirstRow indicate first visible row in view, and FFirstVisibleRow indicate first visible row in whole grid.
Best regards
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
#32
Posted 13 September 2007 - 12:25 PM
I changed the SortRow procedure, but I now I get a List index error in GetRowTop(). It is using FFirstRow in a loop that check RowVisible[I], but FFirstRow is -1.
So then I changed the previous fix in SetRowVisible to...
if (Index = FFirstRow) and (FFirstRow > 0) then Dec(FFirstRow);
inherited;
...but then it is really messed up. (I can send you a demo if you want).
I think the problem may be with FFirstRow. It is decremented by a few procedures, but it's not really incremented very often.
The only places I could find is:
ShowRow:
This procedure increments FFirstRow, but only if (Index = FFirstRow).
GetVertOffset:
This procedure increments FFirstRow, but the procedure is never called from any code?
I will try to trace it some more.
Regards,
Deon
#33
Posted 13 September 2007 - 12:32 PM
If you can, please send it to me. I may send you complete my version agai too (can't track differences anymore )
PS. Maybe you need to use FirstVisibleRow instead FirstVisible row while you loop trough visible rows?
Best regards
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
#34
Posted 13 September 2007 - 12:43 PM
Yes. Please send me latest version again.
Thanks
#35
Posted 13 September 2007 - 06:05 PM
I have sent it to you again. But I am not sure why you read FirstRow row in loop This is a first row in visible portion of grid.
But I will see why is -1 anyway. It doesn't need to be -1.
Best regards
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
#36
Posted 13 September 2007 - 08:33 PM
I have installed the latest version again, and it is still the same.
Run the attached demo, then click on "Do Filter" (2 or 3 times) until you get the error.
It is not me who is using FFirstRow in the loop I was talking about - it is you
Look at the Line#2 and Line#5 of the GetRowTop() function below:
var
i, Delta: Integer;
begin
Result := GetBodyRect.Top + GridSpace[lpTop];
for i := FFirstRow to Index - 1 do <--------
begin
if i < RowCount then begin
if GetRowVisible(i) then Delta := GetRowHeight(i) else Delta := 0; <--------
end else Delta := RowSize;
if Delta > 0 then begin
Inc(Result, Delta);
Inc(Result, GridSpace[lpTopBottom]);
end;
end;
end;
GetRowVisible will cause a List Index error if FFirstRow is -1. The problem is that when you call Dec(FFirstRow) in SetRowVisible procedure, you are not checking if FFirstRow is already zero.
That is what I meant....
Regards,
Deon
Attached Files
#37
Posted 13 September 2007 - 08:45 PM
Thank you. I will check it now again.
Best regards
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
#38
Posted 13 September 2007 - 09:49 PM
Try to comment this line in TNextGrid.SetRowVisible:
I hope that now we are closer to the solution
Best regards
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
#39
Posted 19 September 2007 - 08:37 AM
On the latest version you sent me, it actually seems to be working fine now
I will let you know if I run into any "funnies", but for now it seems to be sorted out. Thanks again for all the long hours you spent trying to sort this out - I really appreciate it.
Regards,
Deon
#40
Posted 19 September 2007 - 02:08 PM
Thank you too for great help with solving this bug. I will continue to test it.
Best regards
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users