MCPcopy Create free account
hub / github.com/GollyGang/ready / ValidNumber

Method ValidNumber

src/gui/dialogs.cpp:124–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122// -----------------------------------------------------------------------------
123
124bool 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

Callers

nothing calls this directly

Calls 2

WarningFunction · 0.85
GetValueMethod · 0.45

Tested by

no test coverage detected