#include <dlgs.h>
#include <imm.h>
#define FILE_NAME_TEXT_FIELD edt1
+#define FILE_NAME_COMBO_BOX cmb13
+#define FILE_NAME_LIST lst1
#include "font.h"
#include "w32font.h"
extern void w32_free_menu_strings (HWND);
extern const char *map_w32_filename (const char *, const char **);
-extern int quit_char;
-
-extern const char *const lispy_function_keys[];
-
/* If non-zero, a w32 timer that, when it expires, displays an
hourglass cursor on all frames. */
static unsigned hourglass_timer = 0;
#define MENU_FREE_DELAY 1000
static unsigned menu_free_timer = 0;
-extern Lisp_Object Qtooltip;
-
#ifdef GLYPH_DEBUG
int image_cache_refcount, dpyinfo_refcount;
#endif
-
-extern HWND w32_system_caret_hwnd;
-
-extern int w32_system_caret_height;
-extern int w32_system_caret_x;
-extern int w32_system_caret_y;
static HWND w32_visible_system_caret_hwnd;
/* From w32menu.c */
/* Initialize `default-minibuffer-frame' in case this is the first
frame on this terminal. */
if (FRAME_HAS_MINIBUF_P (f)
- && (!FRAMEP (kb->Vdefault_minibuffer_frame)
- || !FRAME_LIVE_P (XFRAME (kb->Vdefault_minibuffer_frame))))
- kb->Vdefault_minibuffer_frame = frame;
+ && (!FRAMEP (KVAR (kb, Vdefault_minibuffer_frame))
+ || !FRAME_LIVE_P (XFRAME (KVAR (kb, Vdefault_minibuffer_frame)))))
+ KVAR (kb, Vdefault_minibuffer_frame) = frame;
/* All remaining specified parameters, which have not been "used"
by x_get_arg and friends, now go in the misc. alist of the frame. */
Fset_window_buffer (FRAME_ROOT_WINDOW (f), buffer, Qnil);
old_buffer = current_buffer;
set_buffer_internal_1 (XBUFFER (buffer));
- B_ (current_buffer, truncate_lines) = Qnil;
+ BVAR (current_buffer, truncate_lines) = Qnil;
specbind (Qinhibit_read_only, Qt);
specbind (Qinhibit_modification_hooks, Qt);
Ferase_buffer ();
/* Display the tooltip text in a temporary buffer. */
old_buffer = current_buffer;
set_buffer_internal_1 (XBUFFER (XWINDOW (FRAME_ROOT_WINDOW (f))->buffer));
- B_ (current_buffer, truncate_lines) = Qnil;
+ BVAR (current_buffer, truncate_lines) = Qnil;
clear_glyph_matrix (w->desired_matrix);
clear_glyph_matrix (w->current_matrix);
SET_TEXT_POS (pos, BEGV, BEGV_BYTE);
/***********************************************************************
File selection dialog
***********************************************************************/
-extern Lisp_Object Qfile_name_history;
/* Callback for altering the behavior of the Open File dialog.
Makes the Filename text field contain "Current Directory" and be
{
HWND dialog = GetParent (hwnd);
HWND edit_control = GetDlgItem (dialog, FILE_NAME_TEXT_FIELD);
+ HWND list = GetDlgItem (dialog, FILE_NAME_LIST);
- /* Directories is in index 2. */
+ /* At least on Windows 7, the above attempt to get the window handle
+ to the File Name Text Field fails. The following code does the
+ job though. Note that this code is based on my examination of the
+ window hierarchy using Microsoft Spy++. bk */
+ if (edit_control == NULL)
+ {
+ HWND tmp = GetDlgItem (dialog, FILE_NAME_COMBO_BOX);
+ if (tmp)
+ {
+ tmp = GetWindow (tmp, GW_CHILD);
+ if (tmp)
+ edit_control = GetWindow (tmp, GW_CHILD);
+ }
+ }
+
+ /* Directories is in index 2. */
if (notify->lpOFN->nFilterIndex == 2)
{
CommDlg_OpenSave_SetControlText (dialog, FILE_NAME_TEXT_FIELD,
"Current Directory");
EnableWindow (edit_control, FALSE);
+ /* Note that at least on Windows 7, the above call to EnableWindow
+ disables the window that would ordinarily have focus. If we
+ do not set focus to some other window here, focus will land in
+ no man's land and the user will be unable to tab through the
+ dialog box (pressing tab will only result in a beep).
+ Avoid that problem by setting focus to the list here. */
+ if (notify->hdr.code == CDN_INITDONE)
+ SetFocus (list);
}
else
{
else
filename[0] = '\0';
+ /* The code in file_dialog_callback that attempts to set the text
+ of the file name edit window when handling the CDN_INITDONE
+ WM_NOTIFY message does not work. Setting filename to "Current
+ Directory" in the only_dir_p case here does work however. */
+ if (filename[0] == 0 && ! NILP (only_dir_p))
+ strcpy (filename, "Current Directory");
+
{
NEWOPENFILENAME new_file_details;
BOOL file_opened = FALSE;
CHECK_STRING (document);
/* Encode filename, current directory and parameters. */
- current_dir = ENCODE_FILE (B_ (current_buffer, directory));
+ current_dir = ENCODE_FILE (BVAR (current_buffer, directory));
document = ENCODE_FILE (document);
if (STRINGP (parameters))
parameters = ENCODE_SYSTEM (parameters);