comparison src/toolbar-msw.c @ 442:abe6d1db359e r21-2-36

Import from CVS: tag r21-2-36
author cvs
date Mon, 13 Aug 2007 11:35:02 +0200
parents 8de8e3f6228a
children 183866b06e0b
comparison
equal deleted inserted replaced
441:72a7cfa4a488 442:abe6d1db359e
44 #define TOOLBAR_ITEM_ID_MAX 0x7FFF 44 #define TOOLBAR_ITEM_ID_MAX 0x7FFF
45 #define TOOLBAR_ITEM_ID_BITS(x) (((x) & 0x3FFF) | 0x4000) 45 #define TOOLBAR_ITEM_ID_BITS(x) (((x) & 0x3FFF) | 0x4000)
46 #define TOOLBAR_ID_BIAS 16 46 #define TOOLBAR_ID_BIAS 16
47 #define TOOLBAR_HANDLE(f,p) \ 47 #define TOOLBAR_HANDLE(f,p) \
48 GetDlgItem(FRAME_MSWINDOWS_HANDLE(f), TOOLBAR_ID_BIAS + p) 48 GetDlgItem(FRAME_MSWINDOWS_HANDLE(f), TOOLBAR_ID_BIAS + p)
49 #ifndef TB_SETIMAGELIST 49
50 #define TB_SETIMAGELIST (WM_USER + 48)
51 #define TB_GETIMAGELIST (WM_USER + 49)
52 #define TB_SETDISABLEDIMAGELIST (WM_USER + 54)
53 #define TB_GETDISABLEDIMAGELIST (WM_USER + 55)
54 #endif
55 #ifndef TB_SETPADDING
56 #define TB_SETPADDING (WM_USER + 87)
57 #endif
58 #define MSWINDOWS_BUTTON_SHADOW_THICKNESS 2 50 #define MSWINDOWS_BUTTON_SHADOW_THICKNESS 2
59 #define MSWINDOWS_BLANK_SIZE 5 51 #define MSWINDOWS_BLANK_SIZE 5
60 #define MSWINDOWS_MINIMUM_TOOLBAR_SIZE 8 52 #define MSWINDOWS_MINIMUM_TOOLBAR_SIZE 8
61 53
62 static void 54 static void
129 SendMessage (toolbarwnd, TB_SETIMAGELIST, 0, (LPARAM)NULL); 121 SendMessage (toolbarwnd, TB_SETIMAGELIST, 0, (LPARAM)NULL);
130 122
131 ShowWindow(toolbarwnd, SW_HIDE); 123 ShowWindow(toolbarwnd, SW_HIDE);
132 } 124 }
133 125
134 FRAME_MSWINDOWS_TOOLBAR_CHECKSUM(f,pos)=0; 126 FRAME_MSWINDOWS_TOOLBAR_CHECKSUM (f, pos) = 0;
135 SET_TOOLBAR_WAS_VISIBLE_FLAG (f, pos, 0); 127 SET_TOOLBAR_WAS_VISIBLE_FLAG (f, pos, 0);
136 } 128 }
137 129
138 static void 130 static void
139 mswindows_output_toolbar (struct frame *f, enum toolbar_pos pos) 131 mswindows_output_toolbar (struct frame *f, enum toolbar_pos pos)
221 if (!toolbarwnd || FRAME_MSWINDOWS_TOOLBAR_CHECKSUM(f,pos)!=checksum) 213 if (!toolbarwnd || FRAME_MSWINDOWS_TOOLBAR_CHECKSUM(f,pos)!=checksum)
222 { 214 {
223 /* remove the old one */ 215 /* remove the old one */
224 mswindows_clear_toolbar (f, pos, 0); 216 mswindows_clear_toolbar (f, pos, 0);
225 217
226 FRAME_MSWINDOWS_TOOLBAR_CHECKSUM(f,pos)=checksum; 218 FRAME_MSWINDOWS_TOOLBAR_CHECKSUM (f, pos)=checksum;
227 219
228 /* build up the data required by win32 fns. */ 220 /* build up the data required by win32 fns. */
229 button_tbl = xnew_array_and_zero (TBBUTTON, nbuttons); 221 button_tbl = xnew_array_and_zero (TBBUTTON, nbuttons);
230 button = FRAME_TOOLBAR_BUTTONS (f, pos); 222 button = FRAME_TOOLBAR_BUTTONS (f, pos);
231 tbbutton = button_tbl; 223 tbbutton = button_tbl;
382 && 374 &&
383 (toolbarwnd = 375 (toolbarwnd =
384 CreateWindowEx ( WS_EX_WINDOWEDGE, 376 CreateWindowEx ( WS_EX_WINDOWEDGE,
385 TOOLBARCLASSNAME, 377 TOOLBARCLASSNAME,
386 NULL, 378 NULL,
387 WS_CHILD | WS_VISIBLE 379 WS_CHILD
388 | (style_3d ? WS_DLGFRAME : 0) 380 | (style_3d ? WS_DLGFRAME : 0)
389 | TBSTYLE_TOOLTIPS | CCS_NORESIZE 381 | TBSTYLE_TOOLTIPS
390 | CCS_NOPARENTALIGN | CCS_NODIVIDER, 382 | CCS_NORESIZE
383 | CCS_NOPARENTALIGN | CCS_NODIVIDER
384 | CCS_ADJUSTABLE,
391 x, y, bar_width, bar_height, 385 x, y, bar_width, bar_height,
392 FRAME_MSWINDOWS_HANDLE (f), 386 FRAME_MSWINDOWS_HANDLE (f),
393 (HMENU)(TOOLBAR_ID_BIAS + pos), 387 (HMENU)(TOOLBAR_ID_BIAS + pos),
394 NULL, 388 NULL,
395 NULL))==NULL) 389 NULL))==NULL)
571 565
572 static void 566 static void
573 mswindows_free_frame_toolbars (struct frame *f) 567 mswindows_free_frame_toolbars (struct frame *f)
574 { 568 {
575 HWND twnd=NULL; 569 HWND twnd=NULL;
576 #define DELETE_TOOLBAR(pos) \ 570 #define DELETE_TOOLBAR(pos) \
577 mswindows_clear_toolbar(f, 0, pos); \ 571 mswindows_clear_toolbar(f, pos, 0); \
578 if ((twnd=GetDlgItem(FRAME_MSWINDOWS_HANDLE(f), TOOLBAR_ID_BIAS + pos))) \ 572 if ((twnd=GetDlgItem(FRAME_MSWINDOWS_HANDLE(f), \
573 TOOLBAR_ID_BIAS + pos))) \
579 DestroyWindow(twnd) 574 DestroyWindow(twnd)
580 575
581 DELETE_TOOLBAR(TOP_TOOLBAR); 576 DELETE_TOOLBAR(TOP_TOOLBAR);
582 DELETE_TOOLBAR(BOTTOM_TOOLBAR); 577 DELETE_TOOLBAR(BOTTOM_TOOLBAR);
583 DELETE_TOOLBAR(LEFT_TOOLBAR); 578 DELETE_TOOLBAR(LEFT_TOOLBAR);