Jump to content


Photo

TNxListGridView6.GetFirstRowInPage


  • Please log in to reply
8 replies to this topic

#1 DelphiToday

DelphiToday
  • Members
  • 156 posts
  • Gender:Male

Posted 15 August 2024 - 07:27 AM

VirtualGridMode: when using Showing := (Index mod 2) = 0; PageUp is not working anymore.

See source below and now it works. If this source is a better solution can you implement it?

function TNxListGridView6.GetFirstRowInPage: Integer;

  function FindFirstRowInPage: Integer;
  begin
    Result := FFirstIndex;

    while Result < RowCount do
    begin
      if Showing[Result] then
      begin
        Break;
      end;
      Inc(Result);
    end;
  end;

begin
  if (VirtualMode) then Result := FindFirstRowInPage
    else Result := FFirstIndex;

//  Result := FFirstIndex;
  { TODO: Solve better FindFirstRowInPage for VirtualMode }
//  if VirtualMode then Result := FindFirstRowInPage else Result := FFirstIndex;
end;

And the old one is not good because it's not looking at the first row in Page.

You can remove i think? Or rewrite it. That's better i think because i use something like this to calculate de Row center of the Page.

It's never been used in your sources.

///<summary></summary>
///<returns>Index of first row in Page</returns>
///<author>Eduard</author>
function TNxGridView6.FindFirstRowInPage: Integer;
var
  Count: Integer;
begin
  { 8/28/16: Changed 0 to -1 }
  Result := -1;

  Count := 0;
  while Result < RowCount do
  begin
    Inc(Result);
    if Showing[Result] then
    begin
      Inc(Count);
      if Count > VertScrollBar.Position then Break;
    end;
  end;
end;

Kind regards,

Eduard. :)
 

 

 

 



#2 DelphiToday

DelphiToday
  • Members
  • 156 posts
  • Gender:Male

Posted 16 August 2024 - 02:07 PM

Here is a sample source so you can see what i mean.

Executable included so you can test it right away.

Try a few times PageDn and then try PageUp. Oeps :o

Build with your latest update.

 

Attached File  Project1PdPu.zip   1.32MB   0 downloads



#3 DelphiToday

DelphiToday
  • Members
  • 156 posts
  • Gender:Male

Posted 18 August 2024 - 01:57 PM

I saw another (text) error. Look at attachment.

 

Attached File  BOKI_2024-08-18_124756.png   2.15KB   1 downloads

 

The Header Right Justify with padding is not working anymore. Even de sort indicator is wrong. 

I myself put an older 'NxGridStylePaint6.pas' (23-11-2021) back and now it's working like before. Date is old so don't know the version.

(Padding is never worked i think, seems 2px default with the old one)

 

Hope you can fix all of the problems.

 

Regards,

Eduard.

 

 



#4 DelphiToday

DelphiToday
  • Members
  • 156 posts
  • Gender:Male

Posted 21 August 2024 - 12:41 PM

You think you can fix it?

Regards.



#5 DelphiToday

DelphiToday
  • Members
  • 156 posts
  • Gender:Male

Posted 17 December 2024 - 01:36 PM

Hi Mister Bojan,

 

I wish you a fine Christmas and a peaceful new year.

 

Is het possible to fix my problems. New update was little update.

It's always the Virtual Grid  situations

 

Regards,

Eduard.



#6 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,236 posts
  • Gender:Male

Posted 17 December 2024 - 02:05 PM

I saw another (text) error. Look at attachment.

 

attachicon.gif BOKI_2024-08-18_124756.png

 

The Header Right Justify with padding is not working anymore. Even de sort indicator is wrong. 

I myself put an older 'NxGridStylePaint6.pas' (23-11-2021) back and now it's working like before. Date is old so don't know the version.

(Padding is never worked i think, seems 2px default with the old one)

 

Hope you can fix all of the problems.

 

Regards,

Eduard.

Hi,

Can you send me a simple dfm file for this issue? I never saw something like this before, so maybe some unique combination produces it,


boki@bergsoft.net | LinkedIn Profile
--
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.

#7 DelphiToday

DelphiToday
  • Members
  • 156 posts
  • Gender:Male

Posted 18 December 2024 - 12:41 PM

Create compleet new installation Delphi 10.4 and your latest 'nextgrid6_12-24.zip'.

 

Attached File  BOKI HEADER 2024-12-18_102931.jpg   24.11KB   0 downloads

 

The Header text padding is not working. The Sort indicator is mutilated, under the Header text.

 

And PageUp not working if you press  few times PageDown first.

 

Look also at my previous text in this topic.

 

Here is some source you can try... EXE not attached because the file would be too large

 

Attached File  Project1PdPu_UPDATE.zip   44.97KB   1 downloads

 

Regards :)

 

 



#8 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,236 posts
  • Gender:Male

Posted 18 December 2024 - 03:36 PM

Hello,

 

Thank you for you demo project. It helps a lot.

 

I found that for some reason Screen.PixelPerInch returns 96 in your demo project, but on mine (with 4K screen) is 192. It seems that this is causing all the problems so I will work now to find the solution. 


boki@bergsoft.net | LinkedIn Profile
--
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.

#9 DelphiToday

DelphiToday
  • Members
  • 156 posts
  • Gender:Male

Posted 18 December 2024 - 03:44 PM

That's fine. Don't forget to look at de PageUp.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users