summaryrefslogtreecommitdiff
path: root/plugins/TabSRMM/src/sidebar.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-03-26 20:04:19 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-03-26 20:04:19 +0000
commit0ff5363fc3c387364947df74da71790eb0c4c1a3 (patch)
tree73fec09994495436e38126530b2689fadb348d1d /plugins/TabSRMM/src/sidebar.cpp
parent10bf2c45f3592efcfb662c1c9cc7ba163f32a523 (diff)
code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@4205 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/TabSRMM/src/sidebar.cpp')
-rw-r--r--plugins/TabSRMM/src/sidebar.cpp98
1 files changed, 46 insertions, 52 deletions
diff --git a/plugins/TabSRMM/src/sidebar.cpp b/plugins/TabSRMM/src/sidebar.cpp
index 18b045794e..035d32cd43 100644
--- a/plugins/TabSRMM/src/sidebar.cpp
+++ b/plugins/TabSRMM/src/sidebar.cpp
@@ -917,55 +917,52 @@ void CSideBar::invalidateButton(const TWindowData* dat)
LRESULT CALLBACK CSideBar::wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch(msg) {
- case WM_SIZE:
- return(TRUE);
- case WM_ERASEBKGND: {
- HDC hdc = (HDC)wParam;
- RECT rc;
- ::GetClientRect(hwnd, &rc);
- if (CSkin::m_skinEnabled) {
- CSkinItem *item = &SkinItems[ID_EXTBKSIDEBARBG];
-
- if (item->IGNORED)
- CSkin::SkinDrawBG(hwnd, m_pContainer->hwnd, m_pContainer, &rc, hdc);
- else
- CSkin::DrawItem(hdc, &rc, item);
- }
- else if (M->isAero() || M->isVSThemed()) {
- HDC hdcMem;
- HANDLE hbp = 0;
- HBITMAP hbm, hbmOld;
-
- if (CMimAPI::m_haveBufferedPaint)
- hbp = CSkin::InitiateBufferedPaint(hdc, rc, hdcMem);
- else {
- hdcMem = ::CreateCompatibleDC(hdc);
- hbm = CSkin::CreateAeroCompatibleBitmap(rc, hdcMem);
- hbmOld = reinterpret_cast<HBITMAP>(::SelectObject(hdcMem, hbm));
- }
+ case WM_SIZE:
+ return TRUE;
- if (M->isAero())
- ::FillRect(hdcMem, &rc, CSkin::m_BrushBack);
- else
- CSkin::FillBack(hdcMem, &rc);
-
- if (hbp)
- CSkin::FinalizeBufferedPaint(hbp, &rc);
- else {
- ::BitBlt(hdc, 0, 0, rc.right, rc.bottom, hdcMem, 0, 0, SRCCOPY);
- ::SelectObject(hdcMem, hbmOld);
- ::DeleteObject(hbm);
- ::DeleteDC(hdcMem);
- }
+ case WM_ERASEBKGND:
+ HDC hdc = (HDC)wParam;
+ RECT rc;
+ ::GetClientRect(hwnd, &rc);
+ if (CSkin::m_skinEnabled) {
+ CSkinItem *item = &SkinItems[ID_EXTBKSIDEBARBG];
+
+ if (item->IGNORED)
+ CSkin::SkinDrawBG(hwnd, m_pContainer->hwnd, m_pContainer, &rc, hdc);
+ else
+ CSkin::DrawItem(hdc, &rc, item);
+ }
+ else if (M->isAero() || M->isVSThemed()) {
+ HDC hdcMem;
+ HANDLE hbp = 0;
+ HBITMAP hbm, hbmOld;
+
+ if (CMimAPI::m_haveBufferedPaint)
+ hbp = CSkin::InitiateBufferedPaint(hdc, rc, hdcMem);
+ else {
+ hdcMem = ::CreateCompatibleDC(hdc);
+ hbm = CSkin::CreateAeroCompatibleBitmap(rc, hdcMem);
+ hbmOld = reinterpret_cast<HBITMAP>(::SelectObject(hdcMem, hbm));
}
+
+ if (M->isAero())
+ ::FillRect(hdcMem, &rc, CSkin::m_BrushBack);
else
- ::FillRect(hdc, &rc, ::GetSysColorBrush(COLOR_3DFACE));
- return 1;
+ CSkin::FillBack(hdcMem, &rc);
+
+ if (hbp)
+ CSkin::FinalizeBufferedPaint(hbp, &rc);
+ else {
+ ::BitBlt(hdc, 0, 0, rc.right, rc.bottom, hdcMem, 0, 0, SRCCOPY);
+ ::SelectObject(hdcMem, hbmOld);
+ ::DeleteObject(hbm);
+ ::DeleteDC(hdcMem);
+ }
}
- default:
- break;
+ else ::FillRect(hdc, &rc, ::GetSysColorBrush(COLOR_3DFACE));
+ return 1;
}
- return(DefWindowProc(hwnd, msg, wParam, lParam));
+ return DefWindowProc(hwnd, msg, wParam, lParam);
}
LRESULT CALLBACK CSideBar::wndProcStub(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
@@ -976,15 +973,12 @@ LRESULT CALLBACK CSideBar::wndProcStub(HWND hwnd, UINT msg, WPARAM wParam, LPARA
return(sideBar->wndProc(hwnd, msg, wParam, lParam));
switch(msg) {
- case WM_NCCREATE: {
- CREATESTRUCT *cs = (CREATESTRUCT *)lParam;
- ::SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)cs->lpCreateParams);
- return(TRUE);
- }
- default:
- break;
+ case WM_NCCREATE:
+ CREATESTRUCT *cs = (CREATESTRUCT *)lParam;
+ ::SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)cs->lpCreateParams);
+ return TRUE;
}
- return(::DefWindowProc(hwnd, msg, wParam, lParam));
+ return ::DefWindowProc(hwnd, msg, wParam, lParam);
}
/**
* paints the background for a switchbar item. It can paint aero, visual styles, skins or