aboutsummaryrefslogtreecommitdiffstats
path: root/src/w32fns.c
diff options
context:
space:
mode:
authorStefan Monnier2011-03-21 12:42:16 -0400
committerStefan Monnier2011-03-21 12:42:16 -0400
commitcafdcef32d55cbb44389d7e322e7f973cbb72dfd (patch)
tree7ee0c41ea8a589650ce6f4311fb10e61a63807b9 /src/w32fns.c
parenta08a25d7aaf251aa18f2ef747be53734bc55cae9 (diff)
parent4e05e67e4cd0bc1b0a4ef3176a4d0d91c6b3738e (diff)
downloademacs-cafdcef32d55cbb44389d7e322e7f973cbb72dfd.tar.gz
emacs-cafdcef32d55cbb44389d7e322e7f973cbb72dfd.zip
Merge from trunk
Diffstat (limited to 'src/w32fns.c')
-rw-r--r--src/w32fns.c48
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);
78extern void w32_free_menu_strings (HWND); 80extern void w32_free_menu_strings (HWND);
79extern const char *map_w32_filename (const char *, const char **); 81extern const char *map_w32_filename (const char *, const char **);
80 82
81extern int quit_char;
82
83extern 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. */
87static unsigned hourglass_timer = 0; 85static 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
186static unsigned menu_free_timer = 0; 184static unsigned menu_free_timer = 0;
187 185
188extern Lisp_Object Qtooltip;
189
190#ifdef GLYPH_DEBUG 186#ifdef GLYPH_DEBUG
191int image_cache_refcount, dpyinfo_refcount; 187int image_cache_refcount, dpyinfo_refcount;
192#endif 188#endif
193 189
194
195extern HWND w32_system_caret_hwnd;
196
197extern int w32_system_caret_height;
198extern int w32_system_caret_x;
199extern int w32_system_caret_y;
200static HWND w32_visible_system_caret_hwnd; 190static 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 ***********************************************************************/
5852extern 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;