From 726a5e115575a46814ccc50c9841e093d2ec20cd Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Fri, 3 Apr 2015 21:13:44 +0200 Subject: [PATCH] Prepare propgrid sample to build successfully when wxUSE_LONGLONG is disabled. Make the code ready to build even when wxLongLong type is not available. --- samples/propgrid/propgrid.cpp | 4 ++++ samples/propgrid/tests.cpp | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/samples/propgrid/propgrid.cpp b/samples/propgrid/propgrid.cpp index f03c7709de..a0fa325297 100644 --- a/samples/propgrid/propgrid.cpp +++ b/samples/propgrid/propgrid.cpp @@ -1422,7 +1422,11 @@ void FormMain::PopulateWithExamples () pg->Append( new wxPointProperty( wxT("PointProperty"), wxT("Position"), GetPosition() ) ); // UInt samples +#if wxUSE_LONGLONG pg->Append( new wxUIntProperty( wxT("UIntProperty"), wxPG_LABEL, wxULongLong(wxULL(0xFEEEFEEEFEEE)))); +#else + pg->Append( new wxUIntProperty( wxT("UIntProperty"), wxPG_LABEL, 0xFEEEFEEE)); +#endif pg->SetPropertyAttribute( wxT("UIntProperty"), wxPG_UINT_PREFIX, wxPG_PREFIX_NONE ); pg->SetPropertyAttribute( wxT("UIntProperty"), wxPG_UINT_BASE, wxPG_BASE_HEX ); //pg->SetPropertyAttribute( wxT("UIntProperty"), wxPG_UINT_PREFIX, wxPG_PREFIX_NONE ); diff --git a/samples/propgrid/tests.cpp b/samples/propgrid/tests.cpp index 6e7d76858f..58e1ca1b49 100644 --- a/samples/propgrid/tests.cpp +++ b/samples/propgrid/tests.cpp @@ -671,9 +671,15 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) RT_FAILURE(); #endif +#if wxUSE_LONGLONG && defined(wxLongLong_t) pgman->SetPropertyValue(wxT("IntProperty"),wxLL(10000000000)); if ( pg->GetPropertyValueAsLongLong(wxT("IntProperty")) != wxLL(10000000000) ) RT_FAILURE(); +#else + pgman->SetPropertyValue(wxT("IntProperty"),1000000000); + if ( pg->GetPropertyValueAsLong(wxT("IntProperty")) != 1000000000 ) + RT_FAILURE(); +#endif pg->SetPropertyValue(wxT("StringProperty"),wxT("Text2")); pg->SetPropertyValue(wxT("IntProperty"),512); @@ -721,9 +727,15 @@ bool FormMain::RunTests( bool fullTest, bool interactive ) RT_FAILURE(); #endif +#if wxUSE_LONGLONG && defined(wxLongLong_t) pgman->SetPropertyValue(wxT("IntProperty"),wxLL(-80000000000)); if ( pgman->GetPropertyValueAsLongLong(wxT("IntProperty")) != wxLL(-80000000000) ) RT_FAILURE(); +#else + pgman->SetPropertyValue(wxT("IntProperty"),-1000000000); + if ( pgman->GetPropertyValueAsLong(wxT("IntProperty")) != -1000000000 ) + RT_FAILURE(); +#endif // Make sure children of composite parent get updated as well // Original string value: "Lamborghini Diablo SV; 5707; [300; 3.9; 8.6] 300000; Not Convertible"