diff options
author | Bram Moolenaar <Bram@vim.org> | 2006-08-29 19:26:50 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2006-08-29 19:26:50 +0000 |
commit | 8f2ff9fc869299d29f42d2c05ef0b8a364e55e52 (patch) | |
tree | 6af8cbadd6f12081886718d671b5d6f2c377ac76 | |
parent | 7073cc84bc62549c000ea32f08392db4a52f4835 (diff) |
updated for version 7.0-074v7.0.074
-rw-r--r-- | src/gui_w32.c | 161 | ||||
-rw-r--r-- | src/gui_w48.c | 11 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 80 insertions, 94 deletions
diff --git a/src/gui_w32.c b/src/gui_w32.c index cf1f6fcdb6..edb0be404f 100644 --- a/src/gui_w32.c +++ b/src/gui_w32.c @@ -889,117 +889,90 @@ _WndProc( # ifdef FEAT_MBYTE case TTN_GETDISPINFOW: # endif - case TTN_NEEDTEXT: -# ifdef FEAT_GUI_TABLINE - if (gui_mch_showing_tabline() - && ((LPNMHDR)lParam)->hwndFrom == - TabCtrl_GetToolTips(s_tabhwnd)) + case TTN_GETDISPINFO: { - LPNMTTDISPINFO lpdi; - POINT pt; - static char *tt_text = NULL; - static int tt_text_len = 0; - - /* - * Mouse is over the GUI tabline. Display the tooltip - * for the tab under the cursor - */ - lpdi = (LPNMTTDISPINFO)lParam; - lpdi->hinst = NULL; - lpdi->szText[0] = '\0'; - - /* - * Get the cursor position within the tab control - */ - GetCursorPos(&pt); - if (ScreenToClient(s_tabhwnd, &pt) != 0) - { - TCHITTESTINFO htinfo; - int idx; + LPNMHDR hdr = (LPNMHDR)lParam; + char_u *str = NULL; + static void *tt_text = NULL; + + vim_free(tt_text); + tt_text = NULL; +# ifdef FEAT_GUI_TABLINE + if (gui_mch_showing_tabline() + && hdr->hwndFrom == TabCtrl_GetToolTips(s_tabhwnd)) + { + POINT pt; /* - * Get the tab under the cursor + * Mouse is over the GUI tabline. Display the + * tooltip for the tab under the cursor + * + * Get the cursor position within the tab control */ - htinfo.pt.x = pt.x; - htinfo.pt.y = pt.y; - idx = TabCtrl_HitTest(s_tabhwnd, &htinfo); - if (idx != -1) + GetCursorPos(&pt); + if (ScreenToClient(s_tabhwnd, &pt) != 0) { - tabpage_T *tp; - - tp = find_tabpage(idx + 1); - if (tp != NULL) + TCHITTESTINFO htinfo; + int idx; + + /* + * Get the tab under the cursor + */ + htinfo.pt.x = pt.x; + htinfo.pt.y = pt.y; + idx = TabCtrl_HitTest(s_tabhwnd, &htinfo); + if (idx != -1) { -# ifdef FEAT_MBYTE - WCHAR *wstr = NULL; -# endif - get_tabline_label(tp, TRUE); -# ifdef FEAT_MBYTE - if (enc_codepage >= 0 - && (int)GetACP() != enc_codepage) - { - wstr = enc_to_ucs2(NameBuff, NULL); - if (wstr != NULL) - { - int wlen; - - wlen = ((int)wcslen(wstr) + 1) - * sizeof(WCHAR); - if (tt_text_len < wlen) - { - tt_text = vim_realloc(tt_text, - wlen); - if (tt_text != NULL) - tt_text_len = wlen; - } - if (tt_text != NULL) - wcscpy((WCHAR *)tt_text, wstr); - lpdi->lpszText = tt_text; - vim_free(wstr); - } - } - if (wstr == NULL) -# endif + tabpage_T *tp; + + tp = find_tabpage(idx + 1); + if (tp != NULL) { - int len; - - len = (int)STRLEN(NameBuff) + 1; - if (tt_text_len < len) - { - tt_text = vim_realloc(tt_text, len); - if (tt_text != NULL) - tt_text_len = len; - } - if (tt_text != NULL) - STRCPY(tt_text, NameBuff); - lpdi->lpszText = tt_text; + get_tabline_label(tp, TRUE); + str = NameBuff; } } } } - } - else # endif - { # ifdef FEAT_TOOLBAR - LPTOOLTIPTEXT lpttt; - UINT idButton; - int idx; - vimmenu_T *pMenu; - - lpttt = (LPTOOLTIPTEXT)lParam; - idButton = (UINT) lpttt->hdr.idFrom; - pMenu = gui_mswin_find_menu(root_menu, idButton); - if (pMenu) +# ifdef FEAT_GUI_TABLINE + else +# endif + { + UINT idButton; + vimmenu_T *pMenu; + + idButton = (UINT) hdr->idFrom; + pMenu = gui_mswin_find_menu(root_menu, idButton); + if (pMenu) + str = pMenu->strings[MENU_INDEX_TIP]; + } +# endif + if (str != NULL) { - idx = MENU_INDEX_TIP; - if (pMenu->strings[idx]) +# ifdef FEAT_MBYTE + if (hdr->code == TTN_GETDISPINFOW) { - lpttt->hinst = NULL; /* string, not resource */ - lpttt->lpszText = pMenu->strings[idx]; + LPNMTTDISPINFOW lpdi = (LPNMTTDISPINFOW)lParam; + + tt_text = enc_to_ucs2(str, NULL); + lpdi->lpszText = tt_text; + /* can't show tooltip if failed */ } - } + else # endif + { + LPNMTTDISPINFO lpdi = (LPNMTTDISPINFO)lParam; + + if (STRLEN(str) < sizeof(lpdi->szText) + || ((tt_text = vim_strsave(str)) == NULL)) + vim_strncpy(lpdi->szText, str, + sizeof(lpdi->szText) - 1); + else + lpdi->lpszText = tt_text; + } + } } break; # ifdef FEAT_GUI_TABLINE diff --git a/src/gui_w48.c b/src/gui_w48.c index 06039a5fb7..5fb3b97984 100644 --- a/src/gui_w48.c +++ b/src/gui_w48.c @@ -2194,7 +2194,18 @@ gui_mch_show_toolbar(int showit) return; if (showit) + { +# ifdef FEAT_MBYTE +# ifndef TB_SETUNICODEFORMAT + /* For older compilers. We assume this never changes. */ +# define TB_SETUNICODEFORMAT 0x2005 +# endif + /* Enable/disable unicode support */ + int uu = (enc_codepage >= 0 && (int)GetACP() != enc_codepage); + SendMessage(s_toolbarhwnd, TB_SETUNICODEFORMAT, (WPARAM)uu, (LPARAM)0); +# endif ShowWindow(s_toolbarhwnd, SW_SHOW); + } else ShowWindow(s_toolbarhwnd, SW_HIDE); } diff --git a/src/version.c b/src/version.c index f7ab6154a5..c84bb8e3ea 100644 --- a/src/version.c +++ b/src/version.c @@ -667,6 +667,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 74, +/**/ 73, /**/ 72, |