| 122 | // ----------------------------------------------------------------------------- |
| 123 | |
| 124 | bool XYZIntDialog::ValidNumber(wxTextCtrl* box, int* val) |
| 125 | { |
| 126 | // validate given X/Y/Z value |
| 127 | wxString str = box->GetValue(); |
| 128 | long i; |
| 129 | if ( str.ToLong(&i) ) { |
| 130 | *val = (int)i; |
| 131 | return true; |
| 132 | } else { |
| 133 | Warning(_("Error converting number ")); |
| 134 | box->SetFocus(); |
| 135 | box->SetSelection(-1,-1); |
| 136 | return false; |
| 137 | } |
| 138 | } |
| 139 | |
| 140 | // ----------------------------------------------------------------------------- |
| 141 | |