107 if( aValue.CheckType<std::optional<int>>() )
109 std::optional<int> opt = aValue.As<std::optional<int>>();
111 if( !opt.has_value() )
117 if( aValue.CheckType<std::optional<double>>() )
119 std::optional<double> opt = aValue.As<std::optional<double>>();
121 if( !opt.has_value() )
127 if(
auto v = tryAs<int>( aValue, [&](
int x )
131 if(
auto v = tryAs<long>( aValue, [&](
long x )
135 if(
auto v = tryAs<long long>( aValue, [&](
long long x )
139 if(
auto v = tryAs<unsigned>( aValue, [&](
unsigned x )
143 if(
auto v = tryAs<double>( aValue, [&](
double x )
147 if( aValue.CheckType<
float>() )
150 if(
auto v = tryAs<wxString>( aValue, [](
const wxString& x )
154 if(
auto v = tryAs<std::string>( aValue, [](
const std::string& x )
158 if(
auto v = tryAs<KIID>( aValue, [](
const KIID& x )
162 if(
auto v = tryAs<EDA_ANGLE>( aValue, [](
const EDA_ANGLE& x )
167 if(
auto v = tryAs<VECTOR2I>( aValue, [&](
const VECTOR2I& x )
171 if(
auto v = tryAs<BOX2I>( aValue, [](
const BOX2I& x )
175 if(
auto v = tryAs<KIGFX::COLOR4D>( aValue, [](
const KIGFX::COLOR4D& x )
179 if(
auto v = tryAs<PCB_LAYER_ID>( aValue, [](
PCB_LAYER_ID x )
192 if( aValue.GetAs<
int>( &enumInt ) )
194 const wxPGChoices& choices = aProperty->
Choices();
197 for(
unsigned ii = 0; ii < choices.GetCount(); ++ii )
199 if( choices.GetValue( ii ) == enumInt )
201 label = std::string( choices.GetLabel( ii ).ToUTF8() );
213 if( aValue.GetAs<wxString>( &s ) )