Mercurial > vim
comparison src/gui_w48.c @ 811:d2c169a725c8
updated for version 7.0c01
author | vimboss |
---|---|
date | Mon, 27 Mar 2006 20:55:21 +0000 |
parents | 9f345c48220b |
children | 4a79d6d376f0 |
comparison
equal
deleted
inserted
replaced
810:9f345c48220b | 811:d2c169a725c8 |
---|---|
1111 (WPARAM)0, (LPARAM)(w + ((long)(TOOLBAR_BUTTON_HEIGHT+8)<<16))); | 1111 (WPARAM)0, (LPARAM)(w + ((long)(TOOLBAR_BUTTON_HEIGHT+8)<<16))); |
1112 #endif | 1112 #endif |
1113 #if defined(FEAT_GUI_TABLINE) | 1113 #if defined(FEAT_GUI_TABLINE) |
1114 if (showing_tabline) | 1114 if (showing_tabline) |
1115 { | 1115 { |
1116 int top = 0; | 1116 int top = 0; |
1117 RECT rect; | |
1117 | 1118 |
1118 #ifdef FEAT_TOOLBAR | 1119 #ifdef FEAT_TOOLBAR |
1119 if (vim_strchr(p_go, GO_TOOLBAR) != NULL) | 1120 if (vim_strchr(p_go, GO_TOOLBAR) != NULL) |
1120 top = TOOLBAR_BUTTON_HEIGHT + TOOLBAR_BORDER_HEIGHT; | 1121 top = TOOLBAR_BUTTON_HEIGHT + TOOLBAR_BORDER_HEIGHT; |
1121 #endif | 1122 #endif |
1122 | 1123 |
1123 MoveWindow(s_tabhwnd, 0, top, w, TABLINE_HEIGHT, TRUE); | 1124 GetWindowRect(s_hwnd, &rect); |
1125 SetRect(&rect, 0, top, rect.right, TABLINE_HEIGHT); | |
1126 TabCtrl_AdjustRect(s_tabhwnd, TRUE, &rect); | |
1127 MoveWindow(s_tabhwnd, 0, top, rect.right, rect.bottom, TRUE); | |
1124 } | 1128 } |
1125 #endif | 1129 #endif |
1126 | 1130 |
1127 /* When side scroll bar is unshown, the size of window will change. | 1131 /* When side scroll bar is unshown, the size of window will change. |
1128 * then, the text area move left or right. thus client rect should be | 1132 * then, the text area move left or right. thus client rect should be |
2174 #define TOOLBAR_BITMAP_COUNT 31 | 2178 #define TOOLBAR_BITMAP_COUNT 31 |
2175 | 2179 |
2176 #endif | 2180 #endif |
2177 | 2181 |
2178 #if defined(FEAT_GUI_TABLINE) || defined(PROTO) | 2182 #if defined(FEAT_GUI_TABLINE) || defined(PROTO) |
2183 static void | |
2184 show_tabline_popup_menu(void) | |
2185 { | |
2186 HMENU tab_pmenu; | |
2187 MENUITEMINFO minfo; | |
2188 long rval; | |
2189 POINT pt; | |
2190 char_u string[3]; | |
2191 | |
2192 tab_pmenu = CreatePopupMenu(); | |
2193 if (tab_pmenu == NULL) | |
2194 return; | |
2195 | |
2196 minfo.cbSize = sizeof(MENUITEMINFO); | |
2197 minfo.fMask = MIIM_TYPE|MIIM_ID; | |
2198 minfo.fType = MFT_STRING; | |
2199 | |
2200 minfo.dwTypeData = _("Close tab"); | |
2201 minfo.wID = TABLINE_MENU_CLOSE; | |
2202 InsertMenuItem(tab_pmenu, TABLINE_MENU_CLOSE, FALSE, &minfo); | |
2203 | |
2204 minfo.dwTypeData = _("New tab"); | |
2205 minfo.wID = TABLINE_MENU_NEW; | |
2206 InsertMenuItem(tab_pmenu, TABLINE_MENU_NEW, FALSE, &minfo); | |
2207 | |
2208 minfo.dwTypeData = _("Open tab..."); | |
2209 minfo.wID = TABLINE_MENU_OPEN; | |
2210 InsertMenuItem(tab_pmenu, TABLINE_MENU_OPEN, FALSE, &minfo); | |
2211 | |
2212 GetCursorPos(&pt); | |
2213 rval = TrackPopupMenuEx(tab_pmenu, TPM_RETURNCMD, pt.x, pt.y, s_tabhwnd, | |
2214 NULL); | |
2215 | |
2216 DestroyMenu(tab_pmenu); | |
2217 | |
2218 /* Add the string cmd into input buffer */ | |
2219 if (rval > 0) | |
2220 { | |
2221 TCHITTESTINFO htinfo; | |
2222 int idx; | |
2223 | |
2224 if (ScreenToClient(s_tabhwnd, &pt) == 0) | |
2225 return; | |
2226 | |
2227 htinfo.pt.x = pt.x; | |
2228 htinfo.pt.y = pt.y; | |
2229 idx = TabCtrl_HitTest(s_tabhwnd, &htinfo); | |
2230 if (idx == -1) | |
2231 idx = 0; | |
2232 else | |
2233 idx += 1; | |
2234 | |
2235 string[0] = CSI; | |
2236 string[1] = KS_TABMENU; | |
2237 string[2] = KE_FILLER; | |
2238 add_to_input_buf(string, 3); | |
2239 string[0] = idx; | |
2240 string[1] = (char_u)(long)rval; | |
2241 add_to_input_buf_csi(string, 2); | |
2242 } | |
2243 } | |
2244 | |
2179 /* | 2245 /* |
2180 * Show or hide the tabline. | 2246 * Show or hide the tabline. |
2181 */ | 2247 */ |
2182 void | 2248 void |
2183 gui_mch_show_tabline(int showit) | 2249 gui_mch_show_tabline(int showit) |