(hwndFocus win.HWND)
| 49 | } |
| 50 | |
| 51 | func (pb *PushButton) ensureProperDialogDefaultButton(hwndFocus win.HWND) { |
| 52 | widget := windowFromHandle(hwndFocus) |
| 53 | if widget == nil { |
| 54 | return |
| 55 | } |
| 56 | |
| 57 | if _, ok := widget.(*PushButton); ok { |
| 58 | return |
| 59 | } |
| 60 | |
| 61 | form := ancestor(pb) |
| 62 | if form == nil { |
| 63 | return |
| 64 | } |
| 65 | |
| 66 | dlg, ok := form.(dialogish) |
| 67 | if !ok { |
| 68 | return |
| 69 | } |
| 70 | |
| 71 | defBtn := dlg.DefaultButton() |
| 72 | if defBtn == nil { |
| 73 | return |
| 74 | } |
| 75 | |
| 76 | if err := defBtn.setAndClearStyleBits(win.BS_DEFPUSHBUTTON, win.BS_PUSHBUTTON); err != nil { |
| 77 | return |
| 78 | } |
| 79 | |
| 80 | if err := defBtn.Invalidate(); err != nil { |
| 81 | return |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | func (pb *PushButton) WndProc(hwnd win.HWND, msg uint32, wParam, lParam uintptr) uintptr { |
| 86 | switch msg { |
no test coverage detected