Jump to content


Photo

TreeColumn Expand/collapse painting issues


  • Please log in to reply
16 replies to this topic

#1 Ron

Ron
  • Members
  • 10 posts

Posted 23 November 2007 - 03:43 PM

Hi Boki,

I have three questions.

1) Playing with your TreeColumn demo project, i have some strange painting issues.
I have changed the Button1Click procedure and added an NextGrid1.BestFitRow line to automatically change the rowheight to fit the cell text.

procedure TForm1.Button1Click(Sender: TObject);
begin
NextGrid1.AddRow();
NextGrid1.Cell[2, NextGrid1.LastAddedRow].AsString := 'Top Level Top Level Top Level Top Level Top Level Top Level';
NextGrid1.Cell[3, NextGrid1.LastAddedRow].AsInteger := Random(100);
NextGrid1.Cell[4, NextGrid1.LastAddedRow].AsString := 'Top Level Top Level Top Level Top Level Top Level Top Level';
NextGrid1.Cell[5, NextGrid1.LastAddedRow].AsString := '<a href="http://www.google.com">Link Text</a>';
NextGrid1.BestFitRow(NextGrid1.LastAddedRow);
NextGrid1.SelectLastRow;
end;

When you now add some nodes and subnodes, collapse and extract it by clicking on the + and - signs, you can have grid painting issues (See picture)

2) Can you add OnCollapse and OnExtract events to detect the collapsing/Extracting of the nodes ?

3) Is it possible to add a property for showing the +/- signs yes or no ? For preventing that the user can collapse/extract the nodes.

Regards,
Rony

Attached Files

  • Attached File  pic1.JPG   65.18KB   7 downloads


#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 24 November 2007 - 01:10 AM

Hello Ron,

1) I will check this now.

2) I will most probably add it, but not yet sure that I will add event to the column or to grid.

3) I will add this most probably. But in that case, keyboard expand/collapse must be disabled too?

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

#3 Ron

Ron
  • Members
  • 10 posts

Posted 24 November 2007 - 01:47 AM

Hi Boki,

Thanks for checking it out.

<<3) I will add this most probably. But in that case, keyboard expand/collapse must be disabled too?>>

Yes, if it could be, but of course, point 1 is the most important one.

Regards,
Rony

#4 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 24 November 2007 - 05:00 PM

Hello Ron,

1) Can you please send me source of your updated TreeColumn Demo.

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

#5 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 24 November 2007 - 05:47 PM

Hello Ron,

Update:

2) I have add event OnExpand.

3) I have add 2 new properties for this purpose in TreeColumn: ShowButtons and ExpandLock.

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

#6 Ron

Ron
  • Members
  • 10 posts

Posted 25 November 2007 - 12:13 AM

Boki,

Thanks for the additions to my requests. I hope you can resolve the first issue because its the important one.

You get the source for the TreeColumn Demo in atachment.

Regards,
Rony




QUOTE (Boki (Berg) @ Nov 24 2007, 05:00 PM) <{POST_SNAPBACK}>
Hello Ron,

1) Can you please send me source of your updated TreeColumn Demo.

Best regards

Attached Files



#7 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 25 November 2007 - 12:28 AM

Hello Ron,

Thank you , I have spot it now.

I will work on it. I will send you quick fix as soon I fix it (I will need few days I hope).

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

#8 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 26 November 2007 - 11:54 PM

Hello Ron,

I think that I have fix 1) issue. Please check in members section for updated files (zip archive). There are also 2) 3) features added.

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

#9 Ron

Ron
  • Members
  • 10 posts

Posted 28 November 2007 - 11:13 PM

Hi Boki,

I tested here and it looks better now. Only one small thing, when you collapse the nodes and add a row (to the bottom), then you can have a refresh problem. Toggling the 'Show grid' checkbox solves it (there is a refresh of the grid). You can see it by 'playing' with your demo.

Is there also a method available to collapse or expand the nodes ? (for ex NextGrid.CollapseAll or .ExpandAll)

Regards,
Rony Gellaerts

QUOTE (Boki (Berg) @ Nov 26 2007, 11:54 PM) <{POST_SNAPBACK}>
Hello Ron,

I think that I have fix 1) issue. Please check in members section for updated files (zip archive). There are also 2) 3) features added.

Best regards


#10 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 28 November 2007 - 11:47 PM

Hello Ron,

I will check it now and fix it.

There is no this function at this moment, but I will add it.

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

#11 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 04 December 2007 - 02:07 AM

Hello Ron,

Can you please send me small screenshot of this repaint bug?

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

#12 Ron

Ron
  • Members
  • 10 posts

Posted 04 December 2007 - 11:55 PM

Boki,

Here it is. I notice that when you press the 'Alt' key, the screen paints ok then.

Regards,
Rony

Attached Files

  • Attached File  pic.JPG   67.79KB   3 downloads


#13 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 05 December 2007 - 12:00 AM

Hello Ron,

For me all work fine even in your demo. I have do next:

1) Add few root items
2) Add few child nodes inside 3rd root item
3) Add new root item

Everything goes fine. Do I need to do something more?

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

#14 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 05 December 2007 - 12:13 AM

Update: I have spot it.

I will work on it now.
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.

#15 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 05 December 2007 - 12:22 AM

Hello Ron,

Try to change next procedure in File NxGrid.pas:

Locate first procedure TNextGrid.ExpandRows; (about line 279)

Then replace sub-procedure Collapse:

CODE
  procedure Collapse(const Index: Integer);
  var
    i: Integer;
  begin
    i := Index + 1;
    while (i < RowCount) and (GetLevel(i) > GetLevel(Index)) do
    begin
      if FCells.Row[i].Shown then // <----------- new check
      begin
        FCells.ExpandRow(i, False);
        ShowRow(i, RowHeight[i], False);
      end;
      Inc(i);
    end;
  end;


Please tell me how it works now

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

#16 Ron

Ron
  • Members
  • 10 posts

Posted 05 December 2007 - 12:59 AM

Hello Boki,

With the change it looks better now, but if you 'play' long enough (adding nodes, subnodes, delete nodes, delete subnodes, adding lines), you can have again the painting issue, but i must admit, less frequently than before.

Regards,
Rony

#17 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 05 December 2007 - 01:19 AM

Hello Rony,

Thank you. I will look at them more. I hope that they will dissapear all.

Recently, in August I have change this part of code and it seems that new code need some polishing smile.gif

Best regads
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