Welcome to CListOptionsCtrl, a control which implements a properties browser control similar to the properties browser in Visual Basic. In addition to Boolean values, it also allows edit boxes, combo boxes, file browser, folder browsers, font browsers, font name combo boxes, general opaque objects, date controls, time controls and IP address controls. Included below is a snapshot showing the demo application and what the control looks like.
Features |
Copyright |
Usage |
History |
API Reference |
Planned Enhancements |
Contacting the Author |
V1.0 (5 December 2001)
V1.1 (13 January 2002)
V1.11 (23 January 2002)
V1.12 (31 May 2002)
V1.13 (1 June 2002)
V1.14 (2 June 2002)
V1.15 (17 October 2002)
V1.16 (5 May 2004)
V1.17 (26 November 2004)
V1.18 (3 May 2006)
V1.19 (8 May 2006)
V1.20 (7 July 2006)
V1.21 (23 December 2007)
V1.22 (15 June 2008)
V1.23 (21 May 2012)
V1.24 (16 March 2015)
The API consists of the following class members and global functions
CListOptionsCtrl::AddBoolean
CListOptionsCtrl::AddComboBox
CListOptionsCtrl::AddEditBox
CListOptionsCtrl::AddFileEditBox
CListOptionsCtrl::AddFolderEditBox
CListOptionsCtrl::AddColorSelector
CListOptionsCtrl::AddFontSelector
CListOptionsCtrl::IsBoolean
CListOptionsCtrl::IsEditBox
CListOptionsCtrl::IsFileItem
CListOptionsCtrl::IsFolderItem
CListOptionsCtrl::IsColorItem
CListOptionsCtrl::IsFontItem
CListOptionsCtrl::GetBoolean
CListOptionsCtrl::GetComboText
CListOptionsCtrl::GetEditText
CListOptionsCtrl::GetFileEditText
CListOptionsCtrl::GetFolderEditText
CListOptionsCtrl::GetColor
CListOptionsCtrl::GetFontItem
CListOptionsCtrl::SetBoolean
CListOptionsCtrl::SetComboText
CListOptionsCtrl::SetEditText
CListOptionsCtrl::SetFileEditText
CListOptionsCtrl::SetFolderEditText
CListOptionsCtrl::SetColor
CListOptionsCtrl::SetFontItem
DDX_ListBoolean
DDX_ListEdit
DDX_ListCombo
DDX_ListFileEdit
DDX_ListFolderEdit
DDX_ListColor
DDX_ListFont
BOOL IsCheckBox(int nIndex);
Return Value
TRUE if the specified item is a check box item otherwise FALSE.
Parameters
nIndex index of the item to check the type of.
Remarks
Checks to see if the specified item is a boolean combo box item.
BOOL IsEditBox(int
nIndex);Return Value
TRUE if the specified item is a edit box item otherwise FALSE.
Parameters
nIndex Index of the item to check the type of.
Remarks
Checks to see if the specified item is a edit box item.
BOOL IsFileItem(int
nIndex);Return Value
TRUE if the specified item is a file browser item otherwise FALSE.
Parameters
nIndex Index of the item to check the type of.
Remarks
Checks to see if the specified item is a file browser item.
CListOptionsCtrl::IsFolderItem
BOOL IsFolderItem(int
nIndex);Return Value
TRUE if the specified item is a folder browser item otherwise FALSE.
Parameters
nIndex Index of the item to check the type of.
Remarks
Checks to see if the specified item is a folder browser item.
BOOL IsColorItem(int
nIndex);Return Value
TRUE if the specified item is a color browser item otherwise FALSE.
Parameters
nIndex Index of the item to check the type of.
Remarks
Checks to see if the specified item is a color browser item.
BOOL IsFontItem(int
nIndex);Return Value
TRUE if the specified item is a font browser item otherwise FALSE.
Parameters
nIndex Index of the item to check the type of.
Remarks
Checks to see if the specified item is a font browser item.
BOOL SetBoolean(int nIndex, BOOL bValue);
Return Value
TRUE if the state of the item was successfully changed otherwise FALSE.
Parameters
nIndex Index of the item to change the boolean state of.
bValue The state of the boolean combo box to be set.
Remarks
Changes the boolean state of a boolean combo box item.
BOOL GetBoolean(int nIndex, BOOL& bValue);
Return Value
TRUE if the state of the item was successfully retrieved otherwise FALSE.
Parameters
nIndex Index of the item to retrieve the boolean state of.
bCheck Upon successful return, this will contain the state of the boolean check box.
Remarks
Retrieves the boolean state of a boolean combo box item.
BOOL AddBoolean(int nIndex , DWORD_PTR dwItemData = 0);
Return Value
TRUE if the boolean combo box item was successfully added otherwise FALSE.
Parameters
nIndex Index of the item to add the combo box at.
dwItemData The custom item data you want to use with this list item. This can be used for whathever you want e.g. to maintain a pointer to a custom structure.
Remarks
Adds a boolean combo box item to the list control.
BOOL AddComboBox(int nIndex, CRuntimeClass* pRuntimeClass, DWORD_PTR dwItemData = 0);
Return Value
TRUE if the combo box item was successfully added otherwise FALSE.
Parameters
nIndex Index of the item to add the combo box at.
pRuntimeClass The runtime class pointer on a class derived from "CListOptionsCombo" which is to be added to the list options control.
dwItemData The custom item data you want to use with this list item. This can be used for whathever you want e.g. to maintain a pointer to a custom structure.
Remarks
Adds a combo box item to the list control. The combo box by default provides a choice of multiple strings from which to pick. You are free to derive your own class from "CListOptionsCombo" to implement customized behavior
BOOL AddEditBox(int nIndex, CRuntimeClass* pRuntimeClassEditCtrl, DWORD_PTR dwItemData = 0);
BOOL AddEditBox(int nIndex, CRuntimeClass* pRuntimeClassEditCtrl, CRuntimeClass* pRuntimeClassSpinCtrl, DWORD_PTR dwItemData = 0);
Return Value
TRUE if the edit box item was successfully added otherwise FALSE.
Parameters
nIndex Index of the item to add the edit box at.
pRuntimeClassEditCtrl The runtime class pointer on a class derived from "CListOptionsEdit" which is to be added to the list options control.
pRuntimeClassSpinCtrl The runtime class pointer on a class derived from "CListOptionsSpinCtrl" which is to be attached to the edit box to allow the edit box value to be changed using a standard spin control.
dwItemData The custom item data you want to use with this list item. This can be used for whathever you want e.g. to maintain a pointer to a custom structure.
Remarks
Adds a edit box item to the list control. The edit box by default allows any text to be set. You are free to derive your own class from "CListOptionsEdit" to implement customized behavior. You can use the second version of the function to add an edit box along with a standard spin control with it.
CListOptionsCtrl::AddFileEditBox
BOOL AddFileEditBox(int nIndex, CRuntimeClass* pRuntimeClassEditCtrl, CRuntimeClass* pRuntimeClassBrowseButton, DWORD_PTR dwItemData = 0);
Return Value
TRUE if the edit box item was successfully added otherwise FALSE.
Parameters
nIndex Index of the item to add the File Browser edit box at.
pRuntimeClassEditCtrl The runtime class pointer on a class derived from "CListOptionsEdit" which is to be added to the list options control.
pRuntimeClassBrowseButton The runtime class pointer on a class derived from "CListOptionsBrowseButton" which is to be attached to the edit box to allow the edit box value to be changed using a standard file dialog control.
dwItemData The custom item data you want to use with this list item. This can be used for whathever you want e.g. to maintain a pointer to a custom structure.
Remarks
Adds a File Browser edit box item to the list control. The edit box by default allows any text to be set. You are free to derive your own class from "CListOptionsEdit" to implement customized behavior.
CListOptionsCtrl::AddFolderEditBox
BOOL AddFolderEditBox(int nIndex, CRuntimeClass* pRuntimeClassEditCtrl, CRuntimeClass* pRuntimeClassBrowseButton, DWORD_PTR dwItemData = 0);
Return Value
TRUE if the edit box item was successfully added otherwise FALSE.
Parameters
nIndex Index of the item to add the Folder Browser edit box at.
pRuntimeClassEditCtrl The runtime class pointer on a class derived from "CListOptionsEdit" which is to be added to the list options control.
pRuntimeClassBrowseButton The runtime class pointer on a class derived from "CListOptionsBrowseButton" which is to be attached to the edit box to allow the edit box value to be changed using a standard folder selection dialog control.
dwItemData The custom item data you want to use with this list item. This can be used for whathever you want e.g. to maintain a pointer to a custom structure.
Remarks
Adds a Folder Browser edit box item to the list control. The edit box by default allows any text to be set. You are free to derive your own class from "CListOptionsEdit" to implement customized behavior.
CListOptionsCtrl::GetComboText
CString GetComboText(int nIndex);
Return Value
The text associated with this combo box item.
Parameters
nIndex Index of the item to retrieve the combo box text of.
Remarks
Retrieves the combo text of a combo box item.
CString GetEditText(int nIndex);
Return Value
The text associated with this edit box item.
Parameters
nIndex Index of the item to retrieve the edit box text of.
Remarks
Retrieves the edit box text of a edit box item.
CListOptionsCtrl::GetFileEditText
CString GetEditText(int nIndex);
Return Value
The text associated with this edit box item.
Parameters
nIndex Index of the item to retrieve the edit box text of.
Remarks
Retrieves the edit box text of a File Browser edit box item.
CListOptionsCtrl::GetFolderEditText
CString GetEditText(int nIndex);
Return Value
The text associated with this edit box item.
Parameters
nIndex Index of the item to retrieve the edit box text of.
Remarks
Retrieves the edit box text of a Foldere Browser edit box item.
CListOptionsCtrl::SetComboText
void SetComboText(int nIndex, const CString& sComboText);
Parameters
nIndex Index of the item to change the combo box text of.
sComboText The text to set in the combo box.
Remarks
Changes the combo box text of a combo box item.
void SetEditText(int nIndex, const CString& sEditText);
Parameters
nIndex Index of the item to change the edit box text of.
sEditText The text to set in the edit box.
Remarks
Changes the edit box text of a edit box item.
CListOptionsCtrl::SetFileEditText
void SetFileText(int nIndex, const CString& sEditText);
Parameters
nIndex Index of the item to change the edit box text of.
sEditText The text to set in the edit box.
Remarks
Changes the edit box text of a File Browser edit box item.
CListOptionsCtrl::SetFolderEditText
void SetFolderText(int nIndex, const CString& sEditText);
Parameters
nIndex Index of the item to change the edit box text of.
sEditText The text to set in the edit box.
Remarks
Changes the edit box text of a Folder Browser edit box item.
CListOptionsCtrl::AddColorSelector
BOOL AddColorSelector(int
nIndex, CRuntimeClass* pRuntimeClassButton, DWORD_PTR dwItemData = 0, BOOL bDrawColorForIcon = TRUE);Return Value
TRUE if the color browser item was successfully added otherwise FALSE.
Parameters
nIndex Index of the item to add the color browser at.
pRuntimeClassButton The runtime class pointer on a class derived from "CListOptionsBrowseButton" which is to be added to the list options control.
dwItemData The custom item data you want to use with this list item. This can be used for whathever you want e.g. to maintain a pointer to a custom structure.
bDrawColorForIcon If TRUE then the current color is drawn in the items icon otherwise the normal icon is drawn.
Remarks
Adds a Color Browser item to the list control. The color browser displays a standard CColorDialog when you hit the browse button. You are free to derive your own class from "CListOptionsBrowseButton" to implement customized behavior.
COLORREF GetColor(int
nIndex);Return Value
The COLORREF value associated with this color browser item.
Parameters
nIndex Index of the item to retrieve the COLORREF of.
Remarks
Retrieves the color of a color browser item.
void SetColor(int nIndex, COLORREF
color);Parameters
nIndex Index of the item to change the color of.
color The color to set in the color browser item.
Remarks
Changes the edit box text of a edit box item.
CListOptionsCtrl::AddFontSelector
BOOL AddFontSelector(int
nIndex, CRuntimeClass* pRuntimeClassButton, DWORD_PTR dwItemData = 0);Return Value
TRUE if the font browser item was successfully added otherwise FALSE.
Parameters
nIndex Index of the item to add the color browser at.
pRuntimeClassButton The runtime class pointer on a class derived from "CListOptionsBrowseButton" which is to be added to the list options control.
dwItemData The custom item data you want to use with this list item. This can be used for whathever you want e.g. to maintain a pointer to a custom structure.
Remarks
Adds a font browser item to the list control. The font browser displays a standard CFontDialog when you hit the browse button. You are free to derive your own class from "CListOptionsBrowseButton" to implement customized behavior.
void GetFontItem(int
nIndex, LOGFONT* pLogFont);Parameters
nIndex Index of the item to retrieve the COLORREF of.
pLogFont Upon return this will contain the update LOGFONT structure.
Remarks
Retrieves the font characteristics of a font browser item.
void SetFontItem(int
nIndex, const LOGFONT* pLogFont);Parameters
nIndex Index of the item to change the color of.
pLogFont pointer to the LOGFONT structure to set in the font browser item.
Remarks
Changes the edit font characteristics of a font browser item.
void DDX_ListEdit(CDataExchange*
pDX, int nIDC, int nIndex, CString& sText);void DDX_ListEdit(CDataExchange*
pDX, int nIDC, int nIndex, int& nValue);Parameters
pDX A pointer to a CDataExchange object. The framework supplies this object to establish the context of the data exchange, including its direction.
nIDC The resource ID of the list control associated with the control property.
nIndex Index of the item which contains the edit control item.
sText A reference to a CString which is the text to display or retrieve from the list options control.
Remarks
The DDX_ListEdit function manages the transfer of CString or integer data between a edit box in the CListOptionsCtrl in a dialog box, form view, or control view object and a CString or integer value.
void DDX_ListCombo(CDataExchange*
pDX, int nIDC, int nIndex, CString& sText);Parameters
pDX A pointer to a CDataExchange object. The framework supplies this object to establish the context of the data exchange, including its direction.
nIDC The resource ID of the list control associated with the control property.
nIndex Index of the item which contains the combo box item.
sText A reference to a CString which is the text to display or retrieve from the list options control.
Remarks
The DDX_ListCombo function manages the transfer of CString data between a combo box in the CListOptionsCtrl in a dialog box, form view, or control view object and a CString data member.
void DDX_ListFileEdit(CDataExchange*
pDX, int nIDC, int nIndex, CString& sText);Parameters
pDX A pointer to a CDataExchange object. The framework supplies this object to establish the context of the data exchange, including its direction.
nIDC The resource ID of the list control associated with the control property.
nIndex Index of the item which contains the File Browser edit item.
sText A reference to a CString which is the text to display or retrieve from the list options control.
Remarks
The DDX_ListFileEdit function manages the transfer of CString data between a File Browser edit box in the CListOptionsCtrl in a dialog box, form view, or control view object and a CString value.
void DDX_ListFolderEdit(CDataExchange*
pDX, int nIDC, int nIndex, CString& sText);Parameters
pDX A pointer to a CDataExchange object. The framework supplies this object to establish the context of the data exchange, including its direction.
nIDC The resource ID of the list control associated with the control property.
nIndex Index of the item which contains the Folder Browser edit item.
sText A reference to a CString which is the text to display or retrieve from the list options control.
Remarks
The DDX_ListFolderEdit function manages the transfer of CString data between a Folder Browser edit box in the CListOptionsCtrl in a dialog box, form view, or control view object and a CString value.
void DDX_ListColor(CDataExchange*
pDX, int nIDC, int nIndex, COLORREF& color);Parameters
pDX A pointer to a CDataExchange object. The framework supplies this object to establish the context of the data exchange, including its direction.
nIDC The resource ID of the list control associated with the control property.
nIndex Index of the item which contains the color browser item.
color A reference to a COLORREF which is the color to display or retrieve from the list options control.
Remarks
The DDX_ListColor function manages the transfer of COLORREF data between a color browser item in the CListOptionsCtrl in a dialog box, form view, or control view object and a COLORREF value.
void DDX_ListFont(CDataExchange*
pDX, int nIDC, int nIndex, LOGFONT* pLogFont);Parameters
pDX A pointer to a CDataExchange object. The framework supplies this object to establish the context of the data exchange, including its direction.
nIDC The resource ID of the list control associated with the control property.
nIndex Index of the item which contains the font browser item.
color A pointer to a LOGFONT strucutre which is the font to display or retrieve from the list options control.
Remarks
The DDX_ListFont function manages the transfer of LOGFONT structure data between a font browser item in the CListOptionsCtrl in a dialog box, form view, or control view object and a LOGFONT structure value.
void DDX_ListBoolean(CDataExchange*
pDX, int nIDC, int nIndex, BOOL& bValue);Parameters
pDX A pointer to a CDataExchange object. The framework supplies this object to establish the context of the data exchange, including its direction.
nIDC The resource ID of the list control associated with the control property.
hParent Index of the item which contains the boolean combo box item.
color A reference to a BOOL which is the boolean value to display or retrieve from the list options control.
Remarks
The DDX_ListBoolean function manages the transfer of BOOL value between a boolean combo box item in the CListOptionsCtrl in a dialog box, form view, or control view object and a BOOL value.
PJ Naughter
Email: pjna@naughter.com
Web: http://www.naughter.com
16 March 2015