Replaced dialog resources with control template

Also fixed tabbing in dialogs.
This commit is contained in:
Birunthan Mohanathas 2012-12-13 11:12:25 +02:00
parent 37aee6921e
commit 3d6132811f
13 changed files with 1712 additions and 951 deletions

View File

@ -0,0 +1,49 @@
/*
Copyright (C) 2012 Birunthan Mohanathas
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "ControlTemplate.h"
namespace ControlTemplate
{
void CreateControls(const Control* cts, UINT ctCount, HWND parent, HFONT font, GetStringFunc getString)
{
for (UINT i = 0; i < ctCount; ++i)
{
const Control& ct = cts[i];
WCHAR* text = ct.textId ? getString(ct.textId) : NULL;
RECT r = { ct.x, ct.y, ct.w, ct.h };
MapDialogRect(parent, &r);
HWND wnd = CreateWindowEx(
ct.exStyle,
ct.name,
text,
ct.style,
r.left, r.top, r.right, r.bottom,
parent,
(HMENU)ct.id,
NULL,
NULL);
SendMessage(wnd, WM_SETFONT, (WPARAM)font, FALSE);
}
}
} // namespace ControlTemplate

89
Common/ControlTemplate.h Normal file
View File

@ -0,0 +1,89 @@
/*
Copyright (C) 2012 Birunthan Mohanathas
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef RM_COMMON_CONTROLTEMPLATE_H_
#define RM_COMMON_CONTROLTEMPLATE_H_
#include <Windows.h>
namespace ControlTemplate
{
struct Control
{
const WCHAR* name;
WORD id;
WORD textId;
short x;
short y;
short w;
short h;
DWORD style;
DWORD exStyle;
};
typedef WCHAR* (*GetStringFunc)(UINT id);
void CreateControls(const Control* cts, UINT ctCount, HWND parent, HFONT font, GetStringFunc getString);
// Helpers to declare control structs.
#define CT_ITEM(name, id, textId, x, y, w, h, style, exStyle) \
{ name, id, textId, x, y, w, h, WS_CHILD | style, exStyle }
#define CT_BUTTON(id, textId, x, y, w, h, style, exStyle) \
CT_ITEM(L"Button", id, textId, x, y, w, h, BS_PUSHBUTTON | style, exStyle)
#define CT_CHECKBOX(id, textId, x, y, w, h, style, exStyle) \
CT_ITEM(L"Button", id, textId, x, y, w, h, BS_AUTOCHECKBOX | style, exStyle)
#define CT_COMBOBOX(id, textId, x, y, w, h, style, exStyle) \
CT_ITEM(L"ComboBox", id, textId, x, y, w, h, style, exStyle)
#define CT_EDIT(id, textId, x, y, w, h, style, exStyle) \
CT_ITEM(L"Edit", id, textId, x, y, w, h, ES_LEFT | style, exStyle)
#define CT_GROUPBOX(id, textId, x, y, w, h, style, exStyle) \
CT_ITEM(L"Button", id, textId, x, y, w, h, BS_GROUPBOX | style, exStyle)
#define CT_ICON(id, textId, x, y, w, h, style, exStyle) \
CT_ITEM(L"Static", id, textId, x, y, w, h, SS_ICON | style, exStyle)
#define CT_LABEL(id, textId, x, y, w, h, style, exStyle) \
CT_ITEM(L"Static", id, textId, x, y, w, h, SS_LEFT | style, exStyle)
#define CT_LINEH(id, textId, x, y, w, h, style, exStyle) \
CT_ITEM(L"Static", id, textId, x, y, w, h, SS_ETCHEDHORZ | style, exStyle)
#define CT_LINKLABEL(id, textId, x, y, w, h, style, exStyle) \
CT_ITEM(L"SysLink", id, textId, x, y, w, h, style, exStyle)
#define CT_LISTBOX(id, textId, x, y, w, h, style, exStyle) \
CT_ITEM(L"ListBox", id, textId, x, y, w, h, style, exStyle)
#define CT_LISTVIEW(id, textId, x, y, w, h, style, exStyle) \
CT_ITEM(L"SysListView32", id, textId, x, y, w, h, style, exStyle)
#define CT_TAB(id, textId, x, y, w, h, style, exStyle) \
CT_ITEM(L"SysTabControl32", id, textId, x, y, w, h, TCS_TABS | style, exStyle)
#define CT_TREEVIEW(id, textId, x, y, w, h, style, exStyle) \
CT_ITEM(L"SysTreeView32", id, textId, x, y, w, h, style, exStyle)
} // namespace ControlTemplate
#endif

254
Common/Dialog.cpp Normal file
View File

@ -0,0 +1,254 @@
/*
Copyright (C) 2012 Birunthan Mohanathas
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "Dialog.h"
#include <Commctrl.h>
#include <Uxtheme.h>
HWND CDialog::c_ActiveDialogWindow = NULL;
//
// CBaseDialog
//
CBaseDialog::CBaseDialog() :
m_Window()
{
}
/*
** Create (if not already) and show the dialog.
**
*/
void CBaseDialog::Show(const WCHAR* title, short x, short y, short w, short h, DWORD style, DWORD exStyle, HWND parent)
{
if (m_Window)
{
// Show existing window.
ShowWindow(m_Window, SW_SHOW);
SetForegroundWindow(m_Window);
return;
}
const WCHAR* font = L"MS Shell Dlg 2";
const size_t titleSize = (wcslen(title) + 1) * sizeof(WCHAR);
const size_t fontSize = (wcslen(font) + 1) * sizeof(WCHAR);
const size_t dataSize = sizeof(DLGTEMPLATE) +
sizeof(WCHAR) + // Menu array.
sizeof(WCHAR) + // Class array.
titleSize + // Title array.
sizeof(WORD) + // Font point size.
fontSize; // Font array.
DLGTEMPLATE* dt = (DLGTEMPLATE*)new BYTE[dataSize];
dt->style = style | DS_SHELLFONT | WS_VISIBLE;
dt->dwExtendedStyle = exStyle;
dt->cdit = 0;
dt->x = x;
dt->y = y;
dt->cx = w;
dt->cy = h;
BYTE* dtExtra = (BYTE*)dt + sizeof(DLGTEMPLATE);
// Menu array.
*(WCHAR*)dtExtra = L'\0';
dtExtra += sizeof(WCHAR);
// Class array.
*(WCHAR*)dtExtra = L'\0';
dtExtra += sizeof(WCHAR);
// Title array.
memcpy(dtExtra, title, titleSize);
dtExtra += titleSize;
// Font point size.
*(WORD*)dtExtra = 8;
dtExtra += sizeof(WORD);
// Font array.
memcpy(dtExtra, font, fontSize);
CreateDialogIndirectParam(NULL, dt, parent, InitialDlgProc, (LPARAM)this);
delete [] dt;
}
void CBaseDialog::CreateControls(const ControlTemplate::Control* cts, UINT ctCount, HFONT font, ControlTemplate::GetStringFunc getString)
{
ControlTemplate::CreateControls(cts, ctCount, m_Window, font, getString);
}
INT_PTR CALLBACK CBaseDialog::InitialDlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
if (uMsg == WM_INITDIALOG)
{
CBaseDialog* dialog = (CBaseDialog*)lParam;
dialog->m_Window = hWnd;
SetWindowLongPtr(hWnd, DWLP_USER, (LONG_PTR)dialog);
SetWindowLongPtr(hWnd, DWLP_DLGPROC, (LONG_PTR)MainDlgProc);
return dialog->HandleMessage(uMsg, wParam, lParam);
}
return FALSE;
}
INT_PTR CALLBACK CBaseDialog::MainDlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
CBaseDialog* dialog = (CBaseDialog*)GetWindowLongPtr(hWnd, DWLP_USER);
return dialog->HandleMessage(uMsg, wParam, lParam);
}
//
// CDialog
//
CDialog::CDialog() : CBaseDialog(),
m_Font(),
m_FontBold()
{
NONCLIENTMETRICS ncm;
ncm.cbSize = sizeof(NONCLIENTMETRICS) - sizeof(ncm.iPaddedBorderWidth);
SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &ncm, 0);
m_Font = CreateFontIndirect(&ncm.lfMenuFont);
ncm.lfMenuFont.lfWeight = FW_BOLD;
ncm.lfMenuFont.lfHeight -= 2;
m_FontBold = CreateFontIndirect(&ncm.lfMenuFont);
}
CDialog::~CDialog()
{
DestroyWindow(m_Window);
DeleteObject(m_Font);
DeleteObject(m_FontBold);
}
void CDialog::ShowDialogWindow(const WCHAR* title, short x, short y, short w, short h, DWORD style, DWORD exStyle, HWND parent)
{
Show(title, x, y, w, h, style, exStyle, parent);
}
INT_PTR CDialog::OnActivate(WPARAM wParam, LPARAM lParam)
{
c_ActiveDialogWindow = wParam ? m_Window : NULL;
return FALSE;
}
bool CDialog::HandleMessage(MSG& msg)
{
if (c_ActiveDialogWindow)
{
if (IsDialogMessage(c_ActiveDialogWindow, &msg))
{
return true;
}
}
return false;
}
/*
** Subclass button control to draw arrow on the right.
**
*/
void CDialog::SetMenuButton(HWND button)
{
SetWindowSubclass(button, MenuButtonProc, NULL, NULL);
}
LRESULT CALLBACK CDialog::MenuButtonProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_PTR uIdSubclass, DWORD_PTR dwRefData)
{
LRESULT result = DefSubclassProc(hWnd, uMsg, wParam, lParam);
switch (uMsg)
{
case WM_PAINT:
{
// Draw arrow on top of the button
RECT buttonRect;
GetClientRect(hWnd, &buttonRect);
int arrowX = buttonRect.right - 18;
int arrowY = buttonRect.top + 4;
RECT arrowRect = { arrowX, arrowY, arrowX + 14, arrowY + 14 };
HDC dc = GetDC(hWnd);
const WORD DFCS_MENUARROWDOWN = 0x0010; // Undocumented
DWORD drawFlags = DFCS_TRANSPARENT | DFCS_MENUARROWDOWN | (IsWindowEnabled(hWnd) ? 0 : DFCS_INACTIVE);
DrawFrameControl(dc, &arrowRect, DFC_MENU, drawFlags);
ReleaseDC(hWnd, dc);
}
break;
case WM_GETTEXT:
{
// Append 3 spaces to the button text to move text to the left so
// that it looks better with BS_CENTER.
WCHAR* str = (WCHAR*)lParam + result;
str[0] = str[1] = str[2] = L' ';
str[3] = '\0';
result += 3;
}
break;
case WM_GETTEXTLENGTH:
result += 3;
break;
case WM_NCDESTROY:
RemoveWindowSubclass(hWnd, MenuButtonProc, uIdSubclass);
break;
}
return result;
}
//
// CTab
//
CDialog::CTab::CTab() : CBaseDialog(),
m_Initialized(false)
{
}
void CDialog::CTab::CreateTabWindow(short x, short y, short w, short h, HWND owner)
{
const DWORD style = DS_CONTROL | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS;
const DWORD exStyle = WS_EX_CONTROLPARENT;
Show(L"", x, y, w, h, style, exStyle, owner);
EnableThemeDialogTexture(m_Window, ETDT_ENABLETAB);
}
CDialog::CTab::~CTab()
{
DestroyWindow(m_Window);
}
void CDialog::CTab::Activate()
{
if (!m_Initialized)
{
Initialize();
}
EnableWindow(m_Window, TRUE);
BringWindowToTop(m_Window);
}

94
Common/Dialog.h Normal file
View File

