- Moving to NSIS Unicode

- Partial rewrite of Rainstaller
- Fixed a small problem with !RainmeterShowMeter and ToolTipHidden=1.
- ToolTipHidden can now be used under [Rainmeter].
This commit is contained in:
Birunthan Mohanathas 2010-10-12 14:14:32 +00:00
parent a93064aea3
commit b53f0d9f6b
4 changed files with 19 additions and 4 deletions

View File

@ -61,6 +61,7 @@ CMeter::CMeter(CMeterWindow* meterWindow)
m_Initialized = false;
m_HasMouseAction = false;
m_MouseActionCursor = true;
m_ToolTipHidden = false;
m_ToolTipHandle = NULL;
@ -365,7 +366,7 @@ void CMeter::ReadConfig(const WCHAR* section)
m_ToolTipIcon = parser.ReadString(section, L"ToolTipIcon", L"", true);
m_ToolTipWidth = (int)parser.ReadFormula(section, L"ToolTipWidth", 1000);
m_ToolTipType = 0!=parser.ReadInt(section, L"ToolTipType", 0);
m_ToolTipHidden = 0!=parser.ReadInt(section, L"ToolTipHidden", 0);
m_ToolTipHidden = 0!=parser.ReadInt(section, L"ToolTipHidden", m_ToolTipHidden);
m_MeasureName = parser.ReadString(section, L"MeasureName", L"");
@ -679,9 +680,10 @@ void CMeter::UpdateToolTip()
DestroyIcon(hIcon);
}
}
if (m_ToolTipHidden)
{
SendMessage(hwndTT, TTM_ACTIVATE, false, NULL);
SendMessage(hwndTT, TTM_ACTIVATE, FALSE, NULL);
}
else
{

View File

@ -72,6 +72,8 @@ public:
const std::wstring& GetToolTipText() { return m_ToolTipText; };
HWND GetToolTipHandle() { return m_ToolTipHandle; };
void SetToolTipHandle(HWND handle) { m_ToolTipHandle = handle; };
void SetToolTipHidden(bool b) { m_ToolTipHidden = b; };
bool IsToolTipHidden() { return m_ToolTipHidden; };
void CreateToolTip(CMeterWindow* meterWindow);
void UpdateToolTip();
@ -131,6 +133,7 @@ protected:
std::wstring m_ToolTipTitle;
std::wstring m_ToolTipIcon;
unsigned int m_ToolTipWidth;
unsigned int m_ToolTipDelay;
bool m_ToolTipType;
bool m_ToolTipHidden;

View File

@ -980,7 +980,10 @@ void CMeterWindow::ShowMeter(const WCHAR* name, bool group)
(*j)->Show();
if ((*j)->GetToolTipHandle() != NULL)
{
SendMessage((*j)->GetToolTipHandle(), TTM_ACTIVATE, TRUE, NULL);
if (!(*j)->IsToolTipHidden())
{
SendMessage((*j)->GetToolTipHandle(), TTM_ACTIVATE, TRUE, NULL);
}
}
m_ResetRegion = true; // Need to recalculate the window region
if (!group) return;
@ -1822,6 +1825,7 @@ bool CMeterWindow::ReadSkin()
m_WindowUpdate = m_Parser.ReadInt(L"Rainmeter", L"Update", 1000);
m_TransitionUpdate = m_Parser.ReadInt(L"Rainmeter", L"TransitionUpdate", 100);
m_MouseActionCursor = 0 != m_Parser.ReadInt(L"Rainmeter", L"MouseActionCursor", 1);
m_ToolTipHidden = 0 != m_Parser.ReadInt(L"Rainmeter", L"ToolTipHidden", 0);
// Checking for localfonts
std::wstring localFont = m_Parser.ReadString(L"Rainmeter", L"LocalFont", L"");
@ -1980,11 +1984,16 @@ bool CMeterWindow::ReadSkin()
{
meter->SetName(strSection.c_str());
if(m_MouseActionCursor == false)
if (m_MouseActionCursor == false)
{
meter->SetMouseActionCursor(false);
}
if (m_ToolTipHidden == true)
{
meter->SetToolTipHidden(true);
}
meter->ReadConfig(strSection.c_str());
}
}

View File

@ -373,6 +373,7 @@ private:
Gdiplus::PrivateFontCollection* m_FontCollection;
bool m_MouseActionCursor;
bool m_ToolTipHidden;
};
#endif