]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/valtext.cpp
replaced another printf() with wxLogDebug()
[wxWidgets.git] / src / common / valtext.cpp
index 6346404d47bfe34fa72f4c5f1eb27af77465368d..3973230d8047c81ef51f344df4da633810e32d37 100644 (file)
@@ -24,7 +24,8 @@
 #include <stdio.h>
 #include "wx/textctrl.h"
 #include "wx/utils.h"
-#include "wx/msgbxdlg.h"
+#include "wx/msgdlg.h"
+#include "wx/intl.h"
 #endif
 
 #include "wx/valtext.h"
@@ -41,7 +42,7 @@ BEGIN_EVENT_TABLE(wxTextValidator, wxValidator)
 END_EVENT_TABLE()
 #endif
 
-wxTextValidator::wxTextValidator(const long style, wxString *val)
+wxTextValidator::wxTextValidator(long style, wxString *val)
 {
        m_validatorStyle = style ;
        m_stringValue = val ;
@@ -132,8 +133,8 @@ bool wxTextValidator::Validate(wxWindow *parent)
                if ( !m_includeList.Member(val) )
                {
                        char buf[512];
-                       sprintf(buf, "%s is invalid.", (const char *)val);
-                       wxMessageBox(buf, "Validation conflict", wxOK | wxICON_EXCLAMATION, parent);
+                       sprintf(buf, _("%s is invalid."), (const char *)val);
+                       wxMessageBox(buf, _("Validation conflict"), wxOK | wxICON_EXCLAMATION, parent);
                        return FALSE;
                }
        }
@@ -142,37 +143,37 @@ bool wxTextValidator::Validate(wxWindow *parent)
                if ( m_excludeList.Member(val) )
                {
                        char buf[512];
-                       sprintf(buf, "%s is invalid.", (const char *)val);
-                       wxMessageBox(buf, "Validation conflict", wxOK | wxICON_EXCLAMATION, parent);
+                       sprintf(buf, _("%s is invalid."), (const char *)val);
+                       wxMessageBox(buf, _("Validation conflict"), wxOK | wxICON_EXCLAMATION, parent);
                        return FALSE;
                }
        }
        if ( (m_validatorStyle & wxFILTER_ASCII) && !val.IsAscii() )
        {
                        char buf[512];
-                       sprintf(buf, "%s should only contain ASCII characters.", (const char *)val);
-                       wxMessageBox(buf, "Validation conflict", wxOK | wxICON_EXCLAMATION, parent);
+                       sprintf(buf, _("%s should only contain ASCII characters."), (const char *)val);
+                       wxMessageBox(buf, _("Validation conflict"), wxOK | wxICON_EXCLAMATION, parent);
                        return FALSE;
        }
        if ( (m_validatorStyle & wxFILTER_ALPHA) && !wxIsAlpha(val) )
        {
                        char buf[512];
-                       sprintf(buf, "%s should only contain alphabetic characters.", (const char *)val);
-                       wxMessageBox(buf, "Validation conflict", wxOK | wxICON_EXCLAMATION, parent);
+                       sprintf(buf, _("%s should only contain alphabetic characters."), (const char *)val);
+                       wxMessageBox(buf, _("Validation conflict"), wxOK | wxICON_EXCLAMATION, parent);
                        return FALSE;
        }
        if ( (m_validatorStyle & wxFILTER_ALPHANUMERIC) && !wxIsAlphaNumeric(val))
        {
                        char buf[512];
-                       sprintf(buf, "%s should only contain alphabetic or numeric characters.", (const char *)val);
-                       wxMessageBox(buf, "Validation conflict", wxOK | wxICON_EXCLAMATION, parent);
+                       sprintf(buf, _("%s should only contain alphabetic or numeric characters."), (const char *)val);
+                       wxMessageBox(buf,_("Validation conflict"), wxOK | wxICON_EXCLAMATION, parent);
                        return FALSE;
        }
        if ( (m_validatorStyle & wxFILTER_NUMERIC) && !val.IsNumber())
        {
                        char buf[512];
-                       sprintf(buf, "%s should be numeric.", (const char *)val);
-                       wxMessageBox(buf, "Validation conflict", wxOK | wxICON_EXCLAMATION, parent);
+                       sprintf(buf, _("%s should be numeric."), (const char *)val);
+                       wxMessageBox(buf, _("Validation conflict"), wxOK | wxICON_EXCLAMATION, parent);
                        return FALSE;
        }