From ada33e15355aaf0e222f7aa93063ab1efcdd21a1 Mon Sep 17 00:00:00 2001 From: sje Date: Tue, 30 Oct 2007 04:59:55 +0000 Subject: fixed to options git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@373 4f64403b-2f21-0410-a795-97e2b3489a10 --- message_notify/options.cpp | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) (limited to 'message_notify/options.cpp') diff --git a/message_notify/options.cpp b/message_notify/options.cpp index cb2058c..e5ea989 100644 --- a/message_notify/options.cpp +++ b/message_notify/options.cpp @@ -3,7 +3,7 @@ Options options; -static BOOL CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { +BOOL CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { switch ( msg ) { case WM_INITDIALOG: @@ -71,15 +71,20 @@ static BOOL CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l CheckDlgButton(hwndDlg, IDC_CHK_CLOSE, options.close_win ? TRUE : FALSE); CheckDlgButton(hwndDlg, IDC_CHK_MSG, options.show_msg ? TRUE : FALSE); - CheckDlgButton(hwndDlg, IDC_CHK_SPEECH, (options.flags & MNNF_SPEAK)); + CheckDlgButton(hwndDlg, IDC_CHK_SPEECH, (options.flags & MNNF_SPEAK) ? TRUE : FALSE); if(options.flags & MNNF_POPUP) { CheckDlgButton(hwndDlg, IDC_CHK_POPUPS, TRUE); - HWND hwnd = GetDlgItem(hwndDlg, IDC_CHK_CLOSE); - EnableWindow(hwndDlg, FALSE); - hwnd = GetDlgItem(hwndDlg, IDC_CHK_MSG); - EnableWindow(hwndDlg, FALSE); } else { CheckDlgButton(hwndDlg, IDC_CHK_POPUPS, FALSE); + HWND hwnd = GetDlgItem(hwndDlg, IDC_CHK_CLOSE); + EnableWindow(hwnd, FALSE); + hwnd = GetDlgItem(hwndDlg, IDC_CHK_MSG); + EnableWindow(hwnd, FALSE); + } + + if(!ServiceExists(MS_SPEAK_SAYEX)) { + HWND hwnd = GetDlgItem(hwndDlg, IDC_CHK_SPEECH); + EnableWindow(hwnd, FALSE); } } @@ -112,9 +117,9 @@ static BOOL CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l { bool checked = IsDlgButtonChecked(hwndDlg, IDC_CHK_POPUPS) ? true : false; HWND hwnd = GetDlgItem(hwndDlg, IDC_CHK_CLOSE); - EnableWindow(hwndDlg, checked ? TRUE : FALSE); + EnableWindow(hwnd, checked ? TRUE : FALSE); hwnd = GetDlgItem(hwndDlg, IDC_CHK_MSG); - EnableWindow(hwndDlg, checked ? TRUE : FALSE); + EnableWindow(hwnd, checked ? TRUE : FALSE); } SendMessage( GetParent( hwndDlg ), PSM_CHANGED, 0, 0 ); return TRUE; @@ -174,20 +179,16 @@ static BOOL CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l int OptInit(WPARAM wParam,LPARAM lParam) { OPTIONSDIALOGPAGE odp = { 0 }; -#define OPTIONPAGE_OLD_SIZE2 60 - //odp.cbSize = sizeof(odp); - odp.cbSize = OPTIONPAGE_OLD_SIZE2; - odp.position = -790000000; + odp.cbSize = sizeof(odp); + odp.flags = ODPF_BOLDGROUPS; odp.hInstance = hInst; + odp.pszGroup = "Popups"; + odp.pszTitle = MODULE; + odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS); - odp.pszTitle = Translate(MODULE); - odp.pszGroup = Translate("Popups"); - odp.flags = ODPF_BOLDGROUPS; - odp.nIDBottomSimpleControl = 0; odp.pfnDlgProc = DlgProcOpts; CallService( MS_OPT_ADDPAGE, wParam,( LPARAM )&odp ); - return 0; } -- cgit v1.2.3