Prepare wxPG to build successfully when wxUSE_LONGLONG or wxUSE_DATETIME is disabled.

Make the code ready to build even when wxLongLong and wxDateTime types are not available.
This commit is contained in:
Artur Wieczorek
2015-04-03 21:12:19 +02:00
parent cc575a7a89
commit 7c6943175b
6 changed files with 145 additions and 59 deletions

View File

@@ -378,11 +378,16 @@ bool wxPGSpinCtrlEditor::OnEvent( wxPropertyGrid* propgrid, wxPGProperty* proper
}
else
{
long step = property->GetAttributeAsLong(wxPG_ATTR_SPINCTRL_STEP, 1);
#if defined(wxLongLong_t) && wxUSE_LONGLONG
wxLongLong_t v_ll;
wxLongLong_t step = property->GetAttributeAsLong(wxPG_ATTR_SPINCTRL_STEP, 1);
// Try (long) long
// Try long long
if ( s.ToLongLong(&v_ll, 10) )
#else
long v_ll;
// Try long
if ( s.ToLong(&v_ll, 10) )
#endif
{
if ( bigStep )
step *= 10;
@@ -395,7 +400,11 @@ bool wxPGSpinCtrlEditor::OnEvent( wxPropertyGrid* propgrid, wxPGProperty* proper
// Min/Max check
wxIntProperty::DoValidation(property, v_ll, NULL, mode);
#if defined(wxLongLong_t) && wxUSE_LONGLONG
s = wxLongLong(v_ll).ToString();
#else
s = wxString::Format(wxT("%ld"), v_ll);
#endif
}
else
{