Mirror of the Vim source from https://github.com/vim/vim
Revision | 66e40876590bca973973b6aae208a14cb428c266 (tree) |
---|---|
Zeit | 2007-06-19 23:29:43 |
Autor | vimboss |
Commiter | vimboss |
updated for version 7.1-007
@@ -460,7 +460,6 @@ | ||
460 | 460 | WindowPtr VimWindow; |
461 | 461 | MenuHandle MacOSHelpMenu; /* Help menu provided by the MacOS */ |
462 | 462 | int MacOSHelpItems; /* Nr of help-items supplied by MacOS */ |
463 | - int MacOSHaveCntxMenu; /* Contextual menu available */ | |
464 | 463 | WindowPtr wid; /* Window id of text area */ |
465 | 464 | int visibility; /* Is window partially/fully obscured? */ |
466 | 465 | #endif |
@@ -1676,13 +1676,12 @@ | ||
1676 | 1676 | /* TODO: NEEDED? */ |
1677 | 1677 | clickIsPopup = FALSE; |
1678 | 1678 | |
1679 | - if ((gui.MacOSHaveCntxMenu) && (mouse_model_popup())) | |
1680 | - if (IsShowContextualMenuClick(theEvent)) | |
1681 | - { | |
1682 | - vimMouseButton = MOUSE_RIGHT; | |
1683 | - vimModifiers &= ~MOUSE_CTRL; | |
1684 | - clickIsPopup = TRUE; | |
1685 | - } | |
1679 | + if (mouse_model_popup() && IsShowContextualMenuClick(theEvent)) | |
1680 | + { | |
1681 | + vimMouseButton = MOUSE_RIGHT; | |
1682 | + vimModifiers &= ~MOUSE_CTRL; | |
1683 | + clickIsPopup = TRUE; | |
1684 | + } | |
1686 | 1685 | |
1687 | 1686 | /* Is it a double click ? */ |
1688 | 1687 | dblClick = ((theEvent->when - lastMouseTick) < GetDblTime()); |
@@ -1920,24 +1919,19 @@ | ||
1920 | 1919 | WindowPtr whichWindow; |
1921 | 1920 | |
1922 | 1921 | whichWindow = (WindowPtr) event->message; |
1923 | - if ((event->modifiers) & activeFlag) | |
1924 | - /* Activate */ | |
1925 | - gui_focus_change(TRUE); | |
1926 | - else | |
1922 | + /* Dim scrollbars */ | |
1923 | + if (whichWindow == gui.VimWindow) | |
1927 | 1924 | { |
1928 | - /* Deactivate */ | |
1929 | - gui_focus_change(FALSE); | |
1930 | -/* DON'T KNOW what the code below was doing | |
1931 | - found in the deactivate clause, but the | |
1932 | - clause writing TRUE into in_focus (BUG) | |
1933 | - */ | |
1934 | - | |
1935 | -#if 0 /* Removed by Dany as per above June 2001 */ | |
1936 | - a_bool = false; | |
1937 | - SetPreserveGlyph(a_bool); | |
1938 | - SetOutlinePreferred(a_bool); | |
1939 | -#endif | |
1925 | + ControlRef rootControl; | |
1926 | + GetRootControl(gui.VimWindow, &rootControl); | |
1927 | + if ((event->modifiers) & activeFlag) | |
1928 | + ActivateControl(rootControl); | |
1929 | + else | |
1930 | + DeactivateControl(rootControl); | |
1940 | 1931 | } |
1932 | + | |
1933 | + /* Activate */ | |
1934 | + gui_focus_change((event->modifiers) & activeFlag); | |
1941 | 1935 | } |
1942 | 1936 | |
1943 | 1937 |
@@ -2559,16 +2553,15 @@ | ||
2559 | 2553 | OSErr error; |
2560 | 2554 | |
2561 | 2555 | /* Handle contextual menu right now (if needed) */ |
2562 | - if (gui.MacOSHaveCntxMenu) | |
2563 | - if (IsShowContextualMenuClick(event)) | |
2564 | - { | |
2556 | + if (IsShowContextualMenuClick(event)) | |
2557 | + { | |
2565 | 2558 | # if 0 |
2566 | - gui_mac_handle_contextual_menu(event); | |
2559 | + gui_mac_handle_contextual_menu(event); | |
2567 | 2560 | # else |
2568 | - gui_mac_doMouseDownEvent(event); | |
2561 | + gui_mac_doMouseDownEvent(event); | |
2569 | 2562 | # endif |
2570 | - return; | |
2571 | - } | |
2563 | + return; | |
2564 | + } | |
2572 | 2565 | |
2573 | 2566 | /* Handle normal event */ |
2574 | 2567 | switch (event->what) |
@@ -2782,14 +2775,6 @@ | ||
2782 | 2775 | (void) InstallAEHandlers(); |
2783 | 2776 | #endif |
2784 | 2777 | |
2785 | - if (Gestalt(gestaltContextualMenuAttr, &gestalt_rc) == noErr) | |
2786 | - gui.MacOSHaveCntxMenu = BitTst(&gestalt_rc, 31-gestaltContextualMenuTrapAvailable); | |
2787 | - else | |
2788 | - gui.MacOSHaveCntxMenu = false; | |
2789 | - | |
2790 | - if (gui.MacOSHaveCntxMenu) | |
2791 | - gui.MacOSHaveCntxMenu = (InitContextualMenus()==noErr); | |
2792 | - | |
2793 | 2778 | pomme = NewMenu(256, "\p\024"); /* 0x14= = Apple Menu */ |
2794 | 2779 | |
2795 | 2780 | AppendMenu(pomme, "\pAbout VIM"); |
@@ -2941,6 +2926,7 @@ | ||
2941 | 2926 | #ifdef USE_CARBONKEYHANDLER |
2942 | 2927 | EventHandlerRef keyEventHandlerRef; |
2943 | 2928 | #endif |
2929 | + ControlRef rootControl; | |
2944 | 2930 | |
2945 | 2931 | if (Gestalt(gestaltSystemVersion, &gMacSystemVersion) != noErr) |
2946 | 2932 | gMacSystemVersion = 0x1000; /* TODO: Default to minimum sensible value */ |
@@ -2954,15 +2940,6 @@ | ||
2954 | 2940 | (void) InstallAEHandlers(); |
2955 | 2941 | #endif |
2956 | 2942 | |
2957 | - /* Ctrl click */ | |
2958 | - if (Gestalt(gestaltContextualMenuAttr, &gestalt_rc) == noErr) | |
2959 | - gui.MacOSHaveCntxMenu = BitTst(&gestalt_rc, 31-gestaltContextualMenuTrapAvailable); | |
2960 | - else | |
2961 | - gui.MacOSHaveCntxMenu = false; | |
2962 | - | |
2963 | - if (gui.MacOSHaveCntxMenu) | |
2964 | - gui.MacOSHaveCntxMenu = (InitContextualMenus()==noErr); | |
2965 | - | |
2966 | 2943 | pomme = NewMenu(256, "\p\024"); /* 0x14= = Apple Menu */ |
2967 | 2944 | |
2968 | 2945 | AppendMenu(pomme, "\pAbout VIM"); |
@@ -2981,6 +2958,7 @@ | ||
2981 | 2958 | gui.VimWindow = NewCWindow(nil, &windRect, "\pgVim on Macintosh", true, |
2982 | 2959 | zoomDocProc, |
2983 | 2960 | (WindowPtr)-1L, true, 0); |
2961 | + CreateRootControl(gui.VimWindow, &rootControl); | |
2984 | 2962 | InstallReceiveHandler((DragReceiveHandlerUPP)receiveHandler, |
2985 | 2963 | gui.VimWindow, NULL); |
2986 | 2964 | SetPortWindowPort(gui.VimWindow); |
@@ -667,6 +667,8 @@ | ||
667 | 667 | static int included_patches[] = |
668 | 668 | { /* Add new patch number below this line */ |
669 | 669 | /**/ |
670 | + 7, | |
671 | +/**/ | |
670 | 672 | 6, |
671 | 673 | /**/ |
672 | 674 | 5, |