This commit is contained in:
Pietro Gagliardi 2014-06-26 20:20:00 -04:00
parent 700fef758b
commit 5c002e3d0f
3 changed files with 16 additions and 3 deletions

View File

@ -87,10 +87,11 @@ var classTypes = [nctypes]*classData{
name: toUTF16("STATIC"),
// 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)
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,
// MAKE SURE THIS IS THE SAME
altStyle: _SS_NOPREFIX | _SS_LEFTNOWORDWRAP | controlstyle,
altStyle: (_SS_NOPREFIX | _SS_LEFTNOWORDWRAP | controlstyle) &^ _WS_TABSTOP,
},
c_listbox: &classData{
name: toUTF16("LISTBOX"),
@ -110,7 +111,8 @@ var classTypes = [nctypes]*classData{
},
c_progressbar: &classData{
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,
doNotLoadFont: true,
},

View File

@ -2,6 +2,7 @@ ALL:
- 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
- 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:
- 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)

View File

@ -91,7 +91,9 @@ func ui(main func()) error {
var (
_dispatchMessage = user32.NewProc("DispatchMessageW")
_getActiveWindow = user32.NewProc("GetActiveWindow")
_getMessage = user32.NewProc("GetMessageW")
_isDialogMessage = user32.NewProc("IsDialogMessageW")
_postQuitMessage = user32.NewProc("PostQuitMessage")
_sendMessage = user32.NewProc("SendMessageW")
_translateMessage = user32.NewProc("TranslateMessage")
@ -119,6 +121,14 @@ func msgloop() {
if r1 == 0 { // WM_QUIT message
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)))
_dispatchMessage.Call(uintptr(unsafe.Pointer(&msg)))
}