+ // setup a sizer with the controls for numeric validators
+ // ------------------------------------------------------
+
+ wxIntegerValidator<int> valInt(&g_data.m_intValue,
+ wxNUM_VAL_THOUSANDS_SEPARATOR |
+ wxNUM_VAL_ZERO_AS_BLANK);
+ valInt.SetMin(0); // Only allow positive numbers
+
+ m_numericTextInt = new wxTextCtrl
+ (
+ this,
+ wxID_ANY,
+ "",
+ wxDefaultPosition,
+ wxDefaultSize,
+ wxTE_RIGHT,
+ valInt
+ );
+ m_numericTextInt->SetToolTip("uses wxIntegerValidator to accept positive "
+ "integers only");
+
+ m_numericTextDouble = new wxTextCtrl
+ (
+ this,
+ wxID_ANY,
+ "",
+ wxDefaultPosition,
+ wxDefaultSize,
+ wxTE_RIGHT,
+ wxMakeFloatingPointValidator
+ (
+ 3,
+ &g_data.m_doubleValue,
+ wxNUM_VAL_THOUSANDS_SEPARATOR |
+ wxNUM_VAL_NO_TRAILING_ZEROES
+ )
+ );
+ m_numericTextDouble->SetToolTip("uses wxFloatingPointValidator with 3 decimals");
+ wxBoxSizer *numSizer = new wxBoxSizer( wxHORIZONTAL );
+ numSizer->Add( m_numericTextInt, 1, wxALL, 10 );
+ numSizer->Add( m_numericTextDouble, 1, wxALL, 10 );
+
+