03-02-2009, 10:17 PM
QM_Grid control inherits almost everything from SysListView32 control. When you select an item in list view control, it sends several notification messages in WM_NOTIFY message. Useful can be LVN_ITEMCHANGED, NM_CLICK, LVN_KEYDOWN. Documented in MSDN.
Example:
Function gridNotify
---------------------------
By default all rows can be deleted.
If QG_NOAUTOADD style used (see LVM_QG_SETSTYLE message), all rows cannot be deleted.
A single row cannot be protected from deleting.
Example:
Function gridNotify
sel nh.code ;;nh is NMHDR*, which is lParam of WM_NOTIFY message
,case LVN_ITEMCHANGED
,NMLISTVIEW* nlv=+nh
,if(nlv.iItem<0 or nlv.uNewState&LVIS_SELECTED=0) ret
,out nlv.iItem ;;selected listview item index
---------------------------
By default all rows can be deleted.
If QG_NOAUTOADD style used (see LVM_QG_SETSTYLE message), all rows cannot be deleted.
A single row cannot be protected from deleting.