X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4676948b6814c97b93c431a8cbcd8c0352c87ba9..422d0ff0bec79832494fe4605ffdcf8e87ba6c03:/src/common/valtext.cpp diff --git a/src/common/valtext.cpp b/src/common/valtext.cpp index c90e197703..0e62b5ded3 100644 --- a/src/common/valtext.cpp +++ b/src/common/valtext.cpp @@ -9,7 +9,7 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "valtext.h" #endif @@ -50,13 +50,13 @@ static bool wxIsNumeric(const wxString& val); wxTextValidator::wxTextValidator(long style, wxString *val) { - m_validatorStyle = style ; - m_stringValue = val ; + m_validatorStyle = style; + m_stringValue = val; /* m_refData = new wxVTextRefData; - M_VTEXTDATA->m_validatorStyle = style ; - M_VTEXTDATA->m_stringValue = val ; + M_VTEXTDATA->m_validatorStyle = style; + M_VTEXTDATA->m_stringValue = val; */ } @@ -70,12 +70,12 @@ bool wxTextValidator::Copy(const wxTextValidator& val) { wxValidator::Copy(val); - m_validatorStyle = val.m_validatorStyle ; - m_stringValue = val.m_stringValue ; + m_validatorStyle = val.m_validatorStyle; + m_stringValue = val.m_stringValue; m_includeList = val.m_includeList; m_excludeList = val.m_excludeList; - + return TRUE; } @@ -112,7 +112,7 @@ bool wxTextValidator::Validate(wxWindow *parent) if( !CheckValidator() ) return FALSE; - wxTextCtrl *control = (wxTextCtrl *) m_validatorWindow ; + wxTextCtrl *control = (wxTextCtrl *) m_validatorWindow; // If window is disabled, simply return if ( !control->IsEnabled() ) @@ -195,11 +195,11 @@ bool wxTextValidator::TransferToWindow(void) if( !CheckValidator() ) return FALSE; - if (!m_stringValue) - return TRUE; - - wxTextCtrl *control = (wxTextCtrl *) m_validatorWindow ; - control->SetValue(* m_stringValue) ; + if ( m_stringValue ) + { + wxTextCtrl *control = (wxTextCtrl *) m_validatorWindow; + control->SetValue(* m_stringValue); + } return TRUE; } @@ -210,11 +210,11 @@ bool wxTextValidator::TransferFromWindow(void) if( !CheckValidator() ) return FALSE; - if (!m_stringValue) - return TRUE; - - wxTextCtrl *control = (wxTextCtrl *) m_validatorWindow ; - * m_stringValue = control->GetValue() ; + if ( m_stringValue ) + { + wxTextCtrl *control = (wxTextCtrl *) m_validatorWindow; + *m_stringValue = control->GetValue(); + } return TRUE; } @@ -229,10 +229,6 @@ void wxTextValidator::SetExcludeList(const wxStringList& list) m_excludeList = list; } -#ifdef __WXWINCE__ -inline int isascii(wxChar c) { return (c >= 0) && (c <=127); } -#endif - void wxTextValidator::OnChar(wxKeyEvent& event) { /* @@ -248,8 +244,8 @@ void wxTextValidator::OnChar(wxKeyEvent& event) if ( !(keyCode < WXK_SPACE || keyCode == WXK_DELETE || keyCode > WXK_START) && ( - ((m_validatorStyle & wxFILTER_INCLUDE_CHAR_LIST) && !IsInCharIncludeList(wxString((char) keyCode, 1))) || - ((m_validatorStyle & wxFILTER_EXCLUDE_CHAR_LIST) && !IsNotInCharExcludeList(wxString((char) keyCode, 1))) || + ((m_validatorStyle & wxFILTER_INCLUDE_CHAR_LIST) && !IsInCharIncludeList(wxString((wxChar) keyCode, 1))) || + ((m_validatorStyle & wxFILTER_EXCLUDE_CHAR_LIST) && !IsNotInCharExcludeList(wxString((wxChar) keyCode, 1))) || ((m_validatorStyle & wxFILTER_ASCII) && !isascii(keyCode)) || ((m_validatorStyle & wxFILTER_ALPHA) && !wxIsalpha(keyCode)) || ((m_validatorStyle & wxFILTER_ALPHANUMERIC) && !wxIsalnum(keyCode)) ||