Changed Checkbox on Windows to use BS_CHECKBOX instead of BS_AUTOCHECKBOX; this will be necessary to fix the focus issue in todo.md (see http://blogs.msdn.com/b/oldnewthing/archive/2014/05/22/10527522.aspx).
This commit is contained in:
parent
753f4316e2
commit
bb44712fad
|
@ -84,6 +84,25 @@ func stdWndProc(hwnd _HWND, uMsg uint32, wParam _WPARAM, lParam _LPARAM) _LRESUL
|
|||
if wParam.HIWORD() == _BN_CLICKED {
|
||||
ss.signal()
|
||||
}
|
||||
case c_checkbox:
|
||||
// we opt into doing this ourselves because http://blogs.msdn.com/b/oldnewthing/archive/2014/05/22/10527522.aspx
|
||||
if wParam.HIWORD() == _BN_CLICKED {
|
||||
state, _, _ := _sendMessage.Call(
|
||||
uintptr(ss.hwnd),
|
||||
uintptr(_BM_GETCHECK),
|
||||
uintptr(0),
|
||||
uintptr(0))
|
||||
if state == _BST_CHECKED {
|
||||
state = _BST_UNCHECKED
|
||||
} else if state == _BST_UNCHECKED {
|
||||
state = _BST_CHECKED
|
||||
}
|
||||
_sendMessage.Call(
|
||||
uintptr(ss.hwnd),
|
||||
uintptr(_BM_SETCHECK),
|
||||
state, // already uintptr
|
||||
uintptr(0))
|
||||
}
|
||||
}
|
||||
return 0
|
||||
case _WM_GETMINMAXINFO:
|
||||
|
|
|
@ -57,7 +57,8 @@ var classTypes = [nctypes]*classData{
|
|||
},
|
||||
c_checkbox: &classData{
|
||||
name: toUTF16("BUTTON"),
|
||||
style: _BS_AUTOCHECKBOX | controlstyle,
|
||||
// don't use BS_AUTOCHECKBOX because http://blogs.msdn.com/b/oldnewthing/archive/2014/05/22/10527522.aspx
|
||||
style: _BS_CHECKBOX | controlstyle,
|
||||
xstyle: 0 | controlxstyle,
|
||||
},
|
||||
c_combobox: &classData{
|
||||
|
|
|
@ -6,9 +6,11 @@ const _AC_SRC_OVER = 0
|
|||
const _BCM_GETIDEALSIZE = 5633
|
||||
const _BI_RGB = 0
|
||||
const _BM_GETCHECK = 240
|
||||
const _BM_SETCHECK = 241
|
||||
const _BN_CLICKED = 0
|
||||
const _BST_CHECKED = 1
|
||||
const _BS_AUTOCHECKBOX = 3
|
||||
const _BST_UNCHECKED = 0
|
||||
const _BS_CHECKBOX = 2
|
||||
const _BS_PUSHBUTTON = 0
|
||||
const _CBS_AUTOHSCROLL = 64
|
||||
const _CBS_DROPDOWN = 2
|
||||
|
|
|
@ -6,9 +6,11 @@ const _AC_SRC_OVER = 0
|
|||
const _BCM_GETIDEALSIZE = 5633
|
||||
const _BI_RGB = 0
|
||||
const _BM_GETCHECK = 240
|
||||
const _BM_SETCHECK = 241
|
||||
const _BN_CLICKED = 0
|
||||
const _BST_CHECKED = 1
|
||||
const _BS_AUTOCHECKBOX = 3
|
||||
const _BST_UNCHECKED = 0
|
||||
const _BS_CHECKBOX = 2
|
||||
const _BS_PUSHBUTTON = 0
|
||||
const _CBS_AUTOHSCROLL = 64
|
||||
const _CBS_DROPDOWN = 2
|
||||
|
|
Loading…
Reference in New Issue