comparison src/macmenu.c @ 55851:f1d6a507dcfd

Support Tooltips with the Carbon emacs port. Some code cleanup using helper macros.
author Steven Tamm <steventamm@mac.com>
date Sun, 30 May 2004 00:18:41 +0000
parents 21f88361795c
children d2348e1fa995 4c90ffeb71c5
comparison
equal deleted inserted replaced
55850:63ca25eb73a1 55851:f1d6a507dcfd
1782 1782
1783 /* Adjust coordinates to be root-window-relative. */ 1783 /* Adjust coordinates to be root-window-relative. */
1784 pos.h = x; 1784 pos.h = x;
1785 pos.v = y; 1785 pos.v = y;
1786 1786
1787 #if TARGET_API_MAC_CARBON 1787 SetPortWindowPort (FRAME_MAC_WINDOW (f));
1788 SetPort (GetWindowPort (FRAME_MAC_WINDOW (f)));
1789 #else
1790 SetPort (FRAME_MAC_WINDOW (f));
1791 #endif
1792 1788
1793 LocalToGlobal (&pos); 1789 LocalToGlobal (&pos);
1794 1790
1795 /* No selection has been chosen yet. */ 1791 /* No selection has been chosen yet. */
1796 menu_item_choice = 0; 1792 menu_item_choice = 0;
1940 wv = wv->next; 1936 wv = wv->next;
1941 } 1937 }
1942 1938
1943 window_ptr = GetNewCWindow (DIALOG_WINDOW_RESOURCE, NULL, (WindowPtr) -1); 1939 window_ptr = GetNewCWindow (DIALOG_WINDOW_RESOURCE, NULL, (WindowPtr) -1);
1944 1940
1945 #if TARGET_API_MAC_CARBON 1941 SetPortWindowPort (window_ptr);
1946 SetPort (GetWindowPort (window_ptr));
1947 #else
1948 SetPort (window_ptr);
1949 #endif
1950 1942
1951 TextFont (0); 1943 TextFont (0);
1952 /* Left and right margins in the dialog are 13 pixels each.*/ 1944 /* Left and right margins in the dialog are 13 pixels each.*/
1953 dialog_width = 14; 1945 dialog_width = 14;
1954 /* Calculate width of dialog box: 8 pixels on each side of the text 1946 /* Calculate width of dialog box: 8 pixels on each side of the text
1962 dialog_width = max (dialog_width, StringWidth (prompt) + 26); 1954 dialog_width = max (dialog_width, StringWidth (prompt) + 26);
1963 1955
1964 SizeWindow (window_ptr, dialog_width, 78, 0); 1956 SizeWindow (window_ptr, dialog_width, 78, 0);
1965 ShowWindow (window_ptr); 1957 ShowWindow (window_ptr);
1966 1958
1967 #if TARGET_API_MAC_CARBON 1959 SetPortWindowPort (window_ptr);
1968 SetPort (GetWindowPort (window_ptr));
1969 #else
1970 SetPort (window_ptr);
1971 #endif
1972 1960
1973 TextFont (0); 1961 TextFont (0);
1974 1962
1975 MoveTo (13, 29); 1963 MoveTo (13, 29);
1976 DrawString (prompt); 1964 DrawString (prompt);