From 17e345e621254103a98bbc7e662a2829b7aa3ce6 Mon Sep 17 00:00:00 2001 From: Tobias Weimer Date: Sat, 17 Sep 2016 15:08:31 +0000 Subject: StartupStatus: Cleanup git-svn-id: http://svn.miranda-ng.org/main/trunk@17308 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/StatusPlugins/StartupStatus/options.cpp | 74 ++++++++++++------------- 1 file changed, 35 insertions(+), 39 deletions(-) (limited to 'plugins') diff --git a/plugins/StatusPlugins/StartupStatus/options.cpp b/plugins/StatusPlugins/StartupStatus/options.cpp index 36681553ee..d5a68121a0 100644 --- a/plugins/StatusPlugins/StartupStatus/options.cpp +++ b/plugins/StatusPlugins/StartupStatus/options.cpp @@ -21,10 +21,6 @@ #include "startupstatus.h" #include "../resource.h" -// prototypes -INT_PTR CALLBACK CmdlOptionsDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lParam); -INT_PTR CALLBACK OptDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lParam); -INT_PTR CALLBACK addProfileDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lParam); ///////////////////////////////////////////////////////////////////////////////////////// @@ -538,6 +534,41 @@ static int ClearDatabase(char* filter) static OBJLIST arProfiles(5); +INT_PTR CALLBACK addProfileDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) +{ + static HWND hwndParent; + + switch (msg) { + case WM_INITDIALOG: + TranslateDialogDefault(hwndDlg); + hwndParent = (HWND)lParam; + EnableWindow(GetDlgItem(hwndDlg, IDC_OK), FALSE); + break; + + case WM_COMMAND: + if (LOWORD(wParam) == IDC_OK) { + wchar_t profileName[128]; + GetDlgItemText(hwndDlg, IDC_PROFILENAME, profileName, _countof(profileName)); + SendMessage(hwndParent, UM_ADDPROFILE, 0, (LPARAM)profileName); + // done and exit + DestroyWindow(hwndDlg); + } + else if (LOWORD(wParam) == IDC_CANCEL) { + DestroyWindow(hwndDlg); + } + else if (LOWORD(wParam) == IDC_PROFILENAME) { + (SendDlgItemMessage(hwndDlg, IDC_PROFILENAME, EM_LINELENGTH, 0, 0) > 0) ? EnableWindow(GetDlgItem(hwndDlg, IDC_OK), TRUE) : EnableWindow(GetDlgItem(hwndDlg, IDC_OK), FALSE); + } + break; + + case WM_DESTROY: + EnableWindow(hwndParent, TRUE); + break; + } + + return 0; +} + static INT_PTR CALLBACK StatusProfilesOptDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lParam) { static BOOL bNeedRebuildMenu = FALSE; @@ -890,41 +921,6 @@ static INT_PTR CALLBACK StatusProfilesOptDlgProc(HWND hwndDlg,UINT msg,WPARAM wP return 0; } -INT_PTR CALLBACK addProfileDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lParam) -{ - static HWND hwndParent; - - switch(msg) { - case WM_INITDIALOG: - TranslateDialogDefault(hwndDlg); - hwndParent = (HWND)lParam; - EnableWindow(GetDlgItem(hwndDlg, IDC_OK), FALSE); - break; - - case WM_COMMAND: - if (LOWORD(wParam) == IDC_OK) { - wchar_t profileName[128]; - GetDlgItemText(hwndDlg, IDC_PROFILENAME, profileName, _countof(profileName)); - SendMessage(hwndParent, UM_ADDPROFILE, 0, (LPARAM)profileName); - // done and exit - DestroyWindow(hwndDlg); - } - else if (LOWORD(wParam) == IDC_CANCEL) { - DestroyWindow(hwndDlg); - } - else if (LOWORD(wParam) == IDC_PROFILENAME) { - (SendDlgItemMessage(hwndDlg,IDC_PROFILENAME,EM_LINELENGTH,0,0) > 0)?EnableWindow(GetDlgItem(hwndDlg, IDC_OK), TRUE):EnableWindow(GetDlgItem(hwndDlg, IDC_OK), FALSE); - } - break; - - case WM_DESTROY: - EnableWindow(hwndParent, TRUE); - break; - } - - return 0; -} - int OptionsInit(WPARAM wparam,LPARAM) { OPTIONSDIALOGPAGE odp = { 0 }; -- cgit v1.2.3