diff options
author | George Hazan <ghazan@miranda.im> | 2017-03-08 15:46:18 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-03-08 15:46:18 +0300 |
commit | 7b19b6715a75c52e0285ee2031a8fa2ddace1da7 (patch) | |
tree | aa265af852036090d92a1d7036ea42ce805b8296 /plugins/TabSRMM/src/TSButton.cpp | |
parent | 5d2730f1fb7c3d79ce55292f1d5d7bb5dc33cb44 (diff) |
code cleaning
Diffstat (limited to 'plugins/TabSRMM/src/TSButton.cpp')
-rw-r--r-- | plugins/TabSRMM/src/TSButton.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/plugins/TabSRMM/src/TSButton.cpp b/plugins/TabSRMM/src/TSButton.cpp index 1cf5f57536..8fa0b55cd2 100644 --- a/plugins/TabSRMM/src/TSButton.cpp +++ b/plugins/TabSRMM/src/TSButton.cpp @@ -94,11 +94,11 @@ static void PaintWorker(TSButtonCtrl *ctl, HDC hdcPaint) bf_buttonglyph.AlphaFormat = 0;
}
- if (ctl == NULL || hdcPaint == NULL)
+ if (ctl == nullptr || hdcPaint == nullptr)
return;
CSrmmWindow *dat = (CSrmmWindow*)GetWindowLongPtr(GetParent(ctl->hwnd), GWLP_USERDATA);
- if (dat == NULL)
+ if (dat == nullptr)
return;
HDC hdcMem;
@@ -111,7 +111,7 @@ static void PaintWorker(TSButtonCtrl *ctl, HDC hdcPaint) CopyRect(&rcContent, &rcClient);
if (CMimAPI::m_haveBufferedPaint) {
- hbp = CMimAPI::m_pfnBeginBufferedPaint(hdcPaint, &rcContent, BPBF_TOPDOWNDIB, NULL, &hdcMem);
+ hbp = CMimAPI::m_pfnBeginBufferedPaint(hdcPaint, &rcContent, BPBF_TOPDOWNDIB, nullptr, &hdcMem);
hbmMem = hOld = 0;
}
else {
@@ -295,9 +295,9 @@ static void PaintWorker(TSButtonCtrl *ctl, HDC hdcPaint) sz.cx -= szHot.cx;
}
if (ctl->arrow)
- DrawState(hdcMem, NULL, NULL, (LPARAM)ctl->arrow, 0, rcClient.right - rcClient.left - 5 - PluginConfig.m_smcxicon + (!ctl->hThemeButton && ctl->stateId == PBS_PRESSED ? 1 : 0), (rcClient.bottom - rcClient.top) / 2 - PluginConfig.m_smcyicon / 2 + (!ctl->hThemeButton && ctl->stateId == PBS_PRESSED ? 1 : 0), PluginConfig.m_smcxicon, PluginConfig.m_smcyicon, IsWindowEnabled(ctl->hwnd) ? DST_ICON : DST_ICON | DSS_DISABLED);
+ DrawState(hdcMem, nullptr, nullptr, (LPARAM)ctl->arrow, 0, rcClient.right - rcClient.left - 5 - PluginConfig.m_smcxicon + (!ctl->hThemeButton && ctl->stateId == PBS_PRESSED ? 1 : 0), (rcClient.bottom - rcClient.top) / 2 - PluginConfig.m_smcyicon / 2 + (!ctl->hThemeButton && ctl->stateId == PBS_PRESSED ? 1 : 0), PluginConfig.m_smcxicon, PluginConfig.m_smcyicon, IsWindowEnabled(ctl->hwnd) ? DST_ICON : DST_ICON | DSS_DISABLED);
SelectObject(hdcMem, ctl->hFont);
- DrawState(hdcMem, NULL, NULL, (LPARAM)szText, mir_wstrlen(szText), (rcText.right - rcText.left - sz.cx) / 2 + (!ctl->hThemeButton && ctl->stateId == PBS_PRESSED ? 1 : 0), ctl->hThemeButton ? (rcText.bottom - rcText.top - sz.cy) / 2 : (rcText.bottom - rcText.top - sz.cy) / 2 - (ctl->stateId == PBS_PRESSED ? 0 : 1), sz.cx, sz.cy, IsWindowEnabled(ctl->hwnd) || ctl->hThemeButton ? DST_PREFIXTEXT | DSS_NORMAL : DST_PREFIXTEXT | DSS_DISABLED);
+ DrawState(hdcMem, nullptr, nullptr, (LPARAM)szText, mir_wstrlen(szText), (rcText.right - rcText.left - sz.cx) / 2 + (!ctl->hThemeButton && ctl->stateId == PBS_PRESSED ? 1 : 0), ctl->hThemeButton ? (rcText.bottom - rcText.top - sz.cy) / 2 : (rcText.bottom - rcText.top - sz.cy) / 2 - (ctl->stateId == PBS_PRESSED ? 0 : 1), sz.cx, sz.cy, IsWindowEnabled(ctl->hwnd) || ctl->hThemeButton ? DST_PREFIXTEXT | DSS_NORMAL : DST_PREFIXTEXT | DSS_DISABLED);
SelectObject(hdcMem, hOldFont);
}
@@ -363,21 +363,21 @@ static LRESULT CALLBACK TSButtonWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, L DeleteObject(ii.hbmMask);
DeleteObject(ii.hbmColor);
- bct->hBitmap = NULL;
- InvalidateRect(bct->hwnd, NULL, TRUE);
+ bct->hBitmap = nullptr;
+ InvalidateRect(bct->hwnd, nullptr, TRUE);
}
else if (wParam == IMAGE_BITMAP) {
bct->hBitmap = (HBITMAP)lParam;
if (bct->hIconPrivate)
DestroyIcon(bct->hIconPrivate);
- bct->hIcon = bct->hIconPrivate = NULL;
- InvalidateRect(bct->hwnd, NULL, TRUE);
+ bct->hIcon = bct->hIconPrivate = nullptr;
+ InvalidateRect(bct->hwnd, nullptr, TRUE);
}
return 0;
case BUTTONSETARROW: // turn arrow on/off
bct->arrow = (HICON)wParam;
- InvalidateRect(bct->hwnd, NULL, TRUE);
+ InvalidateRect(bct->hwnd, nullptr, TRUE);
return 0;
case BUTTONSETASDIMMED:
@@ -394,7 +394,7 @@ static LRESULT CALLBACK TSButtonWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, L case BUTTONSETASNORMAL:
bct->stateId = (wParam) ? PBS_NORMAL : PBS_DISABLED;
- InvalidateRect(bct->hwnd, NULL, FALSE);
+ InvalidateRect(bct->hwnd, nullptr, FALSE);
break;
case BUTTONGETSTATEID:
@@ -428,7 +428,7 @@ static LRESULT CALLBACK TSButtonWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, L if (bct->sitem->testCloseButton() != -1)
return TRUE;
bct->stateId = PBS_PRESSED;
- InvalidateRect(bct->hwnd, NULL, TRUE);
+ InvalidateRect(bct->hwnd, nullptr, TRUE);
bct->sitem->activateSession();
}
@@ -443,7 +443,7 @@ static LRESULT CALLBACK TSButtonWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, L SendMessage(GetParent(hwndDlg), WM_COMMAND, MAKELONG(w, BN_CLICKED), (LPARAM)hwndDlg);
}
}
- InvalidateRect(bct->hwnd, NULL, TRUE);
+ InvalidateRect(bct->hwnd, nullptr, TRUE);
return 0;
}
break;
@@ -459,7 +459,7 @@ static LRESULT CALLBACK TSButtonWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, L case WM_MOUSEMOVE:
if (bct->arrow && bct->stateId == PBS_HOT)
- InvalidateRect(bct->hwnd, NULL, TRUE);
+ InvalidateRect(bct->hwnd, nullptr, TRUE);
if (bct->sitem) {
if (bct->sitem->testCloseButton() != -1) {
|