annotate src/gui-msw.c @ 1601:442db3c3c43b

[xemacs-hg @ 2003-08-02 08:42:10 by michaels] 2003-07-31 Mike Sperber <mike@xemacs.org> * isearch-mode.el (isearch-mode-help): (isearch-update): (isearch-done): (isearch-edit-string): Change the way window configurations are handled: Formerly, the code would do `set-window-configuration' off `pre-command-hook' which isn't really allowed. (The old window-configuration code would quietly ignore this restriction.) Instead, save the window configuration only when someone asks for help, and restore afterwards, and otherwise leave it alone.
author michaels
date Sat, 02 Aug 2003 08:42:11 +0000
parents e22b0213b713
children 04bc9d2f42c7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1 /* mswindows GUI code. (menubars, scrollbars, toolbars, dialogs)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2 Copyright (C) 1998 Andy Piper.
1204
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
3 Copyright (C) 2002 Ben Wing.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5 This file is part of XEmacs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
6
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
7 XEmacs is free software; you can redistribute it and/or modify it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
8 under the terms of the GNU General Public License as published by the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
9 Free Software Foundation; either version 2, or (at your option) any
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
10 later version.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
11
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
12 XEmacs is distributed in the hope that it will be useful, but WITHOUT
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
15 for more details.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
16
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
18 along with XEmacs; see the file COPYING. If not, write to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
20 Boston, MA 02111-1307, USA. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
21
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
22 /* Synched up with: Not in FSF. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
23
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 442
diff changeset
24 /* This file essentially Mule-ized (except perhaps some Unicode splitting).
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 442
diff changeset
25 5-2000. */
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 442
diff changeset
26
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
27 #include <config.h>
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
28 #include "lisp.h"
872
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents: 826
diff changeset
29 #include "console-msw-impl.h"
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
30 #include "redisplay.h"
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
31 #include "gui.h"
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
32 #include "glyphs.h"
872
79c6ff3eef26 [xemacs-hg @ 2002-06-20 21:18:01 by ben]
ben
parents: 826
diff changeset
33 #include "frame-impl.h"
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
34 #include "elhash.h"
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
35 #include "events.h"
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
36 #include "buffer.h"
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
37
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
38 /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
39 * Return value is Qt if we have dispatched the command,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
40 * or Qnil if id has not been mapped to a callback.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
41 * Window procedure may try other targets to route the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
42 * command if we return nil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
43 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
44 Lisp_Object
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 442
diff changeset
45 mswindows_handle_gui_wm_command (struct frame *f, HWND ctrl, LPARAM id)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
46 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
47 /* Try to map the command id through the proper hash table */
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
48 Lisp_Object callback, callback_ex, image_instance, frame, event;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
49
793
e38acbeb1cae [xemacs-hg @ 2002-03-29 04:46:17 by ben]
ben
parents: 771
diff changeset
50 frame = wrap_frame (f);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
51
826
6728e641994e [xemacs-hg @ 2002-05-05 11:30:15 by ben]
ben
parents: 793
diff changeset
52 image_instance = Fgethash (make_int_verify (id),
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
53 FRAME_MSWINDOWS_WIDGET_HASH_TABLE1 (f), Qnil);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
54 /* It is possible for a widget action to cause it to get out of sync
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
55 with its instantiator. Thus it is necessary to signal this
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
56 possibility. */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
57 if (IMAGE_INSTANCEP (image_instance))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
58 XIMAGE_INSTANCE_WIDGET_ACTION_OCCURRED (image_instance) = 1;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
59 callback = Fgethash (make_int (id),
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
60 FRAME_MSWINDOWS_WIDGET_HASH_TABLE2 (f), Qnil);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
61 callback_ex = Fgethash (make_int (id),
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
62 FRAME_MSWINDOWS_WIDGET_HASH_TABLE3 (f), Qnil);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
63
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
64 if (!NILP (callback_ex) && !UNBOUNDP (callback_ex))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
65 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
66 event = Fmake_event (Qnil, Qnil);
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
67
964
8d610ea37af8 [xemacs-hg @ 2002-08-16 08:15:18 by michaels]
michaels
parents: 872
diff changeset
68 XSET_EVENT_TYPE (event, misc_user_event);
8d610ea37af8 [xemacs-hg @ 2002-08-16 08:15:18 by michaels]
michaels
parents: 872
diff changeset
69 XSET_EVENT_CHANNEL (event, frame);
8d610ea37af8 [xemacs-hg @ 2002-08-16 08:15:18 by michaels]
michaels
parents: 872
diff changeset
70 XSET_EVENT_TIMESTAMP (event, GetTickCount());
1204
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
71 XSET_EVENT_MISC_USER_FUNCTION (event, Qeval);
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
72 XSET_EVENT_MISC_USER_OBJECT (event,
964
8d610ea37af8 [xemacs-hg @ 2002-08-16 08:15:18 by michaels]
michaels
parents: 872
diff changeset
73 list4 (Qfuncall, callback_ex, image_instance, event));
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
74 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
75 else if (NILP (callback) || UNBOUNDP (callback))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
76 return Qnil;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
77 else
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
78 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
79 Lisp_Object fn, arg;
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
80
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
81 event = Fmake_event (Qnil, Qnil);
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
82
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
83 get_gui_callback (callback, &fn, &arg);
964
8d610ea37af8 [xemacs-hg @ 2002-08-16 08:15:18 by michaels]
michaels
parents: 872
diff changeset
84 XSET_EVENT_TYPE (event, misc_user_event);
8d610ea37af8 [xemacs-hg @ 2002-08-16 08:15:18 by michaels]
michaels
parents: 872
diff changeset
85 XSET_EVENT_CHANNEL (event, frame);
8d610ea37af8 [xemacs-hg @ 2002-08-16 08:15:18 by michaels]
michaels
parents: 872
diff changeset
86 XSET_EVENT_TIMESTAMP (event, GetTickCount());
1204
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
87 XSET_EVENT_MISC_USER_FUNCTION (event, fn);
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
88 XSET_EVENT_MISC_USER_OBJECT (event, arg);
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
89 }
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
90
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
91 mswindows_enqueue_dispatch_event (event);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
92 /* The result of this evaluation could cause other instances to change so
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
93 enqueue an update callback to check this. */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
94 enqueue_magic_eval_event (update_widget_instances, frame);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
95 return Qt;
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
96 }
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
97
1204
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
98 /*
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
99 * Translate X accelerator syntax to win32 accelerator syntax.
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
100 * accel = (Ichar*) to receive the accelerator character
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
101 * or NULL to suppress accelerators in the menu or dialog item.
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
102 *
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
103 * %% is replaced with %
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
104 * if accel is NULL:
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
105 * %_ is removed.
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
106 * if accel is non-NULL:
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
107 * %_ is replaced with &.
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
108 * The accelerator character is passed back in *accel.
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
109 * (If there is no accelerator, it will be added on the first character.)
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
110 *
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
111 */
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
112
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
113 Lisp_Object
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
114 mswindows_translate_menu_or_dialog_item (Lisp_Object item, Ichar *accel)
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
115 {
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
116 Bytecount len = XSTRING_LENGTH (item);
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
117 Ibyte *it = (Ibyte *) ALLOCA (2 * len + 42), *ptr = it;
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
118
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
119 memcpy (ptr, XSTRING_DATA (item), len + 1);
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
120 if (accel)
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
121 *accel = '\0';
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
122
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
123 /* Escape '&' as '&&' */
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
124
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
125 while ((ptr = (Ibyte *) memchr (ptr, '&', len - (ptr - it))) != NULL)
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
126 {
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
127 memmove (ptr + 1, ptr, (len - (ptr - it)) + 1);
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
128 len++;
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
129 ptr += 2;
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
130 }
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
131
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
132 /* Replace XEmacs accelerator '%_' with Windows accelerator '&'
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
133 and `%%' with `%'. */
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
134 ptr = it;
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
135 while ((ptr = (Ibyte *) memchr (ptr, '%', len - (ptr - it))) != NULL)
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
136 {
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
137 if (*(ptr + 1) == '_')
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
138 {
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
139 if (accel)
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
140 {
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
141 *ptr = '&';
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
142 if (!*accel)
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
143 *accel = DOWNCASE (0, itext_ichar (ptr + 2));
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
144 memmove (ptr + 1, ptr + 2, len - (ptr - it + 2) + 1);
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
145 len--;
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
146 }
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
147 else /* Skip accelerator */
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
148 {
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
149 memmove (ptr, ptr + 2, len - (ptr - it + 2) + 1);
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
150 len -= 2;
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
151 }
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
152 }
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
153 else if (*(ptr + 1) == '%')
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
154 {
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
155 memmove (ptr + 1, ptr + 2, len - (ptr - it + 2) + 1);
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
156 len--;
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
157 ptr++;
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
158 }
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
159 else /* % on its own - shouldn't happen */
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
160 ptr++;
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
161 }
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
162
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
163 if (accel && !*accel)
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
164 {
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
165 /* Force a default accelerator */
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
166 ptr = it;
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
167 memmove (ptr + 1, ptr, len + 1);
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
168 *accel = DOWNCASE (0, itext_ichar (ptr + 1));
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
169 *ptr = '&';
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
170
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
171 len++;
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
172 }
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
173
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
174 return make_string (it, len);
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
175 }
e22b0213b713 [xemacs-hg @ 2003-01-12 11:07:58 by michaels]
michaels
parents: 964
diff changeset
176
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
177 void
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
178 syms_of_gui_mswindows (void)
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
179 {
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
180 }