diff options
Diffstat (limited to 'src/w32fns.c')
| -rw-r--r-- | src/w32fns.c | 48 |
1 files changed, 34 insertions, 14 deletions
diff --git a/src/w32fns.c b/src/w32fns.c index ec48397657a..0c899cdceff 100644 --- a/src/w32fns.c +++ b/src/w32fns.c | |||
| @@ -60,6 +60,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 60 | #include <dlgs.h> | 60 | #include <dlgs.h> |
| 61 | #include <imm.h> | 61 | #include <imm.h> |
| 62 | #define FILE_NAME_TEXT_FIELD edt1 | 62 | #define FILE_NAME_TEXT_FIELD edt1 |
| 63 | #define FILE_NAME_COMBO_BOX cmb13 | ||
| 64 | #define FILE_NAME_LIST lst1 | ||
| 63 | 65 | ||
| 64 | #include "font.h" | 66 | #include "font.h" |
| 65 | #include "w32font.h" | 67 | #include "w32font.h" |
| @@ -78,10 +80,6 @@ extern void w32_menu_display_help (HWND, HMENU, UINT, UINT); | |||
| 78 | extern void w32_free_menu_strings (HWND); | 80 | extern void w32_free_menu_strings (HWND); |
| 79 | extern const char *map_w32_filename (const char *, const char **); | 81 | extern const char *map_w32_filename (const char *, const char **); |
| 80 | 82 | ||
| 81 | extern int quit_char; | ||
| 82 | |||
| 83 | extern const char *const lispy_function_keys[]; | ||
| 84 | |||
| 85 | /* If non-zero, a w32 timer that, when it expires, displays an | 83 | /* If non-zero, a w32 timer that, when it expires, displays an |
| 86 | hourglass cursor on all frames. */ | 84 | hourglass cursor on all frames. */ |
| 87 | static unsigned hourglass_timer = 0; | 85 | static unsigned hourglass_timer = 0; |
| @@ -185,18 +183,10 @@ unsigned int msh_mousewheel = 0; | |||
| 185 | #define MENU_FREE_DELAY 1000 | 183 | #define MENU_FREE_DELAY 1000 |
| 186 | static unsigned menu_free_timer = 0; | 184 | static unsigned menu_free_timer = 0; |
| 187 | 185 | ||
| 188 | extern Lisp_Object Qtooltip; | ||
| 189 | |||
| 190 | #ifdef GLYPH_DEBUG | 186 | #ifdef GLYPH_DEBUG |
| 191 | int image_cache_refcount, dpyinfo_refcount; | 187 | int image_cache_refcount, dpyinfo_refcount; |
| 192 | #endif | 188 | #endif |
| 193 | 189 | ||
| 194 | |||
| 195 | extern HWND w32_system_caret_hwnd; | ||
| 196 | |||
| 197 | extern int w32_system_caret_height; | ||
| 198 | extern int w32_system_caret_x; | ||
| 199 | extern int w32_system_caret_y; | ||
| 200 | static HWND w32_visible_system_caret_hwnd; | 190 | static HWND w32_visible_system_caret_hwnd; |
| 201 | 191 | ||
| 202 | /* From w32menu.c */ | 192 | /* From w32menu.c */ |
| @@ -5849,7 +5839,6 @@ Value is t if tooltip was open, nil otherwise. */) | |||
| 5849 | /*********************************************************************** | 5839 | /*********************************************************************** |
| 5850 | File selection dialog | 5840 | File selection dialog |
| 5851 | ***********************************************************************/ | 5841 | ***********************************************************************/ |
| 5852 | extern Lisp_Object Qfile_name_history; | ||
| 5853 | 5842 | ||
| 5854 | /* Callback for altering the behavior of the Open File dialog. | 5843 | /* Callback for altering the behavior of the Open File dialog. |
| 5855 | Makes the Filename text field contain "Current Directory" and be | 5844 | Makes the Filename text field contain "Current Directory" and be |
| @@ -5868,13 +5857,37 @@ file_dialog_callback (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) | |||
| 5868 | { | 5857 | { |
| 5869 | HWND dialog = GetParent (hwnd); | 5858 | HWND dialog = GetParent (hwnd); |
| 5870 | HWND edit_control = GetDlgItem (dialog, FILE_NAME_TEXT_FIELD); | 5859 | HWND edit_control = GetDlgItem (dialog, FILE_NAME_TEXT_FIELD); |
| 5860 | HWND list = GetDlgItem (dialog, FILE_NAME_LIST); | ||
| 5871 | 5861 | ||
| 5872 | /* Directories is in index 2. */ | 5862 | /* At least on Windows 7, the above attempt to get the window handle |
| 5863 | to the File Name Text Field fails. The following code does the | ||
| 5864 | job though. Note that this code is based on my examination of the | ||
| 5865 | window hierarchy using Microsoft Spy++. bk */ | ||
| 5866 | if (edit_control == NULL) | ||
| 5867 | { | ||
| 5868 | HWND tmp = GetDlgItem (dialog, FILE_NAME_COMBO_BOX); | ||
| 5869 | if (tmp) | ||
| 5870 | { | ||
| 5871 | tmp = GetWindow (tmp, GW_CHILD); | ||
| 5872 | if (tmp) | ||
| 5873 | edit_control = GetWindow (tmp, GW_CHILD); | ||
| 5874 | } | ||
| 5875 | } | ||
| 5876 | |||
| 5877 | /* Directories is in index 2. */ | ||
| 5873 | if (notify->lpOFN->nFilterIndex == 2) | 5878 | if (notify->lpOFN->nFilterIndex == 2) |
| 5874 | { | 5879 | { |
| 5875 | CommDlg_OpenSave_SetControlText (dialog, FILE_NAME_TEXT_FIELD, | 5880 | CommDlg_OpenSave_SetControlText (dialog, FILE_NAME_TEXT_FIELD, |
| 5876 | "Current Directory"); | 5881 | "Current Directory"); |
| 5877 | EnableWindow (edit_control, FALSE); | 5882 | EnableWindow (edit_control, FALSE); |
| 5883 | /* Note that at least on Windows 7, the above call to EnableWindow | ||
| 5884 | disables the window that would ordinarily have focus. If we | ||
| 5885 | do not set focus to some other window here, focus will land in | ||
| 5886 | no man's land and the user will be unable to tab through the | ||
| 5887 | dialog box (pressing tab will only result in a beep). | ||
| 5888 | Avoid that problem by setting focus to the list here. */ | ||
| 5889 | if (notify->hdr.code == CDN_INITDONE) | ||
| 5890 | SetFocus (list); | ||
| 5878 | } | 5891 | } |
| 5879 | else | 5892 | else |
| 5880 | { | 5893 | { |
| @@ -5951,6 +5964,13 @@ Otherwise, if ONLY-DIR-P is non-nil, the user can only select directories. */) | |||
| 5951 | else | 5964 | else |
| 5952 | filename[0] = '\0'; | 5965 | filename[0] = '\0'; |
| 5953 | 5966 | ||
| 5967 | /* The code in file_dialog_callback that attempts to set the text | ||
| 5968 | of the file name edit window when handling the CDN_INITDONE | ||
| 5969 | WM_NOTIFY message does not work. Setting filename to "Current | ||
| 5970 | Directory" in the only_dir_p case here does work however. */ | ||
| 5971 | if (filename[0] == 0 && ! NILP (only_dir_p)) | ||
| 5972 | strcpy (filename, "Current Directory"); | ||
| 5973 | |||
| 5954 | { | 5974 | { |
| 5955 | NEWOPENFILENAME new_file_details; | 5975 | NEWOPENFILENAME new_file_details; |
| 5956 | BOOL file_opened = FALSE; | 5976 | BOOL file_opened = FALSE; |