+void MyFrame::NumericEntry(wxCommandEvent& WXUNUSED(event) )
+{
+ long res = wxGetNumberFromUser("", "Enter a number:", "Numeric input test",
+ 50, 0, 100, this);
+
+ wxString msg;
+ int icon;
+ if ( res == -1 )
+ {
+ msg = "Invalid number entered or dialog cancelled.";
+ icon = wxICON_HAND;
+ }
+ else
+ {
+ msg.Printf(_T("You've entered %lu"), res);
+ icon = wxICON_INFORMATION;
+ }
+
+ wxMessageBox(msg, "Numeric test result", wxOK | icon, this);
+}
+