mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Minor tweaks and cleanup.
This commit is contained in:
parent
2835739b12
commit
13b3241307
@ -366,7 +366,7 @@ void CDialogAbout::CTabLog::Initialize()
|
|||||||
|
|
||||||
// Set folder/.ini icons for tree list
|
// Set folder/.ini icons for tree list
|
||||||
HIMAGELIST hImageList = ImageList_Create(16, 16, ILC_COLOR32, 2, 10);
|
HIMAGELIST hImageList = ImageList_Create(16, 16, ILC_COLOR32, 2, 10);
|
||||||
HMODULE hDLL = LoadLibrary(L"user32.dll");
|
HMODULE hDLL = GetModuleHandle(L"user32");
|
||||||
|
|
||||||
HICON hIcon = (HICON)LoadImage(hDLL, MAKEINTRESOURCE(103), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
|
HICON hIcon = (HICON)LoadImage(hDLL, MAKEINTRESOURCE(103), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
|
||||||
ImageList_AddIcon(hImageList, hIcon);
|
ImageList_AddIcon(hImageList, hIcon);
|
||||||
@ -380,8 +380,6 @@ void CDialogAbout::CTabLog::Initialize()
|
|||||||
ImageList_AddIcon(hImageList, hIcon);
|
ImageList_AddIcon(hImageList, hIcon);
|
||||||
DeleteObject(hIcon);
|
DeleteObject(hIcon);
|
||||||
|
|
||||||
FreeLibrary(hDLL);
|
|
||||||
|
|
||||||
ListView_SetImageList(item, (WPARAM)hImageList, LVSIL_SMALL);
|
ListView_SetImageList(item, (WPARAM)hImageList, LVSIL_SMALL);
|
||||||
|
|
||||||
LVCOLUMN lvc;
|
LVCOLUMN lvc;
|
||||||
@ -757,7 +755,7 @@ void CDialogAbout::CTabMeasures::UpdateMeasureList(CMeterWindow* meterWindow)
|
|||||||
range += buffer;
|
range += buffer;
|
||||||
|
|
||||||
ListView_SetItemText(item, index, 1, (WCHAR*)range.c_str());
|
ListView_SetItemText(item, index, 1, (WCHAR*)range.c_str());
|
||||||
ListView_SetItemText(item, index, 2, (WCHAR*)(*j)->GetStats());
|
ListView_SetItemText(item, index, 2, (WCHAR*)(*j)->GetStringValue(AUTOSCALE_OFF, 1, -1, false));
|
||||||
++index;
|
++index;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -369,15 +369,13 @@ void CDialogManage::CTabSkins::Initialize()
|
|||||||
|
|
||||||
// Load folder/.ini icons from shell32
|
// Load folder/.ini icons from shell32
|
||||||
HIMAGELIST hImageList = ImageList_Create(16, 16, ILC_COLOR32, 2, 10);
|
HIMAGELIST hImageList = ImageList_Create(16, 16, ILC_COLOR32, 2, 10);
|
||||||
HMODULE hDLL = LoadLibrary(L"shell32.dll");
|
HMODULE hDLL = GetModuleHandle(L"shell32");
|
||||||
|
|
||||||
HICON hIcon = (HICON)LoadImage(hDLL, MAKEINTRESOURCE(4), IMAGE_ICON, 16, 16, LR_SHARED);
|
HICON hIcon = (HICON)LoadImage(hDLL, MAKEINTRESOURCE(4), IMAGE_ICON, 16, 16, LR_SHARED);
|
||||||
ImageList_AddIcon(hImageList, hIcon);
|
ImageList_AddIcon(hImageList, hIcon);
|
||||||
hIcon = (HICON)LoadImage(hDLL, MAKEINTRESOURCE(151), IMAGE_ICON, 16, 16, LR_SHARED);
|
hIcon = (HICON)LoadImage(hDLL, MAKEINTRESOURCE(151), IMAGE_ICON, 16, 16, LR_SHARED);
|
||||||
ImageList_AddIcon(hImageList, hIcon);
|
ImageList_AddIcon(hImageList, hIcon);
|
||||||
|
|
||||||
FreeLibrary(hDLL);
|
|
||||||
|
|
||||||
// Apply icons and populate tree
|
// Apply icons and populate tree
|
||||||
item = GetDlgItem(m_Window, IDC_MANAGESKINS_SKINS_TREEVIEW);
|
item = GetDlgItem(m_Window, IDC_MANAGESKINS_SKINS_TREEVIEW);
|
||||||
TreeView_SetImageList(item, hImageList, TVSIL_NORMAL);
|
TreeView_SetImageList(item, hImageList, TVSIL_NORMAL);
|
||||||
@ -1394,10 +1392,10 @@ INT_PTR CDialogManage::CTabThemes::OnCommand(WPARAM wParam, LPARAM lParam)
|
|||||||
if (HIWORD(wParam) == EN_CHANGE)
|
if (HIWORD(wParam) == EN_CHANGE)
|
||||||
{
|
{
|
||||||
WCHAR buffer[32];
|
WCHAR buffer[32];
|
||||||
Edit_GetText((HWND)lParam, buffer, 32);
|
int len = Edit_GetText((HWND)lParam, buffer, 32);
|
||||||
|
|
||||||
// Disable save button if no text or if name is "Backup"
|
// Disable save button if no text or if name is "Backup"
|
||||||
BOOL state = (wcslen(buffer) != 0 && _wcsicmp(buffer, L"Backup") != 0);
|
BOOL state = (len > 0 && _wcsicmp(buffer, L"Backup") != 0);
|
||||||
EnableWindow(GetDlgItem(m_Window, IDC_MANAGETHEMES_SAVE_BUTTON), state);
|
EnableWindow(GetDlgItem(m_Window, IDC_MANAGETHEMES_SAVE_BUTTON), state);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -759,16 +759,6 @@ void CMeasure::RemoveTrailingZero(WCHAR* str, int strLen)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
** GetStats
|
|
||||||
**
|
|
||||||
** Returns the stats as string. The stats are shown in the About dialog.
|
|
||||||
*/
|
|
||||||
const WCHAR* CMeasure::GetStats()
|
|
||||||
{
|
|
||||||
return GetStringValue(AUTOSCALE_OFF, 1, -1, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Create
|
** Create
|
||||||
**
|
**
|
||||||
|
@ -52,8 +52,6 @@ public:
|
|||||||
virtual void Initialize();
|
virtual void Initialize();
|
||||||
virtual bool Update() = 0;
|
virtual bool Update() = 0;
|
||||||
|
|
||||||
virtual const WCHAR* GetStats();
|
|
||||||
|
|
||||||
const WCHAR* GetName() { return m_Name.c_str(); }
|
const WCHAR* GetName() { return m_Name.c_str(); }
|
||||||
const std::wstring& GetOriginalName() { return m_Name; }
|
const std::wstring& GetOriginalName() { return m_Name; }
|
||||||
const char* GetAsciiName() { return m_AsciiName.c_str(); }
|
const char* GetAsciiName() { return m_AsciiName.c_str(); }
|
||||||
|
@ -20,8 +20,6 @@
|
|||||||
#include "MeasureCalc.h"
|
#include "MeasureCalc.h"
|
||||||
#include "Rainmeter.h"
|
#include "Rainmeter.h"
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
hqStrMap* CMeasureCalc::c_VarMap = NULL;
|
hqStrMap* CMeasureCalc::c_VarMap = NULL;
|
||||||
bool CMeasureCalc::c_RandSeeded = false;
|
bool CMeasureCalc::c_RandSeeded = false;
|
||||||
|
|
||||||
|
@ -635,9 +635,7 @@ bool CMeter::ReplaceMeasures(const std::vector<std::wstring>& stringValues, std:
|
|||||||
// Create the actual text (i.e. replace %1, %2, .. with the measure texts)
|
// Create the actual text (i.e. replace %1, %2, .. with the measure texts)
|
||||||
for (size_t i = stringValues.size(); i > 0; --i)
|
for (size_t i = stringValues.size(); i > 0; --i)
|
||||||
{
|
{
|
||||||
_snwprintf_s(buffer, _TRUNCATE, L"%%%i", (int)i);
|
size_t len = _snwprintf_s(buffer, _TRUNCATE, L"%%%i", (int)i);
|
||||||
|
|
||||||
size_t len = wcslen(buffer);
|
|
||||||
size_t start = 0, pos;
|
size_t start = 0, pos;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
@ -1157,8 +1157,6 @@ void CSystem::SetClipboardText(const std::wstring& text)
|
|||||||
if (hMem)
|
if (hMem)
|
||||||
{
|
{
|
||||||
LPVOID data = GlobalLock(hMem);
|
LPVOID data = GlobalLock(hMem);
|
||||||
if (data)
|
|
||||||
{
|
|
||||||
memcpy(data, text.c_str(), len * sizeof(WCHAR));
|
memcpy(data, text.c_str(), len * sizeof(WCHAR));
|
||||||
GlobalUnlock(hMem);
|
GlobalUnlock(hMem);
|
||||||
|
|
||||||
@ -1168,7 +1166,6 @@ void CSystem::SetClipboardText(const std::wstring& text)
|
|||||||
GlobalFree(hMem);
|
GlobalFree(hMem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
CloseClipboard();
|
CloseClipboard();
|
||||||
}
|
}
|
||||||
|
@ -410,20 +410,7 @@ void CTrayWindow::ReadConfig(CConfigParser& parser)
|
|||||||
|
|
||||||
LRESULT CALLBACK CTrayWindow::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
LRESULT CALLBACK CTrayWindow::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
static CTrayWindow* tray = NULL;
|
CTrayWindow* tray = Rainmeter->GetTrayWindow();
|
||||||
|
|
||||||
if (uMsg == WM_CREATE)
|
|
||||||
{
|
|
||||||
tray=(CTrayWindow*)((LPCREATESTRUCT)lParam)->lpCreateParams;
|
|
||||||
}
|
|
||||||
else if (uMsg == WM_TASKBARCREATED)
|
|
||||||
{
|
|
||||||
if (tray && tray->IsTrayIconEnabled())
|
|
||||||
{
|
|
||||||
tray->RemoveTrayIcon();
|
|
||||||
tray->AddTrayIcon();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (uMsg)
|
switch (uMsg)
|
||||||
{
|
{
|
||||||
@ -818,6 +805,17 @@ LRESULT CALLBACK CTrayWindow::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA
|
|||||||
case WM_DESTROY:
|
case WM_DESTROY:
|
||||||
PostQuitMessage(0);
|
PostQuitMessage(0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
if (uMsg == WM_TASKBARCREATED)
|
||||||
|
{
|
||||||
|
if (tray && tray->IsTrayIconEnabled())
|
||||||
|
{
|
||||||
|
tray->RemoveTrayIcon();
|
||||||
|
tray->AddTrayIcon();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return DefWindowProc(hWnd, uMsg, wParam, lParam);
|
return DefWindowProc(hWnd, uMsg, wParam, lParam);
|
||||||
|
Loading…
Reference in New Issue
Block a user