@ -0,0 +1,94 @@
/*
Copyright (C) 2012 Birunthan Mohanathas
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef RM_COMMON_DIALOG_H_
#define RM_COMMON_DIALOG_H_
#include <Windows.h>
#include "ControlTemplate.h"
// Shared base class for CDialog and CTab.
class CBaseDialog
{
protected:
CBaseDialog();
virtual ~CBaseDialog() {}
void Show(const WCHAR* title, short x, short y, short w, short h, DWORD style, DWORD exStyle, HWND parent);
void CreateControls(const ControlTemplate::Control* cts, UINT ctCount, HFONT font, ControlTemplate::GetStringFunc getString);
virtual INT_PTR HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam) { return FALSE; }
HWND m_Window;
private:
CBaseDialog(const CBaseDialog& r);
static INT_PTR CALLBACK InitialDlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
static INT_PTR CALLBACK MainDlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
};
class CDialog : public CBaseDialog
{
public:
HWND GetWindow() { return m_Window; }
static bool HandleMessage(MSG& msg);
protected:
class CTab : public CBaseDialog
{
public:
HWND GetWindow() { return m_Window; }
bool IsInitialized() { return m_Initialized; }
void Activate();
virtual void Initialize() {}
virtual void Resize(int w, int h) {}
protected:
CTab();
virtual ~CTab();
void CreateTabWindow(short x, short y, short w, short h, HWND owner);
bool m_Initialized;
};
CDialog();
virtual ~CDialog();
void ShowDialogWindow(const WCHAR* title, short x, short y, short w, short h, DWORD style, DWORD exStyle, HWND parent);
INT_PTR OnActivate(WPARAM wParam, LPARAM lParam);
static void SetMenuButton(HWND button);
HFONT m_Font;
HFONT m_FontBold;
private:
CDialog(const CDialog& r);
static LRESULT CALLBACK MenuButtonProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_PTR uIdSubclass, DWORD_PTR dwRefData);
static HWND c_ActiveDialogWindow;
};
#endif

View File

@ -10,168 +10,15 @@
#define STR_ISRTL "0"
#endif
#define MAKESTRING2(num) #num
#define MAKESTRING(num) MAKESTRING2(num)
#define STR_NUM_BUTTONWIDTH MAKESTRING(NUM_BUTTONWIDTH)
#define STR_NUM_LABELWIDTH MAKESTRING(NUM_LABELWIDTH)
LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_ABOUT_DIALOG DIALOGEX 0, 0, 400, 210
STYLE DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
EXSTYLE DIALOG_EXSTYLE_FLAGS
CAPTION STR_ABOUTRAINMETER
FONT 8, "MS Shell Dlg 2", 0, 0, 0x0
{
CONTROL "", IDC_ABOUT_TAB, "SysTabControl32", TCS_TABS | TCS_FIXEDWIDTH, 6, 6, 388, 181
DEFPUSHBUTTON STR_CLOSE, IDCLOSE, 344, 191, 50, 14
}
IDD_ABOUTLOG_DIALOG DIALOGEX 15, 30, 370, 148
STYLE DS_CONTROL | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS
FONT 8, "MS Shell Dlg 2", 0, 0, 0x0
{
CONTROL "", IDC_ABOUTLOG_ITEMS_LISTVIEW, "SysListView32", LVS_ICON | LVS_REPORT | LVS_SINGLESEL | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP, 0, 0, 368, 135
AUTOCHECKBOX STR_ERROR, IDC_ABOUTLOG_ERROR_CHECKBOX, 0, 139, 70, 9
AUTOCHECKBOX STR_WARNING, IDC_ABOUTLOG_WARNING_CHECKBOX, 70, 139, 70, 9
AUTOCHECKBOX STR_NOTICE, IDC_ABOUTLOG_NOTICE_CHECKBOX, 140, 139, 70, 9
AUTOCHECKBOX STR_DEBUG, IDC_ABOUTLOG_DEBUG_CHECKBOX, 210, 139, 70, 9
}
IDD_ABOUTSKINS_DIALOG DIALOGEX 15, 30, 370, 148
STYLE DS_CONTROL | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS
FONT 8, "MS Shell Dlg 2", 0, 0, 0x0
{
LISTBOX IDC_ABOUTSKINS_ITEMS_LISTBOX, 0, 0, 120, 148, LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP
CONTROL "", IDC_ABOUTSKINS_ITEMS_LISTVIEW, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP, 125, 0, 242, 148
}
IDD_ABOUTPLUGINS_DIALOG DIALOGEX 15, 30, 370, 148
STYLE DS_CONTROL | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS
FONT 8, "MS Shell Dlg 2", 0, 0, 0x0
{
CONTROL "", IDC_ABOUTPLUGINS_ITEMS_LISTVIEW, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP, 0, 0, 368, 148
}
IDD_ABOUTVERSION_DIALOG DIALOGEX 15, 30, 370, 148
STYLE DS_CONTROL | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS
FONT 8, "MS Shell Dlg 2", 0, 0, 0x0
{
CONTROL 0, IDC_ABOUTVERSION_RAINMETER_ICON, STATIC, SS_ICON | WS_CHILD | WS_VISIBLE, 0, 8, 24, 24
LTEXT "", IDC_ABOUTVERSION_VERSION_TEXT, 28, 0, 300, 9
CONTROL STR_GETLATESTVERSION, IDC_STATIC, "SysLink", 0x0, 28, 13, 300, 9
CONTROL STR_COPYRIGHTNOTICE, IDC_STATIC, "SysLink", 0x0, 28, 26, 300, 9
LTEXT "", IDC_ABOUTVERSION_PATH_TEXT, 0, 43, 360, 9, SS_ENDELLIPSIS | SS_NOPREFIX
LTEXT "", IDC_ABOUTVERSION_INIFILE_TEXT, 0, 56, 360, 9, SS_ENDELLIPSIS | SS_NOPREFIX
LTEXT "", IDC_ABOUTVERSION_SKINPATH_TEXT, 0, 69, 360, 9, SS_ENDELLIPSIS | SS_NOPREFIX
PUSHBUTTON STR_COPYTOCLIPBOARD, IDC_ABOUTVERSION_COPY_BUTTON, 0, 85, NUM_BUTTONWIDTH + 25, 14, WS_TABSTOP
}
IDD_MANAGE_DIALOG DIALOGEX 0, 0, 500, 322
STYLE DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE DIALOG_EXSTYLE_FLAGS
CAPTION STR_MANAGERAINMETER
FONT 8, "MS Shell Dlg 2", 0, 0, 0x0
{
CONTROL "", IDC_MANAGE_TAB, "SysTabControl32", TCS_TABS | TCS_FIXEDWIDTH, 6, 6, 488, 293
PUSHBUTTON STR_REFRESHALL, IDC_MANAGE_REFRESHALL_BUTTON, 5, 303, NUM_BUTTONWIDTH, 14
PUSHBUTTON STR_EDITSETTINGS, IDC_MANAGE_EDITSETTINGS_BUTTON, NUM_BUTTONWIDTH + 9, 303, NUM_BUTTONWIDTH, 14
PUSHBUTTON STR_OPENLOG, IDC_MANAGE_OPENLOG_BUTTON, NUM_BUTTONWIDTH + NUM_BUTTONWIDTH + 13, 303, NUM_BUTTONWIDTH, 14
PUSHBUTTON STR_HELP, IDC_MANAGE_HELP_BUTTON, 444 - 50 - 5, 303, 50, 14
PUSHBUTTON STR_CLOSE, IDCLOSE, 444, 303, 50, 14
}
IDD_MANAGESKINS_DIALOG DIALOGEX 15, 30, 470, 260
STYLE DS_CONTROL | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS
FONT 8, "MS Shell Dlg 2", 0, 0, 0x0
{
PUSHBUTTON STR_ACTIVESKINS, IDC_MANAGESKINS_ACTIVESKINS_BUTTON, 0, 0, 146, 14, WS_TABSTOP
CONTROL "", IDC_MANAGESKINS_SKINS_TREEVIEW, "SysTreeView32", TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT | TVS_SHOWSELALWAYS | WS_BORDER | WS_VSCROLL, 0, 18, 145, 221
PUSHBUTTON "Create .rmskin package...", IDC_MANAGESKINS_CREATEPACKAGE_BUTTON, 0, 244, 146, 14, WS_TABSTOP
LTEXT "N/A", IDC_MANAGESKINS_FILE_TEXT, 165, 0, 130, 14, SS_ENDELLIPSIS | SS_NOPREFIX
LTEXT "N/A", IDC_MANAGESKINS_CONFIG_TEXT, 165, 16, 130, 9, SS_ENDELLIPSIS | SS_NOPREFIX
PUSHBUTTON STR_LOAD, IDC_MANAGESKINS_LOAD_BUTTON, 310, 0, 50, 14, WS_DISABLED | WS_TABSTOP
PUSHBUTTON STR_REFRESH, IDC_MANAGESKINS_REFRESH_BUTTON, 364, 0, 50, 14, WS_DISABLED | WS_TABSTOP
PUSHBUTTON STR_EDIT, IDC_MANAGESKINS_EDIT_BUTTON, 418, 0, 50, 14, WS_DISABLED | WS_TABSTOP
LTEXT STR_AUTHORSC, IDC_STATIC, 165, 30, 80, 9
LTEXT "", IDC_MANAGESKINS_AUTHOR_TEXT, 230, 30, 245, 9, SS_ENDELLIPSIS | SS_NOPREFIX
LTEXT STR_VERSIONSC, IDC_STATIC, 165, 43, 80, 9
LTEXT "", IDC_MANAGESKINS_VERSION_TEXT, 230, 43, 245, 9, SS_ENDELLIPSIS | SS_NOPREFIX
LTEXT STR_LICENSESC, IDC_STATIC, 165, 56, 80, 9
LTEXT "", IDC_MANAGESKINS_LICENSE_TEXT, 230, 56, 245, 9, SS_ENDELLIPSIS | SS_NOPREFIX
LTEXT STR_INFORMATIONSC, IDC_STATIC, 165, 69, 80, 9
EDITTEXT IDC_MANAGESKINS_DESCRIPTION_TEXT, 228, 69, 238, 64, ES_MULTILINE | ES_READONLY
CONTROL STR_ADDMETADATA, IDC_MANAGESKINS_ADDMETADATA_LINK, "SysLink", NOT WS_VISIBLE, 165, 142, 150, 9
CONTROL "", IDC_STATIC, STATIC, SS_ETCHEDHORZ | WS_CHILD | WS_VISIBLE, 165, 156, 304, 1
LTEXT STR_COORDINATESSC, IDC_STATIC, 165, 169, NUM_LABELWIDTH, 9
EDITTEXT IDC_MANAGESKINS_X_TEXT, 165 + NUM_LABELWIDTH, 166, 38, 14, WS_BORDER | WS_TABSTOP | WS_DISABLED
EDITTEXT IDC_MANAGESKINS_Y_TEXT, 165 + NUM_LABELWIDTH + 42, 166, 38, 14, WS_BORDER | WS_TABSTOP | WS_DISABLED
LTEXT STR_POSITIONSC, IDC_STATIC, 165, 190, NUM_LABELWIDTH, 9
COMBOBOX IDC_MANAGESKINS_ZPOSITION_COMBOBOX, 165 + NUM_LABELWIDTH, 187, 80, 14, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP | WS_DISABLED
LTEXT STR_LOADORDERSC, IDC_STATIC, 165, 208, NUM_LABELWIDTH, 9
EDITTEXT IDC_MANAGESKINS_LOADORDER_TEXT, 165 + NUM_LABELWIDTH, 205, 80, 14, WS_BORDER | WS_TABSTOP | WS_DISABLED
LTEXT STR_TRANSPARENCYSC, IDC_STATIC, 165, 229, NUM_LABELWIDTH, 9
COMBOBOX IDC_MANAGESKINS_TRANSPARENCY_COMBOBOX, 165 + NUM_LABELWIDTH, 226, 80, 14, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP | WS_DISABLED
LTEXT STR_ONHOVERSC, IDC_STATIC, 165, 247, NUM_LABELWIDTH, 9
COMBOBOX IDC_MANAGESKINS_ONHOVER_COMBOBOX, 165 + NUM_LABELWIDTH, 244, 80, 14, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP | WS_DISABLED
PUSHBUTTON STR_DISPLAYMONITOR, IDC_MANAGESKINS_DISPLAYMONITOR_BUTTON, 350, 166, 118, 14, WS_DISABLED | WS_TABSTOP
AUTOCHECKBOX STR_DRAGGABLE, IDC_MANAGESKINS_DRAGGABLE_CHECKBOX, 350, 190, 118, 9, WS_DISABLED
AUTOCHECKBOX STR_CLICKTHROUGH, IDC_MANAGESKINS_CLICKTHROUGH_CHECKBOX, 350, 203, 118, 9, WS_DISABLED
AUTOCHECKBOX STR_KEEPONSCREEN, IDC_MANAGESKINS_KEEPONSCREEN_CHECKBOX, 350, 216, 118, 9, WS_DISABLED
AUTOCHECKBOX STR_SAVEPOSITION, IDC_MANAGESKINS_SAVEPOSITION_CHECKBOX, 350, 229, 118, 9, WS_DISABLED
AUTOCHECKBOX STR_SNAPTOEDGES, IDC_MANAGESKINS_SNAPTOEDGES_CHECKBOX, 350, 242, 118, 9, WS_DISABLED
}
IDD_MANAGETHEMES_DIALOG DIALOGEX 15, 30, 470, 260
STYLE DS_CONTROL | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS
FONT 8, "MS Shell Dlg 2", 0, 0, 0x0
{
GROUPBOX STR_SAVENEWTHEME, IDC_STATIC, 0, 0, 230, 150
LTEXT STR_THEMEDESCRIPTION, IDC_STATIC, 6, 16, 205, 44
AUTOCHECKBOX STR_SAVEASEMPTYTHEME, IDC_MANAGETHEMES_EMPTYTHEME_CHECKBOX, 6, 70, 220, 9, WS_TABSTOP
AUTOCHECKBOX STR_EXCLUDEUNUSEDSKINS, IDC_MANAGETHEMES_UNUSEDSKINS_CHECKBOX, 6, 83, 220, 9, WS_TABSTOP
AUTOCHECKBOX STR_INCLUDEWALLPAPER, IDC_MANAGETHEMES_WALLPAPER_CHECKBOX, 6, 96, 220, 9, WS_TABSTOP
LTEXT STR_NAMESC, IDC_STATIC, 6, 115, 100, 9
EDITTEXT IDC_MANAGETHEMES_NAME_TEXT, 6, 128, 162, 14, WS_BORDER | WS_TABSTOP
PUSHBUTTON STR_SAVE, IDC_MANAGETHEMES_SAVE_BUTTON, 172, 128, 50, 14, WS_DISABLED | WS_TABSTOP
GROUPBOX STR_SAVEDTHEMES, IDC_STATIC, 238, 0, 230, 150
LISTBOX IDC_MANAGETHEMES_LIST, 244, 16, 160, 125, LBS_STANDARD | LBS_NOINTEGRALHEIGHT
PUSHBUTTON STR_LOAD, IDC_MANAGETHEMES_LOAD_BUTTON, 410, 16, 50, 14, WS_DISABLED
PUSHBUTTON STR_DELETE, IDC_MANAGETHEMES_DELETE_BUTTON, 410, 34, 50, 14, WS_DISABLED
PUSHBUTTON STR_EDIT, IDC_MANAGETHEMES_EDIT_BUTTON, 410, 52, 50, 14, WS_DISABLED
// GROUPBOX STR_BACKUP, IDC_STATIC, 0, 200, 468, 60
// LTEXT STR_BACKUPDESCRIPTION, IDC_STATIC, 6, 216, 455, 34
// PUSHBUTTON STR_BACKUPE, IDC_MANAGETHEMES_BACKUP_BUTTON, 460 - NUM_BUTTONWIDTH, 240, NUM_BUTTONWIDTH, 14
}
IDD_MANAGESETTINGS_DIALOG DIALOGEX 15, 30, 470, 260
STYLE DS_CONTROL | WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS
FONT 8, "MS Shell Dlg 2", 0, 0, 0x0
{
GROUPBOX STR_GENERAL, IDC_STATIC, 0, 0, 468, 118
LTEXT STR_LANGUAGESC, IDC_STATIC, 6, 16, 87, 14
COMBOBOX IDC_MANAGESETTINGS_LANGUAGE_COMBOBOX, 87, 13, 222, 14, CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
//AUTOCHECKBOX "Run automatically at startup", IDC_MANAGESETTINGS_AUTOSTART_CHECKBOX, 6, 16, 140, 9, WS_DISABLED
LTEXT "Editor:", IDC_STATIC, 6, 37, 87, 9
EDITTEXT IDC_MANAGESETTINGS_CONFIGEDITOR_TEXT, 87, 34, 222, 14, ES_AUTOHSCROLL | ES_READONLY | WS_BORDER | WS_TABSTOP
PUSHBUTTON "...", IDC_MANAGESETTINGS_CONFIGEDITOR_BUTTON, 313, 34, 25, 14, WS_TABSTOP
AUTOCHECKBOX STR_CHECKFORUPDATES, IDC_MANAGESETTINGS_CHECKUPDATES_CHECKBOX, 6, 55, 150, 9
AUTOCHECKBOX STR_DISABLEDRAGGING, IDC_MANAGESETTINGS_LOCKSKINS_CHECKBOX, 6, 68, 150, 9
AUTOCHECKBOX "Show notification area icon", IDC_MANAGESETTINGS_TRAYICON_CHECKBOX, 6, 81, 150, 9
PUSHBUTTON STR_RESETSTATISTICS, IDC_MANAGESETTINGS_RESETSTATISTICS_BUTTON, 6, 97, NUM_BUTTONWIDTH + 20, 14, WS_TABSTOP
GROUPBOX STR_LOGGING, IDC_STATIC, 0, 125, 468, 66
AUTOCHECKBOX STR_DEBUGMODE, IDC_MANAGESETTINGS_VERBOSELOGGING_CHECKBOX, 6, 141, 200, 9
AUTOCHECKBOX STR_LOGTOFILE, IDC_MANAGESETTINGS_LOGTOFILE_CHECKBOX, 6, 154, 200, 9
PUSHBUTTON STR_SHOWLOGFILE, IDC_MANAGESETTINGS_SHOWLOGFILE_BUTTON, 6, 170, NUM_BUTTONWIDTH + 20, 14
PUSHBUTTON STR_DELETELOGFILE, IDC_MANAGESETTINGS_DELETELOGFILE_BUTTON, NUM_BUTTONWIDTH + 30, 170, NUM_BUTTONWIDTH + 20, 14
}
/////////////////////////////////////////////////////////////////////////////
//
// String Table
@ -179,94 +26,18 @@ FONT 8, "MS Shell Dlg 2", 0, 0, 0x0
STRINGTABLE
{
ID_STR_NUM_BUTTONWIDTH, STR_NUM_BUTTONWIDTH
ID_STR_NUM_LABELWIDTH, STR_NUM_LABELWIDTH
ID_STR_ISRTL, STR_ISRTL
ID_STR_UPDATEAVAILABLE, STR_UPDATEAVAILABLE
ID_STR_LOG, STR_LOG
ID_STR_MEASURES, STR_MEASURES
ID_STR_PLUGINS, STR_PLUGINS
ID_STR_VERSION, STR_VERSION
ID_STR_TYPE, STR_TYPE
ID_STR_TIME, STR_TIME
ID_STR_MESSAGE, STR_MESSAGE
ID_STR_NAME, STR_NAME
ID_STR_RANGE, STR_RANGE
ID_STR_VALUE, STR_VALUE
ID_STR_AUTHOR, STR_AUTHOR
ID_STR_MANAGERAINMETER, STR_MANAGERAINMETER
ID_STR_SKINS, STR_SKINS
ID_STR_THEMES, STR_THEMES
ID_STR_SETTINGS, STR_SETTINGS
ID_STR_STAYTOPMOST, STR_STAYTOPMOST
ID_STR_TOPMOST, STR_TOPMOST
ID_STR_NORMAL, STR_NORMAL
ID_STR_BOTTOM, STR_BOTTOM
ID_STR_ONDESKTOP, STR_ONDESKTOP
ID_STR_DONOTHING, STR_DONOTHING
ID_STR_HIDE, STR_HIDE
ID_STR_FADEIN, STR_FADEIN
ID_STR_FADEOUT, STR_FADEOUT
ID_STR_LOAD, STR_LOAD
ID_STR_UNLOAD, STR_UNLOAD
ID_STR_COLLAPSE, STR_COLLAPSE
ID_STR_SETTINGSNOTWRITABLE, STR_SETTINGSNOTWRITABLE
ID_STR_SETTINGSMOVEFILE, STR_SETTINGSMOVEFILE
ID_STR_SETTINGSREADONLY, STR_SETTINGSREADONLY
ID_STR_THEMEALREADYEXISTS, STR_THEMEALREADYEXISTS
ID_STR_THEMESAVEFAIL, STR_THEMESAVEFAIL
ID_STR_THEMEDELETE, STR_THEMEDELETE
ID_STR_VARIABLES, STR_VARIABLES
ID_STR_LOGFILECREATEFAIL, STR_LOGFILECREATEFAIL
ID_STR_LOGFILEDELETE, STR_LOGFILEDELETE
ID_STR_NOAVAILABLESKINS, STR_NOAVAILABLESKINS
ID_STR_UNABLETOACTIVATESKIN, STR_UNABLETOACTIVATESKIN
ID_STR_UNABLETOREFRESHSKIN, STR_UNABLETOREFRESHSKIN
ID_STR_NEWVERSIONREQUIRED, STR_NEWVERSIONREQUIRED
ID_STR_NOMETERSINSKIN, STR_NOMETERSINSKIN
ID_STR_INCLUDEINFINITELOOP, STR_INCLUDEINFINITELOOP
ID_STR_ABOUTRAINMETER, STR_ABOUTRAINMETER
ID_STR_WELCOME, STR_WELCOME
ID_STR_CLICKTOMANAGE, STR_CLICKTOMANAGE
ID_STR_CLICKTODOWNLOAD, STR_CLICKTODOWNLOAD
ID_STR_VARIANTS, STR_VARIANTS
ID_STR_POSITION, STR_POSITION
ID_STR_DISPLAYMONITOR, STR_DISPLAYMONITOR
ID_STR_USEDEFAULTMONITOR, STR_USEDEFAULTMONITOR
ID_STR_VIRTUALSCREEN, STR_VIRTUALSCREEN
ID_STR_AUTOSELECTMONITOR, STR_AUTOSELECTMONITOR
ID_STR_FROMRIGHT, STR_FROMRIGHT
ID_STR_FROMBOTTOM, STR_FROMBOTTOM
ID_STR_XASPERCENTAGE, STR_XASPERCENTAGE
ID_STR_YASPERCENTAGE, STR_YASPERCENTAGE
ID_STR_TRANSPARENCY, STR_TRANSPARENCY
ID_STR_HIDEONMOUSEOVER, STR_HIDEONMOUSEOVER
ID_STR_DRAGGABLE, STR_DRAGGABLE
ID_STR_SAVEPOSITION, STR_SAVEPOSITION
ID_STR_SNAPTOEDGES, STR_SNAPTOEDGES
ID_STR_CLICKTHROUGH, STR_CLICKTHROUGH
ID_STR_KEEPONSCREEN, STR_KEEPONSCREEN
ID_STR_MANAGESKIN, STR_MANAGESKIN
ID_STR_EDITSKIN, STR_EDITSKIN
ID_STR_REFRESHSKIN, STR_REFRESHSKIN
ID_STR_UNLOADSKIN, STR_UNLOADSKIN
ID_STR_REFRESH, STR_REFRESH
ID_STR_EDIT, STR_EDIT
ID_STR_EXPAND, STR_EXPAND
ID_STR_OPENFOLDER, STR_OPENFOLDER
ID_STR_DISABLEDRAGGING, STR_DISABLEDRAGGING
ID_STR_0PERCENT, "0%"
ID_STR_10PERCENT, "10%"
ID_STR_20PERCENT, "20%"
ID_STR_30PERCENT, "30%"
ID_STR_40PERCENT, "40%"
ID_STR_50PERCENT, "50%"
ID_STR_60PERCENT, "60%"
ID_STR_70PERCENT, "70%"
ID_STR_80PERCENT, "80%"
ID_STR_90PERCENT, "90%"
ID_STR_MANAGE, STR_MANAGE
ID_STR_ABOUT, STR_ABOUT
ID_STR_HELP, STR_HELP
ID_STR_SKINS, STR_SKINS
ID_STR_NOSKINS, STR_NOSKINS
ID_STR_OPENFOLDER, STR_OPENFOLDER
ID_STR_DISABLEDRAGGING, STR_DISABLEDRAGGING
ID_STR_THEMES, STR_THEMES
ID_STR_NOTHEMES, STR_NOTHEMES
ID_STR_EDITSETTINGS, STR_EDITSETTINGS
ID_STR_REFRESHALL, STR_REFRESHALL
@ -277,4 +48,123 @@ STRINGTABLE
ID_STR_DELETELOGFILE, STR_DELETELOGFILE
ID_STR_DEBUGMODE, STR_DEBUGMODE
ID_STR_EXIT, STR_EXIT
}
ID_STR_VARIANTS, STR_VARIANTS
ID_STR_SETTINGS, STR_SETTINGS
ID_STR_POSITION, STR_POSITION
ID_STR_DISPLAYMONITOR, STR_DISPLAYMONITOR
ID_STR_USEDEFAULTMONITOR, STR_USEDEFAULTMONITOR
ID_STR_VIRTUALSCREEN, STR_VIRTUALSCREEN
ID_STR_AUTOSELECTMONITOR, STR_AUTOSELECTMONITOR
ID_STR_STAYTOPMOST, STR_STAYTOPMOST
ID_STR_TOPMOST, STR_TOPMOST
ID_STR_NORMAL, STR_NORMAL
ID_STR_BOTTOM, STR_BOTTOM
ID_STR_ONDESKTOP, STR_ONDESKTOP
ID_STR_FROMRIGHT, STR_FROMRIGHT
ID_STR_FROMBOTTOM, STR_FROMBOTTOM
ID_STR_XASPERCENTAGE, STR_XASPERCENTAGE
ID_STR_YASPERCENTAGE, STR_YASPERCENTAGE
ID_STR_TRANSPARENCY, STR_TRANSPARENCY
ID_STR_0PERCENT, "0%"
ID_STR_10PERCENT, "10%"
ID_STR_20PERCENT, "20%"
ID_STR_30PERCENT, "30%"
ID_STR_40PERCENT, "40%"
ID_STR_50PERCENT, "50%"
ID_STR_60PERCENT, "60%"
ID_STR_70PERCENT, "70%"
ID_STR_80PERCENT, "80%"
ID_STR_90PERCENT, "90%"
ID_STR_FADEIN, STR_FADEIN
ID_STR_FADEOUT, STR_FADEOUT
ID_STR_HIDEONMOUSEOVER, STR_HIDEONMOUSEOVER
ID_STR_DRAGGABLE, STR_DRAGGABLE
ID_STR_SAVEPOSITION, STR_SAVEPOSITION
ID_STR_SNAPTOEDGES, STR_SNAPTOEDGES
ID_STR_CLICKTHROUGH, STR_CLICKTHROUGH
ID_STR_KEEPONSCREEN, STR_KEEPONSCREEN
ID_STR_MANAGESKIN, STR_MANAGESKIN
ID_STR_EDITSKIN, STR_EDITSKIN
ID_STR_REFRESHSKIN, STR_REFRESHSKIN
ID_STR_UNLOADSKIN, STR_UNLOADSKIN
ID_STR_CLOSE, STR_CLOSE
ID_STR_ABOUTRAINMETER, STR_ABOUTRAINMETER
ID_STR_LOG, STR_LOG
ID_STR_MEASURES, STR_MEASURES
ID_STR_VARIABLES, STR_VARIABLES
ID_STR_PLUGINS, STR_PLUGINS
ID_STR_VERSION, STR_VERSION
ID_STR_TYPE, STR_TYPE
ID_STR_TIME, STR_TIME
ID_STR_MESSAGE, STR_MESSAGE
ID_STR_NAME, STR_NAME
ID_STR_RANGE, STR_RANGE
ID_STR_VALUE, STR_VALUE
ID_STR_AUTHOR, STR_AUTHOR
ID_STR_ERROR, STR_ERROR
ID_STR_WARNING, STR_WARNING
ID_STR_NOTICE, STR_NOTICE
ID_STR_DEBUG, STR_DEBUG
ID_STR_GETLATESTVERSION, STR_GETLATESTVERSION
ID_STR_COPYRIGHTNOTICE, STR_COPYRIGHTNOTICE
ID_STR_COPYTOCLIPBOARD, STR_COPYTOCLIPBOARD
ID_STR_MANAGERAINMETER, STR_MANAGERAINMETER
ID_STR_ACTIVESKINS, STR_ACTIVESKINS
ID_STR_EXPAND, STR_EXPAND
ID_STR_COLLAPSE, STR_COLLAPSE
ID_STR_OPENLOG, STR_OPENLOG
ID_STR_LOAD, STR_LOAD
ID_STR_UNLOAD, STR_UNLOAD
ID_STR_REFRESH, STR_REFRESH
ID_STR_EDIT, STR_EDIT
ID_STR_AUTHORSC, STR_AUTHORSC
ID_STR_VERSIONSC, STR_VERSIONSC
ID_STR_LICENSESC, STR_LICENSESC
ID_STR_INFORMATIONSC, STR_INFORMATIONSC
ID_STR_ADDMETADATA, STR_ADDMETADATA
ID_STR_COORDINATESSC, STR_COORDINATESSC
ID_STR_POSITIONSC, STR_POSITIONSC
ID_STR_LOADORDERSC, STR_LOADORDERSC
ID_STR_TRANSPARENCYSC, STR_TRANSPARENCYSC
ID_STR_ONHOVERSC, STR_ONHOVERSC
ID_STR_DONOTHING, STR_DONOTHING
ID_STR_HIDE, STR_HIDE
ID_STR_SAVENEWTHEME, STR_SAVENEWTHEME
ID_STR_THEMEDESCRIPTION, STR_THEMEDESCRIPTION
ID_STR_SAVEASEMPTYTHEME, STR_SAVEASEMPTYTHEME
ID_STR_EXCLUDEUNUSEDSKINS, STR_EXCLUDEUNUSEDSKINS
ID_STR_INCLUDEWALLPAPER, STR_INCLUDEWALLPAPER
ID_STR_NAMESC, STR_NAMESC
ID_STR_SAVE, STR_SAVE
ID_STR_SAVEDTHEMES, STR_SAVEDTHEMES
ID_STR_DELETE, STR_DELETE
// ID_STR_BACKUP, STR_BACKUP
// ID_STR_BACKUPDESCRIPTION, STR_BACKUPDESCRIPTION
// ID_STR_BACKUPE, STR_BACKUPE
ID_STR_LANGUAGESC, STR_LANGUAGESC
ID_STR_GENERAL, STR_GENERAL
ID_STR_CHECKFORUPDATES, STR_CHECKFORUPDATES
ID_STR_RESETSTATISTICS, STR_RESETSTATISTICS
ID_STR_LOGTOFILE, STR_LOGTOFILE
ID_STR_SETTINGSNOTWRITABLE, STR_SETTINGSNOTWRITABLE
ID_STR_SETTINGSMOVEFILE, STR_SETTINGSMOVEFILE
ID_STR_SETTINGSREADONLY, STR_SETTINGSREADONLY
ID_STR_THEMEALREADYEXISTS, STR_THEMEALREADYEXISTS
ID_STR_THEMESAVEFAIL, STR_THEMESAVEFAIL
ID_STR_THEMEDELETE, STR_THEMEDELETE
ID_STR_LOGFILECREATEFAIL, STR_LOGFILECREATEFAIL
ID_STR_LOGFILEDELETE, STR_LOGFILEDELETE
ID_STR_NOAVAILABLESKINS, STR_NOAVAILABLESKINS
ID_STR_UNABLETOACTIVATESKIN, STR_UNABLETOACTIVATESKIN
ID_STR_UNABLETOREFRESHSKIN, STR_UNABLETOREFRESHSKIN
ID_STR_NEWVERSIONREQUIRED, STR_NEWVERSIONREQUIRED
ID_STR_NOMETERSINSKIN, STR_NOMETERSINSKIN
ID_STR_INCLUDEINFINITELOOP, STR_INCLUDEINFINITELOOP
ID_STR_WELCOME, STR_WELCOME
ID_STR_CLICKTOMANAGE, STR_CLICKTOMANAGE
ID_STR_CLICKTODOWNLOAD, STR_CLICKTODOWNLOAD
ID_STR_CREATERMSKINPACKAGE, "Create .rmskin package..."
ID_STR_EDITORSC, "Editor:"
ID_STR_ELLIPSIS, "..."
ID_STR_SHOWNOTIFICATIONAREAICON, "Show notification area icon"
}

View File

@ -26,8 +26,6 @@
#include "DialogAbout.h"
#include "../Version.h"
#define WM_DELAYED_CLOSE WM_APP + 0
extern CRainmeter* Rainmeter;
WINDOWPLACEMENT CDialogAbout::c_WindowPlacement = {0};
@ -37,11 +35,7 @@ CDialogAbout* CDialogAbout::c_Dialog = NULL;
** Constructor.
**
*/
CDialogAbout::CDialogAbout(HWND wnd) : CDialog(wnd),
m_TabLog(wnd),
m_TabSkins(wnd),
m_TabPlugins(wnd),
m_TabVersion(wnd)
CDialogAbout::CDialogAbout() : CDialog()
{
}
@ -53,6 +47,33 @@ CDialogAbout::~CDialogAbout()
{
}
/*
** Opens the About dialog.
**
*/
void CDialogAbout::Open(int tab)
{
if (!c_Dialog)
{
c_Dialog = new CDialogAbout();
}
c_Dialog->ShowDialogWindow(
GetString(ID_STR_ABOUTRAINMETER),
0, 0, 400, 210,
DS_CENTER | WS_POPUP | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME,
WS_EX_APPWINDOW | WS_EX_CONTROLPARENT,
Rainmeter->GetWindow());
// Fake WM_NOTIFY to change tab
NMHDR nm;
nm.code = TCN_SELCHANGE;
nm.idFrom = Id_Tab;
nm.hwndFrom = GetDlgItem(c_Dialog->m_Window, Id_Tab);
TabCtrl_SetCurSel(nm.hwndFrom, tab);
c_Dialog->OnNotify(0, (LPARAM)&nm);
}
/*
** Opens the About dialog by tab name.
**
@ -81,37 +102,6 @@ void CDialogAbout::Open(const WCHAR* name)
Open(tab);
}
/*
** Opens the About dialog.
**
*/
void CDialogAbout::Open(int tab)
{
if (!c_Dialog)
{
HINSTANCE instance = Rainmeter->GetResourceInstance();
HWND owner = Rainmeter->GetWindow();
if (!CreateDialog(instance, MAKEINTRESOURCE(IDD_ABOUT_DIALOG), owner, DlgProc)) return;
}
else
{
if (!IsZoomed(c_Dialog->m_Window))
{
ShowWindow(c_Dialog->m_Window, SW_SHOWNORMAL);
}
}
SetForegroundWindow(c_Dialog->m_Window);
// Fake WM_NOTIFY to change tab
NMHDR nm;
nm.code = TCN_SELCHANGE;
nm.idFrom = IDC_ABOUT_TAB;
nm.hwndFrom = GetDlgItem(c_Dialog->m_Window, IDC_ABOUT_TAB);
TabCtrl_SetCurSel(nm.hwndFrom, tab);
c_Dialog->OnNotify(0, (LPARAM)&nm);
}
/*
** Shows log if dialog isn't already open.
**
@ -150,7 +140,7 @@ void CDialogAbout::UpdateMeasures(CMeterWindow* meterWindow)
CDialog::CTab& CDialogAbout::GetActiveTab()
{
int sel = TabCtrl_GetCurSel(GetDlgItem(m_Window, IDC_ABOUT_TAB));
int sel = TabCtrl_GetCurSel(GetDlgItem(m_Window, Id_Tab));
if (sel == 0)
{
return m_TabLog;
@ -169,84 +159,67 @@ CDialog::CTab& CDialogAbout::GetActiveTab()
}
}
/*
** Dialog procedure for the About dialog.
**
*/
INT_PTR CALLBACK CDialogAbout::DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
INT_PTR CDialogAbout::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
if (!c_Dialog)
switch (uMsg)
{
if (uMsg == WM_INITDIALOG)
case WM_INITDIALOG:
return OnInitDialog(wParam, lParam);
case WM_ACTIVATE:
return OnActivate(wParam, lParam);
case WM_COMMAND:
return OnCommand(wParam, lParam);
case WM_NOTIFY:
return OnNotify(wParam, lParam);
case WM_GETMINMAXINFO:
{
c_Dialog = new CDialogAbout(hWnd);
return c_Dialog->OnInitDialog(wParam, lParam);
MINMAXINFO* mmi = (MINMAXINFO*)lParam;
mmi->ptMinTrackSize.x = 550;
mmi->ptMinTrackSize.y = 350;
}
}
else
{
switch (uMsg)
return TRUE;
case WM_SIZE:
{
case WM_ACTIVATE:
return c_Dialog->OnActivate(wParam, lParam);
case WM_COMMAND:
return c_Dialog->OnCommand(wParam, lParam);
case WM_NOTIFY:
return c_Dialog->OnNotify(wParam, lParam);
case WM_GETMINMAXINFO:
if (wParam != SIZE_MINIMIZED)
{
MINMAXINFO* mmi = (MINMAXINFO*)lParam;
mmi->ptMinTrackSize.x = 550;
mmi->ptMinTrackSize.y = 350;
int w = LOWORD(lParam);
int h = HIWORD(lParam);
RECT r;
HWND item = GetDlgItem(m_Window, Id_Tab);
SetWindowPos(item, NULL, 0, 0, w - 18, h - 47, SWP_NOMOVE | SWP_NOZORDER);
item = GetDlgItem(m_Window, Id_CloseButton);
GetClientRect(item, &r);
SetWindowPos(item, NULL, w - r.right - 9, h - r.bottom - 8, 0, 0, SWP_NOSIZE | SWP_NOZORDER);
w -= 48;
h -= 100;
m_TabLog.Resize(w, h);
m_TabSkins.Resize(w, h);
m_TabPlugins.Resize(w, h);
m_TabVersion.Resize(w, h);
}
return TRUE;
}
return TRUE;
case WM_SIZE:
{
if (wParam != SIZE_MINIMIZED)
{
int w = LOWORD(lParam);
int h = HIWORD(lParam);
RECT r;
HWND item = GetDlgItem(hWnd, IDC_ABOUT_TAB);
SetWindowPos(item, NULL, 0, 0, w - 18, h - 47, SWP_NOMOVE | SWP_NOZORDER);
item = GetDlgItem(hWnd, IDCLOSE);
GetClientRect(item, &r);
SetWindowPos(item, NULL, w - r.right - 9, h - r.bottom - 8, 0, 0, SWP_NOSIZE | SWP_NOZORDER);
w -= 48;
h -= 100;
c_Dialog->m_TabLog.Resize(w, h);
c_Dialog->m_TabSkins.Resize(w, h);
c_Dialog->m_TabPlugins.Resize(w, h);
c_Dialog->m_TabVersion.Resize(w, h);
}
}
return TRUE;
case WM_CLOSE:
PostMessage(hWnd, WM_DELAYED_CLOSE, 0, 0);
return TRUE;
case WM_DESTROY:
delete c_Dialog;
c_Dialog = NULL;
return FALSE;
case WM_DELAYED_CLOSE:
GetWindowPlacement(hWnd, &c_WindowPlacement);
case WM_CLOSE:
{
GetWindowPlacement(m_Window, &c_WindowPlacement);
if (c_WindowPlacement.showCmd == SW_SHOWMINIMIZED)
{
c_WindowPlacement.showCmd = SW_SHOWNORMAL;
}
DestroyWindow(hWnd);
return TRUE;
delete c_Dialog;
c_Dialog = NULL;
}
return TRUE;
}
return FALSE;
@ -254,13 +227,24 @@ INT_PTR CALLBACK CDialogAbout::DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPAR
INT_PTR CDialogAbout::OnInitDialog(WPARAM wParam, LPARAM lParam)
{
HWND item = GetDlgItem(m_Window, IDCLOSE);
SendMessage(m_Window, WM_NEXTDLGCTL, (WPARAM)item, TRUE);
static const ControlTemplate::Control s_Controls[] =
{
CT_TAB(Id_Tab, 0,
6, 6, 388, 181,
WS_VISIBLE | WS_TABSTOP | TCS_FIXEDWIDTH, WS_EX_CONTROLPARENT),
CT_BUTTON(Id_CloseButton, ID_STR_CLOSE,
344, 191, 50, 14,
WS_VISIBLE | WS_TABSTOP | BS_DEFPUSHBUTTON, 0)
};
HICON hIcon = GetIcon(IDI_RAINMETER);
SendMessage(m_Window, WM_SETICON, ICON_SMALL, (LPARAM)hIcon);
CreateControls(s_Controls, _countof(s_Controls), m_Font, GetString);
HWND item = GetDlgItem(m_Window, Id_Tab);
m_TabLog.Create(item);
m_TabSkins.Create(item);
m_TabPlugins.Create(item);
m_TabVersion.Create(item);
item = GetDlgItem(m_Window, IDC_ABOUT_TAB);
TCITEM tci = {0};
tci.mask = TCIF_TEXT;
tci.pszText = GetString(ID_STR_LOG);
@ -272,14 +256,17 @@ INT_PTR CDialogAbout::OnInitDialog(WPARAM wParam, LPARAM lParam)
tci.pszText = GetString(ID_STR_VERSION);
TabCtrl_InsertItem(item, 3, &tci);
HICON hIcon = GetIcon(IDI_RAINMETER);
SendMessage(m_Window, WM_SETICON, ICON_SMALL, (LPARAM)hIcon);
item = GetDlgItem(m_Window, Id_CloseButton);
SendMessage(m_Window, WM_NEXTDLGCTL, (WPARAM)item, TRUE);
if (CSystem::GetOSPlatform() >= OSPLATFORM_VISTA)
{
// Use UI font (Segoe UI) on Vista+
SetDialogFont();
HWND item = GetDlgItem(m_TabLog.GetWindow(), IDC_ABOUTLOG_ITEMS_LISTVIEW);
item = GetDlgItem(m_TabLog.GetWindow(), CTabLog::Id_ItemsListView);
SetWindowTheme(item, L"explorer", NULL);
item = GetDlgItem(m_TabSkins.GetWindow(), IDC_ABOUTSKINS_ITEMS_LISTVIEW);
item = GetDlgItem(m_TabSkins.GetWindow(), CTabSkins::Id_ItemsListView);
SetWindowTheme(item, L"explorer", NULL);
}
@ -288,18 +275,17 @@ INT_PTR CDialogAbout::OnInitDialog(WPARAM wParam, LPARAM lParam)
c_WindowPlacement.length = sizeof(WINDOWPLACEMENT);
GetWindowPlacement(m_Window, &c_WindowPlacement);
}
SetWindowPlacement(m_Window, &c_WindowPlacement);
return FALSE;
return TRUE;
}
INT_PTR CDialogAbout::OnCommand(WPARAM wParam, LPARAM lParam)
{
switch (LOWORD(wParam))
{
case IDCLOSE:
PostMessage(m_Window, WM_DELAYED_CLOSE, 0, 0);
case Id_CloseButton:
PostMessage(m_Window, WM_CLOSE, 0, 0);
break;
default:
@ -314,7 +300,7 @@ INT_PTR CDialogAbout::OnNotify(WPARAM wParam, LPARAM lParam)
LPNMHDR nm = (LPNMHDR)lParam;
switch (nm->idFrom)
{
case IDC_ABOUT_TAB:
case Id_Tab:
if (nm->code == TCN_SELCHANGE)
{
// Disable all tab windows first
@ -344,7 +330,7 @@ INT_PTR CDialogAbout::OnNotify(WPARAM wParam, LPARAM lParam)
** Constructor.
**
*/
CDialogAbout::CTabLog::CTabLog(HWND owner) : CTab(Rainmeter->GetResourceInstance(), owner, IDD_ABOUTLOG_DIALOG, DlgProc),
CDialogAbout::CTabLog::CTabLog() : CTab(),
m_Error(true),
m_Warning(true),
m_Notice(true),
@ -352,6 +338,32 @@ CDialogAbout::CTabLog::CTabLog(HWND owner) : CTab(Rainmeter->GetResourceInstance
{
}
void CDialogAbout::CTabLog::Create(HWND owner)
{
CTab::CreateTabWindow(9, 24, 370, 148, owner);
static const ControlTemplate::Control s_Controls[] =
{
CT_LISTVIEW(Id_ItemsListView, 0,
0, 0, 368, 135,
WS_VISIBLE | WS_TABSTOP | WS_BORDER | LVS_ICON | LVS_REPORT | LVS_SINGLESEL | LVS_NOSORTHEADER, 0),
CT_CHECKBOX(Id_ErrorCheckBox, ID_STR_ERROR,
0, 139, 70, 9,
WS_VISIBLE | WS_TABSTOP, 0),
CT_CHECKBOX(Id_WarningCheckBox, ID_STR_WARNING,
70, 139, 70, 9,
WS_VISIBLE | WS_TABSTOP, 0),
CT_CHECKBOX(Id_NoticeCheckBox, ID_STR_NOTICE,
140, 139, 70, 9,
WS_VISIBLE | WS_TABSTOP, 0),
CT_CHECKBOX(Id_DebugCheckBox, ID_STR_DEBUG,
210, 139, 70, 9,
WS_VISIBLE | WS_TABSTOP, 0)
};
CreateControls(s_Controls, _countof(s_Controls), c_Dialog->m_Font, GetString);
}
/*
** Called when tab is displayed.
**
@ -359,7 +371,7 @@ CDialogAbout::CTabLog::CTabLog(HWND owner) : CTab(Rainmeter->GetResourceInstance
void CDialogAbout::CTabLog::Initialize()
{
// Add columns to the list view
HWND item = GetDlgItem(m_Window, IDC_ABOUTLOG_ITEMS_LISTVIEW);
HWND item = GetDlgItem(m_Window, Id_ItemsListView);
ListView_SetExtendedListViewStyleEx(item, 0, LVS_EX_LABELTIP | LVS_EX_FULLROWSELECT | LVS_EX_DOUBLEBUFFER);
// Set folder/.ini icons for tree list
@ -403,16 +415,16 @@ void CDialogAbout::CTabLog::Initialize()
AddItem((*iter).level, (*iter).timestamp.c_str(), (*iter).message.c_str());
}
item = GetDlgItem(m_Window, IDC_ABOUTLOG_ERROR_CHECKBOX);
item = GetDlgItem(m_Window, Id_ErrorCheckBox);
Button_SetCheck(item, BST_CHECKED);
item = GetDlgItem(m_Window, IDC_ABOUTLOG_WARNING_CHECKBOX);
item = GetDlgItem(m_Window, Id_WarningCheckBox);
Button_SetCheck(item, BST_CHECKED);
item = GetDlgItem(m_Window, IDC_ABOUTLOG_NOTICE_CHECKBOX);
item = GetDlgItem(m_Window, Id_NoticeCheckBox);
Button_SetCheck(item, BST_CHECKED);
item = GetDlgItem(m_Window, IDC_ABOUTLOG_DEBUG_CHECKBOX);
item = GetDlgItem(m_Window, Id_DebugCheckBox);
Button_SetCheck(item, BST_CHECKED);
m_Initialized = true;
@ -427,21 +439,21 @@ void CDialogAbout::CTabLog::Resize(int w, int h)
SetWindowPos(m_Window, NULL, 0, 0, w, h, SWP_NOMOVE | SWP_NOZORDER);
RECT r;
HWND item = GetDlgItem(m_Window, IDC_ABOUTLOG_ERROR_CHECKBOX);
HWND item = GetDlgItem(m_Window, Id_ErrorCheckBox);
GetClientRect(item, &r);
SetWindowPos(item, NULL, 0, h - r.bottom, 0, 0, SWP_NOSIZE | SWP_NOZORDER);
item = GetDlgItem(m_Window, IDC_ABOUTLOG_WARNING_CHECKBOX);
item = GetDlgItem(m_Window, Id_WarningCheckBox);
SetWindowPos(item, NULL, r.right, h - r.bottom, 0, 0, SWP_NOSIZE | SWP_NOZORDER);
item = GetDlgItem(m_Window, IDC_ABOUTLOG_NOTICE_CHECKBOX);
item = GetDlgItem(m_Window, Id_NoticeCheckBox);
SetWindowPos(item, NULL, r.right * 2, h - r.bottom, 0, 0, SWP_NOSIZE | SWP_NOZORDER);
item = GetDlgItem(m_Window, IDC_ABOUTLOG_DEBUG_CHECKBOX);
item = GetDlgItem(m_Window, Id_DebugCheckBox);
SetWindowPos(item, NULL, r.right * 3, h - r.bottom, 0, 0, SWP_NOSIZE | SWP_NOZORDER);
item = GetDlgItem(m_Window, IDC_ABOUTLOG_ITEMS_LISTVIEW);
item = GetDlgItem(m_Window, Id_ItemsListView);
SetWindowPos(item, NULL, 0, 0, w, h - r.bottom - 7, SWP_NOMOVE | SWP_NOZORDER);
// Adjust third colum
@ -469,31 +481,31 @@ void CDialogAbout::CTabLog::AddItem(int level, LPCWSTR time, LPCWSTR message)
{
case LOG_ERROR:
if (!m_Error) return;
item = GetDlgItem(m_Window, IDC_ABOUTLOG_ERROR_CHECKBOX);
item = GetDlgItem(m_Window, Id_ErrorCheckBox);
vitem.iImage = 0;
break;
case LOG_WARNING:
if (!m_Warning) return;
item = GetDlgItem(m_Window, IDC_ABOUTLOG_WARNING_CHECKBOX);
item = GetDlgItem(m_Window, Id_WarningCheckBox);
vitem.iImage = 1;
break;
case LOG_NOTICE:
if (!m_Notice) return;
item = GetDlgItem(m_Window, IDC_ABOUTLOG_NOTICE_CHECKBOX);
item = GetDlgItem(m_Window, Id_NoticeCheckBox);
vitem.iImage = 2;
break;
case LOG_DEBUG:
if (!m_Debug) return;
item = GetDlgItem(m_Window, IDC_ABOUTLOG_DEBUG_CHECKBOX);
item = GetDlgItem(m_Window, Id_DebugCheckBox);
vitem.iImage = I_IMAGENONE;
break;
}
GetWindowText(item, buffer, 32);
item = GetDlgItem(m_Window, IDC_ABOUTLOG_ITEMS_LISTVIEW);
item = GetDlgItem(m_Window, Id_ItemsListView);
ListView_InsertItem(item, &vitem);
ListView_SetItemText(item, vitem.iItem, 1, (WCHAR*)time);
ListView_SetItemText(item, vitem.iItem, 2, (WCHAR*)message);
@ -503,16 +515,15 @@ void CDialogAbout::CTabLog::AddItem(int level, LPCWSTR time, LPCWSTR message)
}
}
/*
** Dialog procedure for the log dialog.
**
*/
INT_PTR CALLBACK CDialogAbout::CTabLog::DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
INT_PTR CDialogAbout::CTabLog::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg)
{
case WM_COMMAND:
return c_Dialog->m_TabLog.OnCommand(wParam, lParam);
return OnCommand(wParam, lParam);
case WM_NOTIFY:
return OnNotify(wParam, lParam);
}
return FALSE;
@ -522,50 +533,34 @@ INT_PTR CDialogAbout::CTabLog::OnCommand(WPARAM wParam, LPARAM lParam)
{
switch (LOWORD(wParam))
{
case IDC_ABOUTLOG_ERROR_CHECKBOX:
case Id_ErrorCheckBox:
if (HIWORD(wParam) == BN_CLICKED)
{
m_Error = !m_Error;
}
break;
case IDC_ABOUTLOG_WARNING_CHECKBOX:
case Id_WarningCheckBox:
if (HIWORD(wParam) == BN_CLICKED)
{
m_Warning = !m_Warning;
}
break;
case IDC_ABOUTLOG_NOTICE_CHECKBOX:
case Id_NoticeCheckBox:
if (HIWORD(wParam) == BN_CLICKED)
{
m_Notice = !m_Notice;
}
break;
case IDC_ABOUTLOG_DEBUG_CHECKBOX:
case Id_DebugCheckBox:
if (HIWORD(wParam) == BN_CLICKED)
{
m_Debug = !m_Debug;
}
break;
case IDM_COPY:
{
HWND item = GetFocus();
if (item == GetDlgItem(m_Window, IDC_ABOUTLOG_ITEMS_LISTVIEW))
{
int sel = ListView_GetNextItem(item, -1, LVNI_FOCUSED | LVNI_SELECTED);
if (sel != -1)
{
std::wstring tmpSz(512, L'0');
ListView_GetItemText(item, sel, 2, &tmpSz[0], 512);
CSystem::SetClipboardText(tmpSz);
}
}
}
break;
default:
return 1;
}
@ -573,6 +568,35 @@ INT_PTR CDialogAbout::CTabLog::OnCommand(WPARAM wParam, LPARAM lParam)
return 0;
}
INT_PTR CDialogAbout::CTabLog::OnNotify(WPARAM wParam, LPARAM lParam)
{
LPNMHDR nm = (LPNMHDR)lParam;
switch (nm->code)
{
case LVN_KEYDOWN:
{
NMLVKEYDOWN* lvkd = (NMLVKEYDOWN*)nm;
if (lvkd->wVKey == 0x43 && // C key.
IsCtrlKeyDown())
{
int sel = ListView_GetNextItem(nm->hwndFrom, -1, LVNI_FOCUSED | LVNI_SELECTED);
if (sel != -1)
{
std::wstring tmpSz(512, L'0');
ListView_GetItemText(nm->hwndFrom, sel, 2, &tmpSz[0], 512);
CSystem::SetClipboardText(tmpSz);
}
}
}
break;
default:
return FALSE;
}
return TRUE;
}
// -----------------------------------------------------------------------------------------------
//
// Measures tab
@ -583,19 +607,32 @@ INT_PTR CDialogAbout::CTabLog::OnCommand(WPARAM wParam, LPARAM lParam)
** Constructor.
**
*/
CDialogAbout::CTabSkins::CTabSkins(HWND owner) : CTab(Rainmeter->GetResourceInstance(), owner, IDD_ABOUTSKINS_DIALOG, DlgProc),
CDialogAbout::CTabSkins::CTabSkins() : CTab(),
m_SkinWindow()
{
}
/*
** Called when tab is displayed.
**
*/
void CDialogAbout::CTabSkins::Create(HWND owner)
{
CTab::CreateTabWindow(9, 24, 370, 148, owner);
static const ControlTemplate::Control s_Controls[] =
{
CT_LISTBOX(Id_SkinsListBox, 0,
0, 0, 120, 148,
WS_VISIBLE | WS_TABSTOP | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL, WS_EX_CLIENTEDGE),
CT_LISTVIEW(Id_ItemsListView, 0,
125, 0, 242, 148,
WS_VISIBLE | WS_TABSTOP | WS_BORDER | LVS_REPORT | LVS_SINGLESEL | LVS_NOSORTHEADER, 0)
};
CreateControls(s_Controls, _countof(s_Controls), c_Dialog->m_Font, GetString);
}
void CDialogAbout::CTabSkins::Initialize()
{
// Add columns to the list view
HWND item = GetDlgItem(m_Window, IDC_ABOUTSKINS_ITEMS_LISTVIEW);
HWND item = GetDlgItem(m_Window, Id_ItemsListView);
ListView_SetExtendedListViewStyleEx(item, 0, LVS_EX_LABELTIP | LVS_EX_FULLROWSELECT | LVS_EX_DOUBLEBUFFER);
LVGROUP lvg;
@ -640,11 +677,11 @@ void CDialogAbout::CTabSkins::Resize(int w, int h)
{
SetWindowPos(m_Window, NULL, 0, 0, w, h, SWP_NOMOVE | SWP_NOZORDER);
HWND item = GetDlgItem(m_Window, IDC_ABOUTSKINS_ITEMS_LISTBOX);
HWND item = GetDlgItem(m_Window, Id_SkinsListBox);
int wList = (w < 650) ? (w - 373) : 277;
SetWindowPos(item, NULL, 0, 0, wList, h, SWP_NOMOVE | SWP_NOZORDER);
item = GetDlgItem(m_Window, IDC_ABOUTSKINS_ITEMS_LISTVIEW);
item = GetDlgItem(m_Window, Id_ItemsListView);
SetWindowPos(item, NULL, (w < 650) ? (w - 365) : 285, 0, w - wList - 10, h, SWP_NOZORDER);
// Adjust third column
@ -661,7 +698,7 @@ void CDialogAbout::CTabSkins::Resize(int w, int h)
void CDialogAbout::CTabSkins::UpdateSkinList()
{
// Delete all entries
HWND item = GetDlgItem(m_Window, IDC_ABOUTSKINS_ITEMS_LISTBOX);
HWND item = GetDlgItem(m_Window, Id_SkinsListBox);
ListBox_ResetContent(item);
// Add entries for each skin
@ -695,7 +732,7 @@ void CDialogAbout::CTabSkins::UpdateSkinList()
if (windows.empty())
{
m_SkinWindow = NULL;
item = GetDlgItem(m_Window, IDC_ABOUTSKINS_ITEMS_LISTVIEW);
item = GetDlgItem(m_Window, Id_ItemsListView);
ListView_DeleteAllItems(item);
}
else
@ -717,7 +754,7 @@ void CDialogAbout::CTabSkins::UpdateMeasureList(CMeterWindow* meterWindow)
if (!meterWindow)
{
// Find selected skin
HWND item = GetDlgItem(m_Window, IDC_ABOUTSKINS_ITEMS_LISTBOX);
HWND item = GetDlgItem(m_Window, Id_SkinsListBox);
int selected = (int)SendMessage(item, LB_GETCURSEL, NULL, NULL);
const std::map<std::wstring, CMeterWindow*>& windows = Rainmeter->GetAllMeterWindows();
@ -736,7 +773,7 @@ void CDialogAbout::CTabSkins::UpdateMeasureList(CMeterWindow* meterWindow)
return;
}
HWND item = GetDlgItem(m_Window, IDC_ABOUTSKINS_ITEMS_LISTVIEW);
HWND item = GetDlgItem(m_Window, Id_ItemsListView);
SendMessage(item, WM_SETREDRAW, FALSE, 0);
int count = ListView_GetItemCount(item);
@ -836,16 +873,15 @@ int CALLBACK CDialogAbout::CTabSkins::ListSortProc(LPARAM lParam1, LPARAM lParam
return wcscmp((const WCHAR*)lParam1, (const WCHAR*)lParam2);
}
/*
** Dialog procedure for the measures dialog.
**
*/
INT_PTR CALLBACK CDialogAbout::CTabSkins::DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
INT_PTR CDialogAbout::CTabSkins::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg)
{
case WM_COMMAND:
return c_Dialog->m_TabSkins.OnCommand(wParam, lParam);
return OnCommand(wParam, lParam);
case WM_NOTIFY:
return OnNotify(wParam, lParam);
}
return FALSE;
@ -855,7 +891,7 @@ INT_PTR CDialogAbout::CTabSkins::OnCommand(WPARAM wParam, LPARAM lParam)
{
switch (LOWORD(wParam))
{
case IDC_ABOUTSKINS_ITEMS_LISTBOX:
case Id_SkinsListBox:
if (HIWORD(wParam) == LBN_SELCHANGE)
{
UpdateMeasureList(NULL);
@ -865,7 +901,7 @@ INT_PTR CDialogAbout::CTabSkins::OnCommand(WPARAM wParam, LPARAM lParam)
case IDM_COPY:
{
HWND item = GetFocus();
if (item == GetDlgItem(m_Window, IDC_ABOUTSKINS_ITEMS_LISTVIEW))
if (item == GetDlgItem(m_Window, Id_ItemsListView))
{
int sel = ListView_GetNextItem(item, -1, LVNI_FOCUSED | LVNI_SELECTED);
if (sel != -1)
@ -885,28 +921,62 @@ INT_PTR CDialogAbout::CTabSkins::OnCommand(WPARAM wParam, LPARAM lParam)
return 0;
}
INT_PTR CDialogAbout::CTabSkins::OnNotify(WPARAM wParam, LPARAM lParam)
{
LPNMHDR nm = (LPNMHDR)lParam;
switch (nm->code)
{
case LVN_KEYDOWN:
{
NMLVKEYDOWN* lvkd = (NMLVKEYDOWN*)nm;
if (lvkd->wVKey == 0x43 && IsCtrlKeyDown()) // CTRL + C.
{
int sel = ListView_GetNextItem(nm->hwndFrom, -1, LVNI_FOCUSED | LVNI_SELECTED);
if (sel != -1)
{
std::wstring tmpSz(512, L'0');
ListView_GetItemText(nm->hwndFrom, sel, 2, &tmpSz[0], 512);
CSystem::SetClipboardText(tmpSz);
}
}
}
break;
default:
return FALSE;
}
return TRUE;
}
// -----------------------------------------------------------------------------------------------
//
// Plugins tab
//
// -----------------------------------------------------------------------------------------------
/*
** Constructor.
**
*/
CDialogAbout::CTabPlugins::CTabPlugins(HWND owner) : CTab(Rainmeter->GetResourceInstance(), owner, IDD_ABOUTPLUGINS_DIALOG, DlgProc)
CDialogAbout::CTabPlugins::CTabPlugins() : CTab()
{
}
/*
** Called when tab is displayed.
**
*/
void CDialogAbout::CTabPlugins::Create(HWND owner)
{
CTab::CreateTabWindow(9, 24, 370, 148, owner);
static const ControlTemplate::Control s_Controls[] =
{
CT_LISTVIEW(Id_ItemsListView, 0,
0, 0, 368, 148,
WS_VISIBLE | WS_TABSTOP | WS_BORDER | LVS_REPORT | LVS_SINGLESEL | LVS_NOSORTHEADER, 0)
};
CreateControls(s_Controls, _countof(s_Controls), c_Dialog->m_Font, GetString);
}
void CDialogAbout::CTabPlugins::Initialize()
{
// Add columns to the list view
HWND item = GetDlgItem(m_Window, IDC_ABOUTPLUGINS_ITEMS_LISTVIEW);
HWND item = GetDlgItem(m_Window, Id_ItemsListView);
LVCOLUMN lvc;
lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
@ -1053,7 +1123,7 @@ void CDialogAbout::CTabPlugins::Resize(int w, int h)
{
SetWindowPos(m_Window, NULL, 0, 0, w, h, SWP_NOMOVE | SWP_NOZORDER);
HWND item = GetDlgItem(m_Window, IDC_ABOUTPLUGINS_ITEMS_LISTVIEW);
HWND item = GetDlgItem(m_Window, Id_ItemsListView);
SetWindowPos(item, NULL, 0, 0, w, h, SWP_NOMOVE | SWP_NOZORDER);
// Adjust third colum
@ -1063,15 +1133,6 @@ void CDialogAbout::CTabPlugins::Resize(int w, int h)
ListView_SetColumn(item, 2, &lvc);
}
/*
** Dialog procedure for the Plugins tab.
**
*/
INT_PTR CALLBACK CDialogAbout::CTabPlugins::DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
return FALSE;
}
// -----------------------------------------------------------------------------------------------
//
// Version tab
@ -1082,34 +1143,68 @@ INT_PTR CALLBACK CDialogAbout::CTabPlugins::DlgProc(HWND hWnd, UINT uMsg, WPARAM
** Constructor.
**
*/
CDialogAbout::CTabVersion::CTabVersion(HWND owner) : CTab(Rainmeter->GetResourceInstance(), owner, IDD_ABOUTVERSION_DIALOG, DlgProc)
CDialogAbout::CTabVersion::CTabVersion() : CTab()
{
}
/*
** Called when tab is displayed.
**
*/
void CDialogAbout::CTabVersion::Create(HWND owner)
{
CTab::CreateTabWindow(9, 24, 370, 148, owner);
// FIXME: Temporary hack.
short buttonWidth = (short)_wtoi(GetString(ID_STR_NUM_BUTTONWIDTH));
const ControlTemplate::Control s_Controls[] =
{
CT_ICON(Id_AppIcon, 0,
0, 8, 24, 24,
WS_VISIBLE, 0),
CT_LABEL(Id_VersionLabel, 0,
28, 0, 300, 9,
WS_VISIBLE, 0),
CT_LINKLABEL(Id_HomeLink, ID_STR_GETLATESTVERSION,
28, 13, 300, 9,
WS_VISIBLE, 0),
CT_LINKLABEL(Id_LicenseLink, ID_STR_COPYRIGHTNOTICE,
28, 26, 300, 9,
WS_VISIBLE, 0),
CT_LABEL(Id_PathLabel, 0,
0, 43, 360, 9,
WS_VISIBLE | SS_ENDELLIPSIS | SS_NOPREFIX, 0),
CT_LABEL(Id_IniFileLabel, 0,
0, 56, 360, 9,
WS_VISIBLE | SS_ENDELLIPSIS | SS_NOPREFIX, 0),
CT_LABEL(Id_SkinPathLabel, 0,
0, 69, 360, 9,
WS_VISIBLE | SS_ENDELLIPSIS | SS_NOPREFIX, 0),
CT_BUTTON(Id_CopyButton, ID_STR_COPYTOCLIPBOARD,
0, 85, buttonWidth + 25, 14,
WS_VISIBLE | WS_TABSTOP, 0)
};
CreateControls(s_Controls, _countof(s_Controls), c_Dialog->m_Font, GetString);
}
void CDialogAbout::CTabVersion::Initialize()
{
HWND item = GetDlgItem(m_Window, IDC_ABOUTVERSION_RAINMETER_ICON);
HWND item = GetDlgItem(m_Window, Id_AppIcon);
HICON icon = GetIcon(IDI_RAINMETER, true);
Static_SetIcon(item, icon);
item = GetDlgItem(m_Window, IDC_ABOUTVERSION_VERSION_TEXT);
item = GetDlgItem(m_Window, Id_VersionLabel);
WCHAR tmpSz[64];
_snwprintf_s(tmpSz, _TRUNCATE, L"%s%s r%i %s (%s)", APPVERSION, revision_beta ? L" beta" : L"", revision_number, APPBITS, APPDATE);
SetWindowText(item, tmpSz);
item = GetDlgItem(m_Window, IDC_ABOUTVERSION_PATH_TEXT);
item = GetDlgItem(m_Window, Id_PathLabel);
std::wstring text = L"Path: " + Rainmeter->GetPath();
SetWindowText(item, text.c_str());
item = GetDlgItem(m_Window, IDC_ABOUTVERSION_INIFILE_TEXT);
item = GetDlgItem(m_Window, Id_IniFileLabel);
text = L"IniFile: " + Rainmeter->GetIniFile();
SetWindowText(item, text.c_str());
item = GetDlgItem(m_Window, IDC_ABOUTVERSION_SKINPATH_TEXT);
item = GetDlgItem(m_Window, Id_SkinPathLabel);
text = L"SkinPath: " + Rainmeter->GetSkinPath();
SetWindowText(item, text.c_str());
@ -1125,19 +1220,15 @@ void CDialogAbout::CTabVersion::Resize(int w, int h)
SetWindowPos(m_Window, NULL, 0, 0, w, h, SWP_NOMOVE | SWP_NOZORDER);
}
/*
** Dialog procedure for the Version tab.
**
*/
INT_PTR CALLBACK CDialogAbout::CTabVersion::DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
INT_PTR CDialogAbout::CTabVersion::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg)
{
case WM_COMMAND:
return c_Dialog->m_TabVersion.OnCommand(wParam, lParam);
return OnCommand(wParam, lParam);
case WM_NOTIFY:
return c_Dialog->m_TabVersion.OnNotify(wParam, lParam);
return OnNotify(wParam, lParam);
}
return FALSE;
@ -1147,7 +1238,7 @@ INT_PTR CDialogAbout::CTabVersion::OnCommand(WPARAM wParam, LPARAM lParam)
{
switch (LOWORD(wParam))
{
case IDC_ABOUTVERSION_COPY_BUTTON:
case Id_CopyButton:
{
WCHAR tmpSz[64];
int len = _snwprintf_s(tmpSz, _TRUNCATE, L"%s%s r%i %s (%s)", APPVERSION, revision_beta ? L" beta" : L"", revision_number, APPBITS, APPDATE);
@ -1175,7 +1266,14 @@ INT_PTR CDialogAbout::CTabVersion::OnNotify(WPARAM wParam, LPARAM lParam)
switch (nm->code)
{
case NM_CLICK:
RunFile(((PNMLINK)lParam)->item.szUrl);
if (nm->idFrom == Id_HomeLink)
{
RunFile(L"http://rainmeter.net");
}
else if (nm->idFrom == Id_HomeLink)
{
RunFile(L"http://gnu.org/licenses");
}
break;
default:

View File

@ -19,21 +19,20 @@
#ifndef __DIALOGABOUT_H__
#define __DIALOGABOUT_H__
#include "Dialog.h"
#include "../Common/Dialog.h"
class CDialogAbout : public CDialog
{
public:
CDialogAbout(HWND window);
CDialogAbout();
virtual ~CDialogAbout();
static INT_PTR CALLBACK DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
INT_PTR OnInitDialog(WPARAM wParam, LPARAM lParam);
INT_PTR OnNotify(WPARAM wParam, LPARAM lParam);
INT_PTR OnCommand(WPARAM wParam, LPARAM lParam);
static void Open(const WCHAR* name);
static void Open(int tab = 0);
static void Open(const WCHAR* name);
static void ShowAboutLog();
static void AddLogItem(int level, LPCWSTR time, LPCWSTR message);
@ -44,23 +43,35 @@ public:
static CDialogAbout* c_Dialog;
protected:
virtual HWND GetActiveWindow() { return GetActiveTab().GetWindow(); }
virtual INT_PTR HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam);
private:
// Log tab
class CTabLog : public CTab
{
public:
CTabLog(HWND owner);
enum Id
{
Id_ItemsListView = 100,
Id_ErrorCheckBox,
Id_WarningCheckBox,
Id_NoticeCheckBox,
Id_DebugCheckBox
};
CTabLog();
void Create(HWND owner);
virtual void Initialize();
virtual void Resize(int w, int h);
static INT_PTR CALLBACK DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
INT_PTR OnCommand(WPARAM wParam, LPARAM lParam);
void AddItem(int level, LPCWSTR time, LPCWSTR message);
protected:
virtual INT_PTR HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam);
INT_PTR OnCommand(WPARAM wParam, LPARAM lParam);
INT_PTR OnNotify(WPARAM wParam, LPARAM lParam);
private:
bool m_Error;
bool m_Warning;
@ -72,17 +83,26 @@ private:
class CTabSkins : public CTab
{
public:
CTabSkins(HWND owner);
enum Id
{
Id_SkinsListBox = 100,
Id_ItemsListView
};
CTabSkins();
void Create(HWND owner);
virtual void Initialize();
virtual void Resize(int w, int h);
static INT_PTR CALLBACK DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
INT_PTR OnCommand(WPARAM wParam, LPARAM lParam);
void UpdateSkinList();
void UpdateMeasureList(CMeterWindow* meterWindow);
protected:
virtual INT_PTR HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam);
INT_PTR OnCommand(WPARAM wParam, LPARAM lParam);
INT_PTR OnNotify(WPARAM wParam, LPARAM lParam);
private:
static int CALLBACK ListSortProc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);
@ -93,13 +113,17 @@ private:
class CTabPlugins : public CTab
{
public:
CTabPlugins(HWND owner);
enum Id
{
Id_ItemsListView = 100
};
CTabPlugins();
void Create(HWND owner);
virtual void Initialize();
virtual void Resize(int w, int h);
static INT_PTR CALLBACK DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
private:
typedef LPCTSTR (*GETPLUGINAUTHOR)();
typedef UINT (*GETPLUGINVERSION)();
@ -109,16 +133,36 @@ private:
class CTabVersion : public CTab
{
public:
CTabVersion(HWND owner);
enum Id
{
Id_AppIcon = 100,
Id_VersionLabel,
Id_HomeLink,
Id_LicenseLink,
Id_PathLabel,
Id_IniFileLabel,
Id_SkinPathLabel,
Id_CopyButton
};
CTabVersion();
void Create(HWND owner);
virtual void Initialize();
virtual void Resize(int w, int h);
static INT_PTR CALLBACK DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
protected:
virtual INT_PTR HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam);
INT_PTR OnNotify(WPARAM wParam, LPARAM lParam);
INT_PTR OnCommand(WPARAM wParam, LPARAM lParam);
};
enum Id
{
Id_CloseButton = IDCLOSE,
Id_Tab = 100
};
CTab& GetActiveTab();
CTabLog m_TabLog;

File diff suppressed because it is too large Load Diff

View File

@ -19,15 +19,14 @@
#ifndef __DIALOGMANAGE_H__
#define __DIALOGMANAGE_H__
#include "Dialog.h"
#include "../Common/Dialog.h"
class CDialogManage : public CDialog
{
public:
CDialogManage(HWND window);
CDialogManage();
virtual ~CDialogManage();
static INT_PTR CALLBACK DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
INT_PTR OnInitDialog(WPARAM wParam, LPARAM lParam);
INT_PTR OnNotify(WPARAM wParam, LPARAM lParam);
INT_PTR OnCommand(WPARAM wParam, LPARAM lParam);
@ -42,25 +41,56 @@ public:
static CDialogManage* c_Dialog;
protected:
virtual HWND GetActiveWindow() { return GetActiveTab().GetWindow(); }
virtual INT_PTR HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam);
private:
// Skins tab
class CTabSkins : public CTab
{
public:
CTabSkins(HWND owner);
enum Id
{
Id_ActiveSkinsButton = 100,
Id_SkinsTreeView,
Id_CreateSkinPackageButton,
Id_FileLabel,
Id_ConfigLabel,
Id_LoadButton,
Id_RefreshButton,
Id_EditButton,
Id_AuthorLabel,
Id_VersionLabel,
Id_LicenseLabel,
Id_DescriptionLabel,
Id_AddMetadataLink,
Id_XPositionEdit,
Id_YPositionEdit,
Id_ZPositionDropDownList,
Id_LoadOrderEdit,
Id_OnHoverDropDownList,
Id_TransparencyDropDownList,
Id_DisplayMonitorButton,
Id_DraggableCheckBox,
Id_ClickThroughCheckBox,
Id_KeepOnScreenCheckBox,
Id_SavePositionCheckBox,
Id_SnapToEdgesCheckBox
};
CTabSkins();
void Create(HWND owner);
virtual void Initialize();
static INT_PTR CALLBACK DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
INT_PTR OnNotify(WPARAM wParam, LPARAM lParam);
INT_PTR OnCommand(WPARAM wParam, LPARAM lParam);
void Update(CMeterWindow* meterWindow, bool deleted);
static void SelectTreeItem(HWND tree, HTREEITEM item, LPCWSTR name);
protected:
virtual INT_PTR HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam);
INT_PTR OnNotify(WPARAM wParam, LPARAM lParam);
INT_PTR OnCommand(WPARAM wParam, LPARAM lParam);
private:
void SetControls();
void DisableControls(bool clear = false);
@ -80,11 +110,26 @@ private:
class CTabLayouts : public CTab
{
public:
CTabLayouts(HWND owner);
enum Id
{
Id_List = 100,
Id_LoadButton,
Id_DeleteButton,
Id_EditButton,
Id_SaveButton,
Id_SaveEmptyThemeCheckBox,
Id_ExcludeUnusedSkinsCheckBox,
Id_IncludeWallpaperCheckBox,
Id_NameLabel
};
CTabLayouts();
void Create(HWND owner);
virtual void Initialize();
static INT_PTR CALLBACK DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
protected:
virtual INT_PTR HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam);
INT_PTR OnCommand(WPARAM wParam, LPARAM lParam);
};
@ -92,14 +137,41 @@ private:
class CTabSettings : public CTab
{
public:
CTabSettings(HWND owner);
enum Id
{
Id_CheckForUpdatesCheckBox = 100,
Id_LockSkinsCheckBox,
Id_ResetStatisticsButton,
Id_LogToFileCheckBox,
Id_VerboseLoggingCheckbox,
Id_ShowLogFileButton,
Id_DeleteLogFileButton,
Id_LanguageDropDownList,
Id_EditorEdit,
Id_EditorBrowseButton,
Id_ShowTrayIconCheckBox
};
CTabSettings();
void Create(HWND owner);
virtual void Initialize();
static INT_PTR CALLBACK DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
protected:
virtual INT_PTR HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam);
INT_PTR OnCommand(WPARAM wParam, LPARAM lParam);
};
enum Id
{
Id_CloseButton = IDCLOSE,
Id_Tab = 100,
Id_RefreshAllButton,
Id_EditSettingsButton,
Id_OpenLogButton,
Id_HelpButton
};
CTab& GetActiveTab();
CTabSkins m_TabSkins;
@ -108,4 +180,3 @@ private:
};
#endif

View File

@ -185,13 +185,12 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\Common\ControlTemplate.cpp" />
<ClCompile Include="..\Common\Dialog.cpp" />
<ClCompile Include="..\Common\MenuTemplate.cpp" />
<ClCompile Include="ConfigParser.cpp">
<PrecompiledHeader>Use</PrecompiledHeader>
</ClCompile>
<ClCompile Include="Dialog.cpp">
<PrecompiledHeader>Use</PrecompiledHeader>
</ClCompile>
<ClCompile Include="DialogAbout.cpp">
<PrecompiledHeader>Use</PrecompiledHeader>
</ClCompile>
@ -391,9 +390,10 @@
<ResourceCompile Include="Library.rc" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\Common\ControlTemplate.h" />
<ClInclude Include="..\Common\Dialog.h" />
<ClInclude Include="..\Common\MenuTemplate.h" />
<ClInclude Include="ConfigParser.h" />
<ClInclude Include="Dialog.h" />
<ClInclude Include="DialogAbout.h" />
<ClInclude Include="DisableThreadLibraryCalls.h" />
<ClInclude Include="Error.h" />

View File

@ -306,9 +306,6 @@
<ClCompile Include="pcre-8.10\pcre_xclass.c">
<Filter>pcre</Filter>
</ClCompile>
<ClCompile Include="Dialog.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="DialogAbout.cpp">
<Filter>Source Files</Filter>
</ClCompile>
@ -324,6 +321,12 @@
<ClCompile Include="Mouse.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\Common\Dialog.cpp">
<Filter>Common</Filter>
</ClCompile>
<ClCompile Include="..\Common\ControlTemplate.cpp">
<Filter>Common</Filter>
</ClCompile>
<ClCompile Include="..\Common\MenuTemplate.cpp">
<Filter>Common</Filter>
</ClCompile>
@ -533,9 +536,6 @@
<ClInclude Include="pcre-8.10\ucp.h">
<Filter>pcre</Filter>
</ClInclude>
<ClInclude Include="Dialog.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="DialogAbout.h">
<Filter>Header Files</Filter>
</ClInclude>
@ -560,6 +560,12 @@
<ClInclude Include="Section.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\Common\Dialog.h">
<Filter>Common</Filter>
</ClInclude>
<ClInclude Include="..\Common\ControlTemplate.h">
<Filter>Common</Filter>
</ClInclude>
<ClInclude Include="..\Common\MenuTemplate.h">
<Filter>Common</Filter>
</ClInclude>

View File

@ -1107,8 +1107,6 @@ int CRainmeter::MessagePump()
MSG msg;
BOOL ret;
HACCEL hAccel = LoadAccelerators(m_Instance, MAKEINTRESOURCE(IDR_DIALOG_ACCELERATORS));
// Run the standard window message loop
while ((ret = GetMessage(&msg, NULL, 0, 0)) != 0)
{
@ -1116,9 +1114,8 @@ int CRainmeter::MessagePump()
{
break;
}
else if (!CDialog::GetActiveDialogWindow() ||
!TranslateAccelerator(CDialog::GetActiveTabWindow(), hAccel, &msg) ||
!IsDialogMessage(CDialog::GetActiveDialogWindow(), &msg))
if (!CDialog::HandleMessage(msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);

View File

@ -5,192 +5,148 @@
#define IDC_STATIC -1
#define IDI_RAINMETER 100
#define IDI_TRAY 101
#define IDD_ABOUT_DIALOG 105
#define IDD_ABOUTLOG_DIALOG 106
#define IDD_ABOUTSKINS_DIALOG 107
#define IDD_ABOUTPLUGINS_DIALOG 108
#define IDD_ABOUTVERSION_DIALOG 109
#define IDD_MANAGE_DIALOG 110
#define IDD_MANAGESKINS_DIALOG 111
#define IDD_MANAGETHEMES_DIALOG 112
#define IDD_MANAGESETTINGS_DIALOG 113
#define IDR_DIALOG_ACCELERATORS 114
#define IDC_ABOUT_TAB 1000
#define IDC_ABOUT_VERSION_TEXT 1001
#define IDC_ABOUTLOG_ITEMS_LISTVIEW 1000
#define IDC_ABOUTLOG_ERROR_CHECKBOX 1001
#define IDC_ABOUTLOG_WARNING_CHECKBOX 1002
#define IDC_ABOUTLOG_NOTICE_CHECKBOX 1003
#define IDC_ABOUTLOG_DEBUG_CHECKBOX 1004
#define IDC_ABOUTSKINS_ITEMS_LISTBOX 1000
#define IDC_ABOUTSKINS_ITEMS_LISTVIEW 1001
#define IDC_ABOUTPLUGINS_ITEMS_LISTVIEW 1000
#define IDC_ABOUTVERSION_VERSION_TEXT 1000
#define IDC_ABOUTVERSION_PATH_TEXT 1001
#define IDC_ABOUTVERSION_INIFILE_TEXT 1002
#define IDC_ABOUTVERSION_SKINPATH_TEXT 1003
#define IDC_ABOUTVERSION_COPY_BUTTON 1004
#define IDC_ABOUTVERSION_RAINMETER_ICON 1005
#define IDC_MANAGE_TAB 1000
#define IDC_MANAGE_REFRESHALL_BUTTON 1001
#define IDC_MANAGE_EDITSETTINGS_BUTTON 1002
#define IDC_MANAGE_OPENLOG_BUTTON 1003
#define IDC_MANAGE_HELP_BUTTON 1004
#define IDC_MANAGESKINS_ACTIVESKINS_BUTTON 1000
#define IDC_MANAGESKINS_SKINS_TREEVIEW 1001
#define IDC_MANAGESKINS_CREATEPACKAGE_BUTTON 1002
#define IDC_MANAGESKINS_FILE_TEXT 1003
#define IDC_MANAGESKINS_CONFIG_TEXT 1004
#define IDC_MANAGESKINS_LOAD_BUTTON 4056 // IDM_MANAGESKINSMENU_LOAD
#define IDC_MANAGESKINS_REFRESH_BUTTON 4057 // IDM_MANAGESKINSMENU_REFRESH
#define IDC_MANAGESKINS_EDIT_BUTTON 4058 // IDM_MANAGESKINSMENU_EDIT
#define IDC_MANAGESKINS_AUTHOR_TEXT 1005
#define IDC_MANAGESKINS_VERSION_TEXT 1006
#define IDC_MANAGESKINS_LICENSE_TEXT 1007
#define IDC_MANAGESKINS_DESCRIPTION_TEXT 1008
#define IDC_MANAGESKINS_ADDMETADATA_LINK 1009
#define IDC_MANAGESKINS_X_TEXT 1010
#define IDC_MANAGESKINS_Y_TEXT 1011
#define IDC_MANAGESKINS_ZPOSITION_COMBOBOX 1012
#define IDC_MANAGESKINS_LOADORDER_TEXT 1013
#define IDC_MANAGESKINS_ONHOVER_COMBOBOX 1014
#define IDC_MANAGESKINS_TRANSPARENCY_COMBOBOX 1015
#define IDC_MANAGESKINS_DISPLAYMONITOR_BUTTON 1016
#define IDC_MANAGESKINS_DRAGGABLE_CHECKBOX 1017
#define IDC_MANAGESKINS_CLICKTHROUGH_CHECKBOX 1018
#define IDC_MANAGESKINS_KEEPONSCREEN_CHECKBOX 1019
#define IDC_MANAGESKINS_SAVEPOSITION_CHECKBOX 1020
#define IDC_MANAGESKINS_SNAPTOEDGES_CHECKBOX 1021
#define IDC_MANAGETHEMES_LIST 1000
#define IDC_MANAGETHEMES_LOAD_BUTTON 1001
#define IDC_MANAGETHEMES_DELETE_BUTTON 1002
#define IDC_MANAGETHEMES_EDIT_BUTTON 1003
#define IDC_MANAGETHEMES_SAVE_BUTTON 1004
#define IDC_MANAGETHEMES_EMPTYTHEME_CHECKBOX 1005
#define IDC_MANAGETHEMES_UNUSEDSKINS_CHECKBOX 1006
#define IDC_MANAGETHEMES_WALLPAPER_CHECKBOX 1007
#define IDC_MANAGETHEMES_NAME_TEXT 1008
#define IDC_MANAGETHEMES_BACKUP_BUTTON 1009
#define IDC_MANAGESETTINGS_CHECKUPDATES_CHECKBOX 1000
#define IDC_MANAGESETTINGS_LOCKSKINS_CHECKBOX 1001
#define IDC_MANAGESETTINGS_RESETSTATISTICS_BUTTON 1002
#define IDC_MANAGESETTINGS_LOGTOFILE_CHECKBOX 1003
#define IDC_MANAGESETTINGS_VERBOSELOGGING_CHECKBOX 1004
#define IDC_MANAGESETTINGS_SHOWLOGFILE_BUTTON 1005
#define IDC_MANAGESETTINGS_DELETELOGFILE_BUTTON 1006
#define IDC_MANAGESETTINGS_LANGUAGE_COMBOBOX 1007
#define IDC_MANAGESETTINGS_CONFIGEDITOR_TEXT 1008
#define IDC_MANAGESETTINGS_CONFIGEDITOR_BUTTON 1009
#define IDC_MANAGESETTINGS_TRAYICON_CHECKBOX 1010
#define ID_STR_NUM_BUTTONWIDTH 1998
#define ID_STR_NUM_LABELWIDTH 1999
#define ID_STR_ISRTL 2000
#define ID_STR_UPDATEAVAILABLE 2001
#define ID_STR_LOG 2002
#define ID_STR_MEASURES 2003
#define ID_STR_PLUGINS 2004
#define ID_STR_VERSION 2005
#define ID_STR_TYPE 2006
#define ID_STR_TIME 2007
#define ID_STR_MESSAGE 2008
#define ID_STR_NAME 2009
#define ID_STR_RANGE 2010
#define ID_STR_VALUE 2011
#define ID_STR_AUTHOR 2012
#define ID_STR_MANAGERAINMETER 2013
#define ID_STR_SKINS 2014
#define ID_STR_THEMES 2015
#define ID_STR_SETTINGS 2016
#define ID_STR_ACTIVESKINS 2017
#define ID_STR_DISPLAYMONITOR 2018
#define ID_STR_STAYTOPMOST 2019
#define ID_STR_TOPMOST 2020
#define ID_STR_NORMAL 2021
#define ID_STR_BOTTOM 2022
#define ID_STR_ONDESKTOP 2023
#define ID_STR_DONOTHING 2024
#define ID_STR_HIDE 2025
#define ID_STR_FADEIN 2026
#define ID_STR_FADEOUT 2027
#define ID_STR_LOAD 2028
#define ID_STR_UNLOAD 2029
#define ID_STR_COLLAPSE 2030
#define ID_STR_SETTINGSNOTWRITABLE 2031
#define ID_STR_SETTINGSMOVEFILE 2032
#define ID_STR_SETTINGSREADONLY 2033
#define ID_STR_THEMEALREADYEXISTS 2034
#define ID_STR_THEMESAVEFAIL 2035
#define ID_STR_THEMEDELETE 2036
#define ID_STR_VARIABLES 2037
#define ID_STR_LOGFILECREATEFAIL 2038
#define ID_STR_LOGFILEDELETE 2039
#define ID_STR_NOAVAILABLESKINS 2040
#define ID_STR_UNABLETOACTIVATESKIN 2041
#define ID_STR_UNABLETOREFRESHSKIN 2042
#define ID_STR_NEWVERSIONREQUIRED 2043
#define ID_STR_NOMETERSINSKIN 2044
#define ID_STR_INCLUDEINFINITELOOP 2045
#define ID_STR_ABOUTRAINMETER 2046
#define ID_STR_WELCOME 2047
#define ID_STR_CLICKTOMANAGE 2048
#define ID_STR_CLICKTODOWNLOAD 2049
#define ID_STR_VARIANTS 2050
#define ID_STR_POSITION 2051
#define ID_STR_USEDEFAULTMONITOR 2052
#define ID_STR_VIRTUALSCREEN 2053
#define ID_STR_AUTOSELECTMONITOR 2054
#define ID_STR_FROMRIGHT 2055
#define ID_STR_FROMBOTTOM 2056
#define ID_STR_XASPERCENTAGE 2057
#define ID_STR_YASPERCENTAGE 2058
#define ID_STR_TRANSPARENCY 2059
#define ID_STR_HIDEONMOUSEOVER 2060
#define ID_STR_DRAGGABLE 2061
#define ID_STR_SAVEPOSITION 2062
#define ID_STR_SNAPTOEDGES 2063
#define ID_STR_CLICKTHROUGH 2064
#define ID_STR_KEEPONSCREEN 2065
#define ID_STR_MANAGESKIN 2066
#define ID_STR_EDITSKIN 2067
#define ID_STR_REFRESHSKIN 2068
#define ID_STR_UNLOADSKIN 2069
#define ID_STR_REFRESH 2070
#define ID_STR_EDIT 2071
#define ID_STR_EXPAND 2072
#define ID_STR_OPENFOLDER 2073
#define ID_STR_DISABLEDRAGGING 2074
#define ID_STR_0PERCENT 2075
#define ID_STR_10PERCENT 2076
#define ID_STR_20PERCENT 2077
#define ID_STR_30PERCENT 2078
#define ID_STR_40PERCENT 2079
#define ID_STR_50PERCENT 2080
#define ID_STR_60PERCENT 2081
#define ID_STR_70PERCENT 2082
#define ID_STR_80PERCENT 2083
#define ID_STR_90PERCENT 2084
#define ID_STR_MANAGE 2085
#define ID_STR_ABOUT 2086
#define ID_STR_HELP 2087
#define ID_STR_NOSKINS 2088
#define ID_STR_NOTHEMES 2089
#define ID_STR_EDITSETTINGS 2090
#define ID_STR_REFRESHALL 2091
#define ID_STR_LOGGING 2092
#define ID_STR_SHOWLOGFILE 2093
#define ID_STR_STARTLOGGING 2094
#define ID_STR_STOPLOGGING 2095
#define ID_STR_DELETELOGFILE 2096
#define ID_STR_DEBUGMODE 2097
#define ID_STR_EXIT 2098
#define ID_STR_MANAGE 2002
#define ID_STR_ABOUT 2003
#define ID_STR_HELP 2004
#define ID_STR_SKINS 2005
#define ID_STR_NOSKINS 2006
#define ID_STR_OPENFOLDER 2007
#define ID_STR_DISABLEDRAGGING 2008
#define ID_STR_THEMES 2009
#define ID_STR_NOTHEMES 2010
#define ID_STR_EDITSETTINGS 2011
#define ID_STR_REFRESHALL 2012
#define ID_STR_LOGGING 2013
#define ID_STR_SHOWLOGFILE 2014
#define ID_STR_STARTLOGGING 2015
#define ID_STR_STOPLOGGING 2016
#define ID_STR_DELETELOGFILE 2017
#define ID_STR_DEBUGMODE 2018
#define ID_STR_EXIT 2019
#define ID_STR_VARIANTS 2020
#define ID_STR_SETTINGS 2021
#define ID_STR_POSITION 2022
#define ID_STR_DISPLAYMONITOR 2023
#define ID_STR_USEDEFAULTMONITOR 2024
#define ID_STR_VIRTUALSCREEN 2025
#define ID_STR_AUTOSELECTMONITOR 2026
#define ID_STR_STAYTOPMOST 2027
#define ID_STR_TOPMOST 2028
#define ID_STR_NORMAL 2029
#define ID_STR_BOTTOM 2030
#define ID_STR_ONDESKTOP 2031
#define ID_STR_FROMRIGHT 2032
#define ID_STR_FROMBOTTOM 2033
#define ID_STR_XASPERCENTAGE 2034
#define ID_STR_YASPERCENTAGE 2035
#define ID_STR_TRANSPARENCY 2036
#define ID_STR_0PERCENT 2037
#define ID_STR_10PERCENT 2038
#define ID_STR_20PERCENT 2039
#define ID_STR_30PERCENT 2040
#define ID_STR_40PERCENT 2041
#define ID_STR_50PERCENT 2042
#define ID_STR_60PERCENT 2043
#define ID_STR_70PERCENT 2044
#define ID_STR_80PERCENT 2045
#define ID_STR_90PERCENT 2046
#define ID_STR_FADEIN 2047
#define ID_STR_FADEOUT 2048
#define ID_STR_HIDEONMOUSEOVER 2049
#define ID_STR_DRAGGABLE 2050
#define ID_STR_SAVEPOSITION 2051
#define ID_STR_SNAPTOEDGES 2052
#define ID_STR_CLICKTHROUGH 2053
#define ID_STR_KEEPONSCREEN 2054
#define ID_STR_MANAGESKIN 2055
#define ID_STR_EDITSKIN 2056
#define ID_STR_REFRESHSKIN 2057
#define ID_STR_UNLOADSKIN 2058
#define ID_STR_CLOSE 2059
#define ID_STR_ABOUTRAINMETER 2060
#define ID_STR_LOG 2061
#define ID_STR_MEASURES 2062
#define ID_STR_VARIABLES 2063
#define ID_STR_PLUGINS 2064
#define ID_STR_VERSION 2065
#define ID_STR_TYPE 2066
#define ID_STR_TIME 2067
#define ID_STR_MESSAGE 2068
#define ID_STR_NAME 2069
#define ID_STR_RANGE 2070
#define ID_STR_VALUE 2071
#define ID_STR_AUTHOR 2072
#define ID_STR_ERROR 2073
#define ID_STR_WARNING 2074
#define ID_STR_NOTICE 2075
#define ID_STR_DEBUG 2076
#define ID_STR_GETLATESTVERSION 2077
#define ID_STR_COPYRIGHTNOTICE 2078
#define ID_STR_COPYTOCLIPBOARD 2079
#define ID_STR_MANAGERAINMETER 2080
#define ID_STR_ACTIVESKINS 2081
#define ID_STR_EXPAND 2082
#define ID_STR_COLLAPSE 2083
#define ID_STR_OPENLOG 2084
#define ID_STR_LOAD 2085
#define ID_STR_UNLOAD 2086
#define ID_STR_REFRESH 2087
#define ID_STR_EDIT 2088
#define ID_STR_AUTHORSC 2089
#define ID_STR_VERSIONSC 2090
#define ID_STR_LICENSESC 2091
#define ID_STR_INFORMATIONSC 2092
#define ID_STR_ADDMETADATA 2093
#define ID_STR_COORDINATESSC 2094
#define ID_STR_POSITIONSC 2095
#define ID_STR_LOADORDERSC 2096
#define ID_STR_TRANSPARENCYSC 2097
#define ID_STR_ONHOVERSC 2098
#define ID_STR_DONOTHING 2099
#define ID_STR_HIDE 2100
#define ID_STR_SAVENEWTHEME 2101
#define ID_STR_THEMEDESCRIPTION 2102
#define ID_STR_SAVEASEMPTYTHEME 2103
#define ID_STR_EXCLUDEUNUSEDSKINS 2104
#define ID_STR_INCLUDEWALLPAPER 2105
#define ID_STR_NAMESC 2106
#define ID_STR_SAVE 2107
#define ID_STR_SAVEDTHEMES 2108
#define ID_STR_DELETE 2109
#define ID_STR_BACKUP 2110
#define ID_STR_BACKUPDESCRIPTION 2111
#define ID_STR_BACKUPE 2112
#define ID_STR_LANGUAGESC 2113
#define ID_STR_GENERAL 2114
#define ID_STR_CHECKFORUPDATES 2115
#define ID_STR_RESETSTATISTICS 2116
#define ID_STR_LOGTOFILE 2117
#define ID_STR_SETTINGSNOTWRITABLE 2118
#define ID_STR_SETTINGSMOVEFILE 2119
#define ID_STR_SETTINGSREADONLY 2120
#define ID_STR_THEMEALREADYEXISTS 2121
#define ID_STR_THEMESAVEFAIL 2122
#define ID_STR_THEMEDELETE 2123
#define ID_STR_LOGFILECREATEFAIL 2124
#define ID_STR_LOGFILEDELETE 2125
#define ID_STR_NOAVAILABLESKINS 2126
#define ID_STR_UNABLETOACTIVATESKIN 2127
#define ID_STR_UNABLETOREFRESHSKIN 2128
#define ID_STR_NEWVERSIONREQUIRED 2129
#define ID_STR_NOMETERSINSKIN 2130
#define ID_STR_INCLUDEINFINITELOOP 2131
#define ID_STR_WELCOME 2132
#define ID_STR_CLICKTOMANAGE 2133
#define ID_STR_CLICKTODOWNLOAD 2134
#define ID_STR_CREATERMSKINPACKAGE 2135
#define ID_STR_EDITORSC 2136
#define ID_STR_ELLIPSIS 2137
#define ID_STR_SHOWNOTIFICATIONAREAICON 2138
#define IDM_REFRESH 4001
#define IDM_QUIT 4002