diff options
| author | Pietro Gagliardi <[email protected]> | 2014-05-30 14:13:47 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-05-30 14:15:32 -0400 |
| commit | c543f5639b121bcdae11f681466c030394902f65 (patch) | |
| tree | 79d951d0fe67d0d3908223625b4acd469ae78b60 /area_windows.go | |
| parent | 78c909cc9ba87abc759767c11b34a9cccf8ef34c (diff) | |
Normalized DefWindowProc() handling across the Windows files; the syscall.LazyProc now has the normalized name _defWindowProc and defWindowProc() is a convenience function that calls _defWindowProc properly. This will also be important for the switch to a single window class per Window/Area.
Diffstat (limited to 'area_windows.go')
| -rw-r--r-- | area_windows.go | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/area_windows.go b/area_windows.go index 6269002..6708a27 100644 --- a/area_windows.go +++ b/area_windows.go @@ -606,15 +606,6 @@ var ( func areaWndProc(s *sysData) func(hwnd _HWND, uMsg uint32, wParam _WPARAM, lParam _LPARAM) _LRESULT { return func(hwnd _HWND, uMsg uint32, wParam _WPARAM, lParam _LPARAM) _LRESULT { - defwndproc := func() _LRESULT { - r1, _, _ := defWindowProc.Call( - uintptr(hwnd), - uintptr(uMsg), - uintptr(wParam), - uintptr(lParam)) - return _LRESULT(r1) - } - switch uMsg { case _WM_PAINT: paintArea(s) @@ -635,14 +626,14 @@ func areaWndProc(s *sysData) func(hwnd _HWND, uMsg uint32, wParam _WPARAM, lPara scrollArea(s, wParam, _SB_VERT) return 0 } - return defwndproc() + return defWindowProc(hwnd, uMsg, wParam, lParam) case _WM_SIZE: // TODO make this unnecessary if s != nil && s.hwnd != 0 { // this message can be sent before s is assigned properly adjustAreaScrollbars(s) return 0 } - return defwndproc() + return defWindowProc(hwnd, uMsg, wParam, lParam) case _WM_ACTIVATE: // don't keep the double-click timer running if the user switched programs in between clicks s.clickCounter.reset() @@ -656,7 +647,7 @@ func areaWndProc(s *sysData) func(hwnd _HWND, uMsg uint32, wParam _WPARAM, lPara panic(fmt.Errorf("error giving Area keyboard focus: %v", err)) return _MA_ACTIVATE // TODO eat the click? } - return defwndproc() + return defWindowProc(hwnd, uMsg, wParam, lParam) case _WM_MOUSEMOVE: areaMouseEvent(s, 0, false, wParam, lParam) return 0 @@ -698,13 +689,13 @@ func areaWndProc(s *sysData) func(hwnd _HWND, uMsg uint32, wParam _WPARAM, lPara if handled { return 0 } - return defwndproc() + return defWindowProc(hwnd, uMsg, wParam, lParam) case _WM_SYSKEYUP: handled := areaKeyEvent(s, true, wParam, lParam) if handled { return 0 } - return defwndproc() + return defWindowProc(hwnd, uMsg, wParam, lParam) case msgSetAreaSize: s.areawidth = int(wParam) // see setAreaSize() in sysdata_windows.go s.areaheight = int(lParam) @@ -712,7 +703,7 @@ func areaWndProc(s *sysData) func(hwnd _HWND, uMsg uint32, wParam _WPARAM, lPara repaintArea(s) // this calls for an update return 0 default: - return defwndproc() + return defWindowProc(hwnd, uMsg, wParam, lParam) } panic(fmt.Sprintf("areaWndProc message %d did not return: internal bug in ui library", uMsg)) } |
