Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/mpc-hc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortetsuo55 <tetsuo55@users.sourceforge.net>2010-04-19 00:29:12 +0400
committertetsuo55 <tetsuo55@users.sourceforge.net>2010-04-19 00:29:12 +0400
commitb072e90c262fef233872e34f93bf298ce0d1fa03 (patch)
treeee8fd84e6d0e594d6e884e8be7e31d2c24be47fe /src/apps/mplayerc/PlayerInfoBar.cpp
parent5215e9e5c05dcfc26b4314a2b52966cbcea5306f (diff)
Style patch part1. based on newly released astyle 1.24.
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@1790 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/apps/mplayerc/PlayerInfoBar.cpp')
-rw-r--r--src/apps/mplayerc/PlayerInfoBar.cpp232
1 files changed, 116 insertions, 116 deletions
diff --git a/src/apps/mplayerc/PlayerInfoBar.cpp b/src/apps/mplayerc/PlayerInfoBar.cpp
index 6f2908da6..60648f1cd 100644
--- a/src/apps/mplayerc/PlayerInfoBar.cpp
+++ b/src/apps/mplayerc/PlayerInfoBar.cpp
@@ -40,128 +40,128 @@ CPlayerInfoBar::~CPlayerInfoBar()
void CPlayerInfoBar::SetLine(CString label, CString info)
{
- if(info.IsEmpty())
- {
- RemoveLine(label);
- return;
- }
-
- for(size_t idx = 0; idx < m_label.GetCount(); idx++)
- {
- CString tmp;
- m_label[idx]->GetWindowText(tmp);
- if(label == tmp)
- {
- m_info[idx]->GetWindowText(tmp);
- if(info != tmp) m_info[idx]->SetWindowText(info);
- return;
- }
- }
-
- CAutoPtr<CStatusLabel> l(DNew CStatusLabel(true, false));
- l->Create(label, WS_CHILD|WS_VISIBLE|WS_CLIPCHILDREN|WS_CLIPSIBLINGS|SS_OWNERDRAW, CRect(0,0,0,0), this);
- m_label.Add(l);
-
- CAutoPtr<CStatusLabel> i(DNew CStatusLabel(false, true));
- i->Create(info, WS_CHILD|WS_VISIBLE|WS_CLIPCHILDREN|WS_CLIPSIBLINGS|SS_OWNERDRAW, CRect(0,0,0,0), this);
- m_info.Add(i);
-
- Relayout();
+ if(info.IsEmpty())
+ {
+ RemoveLine(label);
+ return;
+ }
+
+ for(size_t idx = 0; idx < m_label.GetCount(); idx++)
+ {
+ CString tmp;
+ m_label[idx]->GetWindowText(tmp);
+ if(label == tmp)
+ {
+ m_info[idx]->GetWindowText(tmp);
+ if(info != tmp) m_info[idx]->SetWindowText(info);
+ return;
+ }
+ }
+
+ CAutoPtr<CStatusLabel> l(DNew CStatusLabel(true, false));
+ l->Create(label, WS_CHILD|WS_VISIBLE|WS_CLIPCHILDREN|WS_CLIPSIBLINGS|SS_OWNERDRAW, CRect(0,0,0,0), this);
+ m_label.Add(l);
+
+ CAutoPtr<CStatusLabel> i(DNew CStatusLabel(false, true));
+ i->Create(info, WS_CHILD|WS_VISIBLE|WS_CLIPCHILDREN|WS_CLIPSIBLINGS|SS_OWNERDRAW, CRect(0,0,0,0), this);
+ m_info.Add(i);
+
+ Relayout();
}
void CPlayerInfoBar::GetLine(CString label, CString& info)
{
- info.Empty();
-
- for(size_t idx = 0; idx < m_label.GetCount(); idx++)
- {
- CString tmp;
- m_label[idx]->GetWindowText(tmp);
- if(label == tmp)
- {
- m_info[idx]->GetWindowText(tmp);
- info = tmp;
- return;
- }
- }
+ info.Empty();
+
+ for(size_t idx = 0; idx < m_label.GetCount(); idx++)
+ {
+ CString tmp;
+ m_label[idx]->GetWindowText(tmp);
+ if(label == tmp)
+ {
+ m_info[idx]->GetWindowText(tmp);
+ info = tmp;
+ return;
+ }
+ }
}
void CPlayerInfoBar::RemoveLine(CString label)
{
- for(size_t i = 0; i < m_label.GetCount(); i++)
- {
- CString tmp;
- m_label[i]->GetWindowText(tmp);
- if(label == tmp)
- {
- m_label.RemoveAt(i);
- m_info.RemoveAt(i);
- break;
- }
- }
-
- Relayout();
+ for(size_t i = 0; i < m_label.GetCount(); i++)
+ {
+ CString tmp;
+ m_label[i]->GetWindowText(tmp);
+ if(label == tmp)
+ {
+ m_label.RemoveAt(i);
+ m_info.RemoveAt(i);
+ break;
+ }
+ }
+
+ Relayout();
}
void CPlayerInfoBar::RemoveAllLines()
{
- m_label.RemoveAll();
- m_info.RemoveAll();
+ m_label.RemoveAll();
+ m_info.RemoveAll();
- Relayout();
+ Relayout();
}
BOOL CPlayerInfoBar::Create(CWnd* pParentWnd)
{
- return CDialogBar::Create(pParentWnd, IDD_PLAYERINFOBAR, WS_CHILD|WS_VISIBLE|CBRS_ALIGN_BOTTOM, IDD_PLAYERINFOBAR);
+ return CDialogBar::Create(pParentWnd, IDD_PLAYERINFOBAR, WS_CHILD|WS_VISIBLE|CBRS_ALIGN_BOTTOM, IDD_PLAYERINFOBAR);
}
BOOL CPlayerInfoBar::PreCreateWindow(CREATESTRUCT& cs)
{
- if(!CDialogBar::PreCreateWindow(cs))
- return FALSE;
+ if(!CDialogBar::PreCreateWindow(cs))
+ return FALSE;
- m_dwStyle &= ~CBRS_BORDER_TOP;
- m_dwStyle &= ~CBRS_BORDER_BOTTOM;
+ m_dwStyle &= ~CBRS_BORDER_TOP;
+ m_dwStyle &= ~CBRS_BORDER_BOTTOM;
- return TRUE;
+ return TRUE;
}
CSize CPlayerInfoBar::CalcFixedLayout(BOOL bStretch, BOOL bHorz)
{
- CRect r;
- GetParent()->GetClientRect(&r);
- r.bottom = r.top + m_label.GetCount() * 17 + (m_label.GetCount() ? 4 : 0);
- return r.Size();
+ CRect r;
+ GetParent()->GetClientRect(&r);
+ r.bottom = r.top + m_label.GetCount() * 17 + (m_label.GetCount() ? 4 : 0);
+ return r.Size();
}
void CPlayerInfoBar::Relayout()
{
- CRect r;
- GetParent()->GetClientRect(&r);
-
- int w = m_nFirstColWidth, h = 17, y = 2;
-
- for(size_t i = 0; i < m_label.GetCount(); i++)
- {
- CDC* pDC = m_label[i]->GetDC();
- CString str;
- m_label[i]->GetWindowText(str);
- w = max(w, pDC->GetTextExtent(str).cx);
- m_label[i]->ReleaseDC(pDC);
- }
-
- for(size_t i = 0; i < m_label.GetCount(); i++, y += h)
- {
- m_label[i]->MoveWindow(1, y, w - 10, h);
- m_info[i]->MoveWindow(w + 10, y, r.Width()-(w+10)-1, h);
- }
+ CRect r;
+ GetParent()->GetClientRect(&r);
+
+ int w = m_nFirstColWidth, h = 17, y = 2;
+
+ for(size_t i = 0; i < m_label.GetCount(); i++)
+ {
+ CDC* pDC = m_label[i]->GetDC();
+ CString str;
+ m_label[i]->GetWindowText(str);
+ w = max(w, pDC->GetTextExtent(str).cx);
+ m_label[i]->ReleaseDC(pDC);
+ }
+
+ for(size_t i = 0; i < m_label.GetCount(); i++, y += h)
+ {
+ m_label[i]->MoveWindow(1, y, w - 10, h);
+ m_info[i]->MoveWindow(w + 10, y, r.Width()-(w+10)-1, h);
+ }
}
BEGIN_MESSAGE_MAP(CPlayerInfoBar, CDialogBar)
- ON_WM_ERASEBKGND()
- ON_WM_SIZE()
- ON_WM_LBUTTONDOWN()
+ ON_WM_ERASEBKGND()
+ ON_WM_SIZE()
+ ON_WM_LBUTTONDOWN()
END_MESSAGE_MAP()
@@ -170,49 +170,49 @@ END_MESSAGE_MAP()
BOOL CPlayerInfoBar::OnEraseBkgnd(CDC* pDC)
{
- for(CWnd* pChild = GetWindow(GW_CHILD); pChild; pChild = pChild->GetNextWindow())
- {
- CRect r;
- pChild->GetClientRect(&r);
- pChild->MapWindowPoints(this, &r);
- pDC->ExcludeClipRect(&r);
- }
+ for(CWnd* pChild = GetWindow(GW_CHILD); pChild; pChild = pChild->GetNextWindow())
+ {
+ CRect r;
+ pChild->GetClientRect(&r);
+ pChild->MapWindowPoints(this, &r);
+ pDC->ExcludeClipRect(&r);
+ }
- CRect r;
- GetClientRect(&r);
+ CRect r;
+ GetClientRect(&r);
- CMainFrame* pFrame = ((CMainFrame*)GetParentFrame());
-
- if(pFrame->m_pLastBar != this || pFrame->m_fFullScreen)
- r.InflateRect(0, 0, 0, 1);
+ CMainFrame* pFrame = ((CMainFrame*)GetParentFrame());
- if(pFrame->m_fFullScreen)
- r.InflateRect(1, 0, 1, 0);
+ if(pFrame->m_pLastBar != this || pFrame->m_fFullScreen)
+ r.InflateRect(0, 0, 0, 1);
- pDC->Draw3dRect(&r, GetSysColor(COLOR_3DSHADOW), GetSysColor(COLOR_3DHILIGHT));
+ if(pFrame->m_fFullScreen)
+ r.InflateRect(1, 0, 1, 0);
- r.DeflateRect(1, 1);
+ pDC->Draw3dRect(&r, GetSysColor(COLOR_3DSHADOW), GetSysColor(COLOR_3DHILIGHT));
- pDC->FillSolidRect(&r, 0);
+ r.DeflateRect(1, 1);
- return TRUE;
+ pDC->FillSolidRect(&r, 0);
+
+ return TRUE;
}
void CPlayerInfoBar::OnSize(UINT nType, int cx, int cy)
{
- CDialogBar::OnSize(nType, cx, cy);
+ CDialogBar::OnSize(nType, cx, cy);
- Relayout();
+ Relayout();
- Invalidate();
+ Invalidate();
}
void CPlayerInfoBar::OnLButtonDown(UINT nFlags, CPoint point)
{
- CMainFrame* pFrame = ((CMainFrame*)GetParentFrame());
- if(!pFrame->m_fFullScreen)
- {
- MapWindowPoints(pFrame, &point, 1);
- pFrame->PostMessage(WM_NCLBUTTONDOWN, HTCAPTION, MAKELPARAM(point.x, point.y));
- }
+ CMainFrame* pFrame = ((CMainFrame*)GetParentFrame());
+ if(!pFrame->m_fFullScreen)
+ {
+ MapWindowPoints(pFrame, &point, 1);
+ pFrame->PostMessage(WM_NCLBUTTONDOWN, HTCAPTION, MAKELPARAM(point.x, point.y));
+ }
}