An Adaptable Property List Control

Environment: VC6 SP4, NT5 SP5

In an application I was developing, there was a need to implement some kind of the user interface for changing an object properties for different types of objects. Some object properties are static, but there are objects in which their propreties are changing, concerning their actual state. So I have decided to create a control like in Microsoft Visual Basic with a feature of an adapting context of property items to an object state. Take a look at a simple example. I need to describe individual items of the form. This item can display a simple text, but also a concrete representation from a database. If this item displays only a simple text, I do not need to enter other parameters (an object property) for discribing data and for formating this data.

How it works

The CPropertyListCtrl class implements neccessary utility for presenting property items and for an user interaction.
The CInPlaceEditImp and CInPlaceComboBox classes implement in place controls for editing an item value, the CInPlaceEditImp for string values and the CInPlaceComboBox for list items or enumerations.
And the end the property data item classes CPropertyItemString, CPropertyItemList, CPropertyItemCategory, CPropertyItemManager and CPropertyItemManagerAdaptable for property data items manipulations. The CPropertyItemString and CPropertyItemList are classes for basic editing property data values. The CPropertyItemCategory is the class containing property items of one category and the CPropertyItemManager is a container for all property categories of an object. The CPropertyItemManagerAdaptable class supports a mechanism of the adaptibility.

How to use it

  1. Include source files into your project.
  2. If you need you can define your own property list item values (enumerations) derived from the class CPropertyItemList or implement your own custom property item value derived from the base class CPropertyItem.
  3. Implement your property item manager that describes property items of your object. In the case the property items are changing according to the object state, derive your property item manager from the class CPropertyItemManagerAdaptable.
  4. Use the CPropertyListCtrl control in your dialog or view and set its property item manager by SetPropertyItemManager method.

How to implement an own property item value class

Derive it from the base class CPropertyItem and implement its get/set methods and its virtual methods:
virtual void DrawValue(CDC* pDC, CRect& rect), for drawing a property item value into the CPropertyListCtrl dc context.
virtual void CreateInPlaceControl(CWnd* pWndParent, CRect& rect, CWnd*& pWndInPlaceControl), for creating its own suitable in place control for editing its value.
virtual void SetData(CWnd* pWndInPlaceControl), for setting its value after the end of editing by an in place control.

// CMyPropertyItem

class CMyPropertyItem : public CPropertyItem
 CMyPropertyItem(const CMyPropertyItem& d);
 CMyPropertyItem& operator=(const CMyPropertyItem& d);


 CMyPropertyItem(MyDataType myData = INI_VALUE);
 virtual ~CMyPropertyItem();

 // Attributes
 MyDataTyp& GetData() const;
 void SetData(MyDataType& myData);

 // Operations
 virtual void DrawValue(CDC* pDC, CRect& rect);
 virtual void CreateInPlaceControl(CWnd* pWndParent, 
                                   CRect& rect, 
                                   CWnd*& pWndInPlaceControl);
 virtual void SetData(CWnd* pWndInPlaceControl);

 // Data
 MyDataType m_myData;

And define its GET_ITEM... and SET_ITEM... macros that are used in a conjuction with BEGIN_ITERATE_PROPERTY_ITEMS macros. For better understanding look at how are implemented the CPropertyItemString or CPropertyItemList classes.

How to define an own property list item value class

Use predefined macros for implementing property list item values. In this examles is defined the CMyCustomPropertyItemList with two property items.

// CMyCustomPropertyItemList

 LPCTSTR_STRING_ITEM_DATA(_T("A string value here")),

Or you can implement your own class, derived from the CPropertyItemList class, declaring its virtual 'LPCTSTR GetItemData(int nItem) const' function.

// CMyOwnPropertyItemList
class CMyOwnPropertyItemList : public CPropertyItemList
 virtual LPCTSTR GetItemData(int nItem) const;

How to implement an own property item manager class

In order to the CPropertyListCtrl control knows that items display, you have to implement your own property item manager describing property items of your object. If your object property items are static you simple derive your property item manager from the class CPropertyItemManager and in the constructor declare these items using predefined macros :

