Components for Delphi and C++ Builder.

Go to Russian forum
Go to EhLib.com
It is currently 28 Mar 2024, 21:39

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: 24 Aug 2018, 13:25 
Offline

Joined: 24 Aug 2018, 13:15
Posts: 46
Location: Brazil
Hello, I'm testing EhLib to see if the components attend the necessities of my company.
I was wondering if it is possible to highlight with a different colour the lines of the nodes in the TreeView without using OnDrawColumnCell or if I should just use bold text

Thanks!


Top
 Profile  
 
PostPosted: 25 Aug 2018, 21:50 
Offline

Joined: 08 May 2014, 18:06
Posts: 660
Hello

You can use Column.OnGetCellParams event
like this

Code:
procedure TForm1.DBGridEh1Columns0GetCellParams(Sender: TObject;
  EditMode: Boolean; Params: TColCellParamsEh);
begin
  if (MemTableEh1.RecView.NodeLevel = 1) then
    Params.Font.Style := [fsBold];
end;


Attachments:
sshot-39.png
sshot-39.png [ 16.21 KiB | Viewed 1789 times ]

_________________
Best regards
EhLib Support Team
Top
 Profile  
 
PostPosted: 30 Jun 2020, 14:17 
Offline

Joined: 24 Aug 2018, 13:15
Posts: 46
Location: Brazil
Is it possible to paint the lines of the child node with a different color?


Top
 Profile  
 
PostPosted: 30 Jun 2020, 16:40 
Offline

Joined: 08 May 2014, 18:06
Posts: 660
Hello

You can use TColumnEh.AdvDrawDataCell event to draw default and extra information on the cell.
Like this

Code:
procedure TForm1.DBGridEh1Columns0AdvDrawDataCell(Sender: TCustomDBGridEh; Cell,
  AreaCell: TGridCoord; Column: TColumnEh; const ARect: TRect;
  var Params: TColCellParamsEh; var Processed: Boolean);
begin
  DBGridEh1.DefaultDrawColumnDataCell(Cell, AreaCell, Column, ARect, Params);

  if (MemTableEh1.RecView.NodeLevel > 1) then
  begin
    DBGridEh1.Canvas.Pen.Color := clRed;
    DBGridEh1.Canvas.Polyline([Point(ARect.Left-1, ARect.Top), Point(ARect.Left-1, ARect.Bottom)]);
  end;

  Processed := True;
end;


Attachments:
sshot-119.png
sshot-119.png [ 6.3 KiB | Viewed 1326 times ]

_________________
Best regards
EhLib Support Team
Top
 Profile  
 
PostPosted: 30 Jun 2020, 16:53 
Offline

Joined: 24 Aug 2018, 13:15
Posts: 46
Location: Brazil
Very Nice

Thanks


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: Bing [Bot] and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group