LOGIN    REGISTER

homepage

Smart PropertyGrid.MFC

The string concept

Each property type must be able to give a string representation of the value, as well as a display string (which can be the same). Those strings are heavily used internally, for example to draw the value or to display its tooltip. It is also a way to transmit sub property values to a master grouped property allowing the possibility to create complex properties. Without entering the details here, it is a powerful way to make a property generic. When you design your own property types, or a new drawing manager, you will use those strings.

So let's give an example with colors: An RGB property value stores a COLORREF but also gives an hexadecimal string representation. So for white, it would be the string "FFFFFF". Without customization, an RGB property value only draws a raw block of color.

String representation not used

When associated with a special look class, the string is used to display the color value. In this case the display string is the same as the string representation.

String representation used for display

There is a feature in the look class to modify the display string. In this case, the string representation is transformed to display the color in R,G,B form.

String representation modified for display