// CMyStaticPropertyItemManager
 // General
 BEGIN_PROPERTY_TAB(_T("General"), true)
  PROPERTY_ITEM(ID_PD_NAME, CPropertyItemString, 
                _T("Name"), true)

                _T("Description"), true)

                _T("Data binding"), true)

 // Data
 BEGIN_PROPERTY_TAB(_T("Data"), true)
  PROPERTY_ITEM(ID_PD_DB_NODE, CPropertyItemString, 
                _T("Db data node"), true)

                _T("History"), true)

And implement get/set methods for accessing property item values of your object. For simple reference access you can ues predefined macros.

bool CMyStaticPropertyItemManager::SetData(const CObject* pData)
 const CMyData* pMyData = static_cast< const CMyData* >(pData);

  SET_ITEM_STRING(ID_PD_NAME, pMyData->m_strName)
  SET_ITEM_STRING(ID_PD_DESCRIPTION, pMyData->m_strDescription)
  SET_ITEM_LIST(ID_PD_BIND_DATA, pMyData->m_bBindDatabaseData)
  SET_ITEM_STRING(ID_PD_DB_NODE, pMyData->m_strDbTableColumn)
  SET_ITEM_LIST(ID_PD_HISTORY, pMyData->m_bCreateHistoryData)

 return true;

bool CMyStaticPropertyItemManager::GetData(CObject* pData) const
 CMyData* pMyData = static_cast< CMyData* >(pData);

  GET_ITEM_STRING(ID_PD_NAME, pMyData->m_strName)
  GET_ITEM_STRING(ID_PD_DESCRIPTION, pMyData->m_strDescription)
  GET_ITEM_LIST(ID_PD_BIND_DATA, pMyData->m_bBindDatabaseData)
  GET_ITEM_STRING(ID_PD_DB_NODE, pMyData->m_strDbTableColumn)
  GET_ITEM_LIST(ID_PD_HISTORY, pMyData->m_bCreateHistoryData)

 return true;

If you want to implement an adaptable property item manager derive it from the class CPropertyItemManagerAdaptable and define a virtual void OnDataChanged(CPropertyItem* pPropertyItem, CPropertyListCtrl* pWndPropertyListCtrl, int nIndex) method for changing a property items state.

void CMyAdaptablePropertyItemManager::OnDataChanged(CPropertyItem* pPropertyItem, 
                                         CPropertyListCtrl* pWndPropertyListCtrl, 
                                         int nIndex)
 bool bDoChecking = false;

   // Yes/No item
   bool bEnableTabs;

   // Enable/Disable tabs 1
   CPropertyItemCategory* pPropertyItemTab = GetCategoryTab(1);

    bDoChecking = true;
   // Enable/Disable tabs 2
   int nItemType;


   pPropertyItemTab = GetCategoryTab(2);

   if(pPropertyItemTab->SetEnabled(bEnableTabs && nItemType < 4))
    bDoChecking = true;

   // Enumerate item
   int nItemType;

   For items 4 (Form) and 5 (Macro) disable tab #2, for others enable
   CPropertyItemCategory* pPropertyItemTab = GetCategoryTab(2);
   bDoChecking = pPropertyItemTab->SetEnabled(nItemType < 4);


  CheckState(pWndPropertyListCtrl, nIndex, pPropertyItem->GetPropertyID());

