Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » Property Grid problem Collapse All
Subject Author Date
Sanna B Sep 7, 2005 - 8:14 AM

I have a project where I shall use the Property Grid to show properties for my own objects. I have looked at the sample project, but I can not figure out how I shall do to get it to work as I want.


The problem is that I will not use for example a button that I will change property on, I will have my own objects (for example a class or so...) that I will change values on. I hope you can help me find a way to do this!

Technical Support Sep 7, 2005 - 1:12 PM

Your classes (whose objects need to be configured with the property grid control) should be able to generate their property trees, i.e. they should have their property store objects (the CExtPropertyStore class) with tree structures of property categories (the CExtPropertyCategory class) and property values (the CExtPropertyValue class). After that you can assign a particular property store to the property grid control by invoking the CExtPropertyGridCtrl::PropertyStoreSet() method. That is enough to make all the properties visible in the property grid control. To receive the change event from the property grid control, you can follow either of the two ways:

1) Implement a set of CExtPropertyValue-derived classes for all your properties and implement the CExtPropertyValue::Apply() virtual method in them. This approach is used in the PropertyGrid sample application and allows you to code separate value change handlers.

2) You can also use all the value change events in one method and use value names to detect which property is changed. You need to use your own CExtPropertyGridCtrl-derived class and override the CExtPropertyGridCtrl::OnPgcInputComplete() virtual method.

The article on the Prof-UIS property grid that includes step-by-step instructions on how to use it and a very simple sample application is to be published within a few days. You can also provide us with details of your task so that we can help you with advice and/or a startup project.