Go to the SVN repository for this file.
39 #include <wx/msgdlg.h> 46 #define INIT_BASE_MEMBERS \ 47 : wxTextValidator(wxFILTER_INCLUDE_CHAR_LIST) \ 48 , m_OutputFormat( outputFormat ? outputFormat : "%.3g") \
55 const char* outputFormat
74 static constwxChar*
chars[]
75= {
wxT(
"0"),
wxT(
"1"),
wxT(
"2"),
wxT(
"3"),
wxT(
"4"),
wxT(
"5"),
wxT(
"6"),
wxT(
"7"),
wxT(
"8"),
wxT(
"9"),
wxT(
"e"),
wxT(
"E"),
wxT(
"-"),
wxT(
"+"),
wxT(
".") };
76 const int n=
sizeof(
chars) /
sizeof(wxChar*);
78wxArrayString valid_chars(
n,
chars);
79SetIncludes(valid_chars);
91wxTextValidator::Copy(
val);
111wxTextCtrl *control = (wxTextCtrl *) m_validatorWindow;
125wxTextCtrl *control = (wxTextCtrl *) m_validatorWindow;
127 if(
m_ValPtr&& control->IsEnabled() && !control->HasFlag( wxTE_READONLY ) ){
137wxTextCtrl *control = (wxTextCtrl *) m_validatorWindow;
138 if( ! control->IsEnabled())
141 if(wxTextValidator::Validate(parent)) {
147 stringerr_msg = e.GetMsg();
148wxMessageBox(
ToWxString(err_msg),
wxT(
"Input is not valid"),
149wxOK | wxICON_EXCLAMATION, parent);
151control->SetSelection(-1,-1);
159wxString errMsg, fmt;
162fmt.Printf(
wxT(
"Please enter number between %s and %s."),
167fmt.Printf(
wxT(
"Please enter number greater or equal then %s."),
172fmt.Printf(
wxT(
"Please enter number less or equal then %s."),
177wxMessageBox(errMsg,
wxT(
"Input is not valid"), wxOK | wxICON_ERROR, parent);
178control->SetSelection(-1,-1);
CFloatTextValidator(double *val_ptr, double minVal=-numeric_limits< double >::infinity(), double maxVal=numeric_limits< double >::infinity(), const char *out_format="%.3g")
bool Copy(const CFloatTextValidator &val)
virtual bool TransferFromWindow()
virtual bool TransferToWindow()
bool CheckValidator() const
virtual bool Validate(wxWindow *parent)
The NCBI C++ standard methods for dealing with std::string.
#define INIT_BASE_MEMBERS
static const char * str(char *buf, int n)
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static double StringToDouble(const CTempStringEx str, TStringToNumFlags flags=0)
Convert string to double.
static const BitmapCharRec *const chars[]
wxString ToWxString(const string &s)
string ToStdString(const wxString &s)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4