BCGControlBar Pro for MFC

Detailed Description

The CBCGPEditListBox class extends the functionality of a Windows list box by providing support for editing items in-place and ability to define a list of buttons to control edit operations. An editable list box displays a list of items, the user can view, select and edit them in-place or use buttons on the top of the list box to create a new items, delete the existing items, rename items, or move a single item up and down.

The following is a picture of the editable list box control. You can notice, that Item2 is selected for editing:

To use an editable list box in a dialog template, declare a CBCGPEditListBox variable in your dialog box class, then use DDX_Control in your dialog box class's DoDataExchange function to connect the member variable to the control. In the resource editor you should create a static control, because CBCGPEditLisBox class inherits from CStatic.

By default, the editable list box is created without buttons. You have to enable them by the CBCGPEditListBase::SetStandardButtons function.

See also
+ Inheritance diagram for CBCGPEditListBox:

Public Member Functions

 CBCGPEditListBoxConstructs a CBCGPEditListBox object
 AddItemAdds a string to a list control.
 EditItemBegins in-place editing of an item's text.
 GetCountReturns the number of strings in a list control.
 GetItemDataReturns the data value associated with the list control item.
 GetItemTextReturns a list control item's text.
 GetSelItemReturns the zero-based index of the currently selected item in a list control.
 RemoveAllItemsRemoves all list control items.
 RemoveItemRemoves an item from a list control.
 SelectItemSelects a list control string.
 SetItemDataSets the data value associated with the list control item.
- Public Member Functions inherited from CBCGPEditListBase
 AddButtonAdds a new button to the list control
 EnableBrowseButtonEnables or disables browse button for each item of a list box.
 EnableButtonAllows to enable or disable a button that manages list control items
 GetButtonIDGiven a button's index returns the button's ID.
 GetButtonNumGiven a button ID returns the button's index
 GetButtonsCountReturns the number of buttons.
 IsBrowseButtonSpecifies whether browse button is enabled or not.
 IsGrayDisabledButtonsTells whether the disabled button will be drawn grayed.
 OnAfterAddItemCalled when a new item has been added by in-place editing.
 OnAfterMoveItemDownCalled when a list box item has been moved down
 OnAfterMoveItemUpCalled when a list control item has been moved up
 OnAfterRenameItemCalled when a list box item has been renamed
 OnBeforeRemoveItemCalled when a list box item is about to be deleted.
 OnBrowseCalled by the framework when the user release the left mouse button over a browse button.
 OnClickButtonCalled when the use clicks the button
 OnEndEditLabelCalled when in-place editing of the list control item's text has been finished
 OnGetImageCalled when an edit list control needs to display an item.
 OnKeyCalled when the user pressed the keyboard key.
 OnSelectionChangedCalled when the selection in the list control has been changed
 RemoveAllButtonsRemoves all standard and custom buttons.
 SetGrayDisabledButtonsAllows to draw disabled button grayed. By default, the disabled button will be drawn with the regular look.
 SetStandardButtonsAllows to specify which standard buttons should be created at the top of control.

Protected Member Functions

 GetListHwndReturns the handle to the embedded list view control.
- Protected Member Functions inherited from CBCGPEditListBase
 CreateNewItemCreates a new list control item in-place