Capture ChecBox event Left click By NM_CLICK message in MySuperGrid.cpp I have included a "history" section in the SuperGridCtrl.cpp file.ĭrop me a line when you find that bug or if you have any comments / suggestions / improvement at all to this listview control.
In the SuperGridCtrl.h header file you will find further information/documentation on how to use this listview control. The listview control was built with Visual C++ 6.0 (sp10) level 8 on Windows 2000 beta 9, I don't remember the Netcard ID -).
The source code shows you how to use the listview control in a CView derived class and in a CDialog derived class. The class CMySuperGrid which is derived from CSuperGridCtrl shows you how to initalize the grid, insert root items, insert items, sort items, associate controltypes and how to implement 'print preview' selected or checked items depending on which extended style you have set, it also shows you have to search for items, select items, delete items and how to set the current listview icon and individual cell color. In the source code you will find an example on how to associate a combobox control to a specific CItemInfo and how to initalize the combobox with default values.Īnother standard control which is implicit in the listview control are the checkbox-control, by using the LVS_EX_CHECKBOXES style you will have this control for free, nothing new here.but in the CItemInfo class you will be able to test which items are checked. In each CItemInfo you may associate a controltype: default controltype is an edit-control. You may have to modify this class to suit your logical data-representation in the listview.
This class is just a wrapper for the CStringArray, each item in the array represents a subitem. The CItemInfo class represents the data in the listview. The CTreeItem has an associated class called CItemInfo. Each listview item has a pointer to the CTreeItem(stored in the lParam of course). Each CTreeItem has a CObList representing its children and a few data members telling you the current status on the node e.g expanded, haschildren etc. The CTreeItem represents a node in a linked list. The class CSuperGridCtrl is derived from CListCtrl and it has a nested class called CTreeItem. If you have any suggestions to some future version let me know. Thanks for all them positive emails I have recived. The listview control does NOT support header drag/drop operations. The listview control supports Insert/Delete items and you can use the +,-,* keys to expand/collapse items. The listview control also has support for sorting items, drag and drop, basic scroll, autoscroll and autoexpand when dragging an item over another item. To edit an item hit the Enter key to start editing, when done editing, hit the Enter Key again. The listview control has support for editing subitems and basic user navigation.
Please see the history section in the SuperGridCtrl.cpp file for further reading.
Okay yet another full blown ownerdraw listview control with a tree like thing in the first column.