2 Subject: Patch 6.2.291 (extra)
4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
11 Problem: Mac: the plus button and close button don't do anything.
12 Solution: Make the plus button maximize the window and the close button
13 close Vim. (Eckehard Berns)
14 Files: src/gui.c, src/gui_mac.c
17 *** ../vim-6.2.290/src/gui.c Fri Feb 20 22:14:29 2004
18 --- src/gui.c Tue Feb 24 20:42:34 2004
23 #if defined(FEAT_GUI_GTK) || defined(FEAT_GUI_X11) || defined(FEAT_GUI_MSWIN) \
24 ! || defined(FEAT_GUI_PHOTON) || defined(PROTO)
26 * Called when the GUI shell is closed by the user. If there are no changed
27 * files Vim exits, otherwise there will be a dialog to ask the user what to
31 #if defined(FEAT_GUI_GTK) || defined(FEAT_GUI_X11) || defined(FEAT_GUI_MSWIN) \
32 ! || defined(FEAT_GUI_PHOTON) || defined(FEAT_GUI_MAC) || defined(PROTO)
34 * Called when the GUI shell is closed by the user. If there are no changed
35 * files Vim exits, otherwise there will be a dialog to ask the user what to
36 *** ../vim-6.2.290/src/gui_mac.c Wed Feb 25 12:54:47 2004
37 --- src/gui_mac.c Wed Feb 25 13:04:47 2004
46 * ------------------------------------------------------------
54 ! * Handle the click in the zoom box
56 ! #ifdef USE_CARBONIZED
58 ! gui_mac_doInZoomClick(theEvent, whichWindow)
59 ! EventRecord *theEvent;
60 ! WindowPtr whichWindow;
66 ! /* ideal width is current */
67 ! p.h = Columns * gui.char_width + 2 * gui.border_offset;
68 ! if (gui.which_scrollbars[SBAR_LEFT])
69 ! p.h += gui.scrollbar_width;
70 ! if (gui.which_scrollbars[SBAR_RIGHT])
71 ! p.h += gui.scrollbar_width;
72 ! /* ideal height is as heigh as we can get */
75 ! thePart = IsWindowInStandardState(whichWindow, &p, &r)
76 ! ? inZoomIn : inZoomOut;
78 ! if (!TrackBox(whichWindow, theEvent->where, thePart))
81 ! /* use returned width */
82 ! p.h = r.right - r.left;
83 ! /* adjust returned height */
84 ! p.v = r.bottom - r.top - 2 * gui.border_offset;
85 ! if (gui.which_scrollbars[SBAR_BOTTOM])
86 ! p.v -= gui.scrollbar_height;
87 ! p.v -= p.v % gui.char_height;
88 ! p.v += 2 * gui.border_width;
89 ! if (gui.which_scrollbars[SBAR_BOTTOM]);
90 ! p.v += gui.scrollbar_height;
92 ! ZoomWindowIdeal(whichWindow, thePart, &p);
94 ! GetWindowBounds(whichWindow, kWindowContentRgn, &r);
95 ! gui_resize_shell(r.right - r.left, r.bottom - r.top);
96 ! gui_mch_set_bg_color(gui.back_pixel);
97 ! gui_set_shellsize(TRUE, FALSE);
99 ! #endif /* defined(USE_CARBONIZED) */
102 * ------------------------------------------------------------
105 gui_mac_doInGrowClick (theEvent->where, whichWindow);
108 ! case (inGoAway): /* TODO */
111 ! /* For now the window doesn't have a GoAway and Zoom */
116 gui_mac_doInGrowClick (theEvent->where, whichWindow);
120 ! if (TrackGoAway(whichWindow, theEvent->where))
121 ! gui_shell_closed();
126 ! #ifdef USE_CARBONIZED
127 ! gui_mac_doInZoomClick(theEvent, whichWindow);
134 SetRect (&windRect, 300, 40, 300+80*7 + 16, 40+24*11);
137 ! gui.VimWindow = NewCWindow(nil, &windRect, "\pgVim on Macintosh", true, documentProc,
138 ! (WindowPtr) -1L, false, 0);
139 InstallReceiveHandler((DragReceiveHandlerUPP)receiveHandler,
140 gui.VimWindow, NULL);
141 #ifdef USE_CARBONIZED
143 SetRect (&windRect, 300, 40, 300+80*7 + 16, 40+24*11);
146 ! gui.VimWindow = NewCWindow(nil, &windRect, "\pgVim on Macintosh", true,
147 ! #ifdef USE_CARBONIZED
152 ! (WindowPtr)-1L, true, 0);
153 InstallReceiveHandler((DragReceiveHandlerUPP)receiveHandler,
154 gui.VimWindow, NULL);
155 #ifdef USE_CARBONIZED
156 *** ../vim-6.2.290/src/version.c Wed Feb 25 12:54:47 2004
157 --- src/version.c Wed Feb 25 13:11:49 2004
161 { /* Add new patch number below this line */
167 Did you hear about the new 3 million dollar West Virginia State Lottery?
168 The winner gets 3 dollars a year for a million years.
170 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
171 /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
172 \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
173 \\\ Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html ///