Components for Delphi and C++ Builder.

Go to Russian forum
Go to EhLib.com
It is currently 29 Mar 2024, 14:45

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: 23 Jul 2020, 19:02 
Offline

Joined: 13 Jul 2019, 19:08
Posts: 88
I looked in the examples but I didn't find it.

I have a TreeView that represents a Menu of system modules and I would like each node to have an icon how could I do that?

I could change the project "\Demos\DBGridEh.TreeView" with different icons on each node for me to understand.

Another thing I wanted to change is the icon that represents the node I wanted a different icon or increase the size because the current one is very small see the image.


Thankful.


Attachments:
Icon_Pequeno.png
Icon_Pequeno.png [ 46.06 KiB | Viewed 2130 times ]
Top
 Profile  
 
PostPosted: 27 Jul 2020, 20:46 
Offline

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

Look at the Demo project \Demos\DBGridEh.TreeView.Solutions\
It have section 'Checkboxes in a Tree' (File FrameFour.pas).
Attachment:
sshot-128.png
sshot-128.png [ 75.44 KiB | Viewed 2113 times ]


Checkboxes are displayed in grid cells using images from the ImageList component.

To display a picture from the ImageList component, you need to make the following settings in the column.

Column.ImageList = ImageList1
Column.ShowImageAndText = True
Column.TextEditing = False

Write Column.OnGetCellParams event handle where image index is assigned to Params.ImageIndex for every record of DataSet.

Code:
procedure TfrFrameFour.DBGridEh1Columns0GetCellParams(Sender: TObject;
  EditMode: Boolean; Params: TColCellParamsEh);
begin
  Params.ImageIndex := MemTableEh1.FieldByName('ImageIndex').AsInteger;
end;


In this example, the picture number is already stored in the DafaSet field - ImageIndex.

-----
About drawing the Plus / Minus tree icons.
Unfortunately, this function is hardcoded.
You need to rewrite the function
procedure TCustomDBGridEh.DrawGridTreeElement.

_________________
Best regards
EhLib Support Team


Top
 Profile  
 
PostPosted: 28 Jul 2020, 00:29 
Offline

Joined: 13 Jul 2019, 19:08
Posts: 88
Hello it worked the icons were good.

However, the size of the Nodes are very small. Would there be any way for me to change the method overload so I don't need to modify the component every time I update it?

Or a property could be created so that we can place the Icon as a Node, or a property to change the size of the Node.

Thankful.


Attachments:
Icon_Pequeno.png
Icon_Pequeno.png [ 190.25 KiB | Viewed 2113 times ]
Top
 Profile  
 
PostPosted: 26 Aug 2020, 14:12 
Offline

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

Do you mean the Plus / Minus Icon that shows the branch's open status?
Unfortunately in the current version there is no such possibility.
We have added this request to the list for the next version of the library.

_________________
Best regards
EhLib Support Team


Top
 Profile  
 
PostPosted: 26 Aug 2020, 14:31 
Offline

Joined: 13 Jul 2019, 19:08
Posts: 88
this the plus and minus icons, a way to increase this icon that is very small in full HD and 4K resolution


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: No registered users and 8 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