![]() |
CXTPPropertyGrid: Custom Colors for Captions |
Post Reply
|
| Author | |
MacW
Senior Member
Joined: 26 June 2007 Status: Offline Points: 253 |
Post Options
Thanks(0)
Quote Reply
Topic: CXTPPropertyGrid: Custom Colors for CaptionsPosted: 27 February 2008 at 9:32am |
|
Hi,
it seems that it is not possible to color individual captions of a CXTPPropertyGrid. I need different colors for different captions. Using my own CXTPPropertyGridPaintManager and overriding the GetItemTextColor and GetItemBackColor works only for normal items, but not captions. The problem is the call to DrawCategoryCaptionBackground in "TPPropertyGridPaintManager.cpp" which fills the entire caption with the line color. This method is not virtual and hence I cannot change the behavior. Can this be made virtual in the next ToolkitPro release? And while you're at it, would it be possible to change the AddCategory / InsertCategory of CXTPPropertyGrid in a way that allows us to use objects derived from CXTPPropertyGridItem? This is currently only possible with AddChildItem, but not for categories. This causes some rather rough work-arounds. It would be much simpler if you would add a method like virtual CXTPPropertyGridItem* CreateInstance() which just does a return new CXTPPropertyGridItem in the CXTPPropertyGrid class, but could be overloaded to return a derived class instead in a class derived from CXTPPropertyGridItem. |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 27 February 2008 at 11:01am |
|
Hi,
DrawCategoryCaptionBackground is virtual even in 11.1.3 version.
Good suggestion about InsertCategory. Changed.
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
MacW
Senior Member
Joined: 26 June 2007 Status: Offline Points: 253 |
Post Options
Thanks(0)
Quote Reply
Posted: 27 February 2008 at 2:33pm |
|
Hi, Oleg
Thanks. Must have looked at a derived PaintManager accidentally ![]() The problem I have is that I don't know _which_ caption is to be drawn inside this method. I would need to override the entire DrawItem method in order to change how the caption is filled. The GetItemBackColor takes the item as a parameter, but not the DrawCategoryCaptionBackground method... Two virtual methods like GetCaptionBackColor and GetCaptionTextColor would solve this problem for me. And would bring the caption painting mechanism in line with the painting mechanism of the normal items. Thanks for allowing us to use derived classes as categories in upcoming versions. This makes it easier to associate custom data with categories, like with items now. PS.: I hope XAML support will also make it to the property grid ![]() |
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |