(hwnd win.HWND, msg uint32, wParam, lParam uintptr)
| 83 | } |
| 84 | |
| 85 | func (pb *PushButton) WndProc(hwnd win.HWND, msg uint32, wParam, lParam uintptr) uintptr { |
| 86 | switch msg { |
| 87 | case win.WM_GETDLGCODE: |
| 88 | hwndFocus := win.GetFocus() |
| 89 | if hwndFocus == pb.hWnd { |
| 90 | form := ancestor(pb) |
| 91 | if form == nil { |
| 92 | break |
| 93 | } |
| 94 | |
| 95 | dlg, ok := form.(dialogish) |
| 96 | if !ok { |
| 97 | break |
| 98 | } |
| 99 | |
| 100 | defBtn := dlg.DefaultButton() |
| 101 | if defBtn == pb { |
| 102 | pb.setAndClearStyleBits(win.BS_DEFPUSHBUTTON, win.BS_PUSHBUTTON) |
| 103 | return win.DLGC_BUTTON | win.DLGC_DEFPUSHBUTTON |
| 104 | } |
| 105 | |
| 106 | break |
| 107 | } |
| 108 | |
| 109 | pb.ensureProperDialogDefaultButton(hwndFocus) |
| 110 | |
| 111 | case win.WM_KILLFOCUS: |
| 112 | pb.ensureProperDialogDefaultButton(win.HWND(wParam)) |
| 113 | } |
| 114 | |
| 115 | return pb.Button.WndProc(hwnd, msg, wParam, lParam) |
| 116 | } |
| 117 | |
| 118 | func (pb *PushButton) CreateLayoutItem(ctx *LayoutContext) LayoutItem { |
| 119 | return &pushButtonLayoutItem{ |
nothing calls this directly
no test coverage detected