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:
authorXhmikosR <xhmikosr@users.sourceforge.net>2010-07-05 16:58:42 +0400
committerXhmikosR <xhmikosr@users.sourceforge.net>2010-07-05 16:58:42 +0400
commitf6883a2c09507d0acb9ccbf0156e5948211dc480 (patch)
tree7789b4fecd6b2e846f070e2e0bdb1e16ea7555e9 /src/apps/mplayerc/StaticLink.cpp
parente9b446380bc3bc122e3e3a1d0622163a5f1920a3 (diff)
astyle formatting
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@2103 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/apps/mplayerc/StaticLink.cpp')
-rw-r--r--src/apps/mplayerc/StaticLink.cpp168
1 files changed, 84 insertions, 84 deletions
diff --git a/src/apps/mplayerc/StaticLink.cpp b/src/apps/mplayerc/StaticLink.cpp
index 6afd07479..6a5f14138 100644
--- a/src/apps/mplayerc/StaticLink.cpp
+++ b/src/apps/mplayerc/StaticLink.cpp
@@ -36,10 +36,10 @@ HCURSOR CStaticLink::g_hCursorLink = NULL;
IMPLEMENT_DYNAMIC(CStaticLink, CStatic)
BEGIN_MESSAGE_MAP(CStaticLink, CStatic)
- ON_WM_NCHITTEST()
- ON_WM_CTLCOLOR_REFLECT()
- ON_WM_LBUTTONDOWN()
- ON_WM_SETCURSOR()
+ ON_WM_NCHITTEST()
+ ON_WM_CTLCOLOR_REFLECT()
+ ON_WM_LBUTTONDOWN()
+ ON_WM_SETCURSOR()
END_MESSAGE_MAP()
///////////////////
@@ -48,9 +48,9 @@ END_MESSAGE_MAP()
//
CStaticLink::CStaticLink(LPCTSTR lpText, BOOL bDeleteOnDestroy)
{
- m_link = lpText; // link text (NULL ==> window text)
- m_color = g_colorUnvisited; // not visited yet
- m_bDeleteOnDestroy = bDeleteOnDestroy; // delete object with window?
+ m_link = lpText; // link text (NULL ==> window text)
+ m_color = g_colorUnvisited; // not visited yet
+ m_bDeleteOnDestroy = bDeleteOnDestroy; // delete object with window?
}
//////////////////
@@ -61,7 +61,7 @@ CStaticLink::CStaticLink(LPCTSTR lpText, BOOL bDeleteOnDestroy)
//
LRESULT CStaticLink::OnNcHitTest(CPoint point)
{
- return HTCLIENT;
+ return HTCLIENT;
}
//////////////////
@@ -71,32 +71,32 @@ LRESULT CStaticLink::OnNcHitTest(CPoint point)
//
HBRUSH CStaticLink::CtlColor(CDC* pDC, UINT nCtlColor)
{
- ASSERT(nCtlColor == CTLCOLOR_STATIC);
- DWORD dwStyle = GetStyle();
-
- HBRUSH hbr = NULL;
- if ((dwStyle & 0xFF) <= SS_RIGHT)
- {
-
- // this is a text control: set up font and colors
- if (!(HFONT)m_font)
- {
- // first time init: create font
- LOGFONT lf;
- GetFont()->GetObject(sizeof(lf), &lf);
- lf.lfUnderline = TRUE;
- m_font.CreateFontIndirect(&lf);
- }
-
- // use underline font and visited/unvisited colors
- pDC->SelectObject(&m_font);
- pDC->SetTextColor(m_color);
- pDC->SetBkMode(TRANSPARENT);
-
- // return hollow brush to preserve parent background color
- hbr = (HBRUSH)::GetStockObject(HOLLOW_BRUSH);
- }
- return hbr;
+ ASSERT(nCtlColor == CTLCOLOR_STATIC);
+ DWORD dwStyle = GetStyle();
+
+ HBRUSH hbr = NULL;
+ if ((dwStyle & 0xFF) <= SS_RIGHT)
+ {
+
+ // this is a text control: set up font and colors
+ if (!(HFONT)m_font)
+ {
+ // first time init: create font
+ LOGFONT lf;
+ GetFont()->GetObject(sizeof(lf), &lf);
+ lf.lfUnderline = TRUE;
+ m_font.CreateFontIndirect(&lf);
+ }
+
+ // use underline font and visited/unvisited colors
+ pDC->SelectObject(&m_font);
+ pDC->SetTextColor(m_color);
+ pDC->SetBkMode(TRANSPARENT);
+
+ // return hollow brush to preserve parent background color
+ hbr = (HBRUSH)::GetStockObject(HOLLOW_BRUSH);
+ }
+ return hbr;
}
/////////////////
@@ -104,29 +104,29 @@ HBRUSH CStaticLink::CtlColor(CDC* pDC, UINT nCtlColor)
//
void CStaticLink::OnLButtonDown(UINT nFlags, CPoint point)
{
- if (m_link.IsEmpty())
- {
- // no link: try to load from resource string or window text
- m_link.LoadString(GetDlgCtrlID()) || (GetWindowText(m_link),1);
- if (m_link.IsEmpty())
- return;
- }
-
- // Call ShellExecute to run the file.
- // For an URL, this means opening it in the browser.
- //
- HINSTANCE h = m_link.Navigate();
- if ((UINT)h > 32) // success!
- {
- m_color = g_colorVisited; // change color
- Invalidate(); // repaint
- }
- else
- {
- MessageBeep(0); // unable to execute file!
- TRACE(_T("*** WARNING: CStaticLink: unable to navigate link %s\n"),
- (LPCTSTR)m_link);
- }
+ if (m_link.IsEmpty())
+ {
+ // no link: try to load from resource string or window text
+ m_link.LoadString(GetDlgCtrlID()) || (GetWindowText(m_link),1);
+ if (m_link.IsEmpty())
+ return;
+ }
+
+ // Call ShellExecute to run the file.
+ // For an URL, this means opening it in the browser.
+ //
+ HINSTANCE h = m_link.Navigate();
+ if ((UINT)h > 32) // success!
+ {
+ m_color = g_colorVisited; // change color
+ Invalidate(); // repaint
+ }
+ else
+ {
+ MessageBeep(0); // unable to execute file!
+ TRACE(_T("*** WARNING: CStaticLink: unable to navigate link %s\n"),
+ (LPCTSTR)m_link);
+ }
}
//////////////////
@@ -137,31 +137,31 @@ void CStaticLink::OnLButtonDown(UINT nFlags, CPoint point)
//
BOOL CStaticLink::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
{
- if (g_hCursorLink == NULL)
- {
- static BOOL bTriedOnce = FALSE;
- if (!bTriedOnce)
- {
- CString windir;
- GetWindowsDirectory(windir.GetBuffer(MAX_PATH), MAX_PATH);
- windir.ReleaseBuffer();
- windir += _T("\\winhlp32.exe");
- HMODULE hModule = LoadLibrary(windir);
- if (hModule)
- {
- g_hCursorLink =
- CopyCursor(::LoadCursor(hModule, MAKEINTRESOURCE(106)));
- }
- FreeLibrary(hModule);
- bTriedOnce = TRUE;
- }
- }
- if (g_hCursorLink)
- {
- ::SetCursor(g_hCursorLink);
- return TRUE;
- }
- return FALSE;
+ if (g_hCursorLink == NULL)
+ {
+ static BOOL bTriedOnce = FALSE;
+ if (!bTriedOnce)
+ {
+ CString windir;
+ GetWindowsDirectory(windir.GetBuffer(MAX_PATH), MAX_PATH);
+ windir.ReleaseBuffer();
+ windir += _T("\\winhlp32.exe");
+ HMODULE hModule = LoadLibrary(windir);
+ if (hModule)
+ {
+ g_hCursorLink =
+ CopyCursor(::LoadCursor(hModule, MAKEINTRESOURCE(106)));
+ }
+ FreeLibrary(hModule);
+ bTriedOnce = TRUE;
+ }
+ }
+ if (g_hCursorLink)
+ {
+ ::SetCursor(g_hCursorLink);
+ return TRUE;
+ }
+ return FALSE;
}
//////////////////
@@ -174,6 +174,6 @@ BOOL CStaticLink::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
//
void CStaticLink::PostNcDestroy()
{
- if (m_bDeleteOnDestroy)
- delete this;
+ if (m_bDeleteOnDestroy)
+ delete this;
}