Mercurial > hg > xemacs-beta
comparison src/menubar-msw.c @ 707:a307f9a2021d
[xemacs-hg @ 2001-12-20 05:49:28 by andyp]
sync with 21-4-6-windows
author | andyp |
---|---|
date | Thu, 20 Dec 2001 05:49:48 +0000 |
parents | fdefd0186b75 |
children | 943eaba38521 |
comparison
equal
deleted
inserted
replaced
706:c9bf82d465b5 | 707:a307f9a2021d |
---|---|
736 /* This function can call lisp, beat dogs and stick chewing gum to | 736 /* This function can call lisp, beat dogs and stick chewing gum to |
737 everything! */ | 737 everything! */ |
738 | 738 |
739 Lisp_Object path, desc; | 739 Lisp_Object path, desc; |
740 struct gcpro gcpro1; | 740 struct gcpro gcpro1; |
741 | 741 |
742 /* Find which guy is going to explode */ | 742 /* Find which guy is going to explode */ |
743 path = Fgethash (hmenu_to_lisp_object (menu), current_hash_table, Qunbound); | 743 path = Fgethash (hmenu_to_lisp_object (menu), current_hash_table, Qunbound); |
744 assert (!UNBOUNDP (path)); | 744 assert (!UNBOUNDP (path)); |
745 #ifdef DEBUG_XEMACS | 745 #ifdef DEBUG_XEMACS |
746 /* Allow to continue in a debugger after assert - not so fatal */ | 746 /* Allow to continue in a debugger after assert - not so fatal */ |
820 XSETFRAME (frame, f); | 820 XSETFRAME (frame, f); |
821 /* this used to call mswindows_enqueue_misc_user_event but that | 821 /* this used to call mswindows_enqueue_misc_user_event but that |
822 breaks customize because the misc_event gets eval'ed in some | 822 breaks customize because the misc_event gets eval'ed in some |
823 circumstances. Don't change it back unless you can fix the | 823 circumstances. Don't change it back unless you can fix the |
824 customize problem also.*/ | 824 customize problem also.*/ |
825 enqueue_misc_user_event (frame, fn, arg); | 825 mswindows_enqueue_misc_user_event (frame, fn, arg); |
826 mswindows_enqueue_magic_event (NULL, XM_BUMPQUEUE); | |
827 | 826 |
828 UNGCPRO; /* data */ | 827 UNGCPRO; /* data */ |
829 return Qt; | 828 return Qt; |
830 } | 829 } |
831 | 830 |
915 if (eev->event_type != button_press_event | 914 if (eev->event_type != button_press_event |
916 && eev->event_type != button_release_event) | 915 && eev->event_type != button_release_event) |
917 eev = NULL; | 916 eev = NULL; |
918 } | 917 } |
919 | 918 |
919 popup_up_p++; | |
920 | |
920 /* Default is to put the menu at the point (10, 10) in frame */ | 921 /* Default is to put the menu at the point (10, 10) in frame */ |
921 if (eev) | 922 if (eev) |
922 { | 923 { |
923 pt.x = eev->event.button.x; | 924 pt.x = eev->event.button.x; |
924 pt.y = eev->event.button.y; | 925 pt.y = eev->event.button.y; |
929 | 930 |
930 if (SYMBOLP (menu_desc)) | 931 if (SYMBOLP (menu_desc)) |
931 menu_desc = Fsymbol_value (menu_desc); | 932 menu_desc = Fsymbol_value (menu_desc); |
932 CHECK_CONS (menu_desc); | 933 CHECK_CONS (menu_desc); |
933 CHECK_STRING (XCAR (menu_desc)); | 934 CHECK_STRING (XCAR (menu_desc)); |
935 | |
936 menu_cleanup (f); | |
934 | 937 |
935 current_menudesc = menu_desc; | 938 current_menudesc = menu_desc; |
936 current_hash_table = | 939 current_hash_table = |
937 make_lisp_hash_table (10, HASH_TABLE_NON_WEAK, HASH_TABLE_EQUAL); | 940 make_lisp_hash_table (10, HASH_TABLE_NON_WEAK, HASH_TABLE_EQUAL); |
938 menu = create_empty_popup_menu (); | 941 menu = create_empty_popup_menu (); |
948 pt.x, pt.y, 0, | 951 pt.x, pt.y, 0, |
949 FRAME_MSWINDOWS_HANDLE (f), NULL); | 952 FRAME_MSWINDOWS_HANDLE (f), NULL); |
950 | 953 |
951 DestroyMenu (menu); | 954 DestroyMenu (menu); |
952 | 955 |
953 /* Signal a signal if caught by Track...() modal loop */ | 956 /* A WM_COMMAND is not issued until TrackPopupMenu returns. This |
957 makes setting popup_up_p fairly pointless since we cannot keep | |
958 the menu up and dispatch events. Furthermore, we seem to have | |
959 little control over what happens to the menu when we click. */ | |
960 popup_up_p--; | |
961 | |
962 /* Signal a signal if caught by Track...() modal loop. */ | |
963 /* I think this is pointless, the code hasn't actually put us in a | |
964 modal loop at this time -- andyp. */ | |
954 mswindows_unmodalize_signal_maybe (); | 965 mswindows_unmodalize_signal_maybe (); |
955 | 966 |
956 /* This is probably the only real reason for failure */ | 967 /* This is probably the only real reason for failure */ |
957 if (!ok) | 968 if (!ok) |
958 { | 969 { |
959 menu_cleanup (f); | 970 menu_cleanup (f); |
960 invalid_operation ("Cannot track popup menu while in menu", | 971 invalid_operation ("Cannot track popup menu while in menu", |
961 menu_desc); | 972 menu_desc); |
962 } | 973 } |
963 UNGCPRO; | 974 UNGCPRO; |
975 | |
976 return Qnil; | |
964 } | 977 } |
965 | 978 |
966 | 979 |
967 /*------------------------------------------------------------------------*/ | 980 /*------------------------------------------------------------------------*/ |
968 /* Initialization */ | 981 /* Initialization */ |