BCGControlBar Pro for MFC
CBCGPPropertyManager

Detailed Description

The CBCGPPropertyManager class implements an easy and efficient way to create your application properties (options) from XML file, bind properties to CBCGPPropList control, save property values to the registry and load them.

How to use a property manager in the application:

  • Create a properties XML file (the following article describes how to create it: https://bcgsoft.com/doc/how_to_create_property_grid_xml.htm) and add this file to your resources (resource type is XML, resource ID, for example, will be IDR_PROPERTIES_XML).
  • Derive your class from CBCGPPropertyManager class and override OnPropertyChanged method. In this method you will be able to add any actions that should be performed after property has been changed.
  • Add m_PropManager member (CBCGPPropertyManager-derived) to the application class.
  • Add the following code in your application's InitInstance (after SetRegistryBase):
Copy
if (m_PropManager.Load(IDR_PROPERTIES_XML))
{
m_PropManager.LoadFromRegistry();
}

Public Member Functions

 CBCGPPropertyManagerDefault constructor.
 
 BindBinds all properties to the given property list control.
 
 GetPropertyReturns a property list control property according to the specified path.
 
 GetPropertyReturns a property list control property according to the specified ID.
 
 LoadLoads properties from XML resource.
 
 LoadFromFileLoads properties from external XML file.
 
 LoadFromXMLBufferLoads properties from from XML buffer allocated in memory.
 
 LoadStrLoads properties from XML resource.
 
 LoadValuesFromRegistryLoads property values from the application registry branch.
 
 OnAfterLoadPropertiesCalled by the framework after all properties are loaded from the XML and ready to use.
 
 OnPropertyChangedCalled by the framework when the value of a property has changed.
 
 RemoveAllRemoves all property objects from a property manager.
 
 SaveToFileSaves properties in external XML file.
 
 SaveValuesInRegistrySaves the property values in the application registry branch.
 
 UnBindCancel binding with a property list control.