From 3d6132811f01d1c31b3b8e648601853e02c1630e Mon Sep 17 00:00:00 2001 From: Birunthan Mohanathas Date: Thu, 13 Dec 2012 11:12:25 +0200 Subject: [PATCH] Replaced dialog resources with control template Also fixed tabbing in dialogs. --- Common/ControlTemplate.cpp | 49 +++ Common/ControlTemplate.h | 89 ++++ Common/Dialog.cpp | 254 +++++++++++ Common/Dialog.h | 94 ++++ Language/Resource.rc | 376 ++++++---------- Library/DialogAbout.cpp | 538 +++++++++++++---------- Library/DialogAbout.h | 80 +++- Library/DialogManage.cpp | 729 +++++++++++++++++++++----------- Library/DialogManage.h | 99 ++++- Library/Library.vcxproj | 8 +- Library/Library.vcxproj.filters | 18 +- Library/Rainmeter.cpp | 7 +- Library/resource.h | 322 ++++++-------- 13 files changed, 1712 insertions(+), 951 deletions(-) create mode 100644 Common/ControlTemplate.cpp create mode 100644 Common/ControlTemplate.h create mode 100644 Common/Dialog.cpp create mode 100644 Common/Dialog.h diff --git a/Common/ControlTemplate.cpp b/Common/ControlTemplate.cpp new file mode 100644 index 00000000..b55c098c --- /dev/null +++ b/Common/ControlTemplate.cpp @@ -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 \ No newline at end of file diff --git a/Common/ControlTemplate.h b/Common/ControlTemplate.h new file mode 100644 index 00000000..f9c192cb --- /dev/null +++ b/Common/ControlTemplate.h @@ -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 + +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 \ No newline at end of file diff --git a/Common/Dialog.cpp b/Common/Dialog.cpp new file mode 100644 index 00000000..5809f217 --- /dev/null +++ b/Common/Dialog.cpp @@ -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 +#include + +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); +} diff --git a/Common/Dialog.h b/Common/Dialog.h new file mode 100644 index 00000000..5b574384 --- /dev/null +++ b/Common/Dialog.h @@ -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 +#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 diff --git a/Language/Resource.rc b/Language/Resource.rc index 77e33d7c..4fb40335 100644 --- a/Language/Resource.rc +++ b/Language/Resource.rc @@ -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 -} \ No newline at end of file + 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" +} diff --git a/Library/DialogAbout.cpp b/Library/DialogAbout.cpp index 0e173a4f..f90518e2 100644 --- a/Library/DialogAbout.cpp +++ b/Library/DialogAbout.cpp @@ -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& 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: diff --git a/Library/DialogAbout.h b/Library/DialogAbout.h index c44fe8e0..95e23eef 100644 --- a/Library/DialogAbout.h +++ b/Library/DialogAbout.h @@ -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; diff --git a/Library/DialogManage.cpp b/Library/DialogManage.cpp index 9e070db1..db30e62e 100644 --- a/Library/DialogManage.cpp +++ b/Library/DialogManage.cpp @@ -29,8 +29,6 @@ #include "../Version.h" #include -#define WM_DELAYED_CLOSE WM_APP + 0 - extern CRainmeter* Rainmeter; WINDOWPLACEMENT CDialogManage::c_WindowPlacement = {0}; @@ -40,10 +38,7 @@ CDialogManage* CDialogManage::c_Dialog = NULL; ** Constructor. ** */ -CDialogManage::CDialogManage(HWND wnd) : CDialog(wnd), - m_TabSkins(wnd), - m_TabLayouts(wnd), - m_TabSettings(wnd) +CDialogManage::CDialogManage() : CDialog() { } @@ -87,25 +82,21 @@ void CDialogManage::Open(int tab) { if (!c_Dialog) { - HINSTANCE instance = Rainmeter->GetResourceInstance(); - HWND owner = Rainmeter->GetWindow(); - if (!CreateDialog(instance, MAKEINTRESOURCE(IDD_MANAGE_DIALOG), owner, DlgProc)) return; - } - else - { - if (!IsZoomed(c_Dialog->m_Window)) - { - ShowWindow(c_Dialog->m_Window, SW_SHOWNORMAL); - } + c_Dialog = new CDialogManage(); } - SetForegroundWindow(c_Dialog->m_Window); + c_Dialog->ShowDialogWindow( + GetString(ID_STR_MANAGERAINMETER), + 0, 0, 500, 322, + DS_CENTER | WS_POPUP | WS_MINIMIZEBOX | 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 = IDC_MANAGE_TAB; - nm.hwndFrom = GetDlgItem(c_Dialog->m_Window, IDC_MANAGE_TAB); + nm.idFrom = Id_Tab; + nm.hwndFrom = GetDlgItem(c_Dialog->m_Window, Id_Tab); TabCtrl_SetCurSel(nm.hwndFrom, tab); c_Dialog->OnNotify(0, (LPARAM)&nm); } @@ -123,7 +114,7 @@ void CDialogManage::OpenSkin(CMeterWindow* meterWindow) std::wstring name = meterWindow->GetFolderPath() + L'\\'; name += meterWindow->GetFileName(); - HWND item = GetDlgItem(c_Dialog->m_TabSkins.GetWindow(), IDC_MANAGESKINS_SKINS_TREEVIEW); + HWND item = GetDlgItem(c_Dialog->m_TabSkins.GetWindow(), CTabSkins::Id_SkinsTreeView); c_Dialog->m_TabSkins.SelectTreeItem(item, TreeView_GetRoot(item), name.c_str()); } } @@ -142,7 +133,7 @@ void CDialogManage::UpdateSkins(CMeterWindow* meterWindow, bool deleted) CDialog::CTab& CDialogManage::GetActiveTab() { - int sel = TabCtrl_GetCurSel(GetDlgItem(m_Window, IDC_MANAGE_TAB)); + int sel = TabCtrl_GetCurSel(GetDlgItem(m_Window, Id_Tab)); if (sel == 0) { return m_TabSkins; @@ -157,51 +148,34 @@ CDialog::CTab& CDialogManage::GetActiveTab() } } -/* -** Dialog procedure for the Manage dialog. -** -*/ -INT_PTR CALLBACK CDialogManage::DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) +INT_PTR CDialogManage::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_CLOSE: { - c_Dialog = new CDialogManage(hWnd); - return c_Dialog->OnInitDialog(wParam, lParam); - } - } - else - { - switch (uMsg) - { - 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_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); + 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; @@ -209,13 +183,38 @@ INT_PTR CALLBACK CDialogManage::DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPA INT_PTR CDialogManage::OnInitDialog(WPARAM wParam, LPARAM lParam) { - HWND item = GetDlgItem(m_Window, IDCLOSE); - SendMessage(m_Window, WM_NEXTDLGCTL, (WPARAM)item, TRUE); + // FIXME: Temporary hack. + short buttonWidth = (short)_wtoi(GetString(ID_STR_NUM_BUTTONWIDTH)); - HICON hIcon = GetIcon(IDI_RAINMETER); - SendMessage(m_Window, WM_SETICON, ICON_SMALL, (LPARAM)hIcon); + const ControlTemplate::Control s_Controls[] = + { + CT_BUTTON(Id_RefreshAllButton, ID_STR_REFRESHALL, + 5, 303, buttonWidth, 14, + WS_VISIBLE | WS_TABSTOP, 0), + CT_BUTTON(Id_EditSettingsButton, ID_STR_EDITSETTINGS, + buttonWidth + 9, 303, buttonWidth, 14, + WS_VISIBLE | WS_TABSTOP, 0), + CT_BUTTON(Id_OpenLogButton, ID_STR_OPENLOG, + buttonWidth + buttonWidth + 13, 303, buttonWidth, 14, + WS_VISIBLE | WS_TABSTOP, 0), + CT_BUTTON(Id_HelpButton, ID_STR_HELP, + 389, 303, 50, 14, + WS_VISIBLE | WS_TABSTOP, 0), + CT_BUTTON(Id_CloseButton, ID_STR_CLOSE, + 444, 303, 50, 14, + WS_VISIBLE | WS_TABSTOP | BS_DEFPUSHBUTTON, 0), + CT_TAB(Id_Tab, 0, + 6, 6, 488, 293, + WS_VISIBLE | WS_TABSTOP | TCS_FIXEDWIDTH, 0) // Last for correct tab order. + }; + + CreateControls(s_Controls, _countof(s_Controls), m_Font, GetString); + + HWND item = GetDlgItem(m_Window, Id_Tab); + m_TabSkins.Create(item); + m_TabLayouts.Create(item); + m_TabSettings.Create(item); - item = GetDlgItem(m_Window, IDC_MANAGE_TAB); TCITEM tci = {0}; tci.mask = TCIF_TEXT; tci.pszText = GetString(ID_STR_SKINS); @@ -225,19 +224,22 @@ INT_PTR CDialogManage::OnInitDialog(WPARAM wParam, LPARAM lParam) tci.pszText = GetString(ID_STR_SETTINGS); TabCtrl_InsertItem(item, 2, &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); + + item = GetDlgItem(m_TabSkins.GetWindow(), CTabSkins::Id_FileLabel); + SendMessage(item, WM_SETFONT, (WPARAM)m_FontBold, 0); + if (CSystem::GetOSPlatform() >= OSPLATFORM_VISTA) { - // Use UI font (Segoe UI) on Vista+ - SetDialogFont(); - // Use arrows instead of plus/minus in the tree for Vista+ - item = GetDlgItem(m_TabSkins.GetWindow(), IDC_MANAGESKINS_SKINS_TREEVIEW); + item = GetDlgItem(m_TabSkins.GetWindow(), CTabSkins::Id_SkinsTreeView); SetWindowTheme(item, L"explorer", NULL); } - item = GetDlgItem(m_TabSkins.GetWindow(), IDC_MANAGESKINS_FILE_TEXT); - SendMessage(item, WM_SETFONT, (WPARAM)m_FontBold, 0); - if (c_WindowPlacement.length == 0) { c_WindowPlacement.length = sizeof(WINDOWPLACEMENT); @@ -253,36 +255,36 @@ INT_PTR CDialogManage::OnCommand(WPARAM wParam, LPARAM lParam) { switch (LOWORD(wParam)) { - case IDC_MANAGE_REFRESHALL_BUTTON: + case Id_RefreshAllButton: Rainmeter->RefreshAll(); break; - case IDC_MANAGE_EDITSETTINGS_BUTTON: + case Id_EditSettingsButton: Rainmeter->EditSettings(); break; - case IDC_MANAGE_OPENLOG_BUTTON: + case Id_OpenLogButton: CDialogAbout::Open(); break; - case IDCLOSE: - PostMessage(m_Window, WM_DELAYED_CLOSE, 0, 0); + case Id_CloseButton: + HandleMessage(WM_CLOSE, 0, 0); break; - case IDC_MANAGE_HELP_BUTTON: + case Id_HelpButton: { std::wstring url = L"http://docs.rainmeter.net/manual/user-interface/manage#"; - HWND hwnd = c_Dialog->GetActiveTabWindow(); - if (hwnd == m_TabSkins.GetWindow()) + CTab& tab = GetActiveTab(); + if (&tab == &m_TabSkins) { url += L"Skins"; } - else if (hwnd == m_TabLayouts.GetWindow()) + else if (&tab == &m_TabLayouts) { url += L"Layouts"; } - else // if (hwnd == m_TabSettings.GetWindow()) + else // if (&tab == &m_TabSettings) { url += L"Settings"; } @@ -304,7 +306,7 @@ INT_PTR CDialogManage::OnNotify(WPARAM wParam, LPARAM lParam) LPNMHDR nm = (LPNMHDR)lParam; switch (nm->idFrom) { - case IDC_MANAGE_TAB: + case Id_Tab: if (nm->code == TCN_SELCHANGE) { // Disable all tab windows first @@ -333,17 +335,137 @@ INT_PTR CDialogManage::OnNotify(WPARAM wParam, LPARAM lParam) ** Constructor. ** */ -CDialogManage::CTabSkins::CTabSkins(HWND owner) : CTab(Rainmeter->GetResourceInstance(), owner, IDD_MANAGESKINS_DIALOG, DlgProc), +CDialogManage::CTabSkins::CTabSkins() : CTab(), m_SkinWindow(), m_HandleCommands(false), m_IgnoreUpdate(false) { } -/* -** Called when tab is displayed. -** -*/ +void CDialogManage::CTabSkins::Create(HWND owner) +{ + CTab::CreateTabWindow(9, 24, 470, 260, owner); + + // FIXME: Temporary hack. + short labelWidth = (short)_wtoi(GetString(ID_STR_NUM_LABELWIDTH)); + + const ControlTemplate::Control s_Controls[] = + { + CT_BUTTON(Id_ActiveSkinsButton, ID_STR_ACTIVESKINS, + 0, 0, 146, 14, + WS_VISIBLE | WS_TABSTOP, 0), + CT_TREEVIEW(Id_SkinsTreeView, 0, + 0, 18, 145, 221, + WS_VISIBLE | WS_TABSTOP | TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT | TVS_SHOWSELALWAYS | WS_VSCROLL, WS_EX_CLIENTEDGE), + CT_BUTTON(Id_CreateSkinPackageButton, ID_STR_CREATERMSKINPACKAGE, + 0, 244, 146, 14, + WS_VISIBLE | WS_TABSTOP, 0), + + CT_LABEL(Id_FileLabel, ID_STR_ELLIPSIS, + 165, 0, 130, 14, + WS_VISIBLE | SS_ENDELLIPSIS | SS_NOPREFIX, 0), + CT_LABEL(Id_ConfigLabel, 0, + 165, 15, 130, 9, + WS_VISIBLE | SS_ENDELLIPSIS | SS_NOPREFIX, 0), + CT_BUTTON(Id_LoadButton, ID_STR_LOAD, + 310, 0, 50, 14, + WS_VISIBLE | WS_TABSTOP | WS_DISABLED, 0), + CT_BUTTON(Id_RefreshButton, ID_STR_REFRESH, + 364, 0, 50, 14, + WS_VISIBLE | WS_TABSTOP | WS_DISABLED, 0), + CT_BUTTON(Id_EditButton, ID_STR_EDIT, + 418, 0, 50, 14, + WS_VISIBLE | WS_TABSTOP | WS_DISABLED, 0), + + CT_LABEL(-1, ID_STR_AUTHORSC, + 165, 30, 80, 9, + WS_VISIBLE | SS_ENDELLIPSIS | SS_NOPREFIX, 0), + CT_LABEL(Id_AuthorLabel, 0, + 230, 30, 245, 9, + WS_VISIBLE | SS_ENDELLIPSIS | SS_NOPREFIX, 0), + CT_LABEL(-1, ID_STR_VERSIONSC, + 165, 43, 80, 9, + WS_VISIBLE | SS_ENDELLIPSIS | SS_NOPREFIX, 0), + CT_LABEL(Id_VersionLabel, 0, + 230, 43, 245, 9, + WS_VISIBLE | SS_ENDELLIPSIS | SS_NOPREFIX, 0), + CT_LABEL(-1, ID_STR_LICENSESC, + 165, 56, 80, 9, + WS_VISIBLE | WS_TABSTOP | SS_NOPREFIX, 0), + CT_LABEL(Id_LicenseLabel, 0, + 230, 56, 245, 9, + WS_VISIBLE | SS_ENDELLIPSIS | SS_NOPREFIX, 0), + CT_LABEL(-1, ID_STR_INFORMATIONSC, + 165, 69, 80, 9, + WS_VISIBLE | SS_ENDELLIPSIS | SS_NOPREFIX, 0), + CT_EDIT(Id_DescriptionLabel, 0, + 228, 69, 238, 64, + WS_VISIBLE | ES_MULTILINE | ES_READONLY, 0), + CT_LINKLABEL(Id_AddMetadataLink, ID_STR_ADDMETADATA, + 165, 142, 150, 9, + 0, 0), + + CT_LINEH(-1, ID_STR_COORDINATESSC, + 165, 156, 304, 1, + WS_VISIBLE, 0), + + CT_LABEL(-1, ID_STR_COORDINATESSC, + 165, 169, labelWidth, 9, + WS_VISIBLE, 0), + CT_EDIT(Id_XPositionEdit, 0, + 165 + labelWidth, 166, 38, 14, + WS_VISIBLE | WS_TABSTOP | WS_DISABLED, WS_EX_CLIENTEDGE), + CT_EDIT(Id_YPositionEdit, 0, + 165 + labelWidth + 42, 166, 38, 14, + WS_VISIBLE | WS_TABSTOP | WS_DISABLED, WS_EX_CLIENTEDGE), + CT_LABEL(-1, ID_STR_POSITIONSC, + 165, 190, labelWidth, 9, + WS_VISIBLE, 0), + CT_COMBOBOX(Id_ZPositionDropDownList, 0, + 165 + labelWidth, 187, 80, 14, + WS_VISIBLE | WS_TABSTOP | CBS_DROPDOWNLIST | WS_VSCROLL | WS_DISABLED, 0), + CT_LABEL(-1, ID_STR_LOADORDERSC, + 165, 208, labelWidth, 9, + WS_VISIBLE, 0), + CT_EDIT(Id_LoadOrderEdit, 0, + 165 + labelWidth, 205, 80, 14, + WS_VISIBLE | WS_TABSTOP | WS_DISABLED, WS_EX_CLIENTEDGE), + CT_LABEL(-1, ID_STR_TRANSPARENCYSC, + 165, 229, labelWidth, 9, + WS_VISIBLE, 0), + CT_COMBOBOX(Id_TransparencyDropDownList, 0, + 165 + labelWidth, 226, 80, 14, + WS_VISIBLE | WS_TABSTOP | CBS_DROPDOWNLIST | WS_VSCROLL | WS_DISABLED, 0), + CT_LABEL(-1, ID_STR_ONHOVERSC, + 165, 247, labelWidth, 9, + WS_VISIBLE, 0), + CT_COMBOBOX(Id_OnHoverDropDownList, 0, + 165 + labelWidth, 244, 80, 14, + WS_VISIBLE | WS_TABSTOP | CBS_DROPDOWNLIST | WS_VSCROLL | WS_DISABLED, 0), + + CT_BUTTON(Id_DisplayMonitorButton, ID_STR_DISPLAYMONITOR, + 350, 166, 118, 14, + WS_VISIBLE | WS_TABSTOP | WS_DISABLED, 0), + CT_CHECKBOX(Id_DraggableCheckBox, ID_STR_DRAGGABLE, + 350, 190, 118, 9, + WS_VISIBLE | WS_TABSTOP | WS_DISABLED, 0), + CT_CHECKBOX(Id_ClickThroughCheckBox, ID_STR_CLICKTHROUGH, + 350, 203, 118, 9, + WS_VISIBLE | WS_TABSTOP | WS_DISABLED, 0), + CT_CHECKBOX(Id_KeepOnScreenCheckBox, ID_STR_KEEPONSCREEN, + 350, 216, 118, 9, + WS_VISIBLE | WS_TABSTOP | WS_DISABLED, 0), + CT_CHECKBOX(Id_SavePositionCheckBox, ID_STR_SAVEPOSITION, + 350, 229, 118, 9, + WS_VISIBLE | WS_TABSTOP | WS_DISABLED, 0), + CT_CHECKBOX(Id_SnapToEdgesCheckBox, ID_STR_SNAPTOEDGES, + 350, 242, 118, 9, + WS_VISIBLE | WS_TABSTOP | WS_DISABLED, 0) + }; + + CreateControls(s_Controls, _countof(s_Controls), c_Dialog->m_Font, GetString); +} + void CDialogManage::CTabSkins::Initialize() { BUTTON_SPLITINFO bsi; @@ -351,10 +473,10 @@ void CDialogManage::CTabSkins::Initialize() bsi.size.cx = 20; bsi.size.cy = 14; - HWND item = GetDlgItem(m_Window, IDC_MANAGESKINS_ACTIVESKINS_BUTTON); + HWND item = GetDlgItem(m_Window, Id_ActiveSkinsButton); CDialog::SetMenuButton(item); - item = GetDlgItem(m_Window, IDC_MANAGESKINS_DISPLAYMONITOR_BUTTON); + item = GetDlgItem(m_Window, Id_DisplayMonitorButton); CDialog::SetMenuButton(item); // Load folder/.ini icons from shell32 @@ -367,16 +489,16 @@ void CDialogManage::CTabSkins::Initialize() ImageList_AddIcon(hImageList, hIcon); // Apply icons and populate tree - item = GetDlgItem(m_Window, IDC_MANAGESKINS_SKINS_TREEVIEW); + item = GetDlgItem(m_Window, Id_SkinsTreeView); TreeView_SetImageList(item, hImageList, TVSIL_NORMAL); Update(NULL, false); // Get rid of the EDITTEXT control border - item = GetDlgItem(m_Window, IDC_MANAGESKINS_DESCRIPTION_TEXT); + item = GetDlgItem(m_Window, Id_DescriptionLabel); SetWindowLongPtr(item, GWL_EXSTYLE, GetWindowLongPtr(item, GWL_EXSTYLE) &~ WS_EX_CLIENTEDGE); SetWindowPos(item, NULL, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER); - item = GetDlgItem(m_Window, IDC_MANAGESKINS_TRANSPARENCY_COMBOBOX); + item = GetDlgItem(m_Window, Id_TransparencyDropDownList); ComboBox_AddString(item, L"0%"); ComboBox_AddString(item, L"10%"); ComboBox_AddString(item, L"20%"); @@ -388,14 +510,14 @@ void CDialogManage::CTabSkins::Initialize() ComboBox_AddString(item, L"80%"); ComboBox_AddString(item, L"90%"); - item = GetDlgItem(m_Window, IDC_MANAGESKINS_ZPOSITION_COMBOBOX); + item = GetDlgItem(m_Window, Id_ZPositionDropDownList); ComboBox_AddString(item, GetString(ID_STR_ONDESKTOP)); ComboBox_AddString(item, GetString(ID_STR_BOTTOM)); ComboBox_AddString(item, GetString(ID_STR_NORMAL)); ComboBox_AddString(item, GetString(ID_STR_TOPMOST)); ComboBox_AddString(item, GetString(ID_STR_STAYTOPMOST)); - item = GetDlgItem(m_Window, IDC_MANAGESKINS_ONHOVER_COMBOBOX); + item = GetDlgItem(m_Window, Id_OnHoverDropDownList); ComboBox_AddString(item, GetString(ID_STR_DONOTHING)); ComboBox_AddString(item, GetString(ID_STR_HIDE)); ComboBox_AddString(item, GetString(ID_STR_FADEIN)); @@ -442,7 +564,7 @@ void CDialogManage::CTabSkins::Update(CMeterWindow* meterWindow, bool deleted) else { // Populate tree - HWND item = GetDlgItem(m_Window, IDC_MANAGESKINS_SKINS_TREEVIEW); + HWND item = GetDlgItem(m_Window, Id_SkinsTreeView); TreeView_DeleteAllItems(item); TVINSERTSTRUCT tvi = {0}; @@ -461,33 +583,33 @@ void CDialogManage::CTabSkins::SetControls() { WCHAR buffer[64]; - HWND item = GetDlgItem(m_Window, IDC_MANAGESKINS_EDIT_BUTTON); + HWND item = GetDlgItem(m_Window, Id_EditButton); EnableWindow(item, TRUE); - item = GetDlgItem(m_Window, IDC_MANAGESKINS_LOAD_BUTTON); + item = GetDlgItem(m_Window, Id_LoadButton); EnableWindow(item, TRUE); if (m_SkinWindow) { SetWindowText(item, GetString(ID_STR_UNLOAD)); - item = GetDlgItem(m_Window, IDC_MANAGESKINS_REFRESH_BUTTON); + item = GetDlgItem(m_Window, Id_RefreshButton); EnableWindow(item, TRUE); - item = GetDlgItem(m_Window, IDC_MANAGESKINS_X_TEXT); + item = GetDlgItem(m_Window, Id_XPositionEdit); EnableWindow(item, TRUE); _itow_s(m_SkinWindow->GetX(), buffer, 10); SetWindowText(item, buffer); - item = GetDlgItem(m_Window, IDC_MANAGESKINS_Y_TEXT); + item = GetDlgItem(m_Window, Id_YPositionEdit); EnableWindow(item, TRUE); _itow_s(m_SkinWindow->GetY(), buffer, 10); SetWindowText(item, buffer); - item = GetDlgItem(m_Window, IDC_MANAGESKINS_DISPLAYMONITOR_BUTTON); + item = GetDlgItem(m_Window, Id_DisplayMonitorButton); EnableWindow(item, TRUE); - item = GetDlgItem(m_Window, IDC_MANAGESKINS_DRAGGABLE_CHECKBOX); + item = GetDlgItem(m_Window, Id_DraggableCheckBox); if (Rainmeter->GetDisableDragging()) { EnableWindow(item, FALSE); @@ -499,39 +621,39 @@ void CDialogManage::CTabSkins::SetControls() Button_SetCheck(item, m_SkinWindow->GetWindowDraggable()); } - item = GetDlgItem(m_Window, IDC_MANAGESKINS_CLICKTHROUGH_CHECKBOX); + item = GetDlgItem(m_Window, Id_ClickThroughCheckBox); EnableWindow(item, TRUE); Button_SetCheck(item, m_SkinWindow->GetClickThrough()); - item = GetDlgItem(m_Window, IDC_MANAGESKINS_KEEPONSCREEN_CHECKBOX); + item = GetDlgItem(m_Window, Id_KeepOnScreenCheckBox); EnableWindow(item, TRUE); Button_SetCheck(item, m_SkinWindow->GetKeepOnScreen()); - item = GetDlgItem(m_Window, IDC_MANAGESKINS_SAVEPOSITION_CHECKBOX); + item = GetDlgItem(m_Window, Id_SavePositionCheckBox); EnableWindow(item, TRUE); Button_SetCheck(item, m_SkinWindow->GetSavePosition()); - item = GetDlgItem(m_Window, IDC_MANAGESKINS_SNAPTOEDGES_CHECKBOX); + item = GetDlgItem(m_Window, Id_SnapToEdgesCheckBox); EnableWindow(item, TRUE); Button_SetCheck(item, m_SkinWindow->GetSnapEdges()); - item = GetDlgItem(m_Window, IDC_MANAGESKINS_TRANSPARENCY_COMBOBOX); + item = GetDlgItem(m_Window, Id_TransparencyDropDownList); EnableWindow(item, TRUE); int value = (int)(10 - m_SkinWindow->GetAlphaValue() / 25.5); value = min(9, value); value = max(0, value); ComboBox_SetCurSel(item, value); - item = GetDlgItem(m_Window, IDC_MANAGESKINS_ZPOSITION_COMBOBOX); + item = GetDlgItem(m_Window, Id_ZPositionDropDownList); EnableWindow(item, TRUE); ComboBox_SetCurSel(item, m_SkinWindow->GetWindowZPosition() + 2); - item = GetDlgItem(m_Window, IDC_MANAGESKINS_LOADORDER_TEXT); + item = GetDlgItem(m_Window, Id_LoadOrderEdit); EnableWindow(item, TRUE); _itow_s(Rainmeter->GetLoadOrder(m_SkinFolderPath), buffer, 10); SetWindowText(item, buffer); - item = GetDlgItem(m_Window, IDC_MANAGESKINS_ONHOVER_COMBOBOX); + item = GetDlgItem(m_Window, Id_OnHoverDropDownList); EnableWindow(item, TRUE); ComboBox_SetCurSel(item, m_SkinWindow->GetWindowHide()); } @@ -543,36 +665,36 @@ void CDialogManage::CTabSkins::SetControls() void CDialogManage::CTabSkins::DisableControls(bool clear) { - HWND item = GetDlgItem(m_Window, IDC_MANAGESKINS_LOAD_BUTTON); + HWND item = GetDlgItem(m_Window, Id_LoadButton); SetWindowText(item, GetString(ID_STR_LOAD)); if (clear) { EnableWindow(item, FALSE); - item = GetDlgItem(m_Window, IDC_MANAGESKINS_EDIT_BUTTON); + item = GetDlgItem(m_Window, Id_EditButton); EnableWindow(item, FALSE); - item = GetDlgItem(m_Window, IDC_MANAGESKINS_FILE_TEXT); - SetWindowText(item, L"N/A"); + item = GetDlgItem(m_Window, Id_FileLabel); + SetWindowText(item, GetString(ID_STR_ELLIPSIS)); - item = GetDlgItem(m_Window, IDC_MANAGESKINS_CONFIG_TEXT); - SetWindowText(item, L"N/A"); - - item = GetDlgItem(m_Window, IDC_MANAGESKINS_AUTHOR_TEXT); + item = GetDlgItem(m_Window, Id_ConfigLabel); SetWindowText(item, L""); - item = GetDlgItem(m_Window, IDC_MANAGESKINS_VERSION_TEXT); + item = GetDlgItem(m_Window, Id_AuthorLabel); SetWindowText(item, L""); - item = GetDlgItem(m_Window, IDC_MANAGESKINS_LICENSE_TEXT); + item = GetDlgItem(m_Window, Id_VersionLabel); SetWindowText(item, L""); - item = GetDlgItem(m_Window, IDC_MANAGESKINS_DESCRIPTION_TEXT); + item = GetDlgItem(m_Window, Id_LicenseLabel); + SetWindowText(item, L""); + + item = GetDlgItem(m_Window, Id_DescriptionLabel); SetWindowText(item, L""); ShowScrollBar(item, SB_VERT, FALSE); - item = GetDlgItem(m_Window, IDC_MANAGESKINS_ADDMETADATA_LINK); + item = GetDlgItem(m_Window, Id_AddMetadataLink); ShowWindow(item, SW_HIDE); } else @@ -580,65 +702,65 @@ void CDialogManage::CTabSkins::DisableControls(bool clear) EnableWindow(item, TRUE); } - item = GetDlgItem(m_Window, IDC_MANAGESKINS_REFRESH_BUTTON); + item = GetDlgItem(m_Window, Id_RefreshButton); EnableWindow(item, FALSE); - item = GetDlgItem(m_Window, IDC_MANAGESKINS_X_TEXT); + item = GetDlgItem(m_Window, Id_XPositionEdit); SetWindowText(item, L""); EnableWindow(item, FALSE); - item = GetDlgItem(m_Window, IDC_MANAGESKINS_Y_TEXT); + item = GetDlgItem(m_Window, Id_YPositionEdit); SetWindowText(item, L""); EnableWindow(item, FALSE); - item = GetDlgItem(m_Window, IDC_MANAGESKINS_DISPLAYMONITOR_BUTTON); + item = GetDlgItem(m_Window, Id_DisplayMonitorButton); EnableWindow(item, FALSE); - item = GetDlgItem(m_Window, IDC_MANAGESKINS_DRAGGABLE_CHECKBOX); + item = GetDlgItem(m_Window, Id_DraggableCheckBox); EnableWindow(item, FALSE); Button_SetCheck(item, BST_UNCHECKED); - item = GetDlgItem(m_Window, IDC_MANAGESKINS_CLICKTHROUGH_CHECKBOX); + item = GetDlgItem(m_Window, Id_ClickThroughCheckBox); EnableWindow(item, FALSE); Button_SetCheck(item, BST_UNCHECKED); - item = GetDlgItem(m_Window, IDC_MANAGESKINS_KEEPONSCREEN_CHECKBOX); + item = GetDlgItem(m_Window, Id_KeepOnScreenCheckBox); EnableWindow(item, FALSE); Button_SetCheck(item, BST_UNCHECKED); - item = GetDlgItem(m_Window, IDC_MANAGESKINS_SAVEPOSITION_CHECKBOX); + item = GetDlgItem(m_Window, Id_SavePositionCheckBox); EnableWindow(item, FALSE); Button_SetCheck(item, BST_UNCHECKED); - item = GetDlgItem(m_Window, IDC_MANAGESKINS_SNAPTOEDGES_CHECKBOX); + item = GetDlgItem(m_Window, Id_SnapToEdgesCheckBox); EnableWindow(item, FALSE); Button_SetCheck(item, BST_UNCHECKED); - item = GetDlgItem(m_Window, IDC_MANAGESKINS_TRANSPARENCY_COMBOBOX); + item = GetDlgItem(m_Window, Id_TransparencyDropDownList); EnableWindow(item, FALSE); ComboBox_SetCurSel(item, -1); - item = GetDlgItem(m_Window, IDC_MANAGESKINS_ZPOSITION_COMBOBOX); + item = GetDlgItem(m_Window, Id_ZPositionDropDownList); EnableWindow(item, FALSE); ComboBox_SetCurSel(item, -1); - item = GetDlgItem(m_Window, IDC_MANAGESKINS_LOADORDER_TEXT); + item = GetDlgItem(m_Window, Id_LoadOrderEdit); SetWindowText(item, L""); EnableWindow(item, FALSE); - item = GetDlgItem(m_Window, IDC_MANAGESKINS_ONHOVER_COMBOBOX); + item = GetDlgItem(m_Window, Id_OnHoverDropDownList); EnableWindow(item, FALSE); ComboBox_SetCurSel(item, -1); } void CDialogManage::CTabSkins::ReadSkin() { - HWND item = GetDlgItem(m_Window, IDC_MANAGESKINS_FILE_TEXT); + HWND item = GetDlgItem(m_Window, Id_FileLabel); SetWindowText(item, m_SkinFileName.c_str()); - PathSetDlgItemPath(m_Window, IDC_MANAGESKINS_CONFIG_TEXT, m_SkinFolderPath.c_str()); + PathSetDlgItemPath(m_Window, Id_ConfigLabel, m_SkinFolderPath.c_str()); - item = GetDlgItem(m_Window, IDC_MANAGESKINS_EDIT_BUTTON); + item = GetDlgItem(m_Window, Id_EditButton); EnableWindow(item, TRUE); std::wstring file = Rainmeter->GetSkinPath() + m_SkinFolderPath; @@ -655,7 +777,7 @@ void CDialogManage::CTabSkins::ReadSkin() WCHAR* buffer = new WCHAR[MAX_LINE_LENGTH]; const WCHAR* fileSz = file.c_str(); - item = GetDlgItem(m_Window, IDC_MANAGESKINS_AUTHOR_TEXT); + item = GetDlgItem(m_Window, Id_AuthorLabel); if (GetPrivateProfileString(L"Metadata", L"Author", NULL, buffer, MAX_LINE_LENGTH, fileSz) == 0) { // For backwards compatibility. @@ -663,21 +785,21 @@ void CDialogManage::CTabSkins::ReadSkin() } SetWindowText(item, buffer); - item = GetDlgItem(m_Window, IDC_MANAGESKINS_ADDMETADATA_LINK); + item = GetDlgItem(m_Window, Id_AddMetadataLink); if (GetPrivateProfileSection(L"Metadata", buffer, 8, fileSz) > 0) { ShowWindow(item, SW_HIDE); // Set metadata - item = GetDlgItem(m_Window, IDC_MANAGESKINS_VERSION_TEXT); + item = GetDlgItem(m_Window, Id_VersionLabel); GetPrivateProfileString(L"Metadata", L"Version", NULL, buffer, MAX_LINE_LENGTH, fileSz); SetWindowText(item, buffer); - item = GetDlgItem(m_Window, IDC_MANAGESKINS_LICENSE_TEXT); + item = GetDlgItem(m_Window, Id_LicenseLabel); GetPrivateProfileString(L"Metadata", L"License", NULL, buffer, MAX_LINE_LENGTH, fileSz); SetWindowText(item, buffer); - item = GetDlgItem(m_Window, IDC_MANAGESKINS_DESCRIPTION_TEXT); + item = GetDlgItem(m_Window, Id_DescriptionLabel); std::wstring text; if (GetPrivateProfileString(L"Metadata", L"Information", NULL, buffer, MAX_LINE_LENGTH, fileSz) > 0) { @@ -718,13 +840,13 @@ void CDialogManage::CTabSkins::ReadSkin() { ShowWindow(item, SW_SHOWNORMAL); - item = GetDlgItem(m_Window, IDC_MANAGESKINS_VERSION_TEXT); + item = GetDlgItem(m_Window, Id_VersionLabel); SetWindowText(item, L""); - item = GetDlgItem(m_Window, IDC_MANAGESKINS_LICENSE_TEXT); + item = GetDlgItem(m_Window, Id_LicenseLabel); SetWindowText(item, L""); - item = GetDlgItem(m_Window, IDC_MANAGESKINS_DESCRIPTION_TEXT); + item = GetDlgItem(m_Window, Id_DescriptionLabel); SetWindowText(item, L""); ShowScrollBar(item, SB_VERT, FALSE); } @@ -856,19 +978,15 @@ void CDialogManage::CTabSkins::SelectTreeItem(HWND tree, HTREEITEM item, LPCWSTR } } -/* -** Dialog procedure for the Skins tab. -** -*/ -INT_PTR CALLBACK CDialogManage::CTabSkins::DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) +INT_PTR CDialogManage::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 c_Dialog->m_TabSkins.OnNotify(wParam, lParam); + return OnNotify(wParam, lParam); } return FALSE; @@ -884,7 +1002,7 @@ INT_PTR CDialogManage::CTabSkins::OnCommand(WPARAM wParam, LPARAM lParam) switch (LOWORD(wParam)) { - case IDC_MANAGESKINS_ACTIVESKINS_BUTTON: + case Id_ActiveSkinsButton: { HMENU menu = CreatePopupMenu(); @@ -920,14 +1038,14 @@ INT_PTR CDialogManage::CTabSkins::OnCommand(WPARAM wParam, LPARAM lParam) } break; - case IDC_MANAGESKINS_CREATEPACKAGE_BUTTON: + case Id_CreateSkinPackageButton: { std::wstring file = Rainmeter->GetPath() + L"SkinInstaller.exe"; RunFile(file.c_str(), L"/Packager"); } break; - case IDC_MANAGESKINS_LOAD_BUTTON: + case Id_LoadButton: { if (!m_SkinWindow) { @@ -940,8 +1058,8 @@ INT_PTR CDialogManage::CTabSkins::OnCommand(WPARAM wParam, LPARAM lParam) // Fake selection change to update controls NMHDR nm; nm.code = TVN_SELCHANGED; - nm.idFrom = IDC_MANAGESKINS_SKINS_TREEVIEW; - nm.hwndFrom = GetDlgItem(m_Window, IDC_MANAGESKINS_SKINS_TREEVIEW); + nm.idFrom = Id_SkinsTreeView; + nm.hwndFrom = GetDlgItem(m_Window, Id_SkinsTreeView); OnNotify(0, (LPARAM)&nm); } } @@ -953,18 +1071,18 @@ INT_PTR CDialogManage::CTabSkins::OnCommand(WPARAM wParam, LPARAM lParam) } break; - case IDC_MANAGESKINS_REFRESH_BUTTON: + case Id_RefreshButton: if (m_SkinWindow) { m_SkinWindow->Refresh(false); } break; - case IDC_MANAGESKINS_EDIT_BUTTON: + case Id_EditButton: Rainmeter->EditSkinFile(m_SkinFolderPath, m_SkinFileName); break; - case IDC_MANAGESKINS_X_TEXT: + case Id_XPositionEdit: if (HIWORD(wParam) == EN_CHANGE) { WCHAR buffer[32]; @@ -980,7 +1098,7 @@ INT_PTR CDialogManage::CTabSkins::OnCommand(WPARAM wParam, LPARAM lParam) } break; - case IDC_MANAGESKINS_Y_TEXT: + case Id_YPositionEdit: if (HIWORD(wParam) == EN_CHANGE) { WCHAR buffer[32]; @@ -996,7 +1114,7 @@ INT_PTR CDialogManage::CTabSkins::OnCommand(WPARAM wParam, LPARAM lParam) } break; - case IDC_MANAGESKINS_LOADORDER_TEXT: + case Id_LoadOrderEdit: if (HIWORD(wParam) == EN_CHANGE) { if (m_IgnoreUpdate) @@ -1051,7 +1169,7 @@ INT_PTR CDialogManage::CTabSkins::OnCommand(WPARAM wParam, LPARAM lParam) } break; - case IDC_MANAGESKINS_DISPLAYMONITOR_BUTTON: + case Id_DisplayMonitorButton: { static const MenuTemplate s_Menu[] = { @@ -1086,32 +1204,32 @@ INT_PTR CDialogManage::CTabSkins::OnCommand(WPARAM wParam, LPARAM lParam) } break; - case IDC_MANAGESKINS_DRAGGABLE_CHECKBOX: + case Id_DraggableCheckBox: m_IgnoreUpdate = true; m_SkinWindow->SetWindowDraggable(!m_SkinWindow->GetWindowDraggable()); break; - case IDC_MANAGESKINS_CLICKTHROUGH_CHECKBOX: + case Id_ClickThroughCheckBox: m_IgnoreUpdate = true; m_SkinWindow->SetClickThrough(!m_SkinWindow->GetClickThrough()); break; - case IDC_MANAGESKINS_KEEPONSCREEN_CHECKBOX: + case Id_KeepOnScreenCheckBox: m_IgnoreUpdate = true; m_SkinWindow->SetKeepOnScreen(!m_SkinWindow->GetKeepOnScreen()); break; - case IDC_MANAGESKINS_SAVEPOSITION_CHECKBOX: + case Id_SavePositionCheckBox: m_IgnoreUpdate = true; m_SkinWindow->SetSavePosition(!m_SkinWindow->GetSavePosition()); break; - case IDC_MANAGESKINS_SNAPTOEDGES_CHECKBOX: + case Id_SnapToEdgesCheckBox: m_IgnoreUpdate = true; m_SkinWindow->SetSnapEdges(!m_SkinWindow->GetSnapEdges()); break; - case IDC_MANAGESKINS_ZPOSITION_COMBOBOX: + case Id_ZPositionDropDownList: if (HIWORD(wParam) == CBN_SELCHANGE) { m_IgnoreUpdate = true; @@ -1120,7 +1238,7 @@ INT_PTR CDialogManage::CTabSkins::OnCommand(WPARAM wParam, LPARAM lParam) } break; - case IDC_MANAGESKINS_TRANSPARENCY_COMBOBOX: + case Id_TransparencyDropDownList: if (HIWORD(wParam) == CBN_SELCHANGE) { m_IgnoreUpdate = true; @@ -1129,7 +1247,7 @@ INT_PTR CDialogManage::CTabSkins::OnCommand(WPARAM wParam, LPARAM lParam) } break; - case IDC_MANAGESKINS_ONHOVER_COMBOBOX: + case Id_OnHoverDropDownList: if (HIWORD(wParam) == CBN_SELCHANGE) { m_IgnoreUpdate = true; @@ -1140,7 +1258,7 @@ INT_PTR CDialogManage::CTabSkins::OnCommand(WPARAM wParam, LPARAM lParam) case IDM_MANAGESKINSMENU_EXPAND: { - HWND tree = GetDlgItem(m_Window, IDC_MANAGESKINS_SKINS_TREEVIEW); + HWND tree = GetDlgItem(m_Window, Id_SkinsTreeView); HTREEITEM item = TreeView_GetSelection(tree); TreeView_Expand(tree, item, TVE_TOGGLE); } @@ -1148,7 +1266,7 @@ INT_PTR CDialogManage::CTabSkins::OnCommand(WPARAM wParam, LPARAM lParam) case IDM_MANAGESKINSMENU_OPENFOLDER: { - HWND tree = GetDlgItem(m_Window, IDC_MANAGESKINS_SKINS_TREEVIEW); + HWND tree = GetDlgItem(m_Window, Id_SkinsTreeView); Rainmeter->OpenSkinFolder(GetTreeSelectionPath(tree)); } break; @@ -1166,7 +1284,7 @@ INT_PTR CDialogManage::CTabSkins::OnCommand(WPARAM wParam, LPARAM lParam) std::wstring name = ((*iter).second)->GetFolderPath() + L'\\'; name += ((*iter).second)->GetFileName(); - HWND item = GetDlgItem(m_Window, IDC_MANAGESKINS_SKINS_TREEVIEW); + HWND item = GetDlgItem(m_Window, Id_SkinsTreeView); SelectTreeItem(item, TreeView_GetRoot(item), name.c_str()); break; } @@ -1197,7 +1315,7 @@ INT_PTR CDialogManage::CTabSkins::OnNotify(WPARAM wParam, LPARAM lParam) switch (nm->code) { case NM_CLICK: - if (nm->idFrom == IDC_MANAGESKINS_ADDMETADATA_LINK) + if (nm->idFrom == Id_AddMetadataLink) { std::wstring file = Rainmeter->GetSkinPath() + m_SkinFolderPath; file += L'\\'; @@ -1210,20 +1328,20 @@ INT_PTR CDialogManage::CTabSkins::OnNotify(WPARAM wParam, LPARAM lParam) L"License=\r\n" L"Version"; WritePrivateProfileString(L"Rainmeter", str, L"", file.c_str()); - SendMessage(m_Window, WM_COMMAND, MAKEWPARAM(IDC_MANAGESKINS_EDIT_BUTTON, 0), 0); + SendMessage(m_Window, WM_COMMAND, MAKEWPARAM(Id_EditButton, 0), 0); ShowWindow(nm->hwndFrom, SW_HIDE); } break; case NM_DBLCLK: - if (nm->idFrom == IDC_MANAGESKINS_SKINS_TREEVIEW && !m_SkinFileName.empty()) + if (nm->idFrom == Id_SkinsTreeView && !m_SkinFileName.empty()) { - OnCommand(MAKEWPARAM(IDC_MANAGESKINS_LOAD_BUTTON, 0), 0); + OnCommand(MAKEWPARAM(Id_LoadButton, 0), 0); } break; case NM_RCLICK: - if (nm->idFrom == IDC_MANAGESKINS_SKINS_TREEVIEW) + if (nm->idFrom == Id_SkinsTreeView) { POINT pt = CSystem::GetCursorPosition(); @@ -1306,7 +1424,7 @@ INT_PTR CDialogManage::CTabSkins::OnNotify(WPARAM wParam, LPARAM lParam) break; case TVN_SELCHANGED: - if (nm->idFrom == IDC_MANAGESKINS_SKINS_TREEVIEW) + if (nm->idFrom == Id_SkinsTreeView) { m_SkinWindow = NULL; m_SkinFileName.clear(); @@ -1370,17 +1488,64 @@ INT_PTR CDialogManage::CTabSkins::OnNotify(WPARAM wParam, LPARAM lParam) ** Constructor. ** */ -CDialogManage::CTabLayouts::CTabLayouts(HWND owner) : CTab(Rainmeter->GetResourceInstance(), owner, IDD_MANAGETHEMES_DIALOG, DlgProc) +CDialogManage::CTabLayouts::CTabLayouts() : CTab() { } -/* -** Called when tab is displayed. -** -*/ +void CDialogManage::CTabLayouts::Create(HWND owner) +{ + CTab::CreateTabWindow(9, 24, 470, 260, owner); + + static const ControlTemplate::Control s_Controls[] = + { + CT_GROUPBOX(-1, ID_STR_SAVENEWTHEME, + 0, 0, 230, 150, + WS_VISIBLE, 0), + CT_LABEL(-1, ID_STR_THEMEDESCRIPTION, + 6, 16, 205, 44, + WS_VISIBLE, 0), + CT_CHECKBOX(Id_SaveEmptyThemeCheckBox, ID_STR_SAVEASEMPTYTHEME, + 6, 70, 220, 9, + WS_VISIBLE | WS_TABSTOP, 0), + CT_CHECKBOX(Id_ExcludeUnusedSkinsCheckBox, ID_STR_EXCLUDEUNUSEDSKINS, + 6, 83, 220, 9, + WS_VISIBLE | WS_TABSTOP, 0), + CT_CHECKBOX(Id_IncludeWallpaperCheckBox, ID_STR_INCLUDEWALLPAPER, + 6, 96, 220, 9, + WS_VISIBLE | WS_TABSTOP, 0), + CT_LABEL(-1, ID_STR_NAMESC, + 6, 115, 100, 9, + WS_VISIBLE, 0), + CT_EDIT(Id_NameLabel, 0, + 6, 128, 162, 14, + WS_VISIBLE | WS_TABSTOP, WS_EX_CLIENTEDGE), + CT_BUTTON(Id_SaveButton, ID_STR_SAVE, + 172, 128, 50, 14, + WS_VISIBLE | WS_TABSTOP | WS_DISABLED, 0), + + CT_GROUPBOX(-1, ID_STR_SAVEDTHEMES, + 238, 0, 230, 150, + WS_VISIBLE, 0), + CT_LISTBOX(Id_List, 0, + 244, 16, 160, 125, + WS_VISIBLE | WS_TABSTOP | WS_VSCROLL | LBS_SORT | LBS_NOTIFY | LBS_NOINTEGRALHEIGHT, WS_EX_CLIENTEDGE), + CT_BUTTON(Id_LoadButton, ID_STR_LOAD, + 410, 16, 50, 14, + WS_VISIBLE | WS_TABSTOP | WS_DISABLED, 0), + CT_BUTTON(Id_EditButton, ID_STR_EDIT, + 410, 34, 50, 14, + WS_VISIBLE | WS_TABSTOP | WS_DISABLED, 0), + CT_BUTTON(Id_DeleteButton, ID_STR_DELETE, + 410, 52, 50, 14, + WS_VISIBLE | WS_TABSTOP | WS_DISABLED, 0) + }; + + CreateControls(s_Controls, _countof(s_Controls), c_Dialog->m_Font, GetString); +} + void CDialogManage::CTabLayouts::Initialize() { - HWND item = GetDlgItem(m_Window, IDC_MANAGETHEMES_LIST); + HWND item = GetDlgItem(m_Window, Id_List); const std::vector& layouts = Rainmeter->GetAllLayouts(); for (int i = 0, isize = layouts.size(); i < isize; ++i) { @@ -1390,16 +1555,12 @@ void CDialogManage::CTabLayouts::Initialize() m_Initialized = true; } -/* -** Dialog procedure for the Layouts tab. -** -*/ -INT_PTR CALLBACK CDialogManage::CTabLayouts::DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) +INT_PTR CDialogManage::CTabLayouts::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam) { switch (uMsg) { case WM_COMMAND: - return c_Dialog->m_TabLayouts.OnCommand(wParam, lParam); + return OnCommand(wParam, lParam); } return FALSE; @@ -1409,21 +1570,21 @@ INT_PTR CDialogManage::CTabLayouts::OnCommand(WPARAM wParam, LPARAM lParam) { switch (LOWORD(wParam)) { - case IDC_MANAGETHEMES_EMPTYTHEME_CHECKBOX: + case Id_SaveEmptyThemeCheckBox: { BOOL state = !(Button_GetCheck((HWND)lParam) == BST_CHECKED); - HWND item = GetDlgItem(m_Window, IDC_MANAGETHEMES_UNUSEDSKINS_CHECKBOX); + HWND item = GetDlgItem(m_Window, Id_ExcludeUnusedSkinsCheckBox); EnableWindow(item, state); Button_SetCheck(item, BST_UNCHECKED); - item = GetDlgItem(m_Window, IDC_MANAGETHEMES_WALLPAPER_CHECKBOX); + item = GetDlgItem(m_Window, Id_IncludeWallpaperCheckBox); EnableWindow(item, state); Button_SetCheck(item, BST_UNCHECKED); } break; - case IDC_MANAGETHEMES_NAME_TEXT: + case Id_NameLabel: if (HIWORD(wParam) == EN_CHANGE) { WCHAR buffer[32]; @@ -1431,37 +1592,37 @@ INT_PTR CDialogManage::CTabLayouts::OnCommand(WPARAM wParam, LPARAM lParam) // Disable save button if no text or if backup BOOL state = (len > 0 && _wcsicmp(buffer, L"@Backup") != 0); - EnableWindow(GetDlgItem(m_Window, IDC_MANAGETHEMES_SAVE_BUTTON), state); + EnableWindow(GetDlgItem(m_Window, Id_SaveButton), state); } break; - case IDC_MANAGETHEMES_LIST: + case Id_List: if (HIWORD(wParam) == LBN_SELCHANGE) { // Ignore clicks that don't hit items if (ListBox_GetCurSel((HWND)lParam) != LB_ERR) { - HWND item = GetDlgItem(m_Window, IDC_MANAGETHEMES_LOAD_BUTTON); + HWND item = GetDlgItem(m_Window, Id_LoadButton); EnableWindow(item, TRUE); - item = GetDlgItem(m_Window, IDC_MANAGETHEMES_DELETE_BUTTON); + item = GetDlgItem(m_Window, Id_DeleteButton); EnableWindow(item, TRUE); - item = GetDlgItem(m_Window, IDC_MANAGETHEMES_EDIT_BUTTON); + item = GetDlgItem(m_Window, Id_EditButton); EnableWindow(item, TRUE); const std::vector& layouts = Rainmeter->GetAllLayouts(); - item = GetDlgItem(m_Window, IDC_MANAGETHEMES_LIST); + item = GetDlgItem(m_Window, Id_List); int sel = ListBox_GetCurSel(item); - item = GetDlgItem(m_Window, IDC_MANAGETHEMES_NAME_TEXT); + item = GetDlgItem(m_Window, Id_NameLabel); Edit_SetText(item, layouts[sel].c_str()); } } break; - case IDC_MANAGETHEMES_SAVE_BUTTON: + case Id_SaveButton: { WCHAR buffer[MAX_PATH]; - HWND item = GetDlgItem(m_Window, IDC_MANAGETHEMES_NAME_TEXT); + HWND item = GetDlgItem(m_Window, Id_NameLabel); Edit_GetText(item, buffer, MAX_PATH); std::wstring layout = buffer; @@ -1487,7 +1648,7 @@ INT_PTR CDialogManage::CTabLayouts::OnCommand(WPARAM wParam, LPARAM lParam) path += L"\\Rainmeter.ini"; - item = GetDlgItem(m_Window, IDC_MANAGETHEMES_EMPTYTHEME_CHECKBOX); + item = GetDlgItem(m_Window, Id_SaveEmptyThemeCheckBox); if (Button_GetCheck(item) != BST_CHECKED) { if (!CSystem::CopyFiles(Rainmeter->GetIniFile(), path)) @@ -1498,7 +1659,7 @@ INT_PTR CDialogManage::CTabLayouts::OnCommand(WPARAM wParam, LPARAM lParam) } // Exclude unused skins - item = GetDlgItem(m_Window, IDC_MANAGETHEMES_UNUSEDSKINS_CHECKBOX); + item = GetDlgItem(m_Window, Id_ExcludeUnusedSkinsCheckBox); if (Button_GetCheck(item) == BST_CHECKED) { CConfigParser parser; @@ -1516,7 +1677,7 @@ INT_PTR CDialogManage::CTabLayouts::OnCommand(WPARAM wParam, LPARAM lParam) } // Save wallpaper - item = GetDlgItem(m_Window, IDC_MANAGETHEMES_WALLPAPER_CHECKBOX); + item = GetDlgItem(m_Window, Id_IncludeWallpaperCheckBox); if (Button_GetCheck(item) == BST_CHECKED) { // Get current wallpaper @@ -1544,7 +1705,7 @@ INT_PTR CDialogManage::CTabLayouts::OnCommand(WPARAM wParam, LPARAM lParam) if (!alreadyExists) { - item = GetDlgItem(m_Window, IDC_MANAGETHEMES_LIST); + item = GetDlgItem(m_Window, Id_List); ListBox_AddString(item, layout.c_str()); Rainmeter->ScanForLayouts(); @@ -1552,17 +1713,17 @@ INT_PTR CDialogManage::CTabLayouts::OnCommand(WPARAM wParam, LPARAM lParam) } break; - case IDC_MANAGETHEMES_LOAD_BUTTON: + case Id_LoadButton: { - HWND item = GetDlgItem(m_Window, IDC_MANAGETHEMES_LIST); + HWND item = GetDlgItem(m_Window, Id_List); int sel = ListBox_GetCurSel(item); Rainmeter->LoadLayout(Rainmeter->m_Layouts[sel]); } break; - case IDC_MANAGETHEMES_EDIT_BUTTON: + case Id_EditButton: { - HWND item = GetDlgItem(m_Window, IDC_MANAGETHEMES_LIST); + HWND item = GetDlgItem(m_Window, Id_List); int sel = ListBox_GetCurSel(item); const std::vector& layouts = Rainmeter->GetAllLayouts(); @@ -1574,9 +1735,9 @@ INT_PTR CDialogManage::CTabLayouts::OnCommand(WPARAM wParam, LPARAM lParam) } break; - case IDC_MANAGETHEMES_DELETE_BUTTON: + case Id_DeleteButton: { - HWND item = GetDlgItem(m_Window, IDC_MANAGETHEMES_LIST); + HWND item = GetDlgItem(m_Window, Id_List); int sel = ListBox_GetCurSel(item); std::vector& layouts = const_cast&>(Rainmeter->GetAllLayouts()); @@ -1605,9 +1766,9 @@ INT_PTR CDialogManage::CTabLayouts::OnCommand(WPARAM wParam, LPARAM lParam) } } - EnableWindow(GetDlgItem(m_Window, IDC_MANAGETHEMES_LOAD_BUTTON), FALSE); - EnableWindow(GetDlgItem(m_Window, IDC_MANAGETHEMES_DELETE_BUTTON), FALSE); - EnableWindow(GetDlgItem(m_Window, IDC_MANAGETHEMES_EDIT_BUTTON), FALSE); + EnableWindow(GetDlgItem(m_Window, Id_LoadButton), FALSE); + EnableWindow(GetDlgItem(m_Window, Id_DeleteButton), FALSE); + EnableWindow(GetDlgItem(m_Window, Id_EditButton), FALSE); } } break; @@ -1629,18 +1790,74 @@ INT_PTR CDialogManage::CTabLayouts::OnCommand(WPARAM wParam, LPARAM lParam) ** Constructor. ** */ -CDialogManage::CTabSettings::CTabSettings(HWND owner) : CTab(Rainmeter->GetResourceInstance(), owner, IDD_MANAGESETTINGS_DIALOG, DlgProc) +CDialogManage::CTabSettings::CTabSettings() : CTab() { } -/* -** Called when tab is displayed. -** -*/ +void CDialogManage::CTabSettings::Create(HWND owner) +{ + CTab::CreateTabWindow(9, 24, 470, 260, owner); + + // FIXME: Temporary hack. + short buttonWidth = (short)_wtoi(GetString(ID_STR_NUM_BUTTONWIDTH)); + + const ControlTemplate::Control s_Controls[] = + { + CT_GROUPBOX(-1, ID_STR_GENERAL, + 0, 0, 468, 118, + WS_VISIBLE, 0), + CT_LABEL(-1, ID_STR_LANGUAGESC, + 6, 16, 87, 14, + WS_VISIBLE, 0), + CT_COMBOBOX(Id_LanguageDropDownList, 0, + 87, 13, 222, 14, + WS_VISIBLE | WS_TABSTOP | CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL, 0), + CT_LABEL(-1, ID_STR_EDITORSC, + 6, 37, 87, 9, + WS_VISIBLE, 0), + CT_EDIT(Id_EditorEdit, 0, + 87, 34, 222, 14, + WS_VISIBLE | WS_TABSTOP | ES_AUTOHSCROLL | ES_READONLY, WS_EX_CLIENTEDGE), + CT_BUTTON(Id_EditorBrowseButton, ID_STR_ELLIPSIS, + 313, 34, 25, 14, + WS_VISIBLE | WS_TABSTOP, 0), + CT_CHECKBOX(Id_CheckForUpdatesCheckBox, ID_STR_CHECKFORUPDATES, + 6, 55, 150, 9, + WS_VISIBLE | WS_TABSTOP, 0), + CT_CHECKBOX(Id_LockSkinsCheckBox, ID_STR_DISABLEDRAGGING, + 6, 68, 150, 9, + WS_VISIBLE | WS_TABSTOP, 0), + CT_CHECKBOX(Id_ShowTrayIconCheckBox, ID_STR_SHOWNOTIFICATIONAREAICON, + 6, 81, 150, 9, + WS_VISIBLE | WS_TABSTOP, 0), + CT_BUTTON(Id_ResetStatisticsButton, ID_STR_RESETSTATISTICS, + 6, 97, buttonWidth + 20, 14, + WS_VISIBLE | WS_TABSTOP, 0), + + CT_GROUPBOX(-1, ID_STR_LOGGING, + 0, 125, 468, 66, + WS_VISIBLE, 0), + CT_CHECKBOX(Id_VerboseLoggingCheckbox, ID_STR_DEBUGMODE, + 6, 141, 200, 9, + WS_VISIBLE | WS_TABSTOP, 0), + CT_CHECKBOX(Id_LogToFileCheckBox, ID_STR_LOGTOFILE, + 6, 154, 200, 9, + WS_VISIBLE | WS_TABSTOP, 0), + CT_BUTTON(Id_ShowLogFileButton, ID_STR_SHOWLOGFILE, + 6, 170, buttonWidth + 20, 14, + WS_VISIBLE | WS_TABSTOP, 0), + CT_BUTTON(Id_DeleteLogFileButton, ID_STR_DELETELOGFILE, + buttonWidth + 30, 170, buttonWidth + 20, 14, + WS_VISIBLE | WS_TABSTOP, 0) + }; + + CreateControls(s_Controls, _countof(s_Controls), c_Dialog->m_Font, GetString); +} + void CDialogManage::CTabSettings::Initialize() { // Scan for languages - HWND item = GetDlgItem(m_Window, IDC_MANAGESETTINGS_LANGUAGE_COMBOBOX); + HWND item = GetDlgItem(m_Window, Id_LanguageDropDownList); std::wstring files = Rainmeter->GetPath() + L"Languages\\*.dll"; WIN32_FIND_DATA fd; @@ -1679,33 +1896,29 @@ void CDialogManage::CTabSettings::Initialize() FindClose(hSearch); } - Button_SetCheck(GetDlgItem(m_Window, IDC_MANAGESETTINGS_CHECKUPDATES_CHECKBOX), !Rainmeter->GetDisableVersionCheck()); - Button_SetCheck(GetDlgItem(m_Window, IDC_MANAGESETTINGS_LOCKSKINS_CHECKBOX), Rainmeter->GetDisableDragging()); - Button_SetCheck(GetDlgItem(m_Window, IDC_MANAGESETTINGS_LOGTOFILE_CHECKBOX), Rainmeter->GetLogging()); - Button_SetCheck(GetDlgItem(m_Window, IDC_MANAGESETTINGS_VERBOSELOGGING_CHECKBOX), Rainmeter->GetDebug()); + Button_SetCheck(GetDlgItem(m_Window, Id_CheckForUpdatesCheckBox), !Rainmeter->GetDisableVersionCheck()); + Button_SetCheck(GetDlgItem(m_Window, Id_LockSkinsCheckBox), Rainmeter->GetDisableDragging()); + Button_SetCheck(GetDlgItem(m_Window, Id_LogToFileCheckBox), Rainmeter->GetLogging()); + Button_SetCheck(GetDlgItem(m_Window, Id_VerboseLoggingCheckbox), Rainmeter->GetDebug()); BOOL isLogFile = (_waccess(Rainmeter->GetLogFile().c_str(), 0) != -1); - EnableWindow(GetDlgItem(m_Window, IDC_MANAGESETTINGS_SHOWLOGFILE_BUTTON), isLogFile); - EnableWindow(GetDlgItem(m_Window, IDC_MANAGESETTINGS_DELETELOGFILE_BUTTON), isLogFile); + EnableWindow(GetDlgItem(m_Window, Id_ShowLogFileButton), isLogFile); + EnableWindow(GetDlgItem(m_Window, Id_DeleteLogFileButton), isLogFile); - Edit_SetText(GetDlgItem(m_Window, IDC_MANAGESETTINGS_CONFIGEDITOR_TEXT), Rainmeter->GetSkinEditor().c_str()); + Edit_SetText(GetDlgItem(m_Window, Id_EditorEdit), Rainmeter->GetSkinEditor().c_str()); bool iconEnabled = Rainmeter->GetTrayWindow()->IsTrayIconEnabled(); - Button_SetCheck(GetDlgItem(m_Window, IDC_MANAGESETTINGS_TRAYICON_CHECKBOX), iconEnabled); + Button_SetCheck(GetDlgItem(m_Window, Id_ShowTrayIconCheckBox), iconEnabled); m_Initialized = true; } -/* -** Dialog procedure for the Settings tab. -** -*/ -INT_PTR CALLBACK CDialogManage::CTabSettings::DlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) +INT_PTR CDialogManage::CTabSettings::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam) { switch (uMsg) { case WM_COMMAND: - return c_Dialog->m_TabSettings.OnCommand(wParam, lParam); + return OnCommand(wParam, lParam); } return FALSE; @@ -1720,7 +1933,7 @@ INT_PTR CDialogManage::CTabSettings::OnCommand(WPARAM wParam, LPARAM lParam) switch (LOWORD(wParam)) { - case IDC_MANAGESETTINGS_LANGUAGE_COMBOBOX: + case Id_LanguageDropDownList: if (HIWORD(wParam) == CBN_SELCHANGE) { int sel = ComboBox_GetCurSel((HWND)lParam); @@ -1740,8 +1953,8 @@ INT_PTR CDialogManage::CTabSettings::OnCommand(WPARAM wParam, LPARAM lParam) if (CDialogAbout::c_Dialog) { - int sel = TabCtrl_GetCurSel(GetDlgItem(CDialogAbout::c_Dialog->GetWindow(), IDC_ABOUT_TAB)); - SendMessage(CDialogAbout::c_Dialog->GetWindow(), WM_DELAYED_CLOSE, 0, 0); + int sel = TabCtrl_GetCurSel(GetDlgItem(CDialogAbout::c_Dialog->GetWindow(), CDialogManage::Id_Tab)); + SendMessage(CDialogAbout::c_Dialog->GetWindow(), WM_CLOSE, 0, 0); if (sel == 0) { Rainmeter->DelayedExecuteCommand(L"!About"); @@ -1760,39 +1973,39 @@ INT_PTR CDialogManage::CTabSettings::OnCommand(WPARAM wParam, LPARAM lParam) } } - SendMessage(c_Dialog->GetWindow(), WM_DELAYED_CLOSE, 0, 0); + SendMessage(c_Dialog->GetWindow(), WM_CLOSE, 0, 0); Rainmeter->DelayedExecuteCommand(L"!Manage Settings"); } } break; - case IDC_MANAGESETTINGS_CHECKUPDATES_CHECKBOX: + case Id_CheckForUpdatesCheckBox: Rainmeter->SetDisableVersionCheck(!Rainmeter->GetDisableVersionCheck()); break; - case IDC_MANAGESETTINGS_LOCKSKINS_CHECKBOX: + case Id_LockSkinsCheckBox: Rainmeter->SetDisableDragging(!Rainmeter->GetDisableDragging()); break; - case IDC_MANAGESETTINGS_RESETSTATISTICS_BUTTON: + case Id_ResetStatisticsButton: Rainmeter->ResetStats(); break; - case IDC_MANAGESETTINGS_SHOWLOGFILE_BUTTON: + case Id_ShowLogFileButton: Rainmeter->ShowLogFile(); break; - case IDC_MANAGESETTINGS_DELETELOGFILE_BUTTON: + case Id_DeleteLogFileButton: Rainmeter->DeleteLogFile(); if (_waccess(Rainmeter->GetLogFile().c_str(), 0) == -1) { - Button_SetCheck(GetDlgItem(m_Window, IDC_MANAGESETTINGS_LOGTOFILE_CHECKBOX), BST_UNCHECKED); - EnableWindow(GetDlgItem(m_Window, IDC_MANAGESETTINGS_SHOWLOGFILE_BUTTON), FALSE); - EnableWindow(GetDlgItem(m_Window, IDC_MANAGESETTINGS_DELETELOGFILE_BUTTON), FALSE); + Button_SetCheck(GetDlgItem(m_Window, Id_LogToFileCheckBox), BST_UNCHECKED); + EnableWindow(GetDlgItem(m_Window, Id_ShowLogFileButton), FALSE); + EnableWindow(GetDlgItem(m_Window, Id_DeleteLogFileButton), FALSE); } break; - case IDC_MANAGESETTINGS_LOGTOFILE_CHECKBOX: + case Id_LogToFileCheckBox: if (Rainmeter->GetLogging()) { Rainmeter->StopLogging(); @@ -1802,17 +2015,17 @@ INT_PTR CDialogManage::CTabSettings::OnCommand(WPARAM wParam, LPARAM lParam) Rainmeter->StartLogging(); if (_waccess(Rainmeter->GetLogFile().c_str(), 0) != -1) { - EnableWindow(GetDlgItem(m_Window, IDC_MANAGESETTINGS_SHOWLOGFILE_BUTTON), TRUE); - EnableWindow(GetDlgItem(m_Window, IDC_MANAGESETTINGS_DELETELOGFILE_BUTTON), TRUE); + EnableWindow(GetDlgItem(m_Window, Id_ShowLogFileButton), TRUE); + EnableWindow(GetDlgItem(m_Window, Id_DeleteLogFileButton), TRUE); } } break; - case IDC_MANAGESETTINGS_VERBOSELOGGING_CHECKBOX: + case Id_VerboseLoggingCheckbox: Rainmeter->SetDebug(!Rainmeter->GetDebug()); break; - case IDC_MANAGESETTINGS_CONFIGEDITOR_TEXT: + case Id_EditorEdit: if (HIWORD(wParam) == EN_CHANGE) { WCHAR buffer[MAX_PATH]; @@ -1823,7 +2036,7 @@ INT_PTR CDialogManage::CTabSettings::OnCommand(WPARAM wParam, LPARAM lParam) } break; - case IDC_MANAGESETTINGS_CONFIGEDITOR_BUTTON: + case Id_EditorBrowseButton: { WCHAR buffer[MAX_PATH]; buffer[0] = L'\0'; @@ -1847,11 +2060,11 @@ INT_PTR CDialogManage::CTabSettings::OnCommand(WPARAM wParam, LPARAM lParam) break; } - Edit_SetText(GetDlgItem(m_Window, IDC_MANAGESETTINGS_CONFIGEDITOR_TEXT), buffer); + Edit_SetText(GetDlgItem(m_Window, Id_EditorEdit), buffer); } break; - case IDC_MANAGESETTINGS_TRAYICON_CHECKBOX: + case Id_ShowTrayIconCheckBox: Rainmeter->GetTrayWindow()->SetTrayIcon(!Rainmeter->GetTrayWindow()->IsTrayIconEnabled()); break; diff --git a/Library/DialogManage.h b/Library/DialogManage.h index 089b05e6..db32c684 100644 --- a/Library/DialogManage.h +++ b/Library/DialogManage.h @@ -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 - diff --git a/Library/Library.vcxproj b/Library/Library.vcxproj index 86f1fde9..581e90f0 100644 --- a/Library/Library.vcxproj +++ b/Library/Library.vcxproj @@ -185,13 +185,12 @@ + + Use - - Use - Use @@ -391,9 +390,10 @@ + + - diff --git a/Library/Library.vcxproj.filters b/Library/Library.vcxproj.filters index 0ecf1d9d..73eac537 100644 --- a/Library/Library.vcxproj.filters +++ b/Library/Library.vcxproj.filters @@ -306,9 +306,6 @@ pcre - - Source Files - Source Files @@ -324,6 +321,12 @@ Source Files + + Common + + + Common + Common @@ -533,9 +536,6 @@ pcre - - Header Files - Header Files @@ -560,6 +560,12 @@ Header Files + + Common + + + Common + Common diff --git a/Library/Rainmeter.cpp b/Library/Rainmeter.cpp index 2083f403..2032ae91 100644 --- a/Library/Rainmeter.cpp +++ b/Library/Rainmeter.cpp @@ -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); diff --git a/Library/resource.h b/Library/resource.h index 1d880e59..912a754c 100644 --- a/Library/resource.h +++ b/Library/resource.h @@ -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