(hwnd win.HWND, msg uint32, wp, lp uintptr)
| 2487 | } |
| 2488 | |
| 2489 | func 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 { |
no test coverage detected
searching dependent graphs…