summaryrefslogtreecommitdiff
path: root/plugins/Db3x_mmap/src/ui.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-12-08 22:54:21 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-12-08 22:54:21 +0000
commit3c001302667561bb3c3458ed0a78699e5e93be82 (patch)
treebd15d845c29ca1b391ae40154e66844b088ba088 /plugins/Db3x_mmap/src/ui.cpp
parent04186af283b3bfa0278e9ad8b223a5c70f3d8158 (diff)
mmap options dialog
git-svn-id: http://svn.miranda-ng.org/main/trunk@7100 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Db3x_mmap/src/ui.cpp')
-rw-r--r--plugins/Db3x_mmap/src/ui.cpp47
1 files changed, 47 insertions, 0 deletions
diff --git a/plugins/Db3x_mmap/src/ui.cpp b/plugins/Db3x_mmap/src/ui.cpp
index 8e98974c09..3e50702048 100644
--- a/plugins/Db3x_mmap/src/ui.cpp
+++ b/plugins/Db3x_mmap/src/ui.cpp
@@ -244,6 +244,51 @@ static INT_PTR ChangePassword(void* obj, LPARAM, LPARAM)
/////////////////////////////////////////////////////////////////////////////////////////
+INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ CDb3Mmap *db = (CDb3Mmap *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+
+ switch (msg) {
+ case WM_INITDIALOG:
+ TranslateDialogDefault(hwndDlg);
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
+
+ db = (CDb3Mmap*)lParam;
+ CheckRadioButton(hwndDlg, IDC_STANDARD, IDC_TOTAL, IDC_STANDARD + db->isEncrypted());
+ return TRUE;
+
+ case WM_COMMAND:
+ if (HIWORD(wParam) == BN_CLICKED && (HWND)lParam == GetFocus())
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+
+ case WM_NOTIFY:
+ if (((LPNMHDR)lParam)->code == PSN_APPLY) {
+ if (IsDlgButtonChecked(hwndDlg, IDC_TOTAL) == (BOOL)db->isEncrypted())
+ break;
+ }
+ break;
+ }
+
+ return FALSE;
+}
+
+static int OnOptionsInit(PVOID obj, WPARAM wParam, LPARAM)
+{
+ OPTIONSDIALOGPAGE odp = { sizeof(odp) };
+ odp.position = -790000000;
+ odp.hInstance = g_hInst;
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
+ odp.flags = ODPF_BOLDGROUPS;
+ odp.pszTitle = LPGEN("Database");
+ odp.pfnDlgProc = DlgProcOptions;
+ odp.dwInitParam = (LPARAM)obj;
+ Options_AddPage(wParam, &odp);
+ return 0;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
void CDb3Mmap::UpdateMenuItem()
{
CLISTMENUITEM mi = { sizeof(mi) };
@@ -259,6 +304,8 @@ static int OnModulesLoaded(PVOID obj, WPARAM, LPARAM)
Icon_Register(g_hInst, LPGEN("Database"), iconList, SIZEOF(iconList), "mmap");
+ HookEventObj(ME_OPT_INITIALISE, OnOptionsInit, db);
+
// main menu item
CLISTMENUITEM mi = { sizeof(mi) };
mi.pszName = LPGEN("Database");