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/common.h | 1 + message_notify/messagenotify.cpp | 1 - message_notify/options.cpp | 35 ++++++++++++++++++----------------- message_notify/resource.h | 2 -- message_notify/resource.rc | 8 ++++---- ping/options.cpp | 35 +++++++++++------------------------ ping/ping_8.vcproj | 2 -- ping/pingthread.cpp | 14 ++++++++------ worldtime/WorldTime.cpp | 8 +------- worldtime/WorldTime.vcproj | 2 -- worldtime/options.cpp | 12 ++++-------- worldtime/plugwin.cpp | 6 +++--- 12 files changed, 50 insertions(+), 76 deletions(-) diff --git a/message_notify/common.h b/message_notify/common.h index a446c6c..cf0be72 100644 --- a/message_notify/common.h +++ b/message_notify/common.h @@ -29,6 +29,7 @@ #include #include +#include "m_speak.h" extern HINSTANCE hInst; extern PLUGINLINK *pluginLink; diff --git a/message_notify/messagenotify.cpp b/message_notify/messagenotify.cpp index 03d88a4..fa29b07 100644 --- a/message_notify/messagenotify.cpp +++ b/message_notify/messagenotify.cpp @@ -10,7 +10,6 @@ #include #include "collection.h" -#include "m_speak.h" Map open_msg_windows; 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; } diff --git a/message_notify/resource.h b/message_notify/resource.h index 83486fc..b969029 100644 --- a/message_notify/resource.h +++ b/message_notify/resource.h @@ -14,12 +14,10 @@ #define IDC_CP_TXT 1008 #define IDC_CHK_TABS 1009 #define IDC_CHK_CLOSE 1010 -#define IDC_CHK_CLOSE2 1011 #define IDC_CHK_MSG 1011 #define IDC_LIST1 1012 #define IDC_LST_STATUS 1012 #define IDC_CHK_POPUPS 1013 -#define IDC_CHK_SPEACH 1014 #define IDC_CHK_SPEECH 1014 // Next default values for new objects diff --git a/message_notify/resource.rc b/message_notify/resource.rc index 1bfc075..e0bf111 100644 --- a/message_notify/resource.rc +++ b/message_notify/resource.rc @@ -60,15 +60,15 @@ BEGIN CONTROL "Notify if window not open",IDC_RAD_CLOSED,"Button",BS_AUTORADIOBUTTON | WS_GROUP,13,21,132,10 CONTROL "Notify if window isn't 'foreground'",IDC_RAD_NFORE, "Button",BS_AUTORADIOBUTTON,13,41,132,10 - CONTROL "Notify always",IDC_RAD_ALWAYS,"Button",BS_AUTORADIOBUTTON,13,77,132,10 CONTROL "Consider tabs",IDC_CHK_TABS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,29,57,112,10 - CONTROL "Close window on right click",IDC_CHK_CLOSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,40,129,132,10 + CONTROL "Notify always",IDC_RAD_ALWAYS,"Button",BS_AUTORADIOBUTTON,13,77,132,10 GROUPBOX "Disable when",IDC_STATIC,155,7,107,94 CONTROL "",IDC_LST_STATUS,"SysListView32",LVS_REPORT | LVS_NOLABELWRAP | LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | LVS_NOSORTHEADER | WS_TABSTOP,159,17,99,80,WS_EX_CLIENTEDGE - CONTROL "Include message text",IDC_CHK_MSG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,40,142,132,10 GROUPBOX "Notification Types",IDC_STATIC,7,103,255,71 CONTROL "Popups",IDC_CHK_POPUPS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,23,116,104,10 - CONTROL "Speech",IDC_CHK_SPEECH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,23,154,104,10 + CONTROL "Include message text",IDC_CHK_MSG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,40,142,132,10 + CONTROL "Close window on right click",IDC_CHK_CLOSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,40,129,132,10 + CONTROL "Speech",IDC_CHK_SPEECH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,23,156,104,10 END diff --git a/ping/options.cpp b/ping/options.cpp index 56e2d69..7da7639 100644 --- a/ping/options.cpp +++ b/ping/options.cpp @@ -539,36 +539,23 @@ static BOOL CALLBACK DlgProcOpts2(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM int PingOptInit(WPARAM wParam,LPARAM lParam) { -#define OPTIONPAGE_OLD_SIZE2 60 - DWORD mirVir = (DWORD)CallService(MS_SYSTEM_GETVERSION, 0, 0); - OPTIONSDIALOGPAGE odp = { 0 }; - //odp.cbSize = sizeof(odp); - odp.cbSize = (mirVir >= 0x00060000 ? sizeof(odp) : OPTIONPAGE_OLD_SIZE2); - odp.position = -790000000; + odp.cbSize = sizeof(odp); odp.hInstance = hInst; - odp.pszTemplate = MAKEINTRESOURCE(IDD_DIALOG1); - odp.pszTitle = Translate("PING"); - odp.pszGroup = Translate("Network"); odp.flags = ODPF_BOLDGROUPS; - odp.nIDBottomSimpleControl = 0; + odp.pszGroup = "Network"; + odp.pszTitle = "PING"; + + odp.pszTab = "Settings"; + odp.pszTemplate = MAKEINTRESOURCE(IDD_DIALOG1); odp.pfnDlgProc = DlgProcOpts; - odp.pszTab = Translate("Settings"); CallService( MS_OPT_ADDPAGE, wParam,( LPARAM )&odp ); - OPTIONSDIALOGPAGE odp2 = { 0 }; - //odp.cbSize = sizeof(odp); - odp2.cbSize = (mirVir >= 0x00060000 ? sizeof(odp) : OPTIONPAGE_OLD_SIZE2); - odp2.position = -790000100; - odp2.hInstance = hInst; - odp2.pszTemplate = MAKEINTRESOURCE(IDD_DIALOG2); - odp2.pszTitle = (mirVir >= 0x00060000 ? Translate("PING") : Translate("PING Hosts")); - odp2.pszGroup = Translate("Network"); - odp2.flags = ODPF_BOLDGROUPS; - odp2.nIDBottomSimpleControl = 0; - odp2.pfnDlgProc = DlgProcOpts2; - odp2.pszTab = Translate("Hosts"); - CallService( MS_OPT_ADDPAGE, wParam,( LPARAM )&odp2 ); + odp.pszTab = "Hosts"; + odp.pszTemplate = MAKEINTRESOURCE(IDD_DIALOG2); + odp.pfnDlgProc = DlgProcOpts2; + CallService( MS_OPT_ADDPAGE, wParam,( LPARAM )&odp ); + return 0; } diff --git a/ping/ping_8.vcproj b/ping/ping_8.vcproj index 6f08f14..a234b86 100644 --- a/ping/ping_8.vcproj +++ b/ping/ping_8.vcproj @@ -78,7 +78,6 @@ Name="VCLinkerTool" IgnoreImportLibrary="true" AdditionalDependencies="user32.lib gdi32.lib ws2_32.lib shell32.lib comdlg32.lib" - OutputFile="../../bin/debug/plugins/pingplug.dll" LinkIncremental="2" SuppressStartupBanner="true" GenerateDebugInformation="true" @@ -180,7 +179,6 @@