MCPcopy Create free account
hub / github.com/lxn/walk / WndProc

Method WndProc

pushbutton.go:85–116  ·  view source on GitHub ↗
(hwnd win.HWND, msg uint32, wParam, lParam uintptr)

Source from the content-addressed store, hash-verified

83}
84
85func (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
118func (pb *PushButton) CreateLayoutItem(ctx *LayoutContext) LayoutItem {
119 return &pushButtonLayoutItem{

Callers

nothing calls this directly

Calls 5

ancestorFunction · 0.85
setAndClearStyleBitsMethod · 0.80
DefaultButtonMethod · 0.65
WndProcMethod · 0.65

Tested by

no test coverage detected