diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2015-09-19 20:59:08 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2015-09-19 20:59:08 +0000 |
commit | b741839a3b40ef50eaab1b745bdf5a9c0456ec45 (patch) | |
tree | 553a79f0a3580c8d1ba7c1098091f2c0c6d28139 /plugins/Toaster/src/options.cpp | |
parent | e87725cb4be71a58c0ddf4d0b0b6d92b8cc47d7b (diff) |
Toaster: added simple options page
git-svn-id: http://svn.miranda-ng.org/main/trunk@15404 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Toaster/src/options.cpp')
-rw-r--r-- | plugins/Toaster/src/options.cpp | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/plugins/Toaster/src/options.cpp b/plugins/Toaster/src/options.cpp new file mode 100644 index 0000000000..7bb01412f5 --- /dev/null +++ b/plugins/Toaster/src/options.cpp @@ -0,0 +1,47 @@ +#include "stdafx.h"
+
+COptions::COptions()
+ : CDlgBase(g_hInstance, IDD_OPTIONS_MAIN),
+ m_shortcut(this, IDC_SHORTCUT),
+ m_preview(this, IDC_PREVIEW)
+{
+ m_shortcut.OnClick = Callback(this, &COptions::Shortcut_OnClick);
+ m_preview.OnClick = Callback(this, &COptions::Preview_OnClick);
+}
+
+void COptions::OnInitDialog()
+{
+}
+
+void COptions::Shortcut_OnClick(CCtrlBase*)
+{
+ if (FAILED(TryCreateShortcut()))
+ {
+ CallService(MS_POPUP_SHOWMESSAGEW, (WPARAM)TranslateT("Failed to create shortcut"), (LPARAM)SM_ERROR);
+ return;
+ }
+ CallService(MS_POPUP_SHOWMESSAGEW, (WPARAM)TranslateT("Shortcut was added to the start menu"), (LPARAM)SM_NOTIFY);
+}
+
+void COptions::Preview_OnClick(CCtrlBase*)
+{
+ CallService(MS_POPUP_SHOWMESSAGEW, (WPARAM)TranslateT("Information"), (LPARAM)SM_NOTIFY);
+ CallService(MS_POPUP_SHOWMESSAGEW, (WPARAM)TranslateT("Warning"), (LPARAM)SM_WARNING);
+ CallService(MS_POPUP_SHOWMESSAGEW, (WPARAM)TranslateT("Error"), (LPARAM)SM_ERROR);
+}
+
+/////////////////////////////////////////////////////////////////////////////////
+
+int OnOptionsInitialized(WPARAM wParam, LPARAM)
+{
+ OPTIONSDIALOGPAGE odp = { 0 };
+ odp.ptszTitle = _T(MODULE);
+ odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR | ODPF_DONTTRANSLATE;
+ odp.ptszGroup = LPGENT("Popups");
+
+ odp.ptszTab = _T("Main");
+ odp.pDialog = new COptions();
+ Options_AddPage(wParam, &odp);
+
+ return 0;
+}
|