2011-08-28 10:58:26 +00:00
|
|
|
/*
|
|
|
|
Copyright (C) 2011 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
|
2012-01-23 06:36:15 +00:00
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2011-08-28 10:58:26 +00:00
|
|
|
*/
|
|
|
|
|
2011-11-21 12:53:55 +00:00
|
|
|
#ifndef __DIALOGMANAGE_H__
|
|
|
|
#define __DIALOGMANAGE_H__
|
2011-08-28 10:58:26 +00:00
|
|
|
|
2012-12-13 09:12:25 +00:00
|
|
|
#include "../Common/Dialog.h"
|
2012-12-23 12:45:50 +00:00
|
|
|
#include "resource.h"
|
2011-08-28 10:58:26 +00:00
|
|
|
|
2013-05-31 14:18:52 +00:00
|
|
|
class DialogManage : public Dialog
|
2011-08-28 10:58:26 +00:00
|
|
|
{
|
|
|
|
public:
|
2013-05-31 14:18:52 +00:00
|
|
|
DialogManage();
|
|
|
|
virtual ~DialogManage();
|
2011-08-28 10:58:26 +00:00
|
|
|
|
2014-01-05 10:07:22 +00:00
|
|
|
DialogManage(const DialogManage& other) = delete;
|
|
|
|
DialogManage& operator=(DialogManage other) = delete;
|
|
|
|
|
2013-05-31 14:18:52 +00:00
|
|
|
static Dialog* GetDialog() { return c_Dialog; }
|
2011-08-28 10:58:26 +00:00
|
|
|
|
2013-08-26 04:47:20 +00:00
|
|
|
static void Open(const WCHAR* tabName, const WCHAR* param1, const WCHAR* param2);
|
2011-10-29 10:36:07 +00:00
|
|
|
static void Open(const WCHAR* name);
|
2011-08-28 10:58:26 +00:00
|
|
|
static void Open(int tab = 0);
|
2013-05-31 14:18:52 +00:00
|
|
|
static void OpenSkin(MeterWindow* meterWindow);
|
2011-08-28 10:58:26 +00:00
|
|
|
|
2013-05-31 14:18:52 +00:00
|
|
|
static void UpdateSkins(MeterWindow* meterWindow, bool deleted = false);
|
2011-08-28 10:58:26 +00:00
|
|
|
|
2012-02-21 09:03:16 +00:00
|
|
|
protected:
|
2012-12-13 09:12:25 +00:00
|
|
|
virtual INT_PTR HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam);
|
2012-12-13 18:12:37 +00:00
|
|
|
INT_PTR OnInitDialog(WPARAM wParam, LPARAM lParam);
|
|
|
|
INT_PTR OnNotify(WPARAM wParam, LPARAM lParam);
|
|
|
|
INT_PTR OnCommand(WPARAM wParam, LPARAM lParam);
|
2012-02-21 09:03:16 +00:00
|
|
|
|
2011-08-28 10:58:26 +00:00
|
|
|
private:
|
|
|
|
// Skins tab
|
2013-05-31 14:18:52 +00:00
|
|
|
class TabSkins : public Tab
|
2011-08-28 10:58:26 +00:00
|
|
|
{
|
|
|
|
public:
|
2012-12-13 09:12:25 +00:00
|
|
|
enum Id
|
|
|
|
{
|
|
|
|
Id_ActiveSkinsButton = 100,
|
|
|
|
Id_SkinsTreeView,
|
|
|
|
Id_CreateSkinPackageButton,
|
|
|
|
Id_FileLabel,
|
|
|
|
Id_ConfigLabel,
|
|
|
|
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,
|
2012-12-23 12:45:50 +00:00
|
|
|
Id_SnapToEdgesCheckBox,
|
|
|
|
|
|
|
|
Id_LoadButton = IDM_MANAGESKINSMENU_LOAD,
|
|
|
|
Id_RefreshButton = IDM_MANAGESKINSMENU_REFRESH,
|
|
|
|
Id_EditButton = IDM_MANAGESKINSMENU_EDIT
|
2012-12-13 09:12:25 +00:00
|
|
|
};
|
|
|
|
|
2013-05-31 14:18:52 +00:00
|
|
|
TabSkins();
|
2012-12-13 09:12:25 +00:00
|
|
|
|
|
|
|
void Create(HWND owner);
|
2011-08-28 10:58:26 +00:00
|
|
|
virtual void Initialize();
|
|
|
|
|
2013-05-31 14:18:52 +00:00
|
|
|
void Update(MeterWindow* meterWindow, bool deleted);
|
2011-08-28 10:58:26 +00:00
|
|
|
|
|
|
|
static void SelectTreeItem(HWND tree, HTREEITEM item, LPCWSTR name);
|
|
|
|
|
2012-12-13 09:12:25 +00:00
|
|
|
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);
|
|
|
|
|
2011-08-28 10:58:26 +00:00
|
|
|
private:
|
|
|
|
void SetControls();
|
|
|
|
void DisableControls(bool clear = false);
|
|
|
|
void ReadSkin();
|
|
|
|
|
2012-06-09 16:56:59 +00:00
|
|
|
static std::wstring GetTreeSelectionPath(HWND tree);
|
2012-06-01 10:05:25 +00:00
|
|
|
static int PopulateTree(HWND tree, TVINSERTSTRUCT& tvi, int index = 0);
|
2011-08-28 10:58:26 +00:00
|
|
|
|
2012-06-01 13:06:36 +00:00
|
|
|
std::wstring m_SkinFileName;
|
|
|
|
std::wstring m_SkinFolderPath;
|
2013-05-31 14:18:52 +00:00
|
|
|
MeterWindow* m_SkinWindow;
|
2011-08-28 10:58:26 +00:00
|
|
|
bool m_HandleCommands;
|
|
|
|
bool m_IgnoreUpdate;
|
|
|
|
};
|
|
|
|
|
2012-10-02 14:44:47 +00:00
|
|
|
// Layouts tab
|
2013-05-31 14:18:52 +00:00
|
|
|
class TabLayouts : public Tab
|
2011-08-28 10:58:26 +00:00
|
|
|
{
|
|
|
|
public:
|
2012-12-13 09:12:25 +00:00
|
|
|
enum Id
|
|
|
|
{
|
|
|
|
Id_List = 100,
|
|
|
|
Id_LoadButton,
|
|
|
|
Id_DeleteButton,
|
|
|
|
Id_EditButton,
|
|
|
|
Id_SaveButton,
|
|
|
|
Id_SaveEmptyThemeCheckBox,
|
|
|
|
Id_ExcludeUnusedSkinsCheckBox,
|
|
|
|
Id_IncludeWallpaperCheckBox,
|
|
|
|
Id_NameLabel
|
|
|
|
};
|
|
|
|
|
2013-05-31 14:18:52 +00:00
|
|
|
TabLayouts();
|
2012-12-13 09:12:25 +00:00
|
|
|
|
|
|
|
void Create(HWND owner);
|
2011-08-28 10:58:26 +00:00
|
|
|
virtual void Initialize();
|
|
|
|
|
2012-12-13 09:12:25 +00:00
|
|
|
protected:
|
|
|
|
virtual INT_PTR HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam);
|
2011-08-28 10:58:26 +00:00
|
|
|
INT_PTR OnCommand(WPARAM wParam, LPARAM lParam);
|
|
|
|
};
|
|
|
|
|
|
|
|
// Settings tab
|
2013-05-31 14:18:52 +00:00
|
|
|
class TabSettings : public Tab
|
2011-08-28 10:58:26 +00:00
|
|
|
{
|
|
|
|
public:
|
2012-12-13 09:12:25 +00:00
|
|
|
enum Id
|
|
|
|
{
|
|
|
|
Id_CheckForUpdatesCheckBox = 100,
|
|
|
|
Id_LockSkinsCheckBox,
|
|
|
|
Id_ResetStatisticsButton,
|
|
|
|
Id_LogToFileCheckBox,
|
|
|
|
Id_VerboseLoggingCheckbox,
|
|
|
|
Id_ShowLogFileButton,
|
|
|
|
Id_DeleteLogFileButton,
|
|
|
|
Id_LanguageDropDownList,
|
|
|
|
Id_EditorEdit,
|
|
|
|
Id_EditorBrowseButton,
|
2013-07-25 22:44:06 +00:00
|
|
|
Id_ShowTrayIconCheckBox,
|
|
|
|
Id_UseD2DCheckBox
|
2012-12-13 09:12:25 +00:00
|
|
|
};
|
|
|
|
|
2013-05-31 14:18:52 +00:00
|
|
|
TabSettings();
|
2012-12-13 09:12:25 +00:00
|
|
|
|
|
|
|
void Create(HWND owner);
|
2011-08-28 10:58:26 +00:00
|
|
|
virtual void Initialize();
|
|
|
|
|
2012-12-13 09:12:25 +00:00
|
|
|
protected:
|
|
|
|
virtual INT_PTR HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam);
|
2011-08-28 10:58:26 +00:00
|
|
|
INT_PTR OnCommand(WPARAM wParam, LPARAM lParam);
|
|
|
|
};
|
|
|
|
|
2012-12-13 09:12:25 +00:00
|
|
|
enum Id
|
|
|
|
{
|
|
|
|
Id_CloseButton = IDCLOSE,
|
|
|
|
Id_Tab = 100,
|
|
|
|
Id_RefreshAllButton,
|
|
|
|
Id_EditSettingsButton,
|
|
|
|
Id_OpenLogButton,
|
|
|
|
Id_HelpButton
|
|
|
|
};
|
|
|
|
|
2013-05-31 14:18:52 +00:00
|
|
|
Tab& GetActiveTab();
|
2012-06-16 18:41:17 +00:00
|
|
|
|
2013-05-31 14:18:52 +00:00
|
|
|
TabSkins m_TabSkins;
|
|
|
|
TabLayouts m_TabLayouts;
|
|
|
|
TabSettings m_TabSettings;
|
2012-12-13 18:12:37 +00:00
|
|
|
|
|
|
|
static WINDOWPLACEMENT c_WindowPlacement;
|
2013-05-31 14:18:52 +00:00
|
|
|
static DialogManage* c_Dialog;
|
2011-08-28 10:58:26 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|