From fe0465b11a317db5408d897484caedc3a5f10c47 Mon Sep 17 00:00:00 2001 From: Rozhuk Ivan Date: Sun, 14 Dec 2014 03:42:51 +0000 Subject: SendDlgItemMessage(...BM_SETCHECK ...) -> CheckDlgButton(...) SendDlgItemMessage(...BM_GETCHECK ...) -> IsDlgButtonChecked(...) constants fix for CheckDlgButton() git-svn-id: http://svn.miranda-ng.org/main/trunk@11387 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/clist/genmenuopt.cpp | 4 ++-- src/modules/findadd/findadd.cpp | 2 +- src/modules/metacontacts/meta_options.cpp | 38 +++++++++++++++---------------- src/modules/netlib/netlibopts.cpp | 14 ++++++------ src/modules/skin/sounds.cpp | 4 ++-- 5 files changed, 31 insertions(+), 31 deletions(-) (limited to 'src/modules') diff --git a/src/modules/clist/genmenuopt.cpp b/src/modules/clist/genmenuopt.cpp index b3ef89cb63..9696141a5d 100644 --- a/src/modules/clist/genmenuopt.cpp +++ b/src/modules/clist/genmenuopt.cpp @@ -514,8 +514,8 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA TreeView_SetImageList( GetDlgItem(hwndDlg, IDC_MENUOBJECTS), himlCheckBoxes, TVSIL_NORMAL); TreeView_SetImageList( GetDlgItem(hwndDlg, IDC_MENUITEMS), himlCheckBoxes, TVSIL_NORMAL); } - CheckDlgButton(hwndDlg, dat->iInitMenuValue ? IDC_RADIO2 : IDC_RADIO1, TRUE); - CheckDlgButton(hwndDlg, IDC_DISABLEMENUICONS, bIconsDisabled); + CheckDlgButton(hwndDlg, dat->iInitMenuValue ? IDC_RADIO2 : IDC_RADIO1, BST_CHECKED); + CheckDlgButton(hwndDlg, IDC_DISABLEMENUICONS, bIconsDisabled ? BST_CHECKED : BST_UNCHECKED); BuildMenuObjectsTree(hwndDlg); return TRUE; diff --git a/src/modules/findadd/findadd.cpp b/src/modules/findadd/findadd.cpp index ef08f042be..40a7b73890 100644 --- a/src/modules/findadd/findadd.cpp +++ b/src/modules/findadd/findadd.cpp @@ -793,7 +793,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP if (lParam && dat->hwndTinySearch == (HWND)lParam && HIWORD(wParam) == EN_SETFOCUS && LOWORD(wParam) == 0 && - !IsDlgButtonChecked(hwndDlg, IDC_BYCUSTOM)) + BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_BYCUSTOM)) { CheckSearchTypeRadioButton(hwndDlg, IDC_BYCUSTOM); } diff --git a/src/modules/metacontacts/meta_options.cpp b/src/modules/metacontacts/meta_options.cpp index 2dbcfd32c2..6a550f1ea7 100644 --- a/src/modules/metacontacts/meta_options.cpp +++ b/src/modules/metacontacts/meta_options.cpp @@ -34,18 +34,18 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara TranslateDialogDefault( hwndDlg ); options_changes = options; - CheckDlgButton(hwndDlg, IDC_CHK_SUPPRESSSTATUS, options_changes.bSuppressStatus); + CheckDlgButton(hwndDlg, IDC_CHK_SUPPRESSSTATUS, options_changes.bSuppressStatus ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_RAD_UID, options_changes.menu_contact_label == DNT_UID); - CheckDlgButton(hwndDlg, IDC_RAD_DID, options_changes.menu_contact_label == DNT_DID); + CheckDlgButton(hwndDlg, IDC_RAD_UID, options_changes.menu_contact_label == DNT_UID ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_RAD_DID, options_changes.menu_contact_label == DNT_DID ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_RAD_MSG, options_changes.menu_function == FT_MSG); - CheckDlgButton(hwndDlg, IDC_RAD_MENU, options_changes.menu_function == FT_MENU); - CheckDlgButton(hwndDlg, IDC_RAD_INFO, options_changes.menu_function == FT_INFO); + CheckDlgButton(hwndDlg, IDC_RAD_MSG, options_changes.menu_function == FT_MSG ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_RAD_MENU, options_changes.menu_function == FT_MENU ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_RAD_INFO, options_changes.menu_function == FT_INFO ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_RAD_NICK, options_changes.clist_contact_name == CNNT_NICK); - CheckDlgButton(hwndDlg, IDC_RAD_NAME, options_changes.clist_contact_name == CNNT_DISPLAYNAME); - CheckDlgButton(hwndDlg, IDC_CHK_LOCKHANDLE, options_changes.bLockHandle); + CheckDlgButton(hwndDlg, IDC_RAD_NICK, options_changes.clist_contact_name == CNNT_NICK ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_RAD_NAME, options_changes.clist_contact_name == CNNT_DISPLAYNAME ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_CHK_LOCKHANDLE, options_changes.bLockHandle ? BST_CHECKED : BST_UNCHECKED); { TCHAR buff[40]; _itot(options_changes.days_history, buff, SIZEOF(buff)); @@ -63,52 +63,52 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara case IDC_RAD_UID: if (IsDlgButtonChecked(hwndDlg, IDC_RAD_UID)) { options_changes.menu_contact_label = DNT_UID; - CheckDlgButton(hwndDlg, IDC_RAD_DID, FALSE); + CheckDlgButton(hwndDlg, IDC_RAD_DID, BST_UNCHECKED); } SendMessage( GetParent(hwndDlg), PSM_CHANGED, 0, 0); break; case IDC_RAD_DID: if (IsDlgButtonChecked(hwndDlg, IDC_RAD_DID)) { options_changes.menu_contact_label = DNT_DID; - CheckDlgButton(hwndDlg, IDC_RAD_UID, FALSE); + CheckDlgButton(hwndDlg, IDC_RAD_UID, BST_UNCHECKED); } SendMessage( GetParent(hwndDlg), PSM_CHANGED, 0, 0); break; case IDC_RAD_MSG: if (IsDlgButtonChecked(hwndDlg, IDC_RAD_MSG)) { options_changes.menu_function = FT_MSG; - CheckDlgButton(hwndDlg, IDC_RAD_MENU, FALSE); - CheckDlgButton(hwndDlg, IDC_RAD_INFO, FALSE); + CheckDlgButton(hwndDlg, IDC_RAD_MENU, BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_RAD_INFO, BST_UNCHECKED); } SendMessage( GetParent(hwndDlg), PSM_CHANGED, 0, 0); break; case IDC_RAD_MENU: if (IsDlgButtonChecked(hwndDlg, IDC_RAD_MENU)) { options_changes.menu_function = FT_MENU; - CheckDlgButton(hwndDlg, IDC_RAD_MSG, FALSE); - CheckDlgButton(hwndDlg, IDC_RAD_INFO, FALSE); + CheckDlgButton(hwndDlg, IDC_RAD_MSG, BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_RAD_INFO, BST_UNCHECKED); } SendMessage( GetParent(hwndDlg), PSM_CHANGED, 0, 0); break; case IDC_RAD_INFO: if (IsDlgButtonChecked(hwndDlg, IDC_RAD_INFO)) { options_changes.menu_function = FT_INFO; - CheckDlgButton(hwndDlg, IDC_RAD_MSG, FALSE); - CheckDlgButton(hwndDlg, IDC_RAD_MENU, FALSE); + CheckDlgButton(hwndDlg, IDC_RAD_MSG, BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_RAD_MENU, BST_UNCHECKED); } SendMessage( GetParent(hwndDlg), PSM_CHANGED, 0, 0); break; case IDC_RAD_NICK: if (IsDlgButtonChecked(hwndDlg, IDC_RAD_NICK)) { options_changes.clist_contact_name = CNNT_NICK; - CheckDlgButton(hwndDlg, IDC_RAD_NAME, FALSE); + CheckDlgButton(hwndDlg, IDC_RAD_NAME, BST_UNCHECKED); } SendMessage( GetParent(hwndDlg), PSM_CHANGED, 0, 0); break; case IDC_RAD_NAME: if (IsDlgButtonChecked(hwndDlg, IDC_RAD_NAME)) { options_changes.clist_contact_name = CNNT_DISPLAYNAME; - CheckDlgButton(hwndDlg, IDC_RAD_NICK, FALSE); + CheckDlgButton(hwndDlg, IDC_RAD_NICK, BST_UNCHECKED); } SendMessage( GetParent(hwndDlg), PSM_CHANGED, 0, 0); break; diff --git a/src/modules/netlib/netlibopts.cpp b/src/modules/netlib/netlibopts.cpp index 92102b044e..e9af455711 100644 --- a/src/modules/netlib/netlibopts.cpp +++ b/src/modules/netlib/netlibopts.cpp @@ -305,7 +305,7 @@ static INT_PTR CALLBACK DlgProcNetlibOpts(HWND hwndDlg, UINT msg, WPARAM wParam, flags = tempSettings[iUser]->flags; } ShowMultipleControls(hwndDlg, outgoingConnectionsControls, SIZEOF(outgoingConnectionsControls), flags&NUF_OUTGOING ? SW_SHOW : SW_HIDE); - CheckDlgButton(hwndDlg, IDC_USEPROXY, settings.useProxy); + CheckDlgButton(hwndDlg, IDC_USEPROXY, settings.useProxy ? BST_CHECKED : BST_UNCHECKED); SendDlgItemMessage(hwndDlg, IDC_PROXYTYPE, CB_RESETCONTENT, 0, 0); if (settings.proxyType == 0) AddProxyTypeItem(hwndDlg, 0, settings.proxyType); AddProxyTypeItem(hwndDlg, PROXYTYPE_SOCKS4, settings.proxyType); @@ -317,20 +317,20 @@ static INT_PTR CALLBACK DlgProcNetlibOpts(HWND hwndDlg, UINT msg, WPARAM wParam, SetDlgItemTextA(hwndDlg, IDC_PROXYHOST, settings.szProxyServer ? settings.szProxyServer : ""); if (settings.wProxyPort) SetDlgItemInt(hwndDlg, IDC_PROXYPORT, settings.wProxyPort, FALSE); else SetDlgItemTextA(hwndDlg, IDC_PROXYPORT, ""); - CheckDlgButton(hwndDlg, IDC_PROXYAUTH, settings.useProxyAuth); + CheckDlgButton(hwndDlg, IDC_PROXYAUTH, settings.useProxyAuth ? BST_CHECKED : BST_UNCHECKED); SetDlgItemTextA(hwndDlg, IDC_PROXYUSER, settings.szProxyAuthUser ? settings.szProxyAuthUser : ""); SetDlgItemTextA(hwndDlg, IDC_PROXYPASS, settings.szProxyAuthPassword ? settings.szProxyAuthPassword : ""); - CheckDlgButton(hwndDlg, IDC_PROXYDNS, settings.dnsThroughProxy); - CheckDlgButton(hwndDlg, IDC_VALIDATESSL, settings.validateSSL); + CheckDlgButton(hwndDlg, IDC_PROXYDNS, settings.dnsThroughProxy ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_VALIDATESSL, settings.validateSSL ? BST_CHECKED : BST_UNCHECKED); ShowMultipleControls(hwndDlg, incomingConnectionsControls, SIZEOF(incomingConnectionsControls), flags&NUF_INCOMING ? SW_SHOW : SW_HIDE); - CheckDlgButton(hwndDlg, IDC_SPECIFYPORTS, settings.specifyIncomingPorts); + CheckDlgButton(hwndDlg, IDC_SPECIFYPORTS, settings.specifyIncomingPorts ? BST_CHECKED : BST_UNCHECKED); SetDlgItemTextA(hwndDlg, IDC_PORTSRANGE, settings.szIncomingPorts ? settings.szIncomingPorts : ""); - CheckDlgButton(hwndDlg, IDC_SPECIFYPORTSO, settings.specifyOutgoingPorts); + CheckDlgButton(hwndDlg, IDC_SPECIFYPORTSO, settings.specifyOutgoingPorts ? BST_CHECKED : BST_UNCHECKED); SetDlgItemTextA(hwndDlg, IDC_PORTSRANGEO, settings.szOutgoingPorts ? settings.szOutgoingPorts : ""); - CheckDlgButton(hwndDlg, IDC_ENABLEUPNP, settings.enableUPnP); + CheckDlgButton(hwndDlg, IDC_ENABLEUPNP, settings.enableUPnP ? BST_CHECKED : BST_UNCHECKED); NetlibFreeUserSettingsStruct(&settings); SendMessage(hwndDlg, M_REFRESHENABLING, 0, 0); diff --git a/src/modules/skin/sounds.cpp b/src/modules/skin/sounds.cpp index 2ab0c21b51..7fb04634f2 100644 --- a/src/modules/skin/sounds.cpp +++ b/src/modules/skin/sounds.cpp @@ -164,7 +164,7 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM SendMessage(hwndDlg, DM_HIDEPANE, 0, 0); SendMessage(hwndDlg, DM_REBUILD_STREE, 0, 0); TreeView_SetItemState(hwndTree, 0, TVIS_SELECTED, TVIS_SELECTED); - CheckDlgButton(hwndDlg, IDC_ENABLESOUNDS, db_get_b(NULL, "Skin", "UseSound", 0)); + CheckDlgButton(hwndDlg, IDC_ENABLESOUNDS, db_get_b(NULL, "Skin", "UseSound", 0) ? BST_CHECKED : BST_UNCHECKED); SendMessage(hwndDlg, DM_CHECKENABLED, 0, 0); return TRUE; @@ -235,7 +235,7 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM case DM_CHECKENABLED: EnableWindow( GetDlgItem(hwndDlg, IDC_SOUNDTREE), IsDlgButtonChecked(hwndDlg, IDC_ENABLESOUNDS)); - if (!IsDlgButtonChecked(hwndDlg, IDC_ENABLESOUNDS)) + if (BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_ENABLESOUNDS)) SendMessage(hwndDlg, DM_HIDEPANE, 0, 0); else if (TreeView_GetSelection(hwndTree) && TreeView_GetParent(hwndTree, TreeView_GetSelection(hwndTree))) SendMessage(hwndDlg, DM_SHOWPANE, 0, 0); -- cgit v1.2.3