Mercurial > dwindows
comparison win/dw.c @ 301:887675ee5b67
More keypress fixes on Windows.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Thu, 27 Mar 2003 10:49:06 +0000 |
parents | 2a97f8d9b297 |
children | 464b5e46b313 |
comparison
equal
deleted
inserted
replaced
300:4559a2fd2db2 | 301:887675ee5b67 |
---|---|
748 | 748 |
749 if(thisbox) | 749 if(thisbox) |
750 { | 750 { |
751 _focus_check_box(thisbox, handle, 3, thisbox->defaultitem); | 751 _focus_check_box(thisbox, handle, 3, thisbox->defaultitem); |
752 } | 752 } |
753 } | |
754 | |
755 HWND _toplevel_window(HWND handle) | |
756 { | |
757 HWND box, lastbox = GetParent(handle); | |
758 | |
759 /* Find the toplevel window */ | |
760 while((box = GetParent(lastbox))) | |
761 { | |
762 lastbox = box; | |
763 } | |
764 if(lastbox) | |
765 return lastbox; | |
766 return handle; | |
753 } | 767 } |
754 | 768 |
755 /* This function finds the current widget in the | 769 /* This function finds the current widget in the |
756 * layout and moves the current focus to the next item. | 770 * layout and moves the current focus to the next item. |
757 */ | 771 */ |
1410 break; | 1424 break; |
1411 case WM_CHAR: | 1425 case WM_CHAR: |
1412 { | 1426 { |
1413 int (*keypressfunc)(HWND, char, int, int, void *) = tmp->signalfunction; | 1427 int (*keypressfunc)(HWND, char, int, int, void *) = tmp->signalfunction; |
1414 | 1428 |
1415 if(hWnd == tmp->window) | 1429 if(hWnd == tmp->window || _toplevel_window(hWnd) == tmp->window) |
1416 { | 1430 { |
1417 int special = 0; | 1431 int special = 0; |
1418 char ch = 0; | 1432 char ch = 0; |
1419 | 1433 |
1420 if(GetAsyncKeyState(VK_SHIFT) & 0x8000) | 1434 if(GetAsyncKeyState(VK_SHIFT) & 0x8000) |