Infralution Support Forum Index Infralution Support
Support groups for Infralution products
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Right Image

 
Post new topic   Reply to topic    Infralution Support Forum Index -> Virtual Tree Support
View previous topic :: View next topic  
Author Message
Bill



Joined: 14 May 2007
Posts: 4

PostPosted: Wed Jun 06, 2007 4:38 pm    Post subject: Right Image Reply with quote

Is it possible to display two images on a row? What I would like to do is to create a tree display like Outlook with a folder icon on the left, the text in the center and then either a "on the fly" generated bitmap with the number of unread messages or a flag that would identify the row as important.
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Thu Jun 07, 2007 11:01 pm    Post subject: Reply with quote

Quote:
Is it possible to display two images on a row? What I would like to do is to create a tree display like Outlook with a folder icon on the left...

Yes this is possible. Take a look a the Advanced Features sample project. It gives a user interface similar to that of Outlook.

Create an extra column to display the second image. If you are using Object Binding and your bound object has an icon property then you can simply set the following CellBinding properties:

Field = name of the property that returns the icon
ShowPreview = true
ShowText = false

If you need to calculate the icon to use programmatically then you can handle the GetCellData event and set CellData.Value to the icon and the CellData.ShowPreview, CellData.ShowText as above.

The column will now display the icon. There are some other properties related to displaying graphic previews of data which you can also play with.

An alternative, if you need to handle interaction with the user, is to create a custom control that displays the icon and set this control as the CellEditor with the DisplayMode set to "Always"
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Bill



Joined: 14 May 2007
Posts: 4

PostPosted: Fri Jun 08, 2007 12:34 pm    Post subject: Right Image Property Reply with quote

Is it possible to have two images in the same cell? So that the width would be jagged? Such as Image-text- Image. The tree that Im using now (and want to move away from) has a right image property in addition to the (left) image properties.
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Mon Jun 11, 2007 12:33 am    Post subject: Reply with quote

This is not something that is supported directly (ie by simply setting properties etc) but you could achieve this by handling the painting of the CellWidget yourself. This is a somewhat more complex task. To do it you need to create a derived CellWidget class and tell Virtual Tree to use it instead of the standard CellWidget (see the section in the online help on using custom widgets).

You would override the PaintText method of the CellWidget to draw the text and paint your right icon. You would also need to override the GetOptimalWidth method to add the width required for your right icon. This will allow the automatic column sizing to work correctly.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Infralution Support Forum Index -> Virtual Tree Support All times are GMT
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group