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-09 01:14:58 +0400
committertetsuo55 <tetsuo55@users.sourceforge.net>2010-04-09 01:14:58 +0400
commita9b7bf3fb3e1334d8defd05ca4cfae870b4912e5 (patch)
tree2dab453d94d5e003379a6cc895eceb84c80e23ec /src/apps/mplayerc/FloatEdit.cpp
parentaafd49a91f7c2fa9c7103971c16fa6e1b29e8bfd (diff)
astyle formatting cleanup to make the sourcecode more accessible
switch used: astyle --style=ansi --min-conditional-indent=0 --pad=oper --unpad=paren http://astyle.sourceforge.net/ git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@1783 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/apps/mplayerc/FloatEdit.cpp')
-rw-r--r--src/apps/mplayerc/FloatEdit.cpp122
1 files changed, 61 insertions, 61 deletions
diff --git a/src/apps/mplayerc/FloatEdit.cpp b/src/apps/mplayerc/FloatEdit.cpp
index d13e45bb9..c8a84bd26 100644
--- a/src/apps/mplayerc/FloatEdit.cpp
+++ b/src/apps/mplayerc/FloatEdit.cpp
@@ -31,49 +31,49 @@ IMPLEMENT_DYNAMIC(CFloatEdit, CEdit)
bool CFloatEdit::GetFloat(float& f)
{
- CString s;
- GetWindowText(s);
- return(_stscanf(s, _T("%f"), &f) == 1);
+ CString s;
+ GetWindowText(s);
+ return(_stscanf(s, _T("%f"), &f) == 1);
}
double CFloatEdit::operator = (double d)
{
- CString s;
- s.Format(_T("%.4f"), d);
- SetWindowText(s);
- return(d);
+ CString s;
+ s.Format(_T("%.4f"), d);
+ SetWindowText(s);
+ return(d);
}
CFloatEdit::operator double()
{
- CString s;
- GetWindowText(s);
- float f;
- return(_stscanf(s, _T("%f"), &f) == 1 ? f : 0);
+ CString s;
+ GetWindowText(s);
+ float f;
+ return(_stscanf(s, _T("%f"), &f) == 1 ? f : 0);
}
BEGIN_MESSAGE_MAP(CFloatEdit, CEdit)
- ON_WM_CHAR()
+ ON_WM_CHAR()
END_MESSAGE_MAP()
void CFloatEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
- if(!(nChar >= '0' && nChar <= '9' || nChar == '.' || nChar == '\b'))
- return;
+ if(!(nChar >= '0' && nChar <= '9' || nChar == '.' || nChar == '\b'))
+ return;
- CString str;
- GetWindowText(str);
+ CString str;
+ GetWindowText(str);
- if(nChar == '.' && (str.Find('.') >= 0 || str.IsEmpty()))
- return;
+ if(nChar == '.' && (str.Find('.') >= 0 || str.IsEmpty()))
+ return;
- int nStartChar, nEndChar;
- GetSel(nStartChar, nEndChar);
+ int nStartChar, nEndChar;
+ GetSel(nStartChar, nEndChar);
- if(nChar == '\b' && nStartChar <= 0)
- return;
+ if(nChar == '\b' && nStartChar <= 0)
+ return;
- CEdit::OnChar(nChar, nRepCnt, nFlags);
+ CEdit::OnChar(nChar, nRepCnt, nFlags);
}
// CIntEdit
@@ -81,30 +81,30 @@ void CFloatEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
IMPLEMENT_DYNAMIC(CIntEdit, CEdit)
BEGIN_MESSAGE_MAP(CIntEdit, CEdit)
- ON_WM_CHAR()
+ ON_WM_CHAR()
END_MESSAGE_MAP()
void CIntEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
- if(!(nChar >= '0' && nChar <= '9' || nChar == '-' || nChar == '\b'))
- return;
+ if(!(nChar >= '0' && nChar <= '9' || nChar == '-' || nChar == '\b'))
+ return;
- CString str;
- GetWindowText(str);
+ CString str;
+ GetWindowText(str);
- if(nChar == '-' && !str.IsEmpty() && str[0] == '-')
- return;
+ if(nChar == '-' && !str.IsEmpty() && str[0] == '-')
+ return;
- int nStartChar, nEndChar;
- GetSel(nStartChar, nEndChar);
+ int nStartChar, nEndChar;
+ GetSel(nStartChar, nEndChar);
- if(nChar == '\b' && nStartChar <= 0)
- return;
+ if(nChar == '\b' && nStartChar <= 0)
+ return;
- if(nChar == '-' && (nStartChar != 0 || nEndChar != 0))
- return;
+ if(nChar == '-' && (nStartChar != 0 || nEndChar != 0))
+ return;
- CEdit::OnChar(nChar, nRepCnt, nFlags);
+ CEdit::OnChar(nChar, nRepCnt, nFlags);
}
// CHexEdit
@@ -113,48 +113,48 @@ IMPLEMENT_DYNAMIC(CHexEdit, CEdit)
bool CHexEdit::GetDWORD(DWORD& dw)
{
- CString s;
- GetWindowText(s);
- return(_stscanf(s, _T("%x"), &dw) == 1);
+ CString s;
+ GetWindowText(s);
+ return(_stscanf(s, _T("%x"), &dw) == 1);
}
DWORD CHexEdit::operator = (DWORD dw)
{
- CString s;
- s.Format(_T("%08x"), dw);
- SetWindowText(s);
- return(dw);
+ CString s;
+ s.Format(_T("%08x"), dw);
+ SetWindowText(s);
+ return(dw);
}
CHexEdit::operator DWORD()
{
- CString s;
- GetWindowText(s);
- DWORD dw;
- return(_stscanf(s, _T("%x"), &dw) == 1 ? dw : 0);
+ CString s;
+ GetWindowText(s);
+ DWORD dw;
+ return(_stscanf(s, _T("%x"), &dw) == 1 ? dw : 0);
}
BEGIN_MESSAGE_MAP(CHexEdit, CEdit)
- ON_WM_CHAR()
+ ON_WM_CHAR()
END_MESSAGE_MAP()
void CHexEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
- if(!(nChar >= 'A' && nChar <= 'F' || nChar >= 'a' && nChar <= 'f'
- || nChar >= '0' && nChar <= '9' || nChar == '\b'))
- return;
+ if(!(nChar >= 'A' && nChar <= 'F' || nChar >= 'a' && nChar <= 'f'
+ || nChar >= '0' && nChar <= '9' || nChar == '\b'))
+ return;
- CString str;
- GetWindowText(str);
+ CString str;
+ GetWindowText(str);
- int nStartChar, nEndChar;
- GetSel(nStartChar, nEndChar);
+ int nStartChar, nEndChar;
+ GetSel(nStartChar, nEndChar);
- if(nChar == '\b' && nStartChar <= 0)
- return;
+ if(nChar == '\b' && nStartChar <= 0)
+ return;
- if(nChar != '\b' && nEndChar - nStartChar == 0 && str.GetLength() >= 8)
- return;
+ if(nChar != '\b' && nEndChar - nStartChar == 0 && str.GetLength() >= 8)
+ return;
- CEdit::OnChar(nChar, nRepCnt, nFlags);
+ CEdit::OnChar(nChar, nRepCnt, nFlags);
}