Tooltips: Added ToolTipWidth= key | Fix for using [MeasureName] as ToolTipText alone.

This commit is contained in:
jsmorley 2010-07-20 21:20:14 +00:00
parent abc5df233d
commit b3507f6f8e
5 changed files with 12 additions and 6 deletions

View File

@ -28,8 +28,8 @@ LANGUAGE LANG_FINNISH, SUBLANG_DEFAULT
// //
VS_VERSION_INFO VERSIONINFO VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,3,0,474 FILEVERSION 1,3,0,477
PRODUCTVERSION 1,3,0,474 PRODUCTVERSION 1,3,0,477
FILEFLAGSMASK 0x17L FILEFLAGSMASK 0x17L
#ifdef _DEBUG #ifdef _DEBUG
FILEFLAGS 0x1L FILEFLAGS 0x1L
@ -45,12 +45,12 @@ BEGIN
BLOCK "040b04b0" BLOCK "040b04b0"
BEGIN BEGIN
VALUE "FileDescription", "Rainmeter - A Customizable Resource Meter" VALUE "FileDescription", "Rainmeter - A Customizable Resource Meter"
VALUE "FileVersion", "1, 3, 0, 474" VALUE "FileVersion", "1, 3, 0, 477"
VALUE "InternalName", "Rainmeter" VALUE "InternalName", "Rainmeter"
VALUE "LegalCopyright", "Copyright (C) 2010 - Rainy" VALUE "LegalCopyright", "Copyright (C) 2010 - Rainy"
VALUE "OriginalFilename", "Rainmeter.exe" VALUE "OriginalFilename", "Rainmeter.exe"
VALUE "ProductName", "Rainmeter" VALUE "ProductName", "Rainmeter"
VALUE "ProductVersion", "1, 3, 0, 474" VALUE "ProductVersion", "1, 3, 0, 477"
END END
END END
BLOCK "VarFileInfo" BLOCK "VarFileInfo"

View File

@ -361,6 +361,7 @@ void CMeter::ReadConfig(const WCHAR* section)
m_ToolTipText = parser.ReadString(section, L"ToolTipText", L"", true); m_ToolTipText = parser.ReadString(section, L"ToolTipText", L"", true);
m_ToolTipTitle = parser.ReadString(section, L"ToolTipTitle", L"", true); m_ToolTipTitle = parser.ReadString(section, L"ToolTipTitle", L"", true);
m_ToolTipIcon = parser.ReadString(section, L"ToolTipIcon", L"", true); m_ToolTipIcon = parser.ReadString(section, L"ToolTipIcon", L"", true);
m_ToolTipWidth = parser.ReadInt(section, L"ToolTipWidth", 1000);
m_ToolTipType = 0!=parser.ReadInt(section, L"ToolTipType", 0); m_ToolTipType = 0!=parser.ReadInt(section, L"ToolTipType", 0);
m_MeasureName = parser.ReadString(section, L"MeasureName", L""); m_MeasureName = parser.ReadString(section, L"MeasureName", L"");
@ -538,7 +539,7 @@ void CMeter::CreateToolTip(CMeterWindow* meterWindow)
ti.rect = GetMeterRect(); ti.rect = GetMeterRect();
SendMessage(hwndTT, TTM_ADDTOOL, NULL, (LPARAM) (LPTOOLINFO) &ti); SendMessage(hwndTT, TTM_ADDTOOL, NULL, (LPARAM) (LPTOOLINFO) &ti);
SendMessage(hwndTT, TTM_SETMAXTIPWIDTH, NULL, 1000); SendMessage(hwndTT, TTM_SETMAXTIPWIDTH, NULL, m_ToolTipWidth);
if (!m_ToolTipTitle.empty()) if (!m_ToolTipTitle.empty())
{ {

View File

@ -124,6 +124,7 @@ protected:
std::wstring m_ToolTipText; std::wstring m_ToolTipText;
std::wstring m_ToolTipTitle; std::wstring m_ToolTipTitle;
std::wstring m_ToolTipIcon; std::wstring m_ToolTipIcon;
unsigned int m_ToolTipWidth;
bool m_ToolTipType; bool m_ToolTipType;
HWND m_ToolTipHandle; HWND m_ToolTipHandle;

View File

@ -2349,6 +2349,10 @@ void CMeterWindow::Update(bool nodraw)
j = m_Meters.begin(); j = m_Meters.begin();
for ( ; j != m_Meters.end(); ++j) for ( ; j != m_Meters.end(); ++j)
{ {
if (!((*j)->GetToolTipHandle() != NULL) && (!(*j)->GetToolTipText().empty()))
{
(*j)->CreateToolTip(this);
}
if ((*j)->GetToolTipHandle() != NULL) if ((*j)->GetToolTipHandle() != NULL)
{ {
(*j)->UpdateToolTip(); (*j)->UpdateToolTip();

View File

@ -1,2 +1,2 @@
#pragma once #pragma once
const int revision_number = 474; const int revision_number = 477;