View previous topic :: View next topic |
Author |
Message |
Bill
Joined: 14 May 2007 Posts: 4
|
Posted: Wed Jun 06, 2007 4:38 pm Post subject: Right Image |
|
|
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 |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Thu Jun 07, 2007 11:01 pm Post subject: |
|
|
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 |
|
|
Bill
Joined: 14 May 2007 Posts: 4
|
Posted: Fri Jun 08, 2007 12:34 pm Post subject: Right Image Property |
|
|
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 |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Mon Jun 11, 2007 12:33 am Post subject: |
|
|
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 |
|
|
|