summaryrefslogtreecommitdiff
path: root/plugins/Clist_nicer/coolsb/coolscroll.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-06-02 20:55:18 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-06-02 20:55:18 +0000
commit78c0815c4118fe24ab78cce2dc48a6232dcd824a (patch)
tree8512c50df70b8dd80c919e88ade3419207c95956 /plugins/Clist_nicer/coolsb/coolscroll.cpp
parentce816d83a8c75808e0eb06832592bffefe4a8dc4 (diff)
- code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@270 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_nicer/coolsb/coolscroll.cpp')
-rw-r--r--plugins/Clist_nicer/coolsb/coolscroll.cpp38
1 files changed, 19 insertions, 19 deletions
diff --git a/plugins/Clist_nicer/coolsb/coolscroll.cpp b/plugins/Clist_nicer/coolsb/coolscroll.cpp
index 68fd144edb..ae31ec3e47 100644
--- a/plugins/Clist_nicer/coolsb/coolscroll.cpp
+++ b/plugins/Clist_nicer/coolsb/coolscroll.cpp
@@ -106,7 +106,7 @@ BOOL WINAPI CoolSB_IsThumbTracking(HWND hwnd)
{
SCROLLWND *sw;
- if((sw = GetScrollWndFromHwnd(hwnd)) == NULL)
+ if ((sw = GetScrollWndFromHwnd(hwnd)) == NULL)
return FALSE;
else
return sw->fThumbTracking;
@@ -142,7 +142,7 @@ static void __stdcall RotateRect0(SCROLLBAR *sb, RECT *rect)
//
static BOOL IsScrollInfoActive(SCROLLINFO *si)
{
- if((si->nPage > (UINT)si->nMax
+ if ((si->nPage > (UINT)si->nMax
|| si->nMax <= si->nMin || si->nMax == 0))
return FALSE;
else
@@ -155,7 +155,7 @@ static BOOL IsScrollInfoActive(SCROLLINFO *si)
static BOOL IsScrollbarActive(SCROLLBAR *sb)
{
SCROLLINFO *si = &sb->scrollInfo;
- if(((sb->fScrollFlags & ESB_DISABLE_BOTH) == ESB_DISABLE_BOTH) ||
+ if (((sb->fScrollFlags & ESB_DISABLE_BOTH) == ESB_DISABLE_BOTH) ||
!(sb->fScrollFlags & CSBS_THUMBALWAYS) && !IsScrollInfoActive(si))
return FALSE;
else
@@ -832,7 +832,7 @@ static LRESULT NCDrawHScrollbar(SCROLLBAR *sb, HWND hwnd, HDC hdc, const RECT *r
if(sb->fScrollFlags & ESB_DISABLE_RIGHT) uRightButFlags |= DFCS_INACTIVE;
//if we need to grey the arrows because there is no data to scroll
- if(!IsScrollInfoActive(si) && !(sb->fScrollFlags & CSBS_THUMBALWAYS))
+ if (!IsScrollInfoActive(si) && !(sb->fScrollFlags & CSBS_THUMBALWAYS))
{
uLeftButFlags |= DFCS_INACTIVE;
uRightButFlags |= DFCS_INACTIVE;
@@ -954,7 +954,7 @@ static LRESULT NCDrawHScrollbar(SCROLLBAR *sb, HWND hwnd, HDC hdc, const RECT *r
//if we always show the thumb covering the whole scrollbar,
//then draw it that way
- if(!IsScrollInfoActive(si) && (sb->fScrollFlags & CSBS_THUMBALWAYS)
+ if (!IsScrollInfoActive(si) && (sb->fScrollFlags & CSBS_THUMBALWAYS)
&& ctrl.right - ctrl.left > sb->nMinThumbSize)
{
//leave a 1-pixel gap between the thumb + right button
@@ -1342,7 +1342,7 @@ static LRESULT DrawHorzButtons(SCROLLBAR *sbar, HDC hdc, const RECT *rect, int l
for(i = 0; i < sbar->nButtons; i++)
{
- if((leftright & SBBP_LEFT) && sbut[i].uPlacement == SBBP_LEFT)
+ if ((leftright & SBBP_LEFT) && sbut[i].uPlacement == SBBP_LEFT)
{
int butwidth = GetSingleButSize(sbar, &sbut[i]);
SetRect(&ctrl, xposl, rect->top, xposl + butwidth, rect->bottom);
@@ -1352,7 +1352,7 @@ static LRESULT DrawHorzButtons(SCROLLBAR *sbar, HDC hdc, const RECT *rect, int l
xposl += butwidth;
}
- if((leftright & SBBP_RIGHT) && sbut[i].uPlacement == SBBP_RIGHT)
+ if ((leftright & SBBP_RIGHT) && sbut[i].uPlacement == SBBP_RIGHT)
{
int butwidth = GetSingleButSize(sbar, &sbut[i]);
SetRect(&ctrl, xposr, rect->top, xposr + butwidth, rect->bottom);
@@ -1603,7 +1603,7 @@ static LRESULT NCPaint(SCROLLWND *sw, HWND hwnd, WPARAM wParam, LPARAM lParam)
CopyRect(&rect2, &rect);
OffsetRect(&rect2, winrect.left, winrect.top);
- if(!sw->fLeftScrollbar && parent.right == rect2.right+sw->cxRightEdge && parent.bottom == rect2.bottom+sw->cyBottomEdge
+ if (!sw->fLeftScrollbar && parent.right == rect2.right+sw->cxRightEdge && parent.bottom == rect2.bottom+sw->cyBottomEdge
|| sw->fLeftScrollbar && parent.left == rect2.left -sw->cxLeftEdge && parent.bottom == rect2.bottom+sw->cyBottomEdge)
DrawFrameControl(hdc, &rect, DFC_SCROLL, sw->fLeftScrollbar ? DFCS_SCROLLSIZEGRIPRIGHT : DFCS_SCROLLSIZEGRIP );
else
@@ -1770,7 +1770,7 @@ static UINT GetHorzButtonFromPt(SCROLLBAR *sb, RECT *rect, POINT pt, BOOL fRetur
int butwidth;
SCROLLBUT *sbut = sb->sbButtons;
- if(!PtInRect(rect, pt))
+ if (!PtInRect(rect, pt))
return -1;
if(sb->fButVisibleAfter)
@@ -2007,7 +2007,7 @@ static LRESULT NCLButtonDown(SCROLLWND *sw, HWND hwnd, WPARAM wParam, LPARAM lPa
case HTSCROLL_THUMB:
//if the scrollbar is disabled, then do no further processing
- if(!IsScrollbarActive(sb))
+ if (!IsScrollbarActive(sb))
return 0;
GetRealScrollRect(sb, &rect);
@@ -2056,7 +2056,7 @@ static LRESULT NCLButtonDown(SCROLLWND *sw, HWND hwnd, WPARAM wParam, LPARAM lPa
target1:
//if the scrollbar is disabled, then do no further processing
- if(!IsScrollbarActive(sb))
+ if (!IsScrollbarActive(sb))
break;
//ajust the horizontal rectangle to NOT include
@@ -2162,7 +2162,7 @@ static LRESULT LButtonUp(SCROLLWND *sw, HWND hwnd, WPARAM wParam, LPARAM lParam)
SCROLLBUT *sbut = &sb->sbButtons[buttonIdx];
UINT cmdid = sbut->uCmdId;
- if((sbut->uButType & SBBT_MASK) == SBBT_TOGGLEBUTTON)
+ if ((sbut->uButType & SBBT_MASK) == SBBT_TOGGLEBUTTON)
sbut->uState ^= 1;
//send a notify??
@@ -2274,7 +2274,7 @@ static LRESULT ThumbTrackHorz(SCROLLBAR *sbar, HWND hwnd, int x, int y)
//if the mouse is not in a suitable distance of the scrollbar,
//then "snap" the thumb back to its initial position
#ifdef SNAP_THUMB_BACK
- if(!PtInRect(&rc2, pt))
+ if (!PtInRect(&rc2, pt))
{
thumbpos = nThumbPos0;
}
@@ -2494,7 +2494,7 @@ static LRESULT MouseMove(SCROLLWND *sw, HWND hwnd, WPARAM wParam, LPARAM lParam)
if(sbut->nSize < (int)sbut->nMinSize)
sbut->nSize = sbut->nMinSize;
- if((UINT)sbut->nSize > (UINT)sbut->nMaxSize)
+ if ((UINT)sbut->nSize > (UINT)sbut->nMaxSize)
sbut->nSize = sbut->nMaxSize;
GetScrollRect(sw, uCurrentScrollbar, hwnd, &rect2);
@@ -2645,7 +2645,7 @@ static void ResizeButtonsToFit(SCROLLWND *sw, SCROLLBAR *sbar, HWND hwnd)
if(sbut->nSize < (int)sbut->nMinSize)
sbut->nSize = sbut->nMinSize;
- if((UINT)sbut->nSize > (UINT)sbut->nMaxSize)
+ if ((UINT)sbut->nSize > (UINT)sbut->nMaxSize)
sbut->nSize = sbut->nMaxSize;
@@ -2713,7 +2713,7 @@ static LRESULT NCCalcSize(SCROLLWND *sw, HWND hwnd, WPARAM wParam, LPARAM lParam
//if there is room, allocate some space for the horizontal scrollbar
//NOTE: Change the ">" to a ">=" to make the horz bar totally fill the
//window before disappearing
- if((sb->fScrollFlags & CSBS_VISIBLE) &&
+ if ((sb->fScrollFlags & CSBS_VISIBLE) &&
#ifdef COOLSB_FILLWINDOW
rect->bottom - rect->top >= GetScrollMetric(sb, SM_CYHORZSB))
#else
@@ -2729,7 +2729,7 @@ static LRESULT NCCalcSize(SCROLLWND *sw, HWND hwnd, WPARAM wParam, LPARAM lParam
sb = &sw->sbarVert;
//if there is room, allocate some space for the vertical scrollbar
- if((sb->fScrollFlags & CSBS_VISIBLE) &&
+ if ((sb->fScrollFlags & CSBS_VISIBLE) &&
rect->right - rect->left >= GetScrollMetric(sb, SM_CXVERTSB))
{
if(sw->fLeftScrollbar)
@@ -2822,7 +2822,7 @@ static LRESULT CoolSB_Timer(SCROLLWND *swnd, HWND hwnd, WPARAM wTimerId, LPARAM
//then kill the timer..
GetCursorPos(&pt);
- if(!PtInRect(&MouseOverRect, pt))
+ if (!PtInRect(&MouseOverRect, pt))
{
KillTimer(hwnd, uMouseOverId);
uMouseOverId = 0;
@@ -3020,7 +3020,7 @@ static LRESULT CoolSB_SetCursor(SCROLLWND *swnd, HWND hwnd, WPARAM wParam, LPARA
}
//set the cursor if one has been specified
- if((id = GetButtonFromPt(sbar, &rect, pt, TRUE)) != -1)
+ if ((id = GetButtonFromPt(sbar, &rect, pt, TRUE)) != -1)
{
sbut = &sbar->sbButtons[id];
curTool = sbut->uCmdId;