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

Function tableViewHdrWndProc

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

Source from the content-addressed store, hash-verified

2487}
2488
2489func tableViewHdrWndProc(hwnd win.HWND, msg uint32, wp, lp uintptr) uintptr {
2490 tv := (*TableView)(unsafe.Pointer(windowFromHandle(win.GetParent(win.GetParent(hwnd))).AsWindowBase()))
2491
2492 var origWndProcPtr uintptr
2493 if hwnd == tv.hwndFrozenHdr {
2494 origWndProcPtr = tv.frozenHdrOrigWndProcPtr
2495 } else {
2496 origWndProcPtr = tv.normalHdrOrigWndProcPtr
2497 }
2498
2499 switch msg {
2500 case win.WM_NOTIFY:
2501 switch ((*win.NMHDR)(unsafe.Pointer(lp))).Code {
2502 case win.NM_CUSTOMDRAW:
2503 if tv.customHeaderHeight == 0 {
2504 break
2505 }
2506
2507 nmcd := (*win.NMCUSTOMDRAW)(unsafe.Pointer(lp))
2508
2509 switch nmcd.DwDrawStage {
2510 case win.CDDS_PREPAINT:
2511 return win.CDRF_NOTIFYITEMDRAW
2512
2513 case win.CDDS_ITEMPREPAINT:
2514 return win.CDRF_NOTIFYPOSTPAINT
2515
2516 case win.CDDS_ITEMPOSTPAINT:
2517 col := tv.fromLVColIdx(hwnd == tv.hwndFrozenHdr, int32(nmcd.DwItemSpec))
2518 if tv.styler != nil && col > -1 {
2519 tv.style.row = -1
2520 tv.style.col = col
2521 tv.style.bounds = rectangleFromRECT(nmcd.Rc)
2522 tv.style.dpi = tv.DPI()
2523 tv.style.hdc = nmcd.Hdc
2524 tv.style.TextColor = tv.themeNormalTextColor
2525 tv.style.Font = nil
2526
2527 tv.styler.StyleCell(&tv.style)
2528
2529 defer func() {
2530 tv.style.bounds = Rectangle{}
2531 if tv.style.canvas != nil {
2532 tv.style.canvas.Dispose()
2533 tv.style.canvas = nil
2534 }
2535 tv.style.hdc = 0
2536 }()
2537 }
2538
2539 return win.CDRF_DODEFAULT
2540 }
2541
2542 return win.CDRF_DODEFAULT
2543 }
2544
2545 case win.HDM_LAYOUT:
2546 if tv.customHeaderHeight == 0 {

Callers 1

lvWndProcMethod · 0.85

Calls 14

windowFromHandleFunction · 0.85
rectangleFromRECTFunction · 0.85
calculateTextSizeFunction · 0.85
fromLVColIdxMethod · 0.80
TitleEffectiveMethod · 0.80
AsWindowBaseMethod · 0.65
DPIMethod · 0.65
StyleCellMethod · 0.65
DisposeMethod · 0.65
SendMessageMethod · 0.65
FontMethod · 0.65
setTextMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…