From def15f7b4ab039525ea2a9028c18b497128f8c0d Mon Sep 17 00:00:00 2001 From: sje Date: Tue, 10 Jul 2007 06:07:39 +0000 Subject: use new YAPP popup class API git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@267 4f64403b-2f21-0410-a795-97e2b3489a10 --- message_notify/options.cpp | 66 ---------------------------------------------- 1 file changed, 66 deletions(-) (limited to 'message_notify/options.cpp') diff --git a/message_notify/options.cpp b/message_notify/options.cpp index 8b7a40c..c2f42b7 100644 --- a/message_notify/options.cpp +++ b/message_notify/options.cpp @@ -68,40 +68,9 @@ 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); - if(options.timeout == -1) { - CheckDlgButton(hwndDlg, IDC_CHK_SETTIMEOUT, FALSE); - SetDlgItemInt(hwndDlg, IDC_ED_TIMEOUT, 0, FALSE); - HWND hwnd = GetDlgItem(hwndDlg, IDC_ED_TIMEOUT); - EnableWindow(hwnd, FALSE); - } else { - CheckDlgButton(hwndDlg, IDC_CHK_SETTIMEOUT, TRUE); - SetDlgItemInt(hwndDlg, IDC_ED_TIMEOUT, options.timeout, FALSE); - } - - CheckDlgButton(hwndDlg, IDC_CHK_SETCOLOURS, options.set_colours ? TRUE : FALSE); - SendDlgItemMessage(hwndDlg, IDC_CP_BK, CPM_SETCOLOUR, 0, (LPARAM)options.bkCol); - SendDlgItemMessage(hwndDlg, IDC_CP_TXT, CPM_SETCOLOUR, 0, (LPARAM)options.textCol); - if(!options.set_colours) { - CheckDlgButton(hwndDlg, IDC_CHK_SETCOLOURS, FALSE); - HWND hwnd = GetDlgItem(hwndDlg, IDC_CP_BK); - EnableWindow(hwnd, FALSE); - hwnd = GetDlgItem(hwndDlg, IDC_CP_TXT); - EnableWindow(hwnd, FALSE); - } return FALSE; case WM_COMMAND: - if(LOWORD(wParam) == IDC_CP_BK || LOWORD(wParam) == IDC_CP_TXT) { - SendMessage( GetParent( hwndDlg ), PSM_CHANGED, 0, 0 ); - break; - } - if ( HIWORD( wParam ) == EN_CHANGE && ( HWND )lParam == GetFocus()) { - switch( LOWORD( wParam )) { - case IDC_ED_TIMEOUT: - SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); - } - break; - } if ( HIWORD( wParam ) == BN_CLICKED ) { switch( LOWORD( wParam )) { case IDC_RAD_CLOSED: @@ -119,22 +88,6 @@ static BOOL CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l } SendMessage( GetParent( hwndDlg ), PSM_CHANGED, 0, 0 ); return TRUE; - case IDC_CHK_SETTIMEOUT: - { - HWND hwnd = GetDlgItem(hwndDlg, IDC_ED_TIMEOUT); - EnableWindow(hwnd, IsDlgButtonChecked(hwndDlg, IDC_CHK_SETTIMEOUT)); - } - SendMessage( GetParent( hwndDlg ), PSM_CHANGED, 0, 0 ); - return TRUE; - case IDC_CHK_SETCOLOURS: - { - HWND hwnd = GetDlgItem(hwndDlg, IDC_CP_BK); - EnableWindow(hwnd, IsDlgButtonChecked(hwndDlg, IDC_CHK_SETCOLOURS)); - hwnd = GetDlgItem(hwndDlg, IDC_CP_TXT); - EnableWindow(hwnd, IsDlgButtonChecked(hwndDlg, IDC_CHK_SETCOLOURS)); - } - SendMessage( GetParent( hwndDlg ), PSM_CHANGED, 0, 0 ); - return TRUE; case IDC_CHK_MSG: case IDC_CHK_CLOSE: case IDC_CHK_TABS: @@ -169,17 +122,6 @@ static BOOL CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l options.close_win = IsDlgButtonChecked(hwndDlg, IDC_CHK_CLOSE) ? true : false; options.show_msg = IsDlgButtonChecked(hwndDlg, IDC_CHK_MSG) ? true : false; - if(IsDlgButtonChecked(hwndDlg, IDC_CHK_SETTIMEOUT)) { - BOOL trans; - int t = GetDlgItemInt(hwndDlg, IDC_ED_TIMEOUT, &trans, FALSE); - if(trans) options.timeout = t; - } else - options.timeout = -1; - - options.set_colours = IsDlgButtonChecked(hwndDlg, IDC_CHK_SETCOLOURS) ? true : false; - options.bkCol = (COLORREF)SendDlgItemMessage(hwndDlg, IDC_CP_BK, CPM_GETCOLOUR, 0, 0); - options.textCol = (COLORREF)SendDlgItemMessage(hwndDlg, IDC_CP_TXT, CPM_GETCOLOUR, 0, 0); - for(int i = 0; i < 9; i++) options.disable_status[i] = (ListView_GetCheckState(GetDlgItem(hwndDlg, IDC_LST_STATUS), i) ? true : false); SaveOptions(); @@ -221,10 +163,6 @@ int OptInit(WPARAM wParam,LPARAM lParam) void LoadOptions() { options.notify_when = DBGetContactSettingByte(0, MODULE, "NotifyWhen", NOTIFY_NFORE); - options.timeout = (int)DBGetContactSettingDword(0, MODULE, "Timeout", 5); - options.set_colours = (DBGetContactSettingByte(0, MODULE, "SetColours", 0) == 1); - options.bkCol = (COLORREF)DBGetContactSettingDword(0, MODULE, "BkColour", (DWORD)0xFFFFFF); - options.textCol = (COLORREF)DBGetContactSettingDword(0, MODULE, "TextColour", (DWORD)0x000000); options.consider_tabs = (DBGetContactSettingByte(0, MODULE, "ConsiderTabs", 1) == 1); options.close_win = (DBGetContactSettingByte(0, MODULE, "CloseWin", 0) == 1); options.show_msg = (DBGetContactSettingByte(0, MODULE, "ShowMsg", 1) == 1); @@ -238,10 +176,6 @@ void LoadOptions() { void SaveOptions() { DBWriteContactSettingByte(0, MODULE, "NotifyWhen", options.notify_when); - DBWriteContactSettingDword(0, MODULE, "Timeout", (DWORD)options.timeout); - DBWriteContactSettingByte(0, MODULE, "SetColours", options.set_colours ? 1 : 0); - DBWriteContactSettingDword(0, MODULE, "BkColour", (DWORD)options.bkCol); - DBWriteContactSettingDword(0, MODULE, "TextColour", (DWORD)options.textCol); DBWriteContactSettingByte(0, MODULE, "ConsiderTabs", options.consider_tabs ? 1 : 0); DBWriteContactSettingByte(0, MODULE, "CloseWin", options.close_win ? 1 : 0); DBWriteContactSettingByte(0, MODULE, "ShowMsg", options.show_msg ? 1 : 0); -- cgit v1.2.3