diff options
author | George Hazan <ghazan@miranda.im> | 2017-11-24 14:52:14 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-11-24 14:52:14 +0300 |
commit | baa0c8ab5a4e5dc7a94a6bb0b8be095a760f48d0 (patch) | |
tree | d4a6b214ca5407cbc236f61190e9e7ec91cea929 /plugins/DbEditorPP/src/options.cpp | |
parent | 7394160d234881ab31ba5f5e996e052ef5002b6c (diff) |
dbeditor:
- code cleaning
- version bump
Diffstat (limited to 'plugins/DbEditorPP/src/options.cpp')
-rw-r--r-- | plugins/DbEditorPP/src/options.cpp | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/plugins/DbEditorPP/src/options.cpp b/plugins/DbEditorPP/src/options.cpp index 3e2ca49646..12a60c0693 100644 --- a/plugins/DbEditorPP/src/options.cpp +++ b/plugins/DbEditorPP/src/options.cpp @@ -1,12 +1,10 @@ #include "stdafx.h"
-INT_PTR CALLBACK DlgProcOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+static INT_PTR CALLBACK DlgProcOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
static bool bInitDone = true;
- switch (msg)
- {
+ switch (msg) {
case WM_INITDIALOG:
- {
bInitDone = false;
CheckDlgButton(hwnd, IDC_EXPANDSETTINGS, db_get_b(NULL, modname, "ExpandSettingsOnOpen", 0) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwnd, IDC_RESTORESETTINGS, db_get_b(NULL, modname, "RestoreOnOpen", 1) ? BST_CHECKED : BST_UNCHECKED);
@@ -16,11 +14,10 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) SendDlgItemMessage(hwnd, IDC_COLOUR, CPM_SETCOLOUR, 0, (LPARAM)db_get_dw(NULL, modname, "PopupColour", RGB(255, 0, 0)));
TranslateDialogDefault(hwnd);
bInitDone = true;
- }
- return TRUE;
+ return TRUE;
+
case WM_COMMAND:
- switch (LOWORD(wParam))
- {
+ switch (LOWORD(wParam)) {
case IDC_RESTORESETTINGS:
case IDC_EXPANDSETTINGS:
case IDC_POPUPS:
@@ -28,20 +25,19 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) case IDC_COLOUR:
SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
break;
+
case IDC_POPUPTIMEOUT:
if (bInitDone && (HIWORD(wParam) == EN_CHANGE))
SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
break;
}
break;
+
case WM_NOTIFY:
- switch (((LPNMHDR)lParam)->idFrom)
- {
+ switch (((LPNMHDR)lParam)->idFrom) {
case 0:
- switch (((LPNMHDR)lParam)->code)
- {
+ switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- {
db_set_b(NULL, modname, "ExpandSettingsOnOpen", (BYTE)IsDlgButtonChecked(hwnd, IDC_EXPANDSETTINGS));
db_set_b(NULL, modname, "RestoreOnOpen", (BYTE)IsDlgButtonChecked(hwnd, IDC_RESTORESETTINGS));
db_set_b(NULL, modname, "WarnOnDelete", (BYTE)IsDlgButtonChecked(hwnd, IDC_WARNONDEL));
@@ -49,8 +45,7 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) db_set_b(NULL, modname, "UsePopUps", (BYTE)g_bUsePopups);
db_set_w(NULL, modname, "PopupDelay", (WORD)GetDlgItemInt(hwnd, IDC_POPUPTIMEOUT, nullptr, 0));
db_set_dw(NULL, modname, "PopupColour", (DWORD)SendDlgItemMessage(hwnd, IDC_COLOUR, CPM_GETCOLOUR, 0, 0));
- }
- return TRUE;
+ return TRUE;
}
break;
}
|