summaryrefslogtreecommitdiff
path: root/plugins/Toaster/src/options.cpp
blob: 2cca826654cd63cf6f4fcee5e400bcbea14af2a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#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("Popups"); //_T(MODULE);
	odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
	odp.position = -790000000;
	odp.ptszTab = _T(MODULE);
	odp.pDialog = new COptions();
	Options_AddPage(wParam, &odp);

	return 0;
}