Skip to content

Commit

Permalink
TextEdit: Improve handling of escape and tab keys.
Browse files Browse the repository at this point in the history
  • Loading branch information
lxn committed Aug 14, 2011
1 parent f32c731 commit 5370a7c
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/pkg/walk/textedit.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,11 @@ func (te *TextEdit) SetReadOnly(readOnly bool) os.Error {
func (te *TextEdit) wndProc(hwnd HWND, msg uint32, wParam, lParam uintptr) uintptr {
switch msg {
case WM_GETDLGCODE:
result := CallWindowProc(textEditOrigWndProcPtr, hwnd, msg, wParam, lParam)
return result &^ DLGC_HASSETSEL

case WM_KEYDOWN:
if wParam == VK_ESCAPE {
// Suppress weird parent destruction behavior.
return 0
if wParam == VK_RETURN {
return DLGC_WANTALLKEYS
}

return DLGC_HASSETSEL | DLGC_WANTARROWS | DLGC_WANTCHARS
}

return te.WidgetBase.wndProc(hwnd, msg, wParam, lParam)
Expand Down

0 comments on commit 5370a7c

Please sign in to comment.