MCPcopy
hub / github.com/lxn/walk / lvWndProc

Method lvWndProc

tableview.go:1950–2487  ·  view source on GitHub ↗
(origWndProcPtr uintptr, hwnd win.HWND, msg uint32, wp, lp uintptr)

Source from the content-addressed store, hash-verified

1948}
1949
1950func (tv *TableView) lvWndProc(origWndProcPtr uintptr, hwnd win.HWND, msg uint32, wp, lp uintptr) uintptr {
1951 var hwndOther win.HWND
1952 if hwnd == tv.hwndFrozenLV {
1953 hwndOther = tv.hwndNormalLV
1954 } else {
1955 hwndOther = tv.hwndFrozenLV
1956 }
1957
1958 var maybeStretchLastColumn bool
1959
1960 switch msg {
1961 case win.WM_ERASEBKGND:
1962 maybeStretchLastColumn = true
1963
1964 case win.WM_WINDOWPOSCHANGED:
1965 wp := (*win.WINDOWPOS)(unsafe.Pointer(lp))
1966
1967 if wp.Flags&win.SWP_NOSIZE != 0 {
1968 break
1969 }
1970
1971 maybeStretchLastColumn = int(wp.Cx) < tv.WidthPixels()
1972
1973 case win.WM_GETDLGCODE:
1974 if wp == win.VK_RETURN {
1975 return win.DLGC_WANTALLKEYS
1976 }
1977
1978 case win.WM_LBUTTONDOWN, win.WM_RBUTTONDOWN, win.WM_LBUTTONDBLCLK, win.WM_RBUTTONDBLCLK:
1979 var hti win.LVHITTESTINFO
1980 hti.Pt = win.POINT{win.GET_X_LPARAM(lp), win.GET_Y_LPARAM(lp)}
1981 win.SendMessage(hwnd, win.LVM_HITTEST, 0, uintptr(unsafe.Pointer(&hti)))
1982
1983 tv.itemIndexOfLastMouseButtonDown = int(hti.IItem)
1984
1985 if hti.Flags == win.LVHT_NOWHERE {
1986 if tv.MultiSelection() {
1987 tv.publishNextSelClear = true
1988 } else {
1989 if tv.CheckBoxes() {
1990 if tv.currentIndex > -1 {
1991 tv.SetCurrentIndex(-1)
1992 }
1993 } else {
1994 // We keep the current item, if in single item selection mode without check boxes.
1995 win.SetFocus(tv.hwndFrozenLV)
1996 return 0
1997 }
1998 }
1999
2000 if tv.IgnoreNowhere() {
2001 return 0
2002 }
2003 }
2004
2005 switch msg {
2006 case win.WM_LBUTTONDOWN, win.WM_RBUTTONDOWN:
2007 if hti.Flags == win.LVHT_ONITEMSTATEICON &&

Callers 2

tableViewFrozenLVWndProcFunction · 0.80
tableViewNormalLVWndProcFunction · 0.80

Calls 15

MultiSelectionMethod · 0.95
CheckBoxesMethod · 0.95
SetCurrentIndexMethod · 0.95
IgnoreNowhereMethod · 0.95
toggleItemCheckedMethod · 0.95
fromLVColIdxMethod · 0.95
FocusedMethod · 0.95
copySelectedIndexesMethod · 0.95
updateSelectedIndexesMethod · 0.95
updateLVSizesMethod · 0.95
visibleColumnCountMethod · 0.95

Tested by

no test coverage detected