Allowed tab stops on Windows; see http://blogs.msdn.com/b/oldnewthing/archive/2003/10/21/55384.aspx. Fixes #13
This commit is contained in:
parent
700fef758b
commit
5c002e3d0f
|
@ -87,10 +87,11 @@ var classTypes = [nctypes]*classData{
|
||||||
name: toUTF16("STATIC"),
|
name: toUTF16("STATIC"),
|
||||||
// SS_NOPREFIX avoids accelerator translation; SS_LEFTNOWORDWRAP clips text past the end
|
// SS_NOPREFIX avoids accelerator translation; SS_LEFTNOWORDWRAP clips text past the end
|
||||||
// controls are vertically aligned to the top by default (thanks Xeek in irc.freenode.net/#winapi)
|
// controls are vertically aligned to the top by default (thanks Xeek in irc.freenode.net/#winapi)
|
||||||
style: _SS_NOPREFIX | _SS_LEFTNOWORDWRAP | controlstyle,
|
// also note that tab stops are remove dfor labels
|
||||||
|
style: (_SS_NOPREFIX | _SS_LEFTNOWORDWRAP | controlstyle) &^ _WS_TABSTOP,
|
||||||
xstyle: 0 | controlxstyle,
|
xstyle: 0 | controlxstyle,
|
||||||
// MAKE SURE THIS IS THE SAME
|
// MAKE SURE THIS IS THE SAME
|
||||||
altStyle: _SS_NOPREFIX | _SS_LEFTNOWORDWRAP | controlstyle,
|
altStyle: (_SS_NOPREFIX | _SS_LEFTNOWORDWRAP | controlstyle) &^ _WS_TABSTOP,
|
||||||
},
|
},
|
||||||
c_listbox: &classData{
|
c_listbox: &classData{
|
||||||
name: toUTF16("LISTBOX"),
|
name: toUTF16("LISTBOX"),
|
||||||
|
@ -110,7 +111,8 @@ var classTypes = [nctypes]*classData{
|
||||||
},
|
},
|
||||||
c_progressbar: &classData{
|
c_progressbar: &classData{
|
||||||
name: toUTF16(x_PROGRESS_CLASS),
|
name: toUTF16(x_PROGRESS_CLASS),
|
||||||
style: _PBS_SMOOTH | controlstyle,
|
// note that tab stops are disabled for progress bars
|
||||||
|
style: (_PBS_SMOOTH | controlstyle) &^ _WS_TABSTOP,
|
||||||
xstyle: 0 | controlxstyle,
|
xstyle: 0 | controlxstyle,
|
||||||
doNotLoadFont: true,
|
doNotLoadFont: true,
|
||||||
},
|
},
|
||||||
|
|
1
todo.md
1
todo.md
|
@ -2,6 +2,7 @@ ALL:
|
||||||
- vertical alignment of labels still has some flaws
|
- vertical alignment of labels still has some flaws
|
||||||
- gtk+: currently requires labels to be filling for this to work: grids don't do this by default, for instance
|
- gtk+: currently requires labels to be filling for this to work: grids don't do this by default, for instance
|
||||||
- won't cause any issues, just an inconvenience that should be addressed
|
- won't cause any issues, just an inconvenience that should be addressed
|
||||||
|
- make sure tab stop behavior for Areas makes sense, or provide a handler function
|
||||||
|
|
||||||
MAC OS X:
|
MAC OS X:
|
||||||
- NSComboBox scans the entered text to see if it matches one of the items and returns the index of that item if it does; find out how to suppress this so that it returns -1 unless the item was chosen from the list (like the other platforms)
|
- NSComboBox scans the entered text to see if it matches one of the items and returns the index of that item if it does; find out how to suppress this so that it returns -1 unless the item was chosen from the list (like the other platforms)
|
||||||
|
|
|
@ -91,7 +91,9 @@ func ui(main func()) error {
|
||||||
|
|
||||||
var (
|
var (
|
||||||
_dispatchMessage = user32.NewProc("DispatchMessageW")
|
_dispatchMessage = user32.NewProc("DispatchMessageW")
|
||||||
|
_getActiveWindow = user32.NewProc("GetActiveWindow")
|
||||||
_getMessage = user32.NewProc("GetMessageW")
|
_getMessage = user32.NewProc("GetMessageW")
|
||||||
|
_isDialogMessage = user32.NewProc("IsDialogMessageW")
|
||||||
_postQuitMessage = user32.NewProc("PostQuitMessage")
|
_postQuitMessage = user32.NewProc("PostQuitMessage")
|
||||||
_sendMessage = user32.NewProc("SendMessageW")
|
_sendMessage = user32.NewProc("SendMessageW")
|
||||||
_translateMessage = user32.NewProc("TranslateMessage")
|
_translateMessage = user32.NewProc("TranslateMessage")
|
||||||
|
@ -119,6 +121,14 @@ func msgloop() {
|
||||||
if r1 == 0 { // WM_QUIT message
|
if r1 == 0 { // WM_QUIT message
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
// this next bit handles tab stops
|
||||||
|
r1, _, _ = _getActiveWindow.Call()
|
||||||
|
r1, _, _ = _isDialogMessage.Call(
|
||||||
|
r1, // active window
|
||||||
|
uintptr(unsafe.Pointer(&msg)))
|
||||||
|
if r1 != 0 {
|
||||||
|
continue
|
||||||
|
}
|
||||||
_translateMessage.Call(uintptr(unsafe.Pointer(&msg)))
|
_translateMessage.Call(uintptr(unsafe.Pointer(&msg)))
|
||||||
_dispatchMessage.Call(uintptr(unsafe.Pointer(&msg)))
|
_dispatchMessage.Call(uintptr(unsafe.Pointer(&msg)))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue