summaryrefslogtreecommitdiff
path: root/plugins/UserInfoEx/src/ctrl_button.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/UserInfoEx/src/ctrl_button.cpp')
-rw-r--r--plugins/UserInfoEx/src/ctrl_button.cpp60
1 files changed, 30 insertions, 30 deletions
diff --git a/plugins/UserInfoEx/src/ctrl_button.cpp b/plugins/UserInfoEx/src/ctrl_button.cpp
index 38b8ef5fc3..534bf8edc2 100644
--- a/plugins/UserInfoEx/src/ctrl_button.cpp
+++ b/plugins/UserInfoEx/src/ctrl_button.cpp
@@ -46,7 +46,7 @@ typedef struct TMBCtrl{
// External theme methods and properties
static mir_cs csTips;
-static HWND hwndToolTips = NULL;
+static HWND hwndToolTips = nullptr;
/**
* name: DestroyTheme
@@ -57,11 +57,11 @@ static HWND hwndToolTips = NULL;
static void __fastcall DestroyTheme(BTNCTRL *ctl) {
if (ctl->hThemeButton) {
CloseThemeData(ctl->hThemeButton);
- ctl->hThemeButton = NULL;
+ ctl->hThemeButton = nullptr;
}
if (ctl->hThemeToolbar) {
CloseThemeData(ctl->hThemeToolbar);
- ctl->hThemeToolbar = NULL;
+ ctl->hThemeToolbar = nullptr;
}
}
@@ -120,7 +120,7 @@ static void __fastcall PaintIcon(BTNCTRL *ctl, HDC hdcMem, LPWORD ccText, LPRECT
OffsetRect(rcText, rcImage.right + 4, 0);
if (ctl->stateId == PBS_PRESSED) OffsetRect(&rcImage, 1, 1);
- DrawState(hdcMem, NULL, NULL, (LPARAM)ctl->hIcon, 0,
+ DrawState(hdcMem, nullptr, nullptr, (LPARAM)ctl->hIcon, 0,
rcImage.left, rcImage.top,
rcImage.right - rcImage.left, rcImage.bottom - rcImage.top,
IsWindowEnabled(ctl->hwnd) ? DST_ICON | DSS_NORMAL : DST_ICON | DSS_DISABLED);
@@ -137,7 +137,7 @@ static void __fastcall PaintIcon(BTNCTRL *ctl, HDC hdcMem, LPWORD ccText, LPRECT
rcImage.top = (rcClient->bottom - rcClient->top - rcImage.bottom) / 2;
if (ctl->stateId == PBS_PRESSED) OffsetRect(&rcImage, 1, 1);
- DrawState(hdcMem, NULL, NULL, (LPARAM)ctl->arrow, 0,
+ DrawState(hdcMem, nullptr, nullptr, (LPARAM)ctl->arrow, 0,
rcImage.left, rcImage.top,
rcImage.right - rcImage.left, rcImage.bottom - rcImage.top,
IsWindowEnabled(ctl->hwnd) ? DST_ICON | DSS_NORMAL : DST_ICON | DSS_DISABLED);
@@ -205,7 +205,7 @@ static void __fastcall PaintThemeButton(BTNCTRL *ctl, HDC hdcMem, LPRECT rcClien
wszText,
ccText,
DST_PREFIXTEXT,
- NULL,
+ nullptr,
&sizeText);
if (ctl->cHot) {
@@ -218,7 +218,7 @@ static void __fastcall PaintThemeButton(BTNCTRL *ctl, HDC hdcMem, LPRECT rcClien
L"&",
1,
DST_PREFIXTEXT,
- NULL,
+ nullptr,
&rcHot);
sizeText.right -= (rcHot.right - rcHot.left);
@@ -259,7 +259,7 @@ static void __fastcall PaintButton(BTNCTRL *ctl, HDC hdcMem, LPRECT rcClient)
// Draw the flat button
if (ctl->dwStyle & MBS_FLAT) {
- HBRUSH hbr = NULL;
+ HBRUSH hbr = nullptr;
if (ctl->stateId == PBS_PRESSED || ctl->stateId == PBS_HOT)
hbr = GetSysColorBrush(COLOR_3DLIGHT);
@@ -338,7 +338,7 @@ static void __fastcall PaintButton(BTNCTRL *ctl, HDC hdcMem, LPRECT rcClient)
: GetSysColor(COLOR_BTNTEXT)
: GetSysColor(COLOR_GRAYTEXT));
- DrawState(hdcMem, NULL, NULL, (LPARAM)szText, 0,
+ DrawState(hdcMem, nullptr, nullptr, (LPARAM)szText, 0,
rcText.left, rcText.top, rcText.right - rcText.left, rcText.bottom - rcText.top,
IsWindowEnabled(ctl->hwnd) || ctl->hThemeButton ? DST_PREFIXTEXT | DSS_NORMAL : DST_PREFIXTEXT | DSS_DISABLED);
SelectObject(hdcMem, hOldFont);
@@ -393,7 +393,7 @@ static LRESULT CALLBACK Button_WndProc(HWND hwndBtn, UINT uMsg, WPARAM wParam, L
}
if (SendMessage(hwndToolTips, TTM_GETTOOLCOUNT, 0, (LPARAM)&ti) == 0) {
DestroyWindow(hwndToolTips);
- hwndToolTips = NULL;
+ hwndToolTips = nullptr;
}
}
DestroyTheme(bct);
@@ -413,7 +413,7 @@ static LRESULT CALLBACK Button_WndProc(HWND hwndBtn, UINT uMsg, WPARAM wParam, L
}
tmp++;
}
- InvalidateRect(bct->hwnd, NULL, TRUE);
+ InvalidateRect(bct->hwnd, nullptr, TRUE);
}
break;
case WM_SYSKEYUP:
@@ -421,7 +421,7 @@ static LRESULT CALLBACK Button_WndProc(HWND hwndBtn, UINT uMsg, WPARAM wParam, L
if (bct->dwStyle & MBS_PUSHBUTTON) {
if (bct->pbState) bct->pbState = 0;
else bct->pbState = 1;
- InvalidateRect(bct->hwnd, NULL, TRUE);
+ InvalidateRect(bct->hwnd, nullptr, TRUE);
}
else
SetFocus(hwndBtn);
@@ -432,7 +432,7 @@ static LRESULT CALLBACK Button_WndProc(HWND hwndBtn, UINT uMsg, WPARAM wParam, L
case WM_THEMECHANGED:
// themed changed, reload theme object
LoadTheme(bct);
- InvalidateRect(bct->hwnd, NULL, TRUE); // repaint it
+ InvalidateRect(bct->hwnd, nullptr, TRUE); // repaint it
break;
case WM_SETFONT: // remember the font so we can use it later
bct->hFont = (HFONT)wParam; // maybe we should redraw?
@@ -472,13 +472,13 @@ static LRESULT CALLBACK Button_WndProc(HWND hwndBtn, UINT uMsg, WPARAM wParam, L
case BM_SETIMAGE:
if (wParam == IMAGE_ICON) {
bct->hIcon = (HICON)lParam;
- bct->hBitmap = NULL;
- InvalidateRect(bct->hwnd, NULL, TRUE);
+ bct->hBitmap = nullptr;
+ InvalidateRect(bct->hwnd, nullptr, TRUE);
}
else if (wParam == IMAGE_BITMAP) {
- bct->hIcon = NULL;
+ bct->hIcon = nullptr;
bct->hBitmap = (HBITMAP)lParam;
- InvalidateRect(bct->hwnd, NULL, TRUE);
+ InvalidateRect(bct->hwnd, nullptr, TRUE);
}
break;
case BM_SETCHECK:
@@ -491,20 +491,20 @@ static LRESULT CALLBACK Button_WndProc(HWND hwndBtn, UINT uMsg, WPARAM wParam, L
bct->pbState = 0;
bct->stateId = PBS_NORMAL;
}
- InvalidateRect(bct->hwnd, NULL, TRUE);
+ InvalidateRect(bct->hwnd, nullptr, TRUE);
break;
case BM_GETCHECK:
if (bct->dwStyle & MBS_PUSHBUTTON) return bct->pbState ? BST_CHECKED : BST_UNCHECKED;
return 0;
case BUTTONSETDEFAULT:
bct->defbutton = (wParam != 0);
- InvalidateRect(bct->hwnd, NULL, TRUE);
+ InvalidateRect(bct->hwnd, nullptr, TRUE);
break;
case BUTTONADDTOOLTIP:
if (wParam) {
mir_cslock lck(csTips);
if (!hwndToolTips)
- hwndToolTips = CreateWindowEx(WS_EX_TOPMOST, TOOLTIPS_CLASS, NULL, WS_POPUP, 0, 0, 0, 0, NULL, NULL, GetModuleHandleA("mir_app.mir"), NULL);
+ hwndToolTips = CreateWindowEx(WS_EX_TOPMOST, TOOLTIPS_CLASS, nullptr, WS_POPUP, 0, 0, 0, 0, nullptr, nullptr, GetModuleHandleA("mir_app.mir"), nullptr);
if (lParam == MBBF_UNICODE) {
TOOLINFOW ti;
@@ -549,29 +549,29 @@ static LRESULT CALLBACK Button_WndProc(HWND hwndBtn, UINT uMsg, WPARAM wParam, L
break;
case WM_SETFOCUS: // set keybord bFocus and redraw
bct->bFocus = 1;
- InvalidateRect(bct->hwnd, NULL, TRUE);
+ InvalidateRect(bct->hwnd, nullptr, TRUE);
break;
case WM_KILLFOCUS: // kill bFocus and redraw
bct->bFocus = 0;
- InvalidateRect(bct->hwnd, NULL, TRUE);
+ InvalidateRect(bct->hwnd, nullptr, TRUE);
break;
case WM_WINDOWPOSCHANGED:
- InvalidateRect(bct->hwnd, NULL, TRUE);
+ InvalidateRect(bct->hwnd, nullptr, TRUE);
break;
case WM_ENABLE: // windows tells us to enable/disable
bct->stateId = wParam ? PBS_NORMAL : PBS_DISABLED;
- InvalidateRect(bct->hwnd, NULL, TRUE);
+ InvalidateRect(bct->hwnd, nullptr, TRUE);
break;
case WM_MOUSELEAVE: // faked by the WM_TIMER
if (bct->stateId != PBS_DISABLED) { // don't change states if disabled
bct->stateId = PBS_NORMAL;
- InvalidateRect(bct->hwnd, NULL, TRUE);
+ InvalidateRect(bct->hwnd, nullptr, TRUE);
}
break;
case WM_LBUTTONDOWN:
if (bct->stateId != PBS_DISABLED) { // don't change states if disabled
bct->stateId = PBS_PRESSED;
- InvalidateRect(bct->hwnd, NULL, TRUE);
+ InvalidateRect(bct->hwnd, nullptr, TRUE);
}
break;
case WM_LBUTTONUP:
@@ -587,16 +587,16 @@ static LRESULT CALLBACK Button_WndProc(HWND hwndBtn, UINT uMsg, WPARAM wParam, L
// Tell your daddy you got clicked, if mouse is still over the button.
if ((bct->dwStyle & MBS_PUSHBUTTON) || bPressed)
SendMessage(GetParent(hwndBtn), WM_COMMAND, MAKELONG(GetDlgCtrlID(hwndBtn), BN_CLICKED), (LPARAM)hwndBtn);
- InvalidateRect(bct->hwnd, NULL, TRUE);
+ InvalidateRect(bct->hwnd, nullptr, TRUE);
}
break;
case WM_MOUSEMOVE:
if (bct->stateId == PBS_NORMAL) {
bct->stateId = PBS_HOT;
- InvalidateRect(bct->hwnd, NULL, TRUE);
+ InvalidateRect(bct->hwnd, nullptr, TRUE);
}
// Call timer, used to start cheesy TrackMouseEvent faker
- SetTimer(hwndBtn, BUTTON_POLLID, BUTTON_POLLDELAY, NULL);
+ SetTimer(hwndBtn, BUTTON_POLLID, BUTTON_POLLDELAY, nullptr);
break;
case WM_TIMER: // use a timer to check if they have did a mouseout
if (wParam == BUTTON_POLLID) {
@@ -630,7 +630,7 @@ void CtrlButtonLoadModule()
wc.cbSize = sizeof(wc);
wc.lpszClassName = UINFOBUTTONCLASS;
wc.lpfnWndProc = Button_WndProc;
- wc.hCursor = LoadCursor(NULL, IDC_ARROW);
+ wc.hCursor = LoadCursor(nullptr, IDC_ARROW);
wc.cbWndExtra = sizeof(LPBTNCTRL);
wc.style = CS_GLOBALCLASS;
RegisterClassEx(&wc);