Exemplo n.º 1
0
double wxTextInputStream::ReadDouble()
{
    if(!m_input) return 0;
    wxString word = ReadWord();
    if(word.empty())
        return 0;
    return wxStrtod(word.c_str(), 0);
}
Exemplo n.º 2
0
bool ecUtils::StrToDouble (const wxString & strValue, double &dValue)
{
	wxChar* pEnd;
	errno = 0;
	//dValue = _tcstod (strValue, &pEnd);
	dValue = wxStrtod(strValue, &pEnd);
	return (0 == errno) && (*pEnd == wxT('\0'));
}
Exemplo n.º 3
0
double wxStrtod_l(const char* str, char **endptr, const wxXLocale& loc)
{
    wxCHECK( loc.IsOk(), 0. );

    CNumericLocaleSetter locSetter;

    return wxStrtod(str, endptr);
}
Exemplo n.º 4
0
bool CSG_String::asDouble(double &Value) const
{
	const wxChar	*start = m_pString->c_str();
	wxChar			*end;

	Value	= wxStrtod(start, &end);

	return( end > start );
}
Exemplo n.º 5
0
bool wxGetResource(const wxString& section, const wxString& entry, float *value, const wxString& file )
{
    wxChar *s = NULL;
    bool succ = wxGetResource(section, entry, (wxChar **)&s, file);
    if (succ)
    {
        *value = (float)wxStrtod(s, NULL);
        delete[] s;
        return true;
    }
    else return false;
}
Exemplo n.º 6
0
bool wxPropertyValidator::StringToDouble (wxChar *s, double *number) {
    bool ok = true;
    wxChar *value_ptr;
    *number = wxStrtod (s, &value_ptr);
    if (value_ptr) {
        int len = wxStrlen (value_ptr);
        for (int i = 0; i < len; i++) {
            ok = (wxIsspace (value_ptr[i]) != 0);
            if (!ok) return false;
        }
    }
    return ok;
}
Exemplo n.º 7
0
void MyFrame::OnSetGravity(wxCommandEvent& WXUNUSED(event) )
{
    wxString str;
    str.Printf( wxT("%g"), m_splitter->GetSashGravity());
#if wxUSE_TEXTDLG
    str = wxGetTextFromUser(wxT("Enter sash gravity (0,1):"), wxT(""), str, this);
#endif
    if ( str.empty() )
        return;

    double gravity = wxStrtod( str, (wxChar**)NULL);
    m_splitter->SetSashGravity(gravity);
#if wxUSE_STATUSBAR
    str.Printf( wxT("Gravity = %g"), gravity);
    SetStatusText(str, 1);
#endif // wxUSE_STATUSBAR
}
Exemplo n.º 8
0
void
StringToDouble (const wxChar *s, double *number)
{
    if (s && *s && number)
        *number = wxStrtod (s, (wxChar **) NULL);
}
Exemplo n.º 9
0
void
StringToFloat (const wxChar *s, float *number)
{
    if (s && *s && number)
        *number = (float) wxStrtod (s, (wxChar **) NULL);
}
Exemplo n.º 10
0
double wxStrtod_l(const char* str, char **endptr, const wxXLocale& loc)
{
    IMPLEMENT_STRTOX_L_START
    double ret = wxStrtod(str, endptr);
    IMPLEMENT_STRTOX_L_END
}