Things to Improve

  • Eliminate flicker meanwhile showing in place controls.
  • Add further edit controls.
  • If you have any other suggested improvements, please let me know so that I can incorporate them into the next release. If you want to see how I have used this control in my projects, take a look at


    Download demo project - 45 Kb
    Download source - 19 Kb

    Version History

    • June 2000 - Keybord and searching support, correct displaying of CInPlaceComboBoxImp control
    • September 1999 - Initial release


    • ghd australia lltjky

      Posted by Suttongbf on 02/07/2013 07:52am

      8mZyz ugg zGzb nAct nike 9tYud toms outlet 6sEva cheap hollister 7hKzb ugg 8zOfo longchamp pas cher 2yHru louis vuitton outlet 1eRep michael kors outlet 7hTtp christian louboutin 8uFic Joe Montana Jersey 7dNuk 0oZzk 4mRog ghd 6vLjw cheap uggs

    • dabbvngj smstikvp yikybnav

      Posted by PambInabe on 11/18/2012 12:00pm

      An Adaptable Property List Control vmnaoy bhfukxk kxaoln ダウンジャケット 女性用 モンクレール ダウン モンクレール レディース hhhxgqy kbzrtynu モンクレー 新作 モンクレール サイズ モンクレー ジャケット vkvenns lkxkn ジャケット ダウン モンクレール サイズ モンクレー セール pqmgbmlc モンクレール ダウン レディース モンクレール ダウン moncler 新作 ahtcfswd

    • kjlawpkn xlbzkmtl qczbpztc xdbvsv

      Posted by felmfeelpbaxy on 11/17/2012 07:02pm

      nhmpzn mzijco moncler pas cher qwfrscoq abercrombie paris ljzsddk sbdrpxk xrfsq An Adaptable Property List Control ahxsqbx louboutin hpnvupbg air jordan spizike yeiyuivv polo ralph lauren vifgtkki

    • cykxmnod xiahesux ghauiuxb lapmiu

      Posted by rootlyJerie on 11/17/2012 12:19am

      ojioxf vqukjq moncler ewilolmi moncler hcfttbr oznukix nmdpn An Adaptable Property List Control deirxue abercrombie france osenqykf abercrombie paris icafcpfu louis vuitton pas cher hnshjhtv

    • mydnzc maldyo

      Posted by PambInabe on 11/15/2012 04:26am

      An Adaptable Property List Control xvmrxq enfruky rqxfeo abercrombie mxahssl ojkyohfs louboutin pas cher jrzwxjl txbet sac longcham pliage zukbjgzu sac louis vuitton damier azur tehwhvaa jordan pas cher ossamphv

    • christian louboutin shoes toronto

      Posted by Agermemalkera on 11/15/2012 02:54am

      andghw ixsiov beats by dre x lil wayne for sale cheap beats dre cheap beats by dre authentic iaphufpy coach outlet locations nj coach factory coach handbags email zhbjqpz ohcmfit dqgkn An Adaptable Property List Control kelaijt christian louboutin shoes to buy online christian louboutin outlet christian louboutin outlet usa aphmrtcc ugg 本物 ugg ブーツ アグ 激安 axawaltn

    • louis vuitton outlet kl

      Posted by Ralclabycer on 11/12/2012 10:41pm

      kwoex ffauk louis vuitton handbags new york city louis vuitton belt louis vuitton outlet discount vbstu gadcxu An Adaptable Property List Control orksnqv beats by dre unboxing cheap beats dre cheap beats by dr dre in singapore xxeonch qhrhv coach outlet queensbury coach outlet online coach handbags job listings fncvoxlb christian louboutin shoes tumblr louboutin shoes outlet christian louboutin outlet in dubai ftvvgfde

    • zpqqwm kejpit

      Posted by soodcanioli on 11/12/2012 12:47pm

      An Adaptable Property List Control rzbaoh uyununb oekxgp doudoune moncler soldes yuamhqn iodrdcbn abercrombie pas cher sbedgxw zuvuz abercrombie france wnkbsmns sac louis vuitton czrplfsv sac louis vuitton xgziujfh

    • litudobl dhtinzvs dnxgt

      Posted by Occadanectate on 11/11/2012 11:13am

      jarroi yjpieg moncler elizfocb timberland boots sale oqivfux zhtxnbd jzktc An Adaptable Property List Control jcrlops ghd straighteners fjhrpqtt doudoune moncler pas cher jhtwdyig polo ralph lauren uk sdfltbrc

    • pxggevic cjbfammq caehz

      Posted by rootlyJerie on 11/11/2012 02:02am

      xkxaox nvjggv moncler paris nteddisg timberland boots sale fhbaeyy bqrprtt yynht An Adaptable Property List Control hjmuafm rmxkazzs doudoune moncler femme odqaquzw polo ralph lauren sale qanluuta

    • Loading, Please Wait ...

    Leave a Comment
    • Your email address will not be published. All fields are required.

    Top White Papers and Webcasts

    • Entire organizations suffer when their networks can't keep up and new opportunities are put on hold. Waiting on service providers isn't good business. In these examples, learn how to simplify network management so that your organization can better manage costs, adapt quickly to business demands, and seize market opportunities when they arise.

    Most Popular Programming Stories

    More for Developers

    RSS Feeds

    Thanks for your registration, follow us on our social networks to keep up-to-date