mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
updated for version 7.0-074
This commit is contained in:
parent
7073cc84bc
commit
8f2ff9fc86
113
src/gui_w32.c
113
src/gui_w32.c
@ -889,26 +889,24 @@ _WndProc(
|
|||||||
# ifdef FEAT_MBYTE
|
# ifdef FEAT_MBYTE
|
||||||
case TTN_GETDISPINFOW:
|
case TTN_GETDISPINFOW:
|
||||||
# endif
|
# endif
|
||||||
case TTN_NEEDTEXT:
|
case TTN_GETDISPINFO:
|
||||||
|
{
|
||||||
|
LPNMHDR hdr = (LPNMHDR)lParam;
|
||||||
|
char_u *str = NULL;
|
||||||
|
static void *tt_text = NULL;
|
||||||
|
|
||||||
|
vim_free(tt_text);
|
||||||
|
tt_text = NULL;
|
||||||
|
|
||||||
# ifdef FEAT_GUI_TABLINE
|
# ifdef FEAT_GUI_TABLINE
|
||||||
if (gui_mch_showing_tabline()
|
if (gui_mch_showing_tabline()
|
||||||
&& ((LPNMHDR)lParam)->hwndFrom ==
|
&& hdr->hwndFrom == TabCtrl_GetToolTips(s_tabhwnd))
|
||||||
TabCtrl_GetToolTips(s_tabhwnd))
|
|
||||||
{
|
{
|
||||||
LPNMTTDISPINFO lpdi;
|
|
||||||
POINT pt;
|
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';
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
* Mouse is over the GUI tabline. Display the
|
||||||
|
* tooltip for the tab under the cursor
|
||||||
|
*
|
||||||
* Get the cursor position within the tab control
|
* Get the cursor position within the tab control
|
||||||
*/
|
*/
|
||||||
GetCursorPos(&pt);
|
GetCursorPos(&pt);
|
||||||
@ -930,76 +928,51 @@ _WndProc(
|
|||||||
tp = find_tabpage(idx + 1);
|
tp = find_tabpage(idx + 1);
|
||||||
if (tp != NULL)
|
if (tp != NULL)
|
||||||
{
|
{
|
||||||
# ifdef FEAT_MBYTE
|
|
||||||
WCHAR *wstr = NULL;
|
|
||||||
# endif
|
|
||||||
get_tabline_label(tp, TRUE);
|
get_tabline_label(tp, TRUE);
|
||||||
# ifdef FEAT_MBYTE
|
str = NameBuff;
|
||||||
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
|
||||||
|
# ifdef FEAT_TOOLBAR
|
||||||
|
# ifdef FEAT_GUI_TABLINE
|
||||||
|
else
|
||||||
# endif
|
# endif
|
||||||
{
|
{
|
||||||
int len;
|
UINT idButton;
|
||||||
|
vimmenu_T *pMenu;
|
||||||
|
|
||||||
len = (int)STRLEN(NameBuff) + 1;
|
idButton = (UINT) hdr->idFrom;
|
||||||
if (tt_text_len < len)
|
pMenu = gui_mswin_find_menu(root_menu, idButton);
|
||||||
|
if (pMenu)
|
||||||
|
str = pMenu->strings[MENU_INDEX_TIP];
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
if (str != NULL)
|
||||||
{
|
{
|
||||||
tt_text = vim_realloc(tt_text, len);
|
# ifdef FEAT_MBYTE
|
||||||
if (tt_text != NULL)
|
if (hdr->code == TTN_GETDISPINFOW)
|
||||||
tt_text_len = len;
|
{
|
||||||
}
|
LPNMTTDISPINFOW lpdi = (LPNMTTDISPINFOW)lParam;
|
||||||
if (tt_text != NULL)
|
|
||||||
STRCPY(tt_text, NameBuff);
|
tt_text = enc_to_ucs2(str, NULL);
|
||||||
lpdi->lpszText = tt_text;
|
lpdi->lpszText = tt_text;
|
||||||
}
|
/* can't show tooltip if failed */
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
# endif
|
# endif
|
||||||
{
|
{
|
||||||
# ifdef FEAT_TOOLBAR
|
LPNMTTDISPINFO lpdi = (LPNMTTDISPINFO)lParam;
|
||||||
LPTOOLTIPTEXT lpttt;
|
|
||||||
UINT idButton;
|
|
||||||
int idx;
|
|
||||||
vimmenu_T *pMenu;
|
|
||||||
|
|
||||||
lpttt = (LPTOOLTIPTEXT)lParam;
|
if (STRLEN(str) < sizeof(lpdi->szText)
|
||||||
idButton = (UINT) lpttt->hdr.idFrom;
|
|| ((tt_text = vim_strsave(str)) == NULL))
|
||||||
pMenu = gui_mswin_find_menu(root_menu, idButton);
|
vim_strncpy(lpdi->szText, str,
|
||||||
if (pMenu)
|
sizeof(lpdi->szText) - 1);
|
||||||
{
|
else
|
||||||
idx = MENU_INDEX_TIP;
|
lpdi->lpszText = tt_text;
|
||||||
if (pMenu->strings[idx])
|
|
||||||
{
|
|
||||||
lpttt->hinst = NULL; /* string, not resource */
|
|
||||||
lpttt->lpszText = pMenu->strings[idx];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
# endif
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
# ifdef FEAT_GUI_TABLINE
|
# ifdef FEAT_GUI_TABLINE
|
||||||
|
@ -2194,7 +2194,18 @@ gui_mch_show_toolbar(int showit)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (showit)
|
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);
|
ShowWindow(s_toolbarhwnd, SW_SHOW);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
ShowWindow(s_toolbarhwnd, SW_HIDE);
|
ShowWindow(s_toolbarhwnd, SW_HIDE);
|
||||||
}
|
}
|
||||||
|
@ -666,6 +666,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
74,
|
||||||
/**/
|
/**/
|
||||||
73,
|
73,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user