comparison src/scrollbar-msw.c @ 288:e11d67e05968 r21-0b42

Import from CVS: tag r21-0b42
author cvs
date Mon, 13 Aug 2007 10:35:54 +0200
parents 57709be46d1b
children c9fe270a4101
comparison
equal deleted inserted replaced
287:13a0bd77a29d 288:e11d67e05968
164 164
165 void 165 void
166 mswindows_handle_scrollbar_event (HWND hwnd, int code, int pos) 166 mswindows_handle_scrollbar_event (HWND hwnd, int code, int pos)
167 { 167 {
168 struct frame *f; 168 struct frame *f;
169 Lisp_Object win; 169 Lisp_Object win, frame;
170 struct scrollbar_instance *sb; 170 struct scrollbar_instance *sb;
171 SCROLLINFO scrollinfo; 171 SCROLLINFO scrollinfo;
172 int vert = GetWindowLong (hwnd, GWL_STYLE) & SBS_VERT; 172 int vert = GetWindowLong (hwnd, GWL_STYLE) & SBS_VERT;
173 173
174 sb = (struct scrollbar_instance *)GetWindowLong (hwnd, GWL_USERDATA); 174 sb = (struct scrollbar_instance *)GetWindowLong (hwnd, GWL_USERDATA);
175 win = real_window (sb->mirror, 1); 175 win = real_window (sb->mirror, 1);
176 f = XFRAME (XWINDOW (win)->frame); 176 frame = XWINDOW (win)->frame;
177 f = XFRAME (frame);
177 178
178 inhibit_slider_size_change = code == SB_THUMBTRACK; 179 inhibit_slider_size_change = code == SB_THUMBTRACK;
179 180
180 /* SB_LINEDOWN == SB_CHARLEFT etc. This is the way they will 181 /* SB_LINEDOWN == SB_CHARLEFT etc. This is the way they will
181 always be - any Windows is binary compatible backward with 182 always be - any Windows is binary compatible backward with
182 old programs */ 183 old programs */
183 184
184 switch (code) 185 switch (code)
185 { 186 {
186 case SB_LINEDOWN: 187 case SB_LINEDOWN:
187 enqueue_misc_user_event(win, 188 mswindows_enqueue_misc_user_event
188 vert ? Qscrollbar_line_down : Qscrollbar_char_right, 189 (frame, vert ? Qscrollbar_line_down : Qscrollbar_char_right, win);
189 win);
190 break; 190 break;
191 191
192 case SB_LINEUP: 192 case SB_LINEUP:
193 enqueue_misc_user_event(win, 193 mswindows_enqueue_misc_user_event
194 vert ? Qscrollbar_line_up : Qscrollbar_char_left, 194 (frame, vert ? Qscrollbar_line_up : Qscrollbar_char_left, win);
195 win);
196 break; 195 break;
197 196
198 case SB_PAGEDOWN: 197 case SB_PAGEDOWN:
199 enqueue_misc_user_event(win, 198 mswindows_enqueue_misc_user_event
200 vert ? Qscrollbar_page_down : Qscrollbar_page_right, 199 (win, vert ? Qscrollbar_page_down : Qscrollbar_page_right,
201 vert ? Fcons (win, Qnil) : win); 200 vert ? Fcons (win, Qnil) : win);
202 break; 201 break;
203 202
204 case SB_PAGEUP: 203 case SB_PAGEUP:
205 enqueue_misc_user_event(win, 204 mswindows_enqueue_misc_user_event
206 vert ? Qscrollbar_page_up : Qscrollbar_page_left, 205 (frame,
207 vert ? Fcons (win, Qnil) : win); 206 vert ? Qscrollbar_page_up : Qscrollbar_page_left,
207 vert ? Fcons (win, Qnil) : win);
208 break; 208 break;
209 209
210 case SB_BOTTOM: 210 case SB_BOTTOM:
211 enqueue_misc_user_event(win, 211 mswindows_enqueue_misc_user_event
212 vert ? Qscrollbar_to_bottom : Qscrollbar_to_right, 212 (frame, vert ? Qscrollbar_to_bottom : Qscrollbar_to_right, win);
213 win);
214 break; 213 break;
215 214
216 case SB_TOP: 215 case SB_TOP:
217 enqueue_misc_user_event(win, 216 mswindows_enqueue_misc_user_event
218 vert ? Qscrollbar_to_top : Qscrollbar_to_left, 217 (frame, vert ? Qscrollbar_to_top : Qscrollbar_to_left, win);
219 win);
220 break; 218 break;
221 219
222 case SB_THUMBTRACK: 220 case SB_THUMBTRACK:
223 case SB_THUMBPOSITION: 221 case SB_THUMBPOSITION:
224 scrollinfo.cbSize = sizeof(SCROLLINFO); 222 scrollinfo.cbSize = sizeof(SCROLLINFO);
225 scrollinfo.fMask = SIF_TRACKPOS; 223 scrollinfo.fMask = SIF_TRACKPOS;
226 GetScrollInfo (hwnd, SB_CTL, &scrollinfo); 224 GetScrollInfo (hwnd, SB_CTL, &scrollinfo);
227 enqueue_misc_user_event (win, 225 mswindows_enqueue_misc_user_event
228 (vert ? Qscrollbar_vertical_drag 226 (frame,
229 : Qscrollbar_horizontal_drag), 227 vert ? Qscrollbar_vertical_drag : Qscrollbar_horizontal_drag,
230 Fcons (win, make_int (scrollinfo.nTrackPos))); 228 Fcons (win, make_int (scrollinfo.nTrackPos)));
231 break; 229 break;
232 } 230 }
233 } 231 }
234 232
235 #ifdef MEMORY_USAGE_STATS 233 #ifdef MEMORY_USAGE_STATS