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/FloatEdit.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/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);
}