Changed Areas on Windows to store their sysData inside the window memory instead of being given it via a closure. Actually having only one window class for all Areas comes next.
This commit is contained in:
parent
a3e27bfbd0
commit
855a09656a
|
@ -604,8 +604,12 @@ var (
|
|||
_setFocus = user32.NewProc("SetFocus")
|
||||
)
|
||||
|
||||
func areaWndProc(s *sysData) func(hwnd _HWND, uMsg uint32, wParam _WPARAM, lParam _LPARAM) _LRESULT {
|
||||
func areaWndProc(unused *sysData) func(hwnd _HWND, uMsg uint32, wParam _WPARAM, lParam _LPARAM) _LRESULT {
|
||||
return func(hwnd _HWND, uMsg uint32, wParam _WPARAM, lParam _LPARAM) _LRESULT {
|
||||
s := getSysData(hwnd)
|
||||
if s == nil { // not yet saved
|
||||
return storeSysData(hwnd, uMsg, wParam, lParam)
|
||||
}
|
||||
switch uMsg {
|
||||
case _WM_PAINT:
|
||||
paintArea(s)
|
||||
|
|
|
@ -116,6 +116,7 @@ var classTypes = [nctypes]*classData{
|
|||
register: registerAreaWndClass,
|
||||
style: areastyle,
|
||||
xstyle: areaxstyle,
|
||||
storeSysData: true,
|
||||
doNotLoadFont: true,
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue