Home > Web Site Updates > CTreeOptionsCtrl v1.74 (Obsolete)

CTreeOptionsCtrl v1.74 (Obsolete)

February 28, 2016
  • Please note that I have discontinued development of this code and it is now considered obsolete. This is because as of Visual Studio 2008 with the MFC Feature Pack, there is a new GUI CMFCPropertyGridCtrl class which implements pretty much all the functionality of CTreeOptionsCtrl. I have reviewed the "NewControls" MFC sample which demonstrates CMFCPropertyGridCtrl as well as a lot of the other Feature Pack classes. With this new class, it is relatively easily to implement:
    • Hierarchical items are supported via the CMFCPropertyGridProperty::AddSubItem method
    • Check boxes can be implemented either via setting the value of a CMFCPropertyGridProperty property to a VT_BOOL or using a custom class derived from CMFCPropertyGridProperty. In the NewControls sample, this corresponds most closely to the class called "CCheckBoxProp".
    • You could implement radio buttons using a custom class derived from CMFCPropertyGridProperty although you would be better advised to implement this using the CMFCPropertyGridProperty::AddOption method to add all possible values to one property instead.
    • The "Your First Name" sample property in my code is supported out of the box using the in place editor support of CMFCPropertyGridCtrl
    • The "Day of the Week" and "Font Name combo" sample properties in my code are supported via the CMFCPropertyGridProperty::AddOption method
    • If you want to link the state of one property to another such as the "Security" sample properties then you would need to implement custom classes derived from CMFCPropertyGridProperty
    • The "Rating" sample property in my code is supported via the CMFCPropertyGridProperty::EnableSpinControl method
    • The "File edit box" and "Folder edit box" properties in my code are supported via the CMFCPropertyGridFileProperty class
    • The "Color selector" property in my code is supported via the CMFCPropertyGridColorProperty class
    • The "Font Selector" property in my code is supported via the CMFCPropertyGridFontProperty class.
    • The "Boolean combo" property in my code is supported via setting the value of a CMFCPropertyGridProperty property to a VT_BOOL.
    • The "Date Example" and "Time Example" properties in my code can be implemented using a custom class derived from CMFCPropertyGridProperty. I was able to implement both of these using just c. 80 lines of code
    • The "IP address Selector" property in my code requires a bit more code to implement than the date or time example as I needed to modify the CMFCPropertyGridCtrl::m_nRowHeight value to avoid clipping when the IP address in place control was drawn. To change the m_nRowHeight value I needed to implement a class derived from CMFCPropertyGridCtrl and override the AdjustLayout method to increase the size of the calculated m_nRowHeight value. I also needed to implement a class derived from CMFCPropertyGridProperty to provide access to the HasButton protected member variable. All told, about 130 lines of code to support an IPv4 address control.
    • The "Your Shoe Size" property in my code is supported via implementing a custom class derived from CMFCPropertyGridProperty. In the NewControls sample, this corresponds most closely to the class called "CCustomDlgProp"
    • The "Your Shoe Size (Combo)" property in my code can be implementing with a custom class derived from CMFCPropertyGridProperty. I was able to take the class called "CTwoButtonsProp" in the "NewControls" sample and modify it to show the standard drop down button and "…" edit bottom at the same time. The drop down button then showed the combo box values while the edit button brought up a custom editor. This was all achieved using just c. 50 lines of code.
    • The "Multi line edit control" property in my code can be implemented using a custom class derived from CMFCPropertyGridProperty.
  • This new built in MFC control class supports a number of additional features such as skinning, masked edit values, embedded slider and ComboBoEx classes, icon lists, a description bar and many other features, which now makes my implementation obsolete.
Categories: Web Site Updates
%d bloggers like this: