Mercurial > emacs
comparison src/w32menu.c @ 109428:5ba21f4a3d62
Merge from mainline.
author | Katsumi Yamaoka <yamaoka@jpl.org> |
---|---|
date | Thu, 08 Jul 2010 22:47:34 +0000 |
parents | 8cfee7d2955f |
children | c02e8765755d |
comparison
equal
deleted
inserted
replaced
109427:9d1a0d3d72be | 109428:5ba21f4a3d62 |
---|---|
154 on the left of the dialog box and all following items on the right. | 154 on the left of the dialog box and all following items on the right. |
155 \(By default, approximately half appear on each side.) | 155 \(By default, approximately half appear on each side.) |
156 | 156 |
157 If HEADER is non-nil, the frame title for the box is "Information", | 157 If HEADER is non-nil, the frame title for the box is "Information", |
158 otherwise it is "Question". */) | 158 otherwise it is "Question". */) |
159 (position, contents, header) | 159 (Lisp_Object position, Lisp_Object contents, Lisp_Object header) |
160 Lisp_Object position, contents, header; | |
161 { | 160 { |
162 FRAME_PTR f = NULL; | 161 FRAME_PTR f = NULL; |
163 Lisp_Object window; | 162 Lisp_Object window; |
164 | 163 |
165 check_w32 (); | 164 check_w32 (); |
448 | 447 |
449 items = FRAME_MENU_BAR_ITEMS (f); | 448 items = FRAME_MENU_BAR_ITEMS (f); |
450 | 449 |
451 /* Save the frame's previous menu bar contents data. */ | 450 /* Save the frame's previous menu bar contents data. */ |
452 if (previous_menu_items_used) | 451 if (previous_menu_items_used) |
453 bcopy (XVECTOR (f->menu_bar_vector)->contents, previous_items, | 452 memcpy (previous_items, XVECTOR (f->menu_bar_vector)->contents, |
454 previous_menu_items_used * sizeof (Lisp_Object)); | 453 previous_menu_items_used * sizeof (Lisp_Object)); |
455 | 454 |
456 /* Fill in menu_items with the current menu bar contents. | 455 /* Fill in menu_items with the current menu bar contents. |
457 This can evaluate Lisp code. */ | 456 This can evaluate Lisp code. */ |
458 save_menu_items (); | 457 save_menu_items (); |
459 | 458 |
1520 if (!wv->title && wv->call_data != 0) | 1519 if (!wv->title && wv->call_data != 0) |
1521 { | 1520 { |
1522 if (set_menu_item_info) | 1521 if (set_menu_item_info) |
1523 { | 1522 { |
1524 MENUITEMINFO info; | 1523 MENUITEMINFO info; |
1525 bzero (&info, sizeof (info)); | 1524 memset (&info, 0, sizeof (info)); |
1526 info.cbSize = sizeof (info); | 1525 info.cbSize = sizeof (info); |
1527 info.fMask = MIIM_DATA; | 1526 info.fMask = MIIM_DATA; |
1528 | 1527 |
1529 /* Set help string for menu item. Leave it as a Lisp_Object | 1528 /* Set help string for menu item. Leave it as a Lisp_Object |
1530 until it is ready to be displayed, since GC can happen while | 1529 until it is ready to be displayed, since GC can happen while |
1603 help = Qnil; | 1602 help = Qnil; |
1604 else | 1603 else |
1605 { | 1604 { |
1606 MENUITEMINFO info; | 1605 MENUITEMINFO info; |
1607 | 1606 |
1608 bzero (&info, sizeof (info)); | 1607 memset (&info, 0, sizeof (info)); |
1609 info.cbSize = sizeof (info); | 1608 info.cbSize = sizeof (info); |
1610 info.fMask = MIIM_DATA; | 1609 info.fMask = MIIM_DATA; |
1611 get_menu_item_info (menu, item, FALSE, &info); | 1610 get_menu_item_info (menu, item, FALSE, &info); |
1612 | 1611 |
1613 #ifdef USE_LISP_UNION_TYPE | 1612 #ifdef USE_LISP_UNION_TYPE |
1640 { | 1639 { |
1641 int i, num = GetMenuItemCount (menu); | 1640 int i, num = GetMenuItemCount (menu); |
1642 for (i = 0; i < num; i++) | 1641 for (i = 0; i < num; i++) |
1643 { | 1642 { |
1644 MENUITEMINFO info; | 1643 MENUITEMINFO info; |
1645 bzero (&info, sizeof (info)); | 1644 memset (&info, 0, sizeof (info)); |
1646 info.cbSize = sizeof (info); | 1645 info.cbSize = sizeof (info); |
1647 info.fMask = MIIM_DATA | MIIM_TYPE | MIIM_SUBMENU; | 1646 info.fMask = MIIM_DATA | MIIM_TYPE | MIIM_SUBMENU; |
1648 | 1647 |
1649 get_menu_item_info (menu, i, TRUE, &info); | 1648 get_menu_item_info (menu, i, TRUE, &info); |
1650 | 1649 |
1686 | 1685 |
1687 /* The following is used by delayed window autoselection. */ | 1686 /* The following is used by delayed window autoselection. */ |
1688 | 1687 |
1689 DEFUN ("menu-or-popup-active-p", Fmenu_or_popup_active_p, Smenu_or_popup_active_p, 0, 0, 0, | 1688 DEFUN ("menu-or-popup-active-p", Fmenu_or_popup_active_p, Smenu_or_popup_active_p, 0, 0, 0, |
1690 doc: /* Return t if a menu or popup dialog is active on selected frame. */) | 1689 doc: /* Return t if a menu or popup dialog is active on selected frame. */) |
1691 () | 1690 (void) |
1692 { | 1691 { |
1693 #ifdef HAVE_MENUS | 1692 #ifdef HAVE_MENUS |
1694 FRAME_PTR f; | 1693 FRAME_PTR f; |
1695 f = SELECTED_FRAME (); | 1694 f = SELECTED_FRAME (); |
1696 return (f->output_data.w32->menubar_active > 0) ? Qt : Qnil; | 1695 return (f->output_data.w32->menubar_active > 0) ? Qt : Qnil; |