Jump to content


Photo

need help on getnextsibling


  • Please log in to reply
5 replies to this topic

#1 chris

chris
  • Members
  • 21 posts
  • Location:Bordeaux, france

Posted 06 April 2006 - 01:05 PM

hello,
what is exactly for ?
is it to find next parent or to find next record on same level ?

#2 wvd_vegt

wvd_vegt

    Master Member

  • Honorable Members
  • PipPipPipPipPip
  • 710 posts
  • Gender:Male
  • Location:the Netherlands

Posted 06 April 2006 - 06:44 PM

Hi,

Returns the next row (if any) with the same indent level and attached to the same parent.

So from the parent's view it's the next child (if any).
G.W. van der Vegt

#3 chris

chris
  • Members
  • 21 posts
  • Location:Bordeaux, france

Posted 06 April 2006 - 06:54 PM

so it's not working
try to do this

parent1
child1
parent2
child2

if you put cursor on child1 the function return row 3 (child2) instead of -1

O btw i think i detected the sam error of you, when i expand manualy by clicking a node and then do a searchnext the cursor is on a correct position but i cant see it, obliged to roll up the grid.

#4 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 06 April 2006 - 09:10 PM

Hello,

I have fix it. If you have a source, open NxGrid.pas, find TNextGrid.GetNextSibling and change it to:

CODE
function TNextGrid.GetNextSibling(const Index: Integer): Integer;

var

 i: Integer;

begin

 Result := -1;

 for i := Index + 1 to Pred(RowCount) do

   if GetLevel(i) >= GetLevel(Index) then

   begin

     if GetLevel(i) = GetLevel(Index) then

     begin

       Result := i;

       Break;

     end

   end else Exit; // <---------- New

end;


regards[/code]
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.

#5 chris

chris
  • Members
  • 21 posts
  • Location:Bordeaux, france

Posted 07 April 2006 - 10:14 AM

thank you boki, is it the same for getprevsibling ?

#6 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 07 April 2006 - 09:13 PM

Hello,

Yes it is.

regards
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.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users