32 virtual void setA(
int a ) = 0;
33 virtual int getA()
const = 0;
34 virtual const int&
getA2()
const {
return m_a; }
79class D :
public A,
public C
85 virtual void setA(
int a )
override {
m_aa = 2 * a; }
86 virtual int getA()
const override {
return m_aa; }
161 .Map( D::enum_class::TESTA,
"TESTA" )
162 .Map( D::enum_class::TESTB,
"TESTB" )
163 .Map( D::enum_class::TESTC,
"TESTC" );
180 cond->SetAvailableFunc( [=](
INSPECTABLE* aItem)->
bool {
194 wxArrayString labels;
197 wxPGChoices newChoices( labels, values );
202 prop->SetChoices( newChoices );
230 ptr->Set(
"A", 100 );
231 ptr->Set(
"point", wxPoint( 100, 200 ) );
237 ptr->Set(
"enumClass", D::enum_class::TESTC );
239 BOOST_CHECK_EQUAL( *ptr->Get<D::enum_class>(
"enumClass" ), D::enum_class::TESTC );
267 BOOST_CHECK_THROW( ptr->Get<wxPoint>(
"A" ), std::invalid_argument );
290 wxArrayString labels;
291 labels.Add(
"TEST1" );
292 labels.Add(
"TEST2" );
293 labels.Add(
"TEST3" );
295 const wxPGChoices& v = prop->
Choices();
299 for (
unsigned int i = 0; i < values.GetCount(); ++i )
304 for (
unsigned int i = 0; i < labels.GetCount(); ++i )
313 wxAny
any = item.
Get( prop );
327 values.Add( D::enum_class::TESTA );
328 values.Add( D::enum_class::TESTB );
329 values.Add( D::enum_class::TESTC );
330 wxArrayString labels;
331 labels.Add(
"TESTA" );
332 labels.Add(
"TESTB" );
333 labels.Add(
"TESTC" );
335 const wxPGChoices& v = prop->
Choices();
339 for (
unsigned int i = 0; i < values.GetCount(); ++i )
344 for (
unsigned int i = 0; i < labels.GetCount(); ++i )
358 BOOST_CHECK( !propCond->
Available( ptr ) );
361 BOOST_CHECK( propCond->
Available( ptr ) );
369 ptr->Set(
"point", wxPoint( 100, 100 ) );
373 ptr->Set(
"point_alias", wxPoint( 300, 300 ) );
383 prop = propMgr.GetProperty(
TYPE_HASH(
D ),
"bool" );
386 prop = propMgr.GetProperty(
TYPE_HASH(
D ),
"replaced_bool" );
399 wxArrayString labels;
403 const wxPGChoices& v = prop->
Choices();
407 for (
unsigned int i = 0; i < values.GetCount(); ++i )
412 for (
unsigned int i = 0; i < labels.GetCount(); ++i )
int getA() const override
void setA(int a) override
virtual int getA() const override
enum_glob getGlobEnum() const
enum_class getClassEnum() const
virtual void setA(int a) override
void setGlobEnum(enum_glob val)
void setClassEnum(enum_class val)
static ENUM_MAP< T > & Instance()
Class that other classes need to inherit from, in order to be inspectable.
wxAny Get(PROPERTY_BASE *aProperty) const
virtual bool HasChoices() const
Return true if this PROPERTY has a limited set of possible values.
bool Available(INSPECTABLE *aObject) const
Return true if aObject offers this PROPERTY.
virtual const wxPGChoices & Choices() const
Return a limited set of possible values (e.g.
Provide class metadata.Helper macro to map type hashes to names.
void InheritsAfter(TYPE_ID aDerived, TYPE_ID aBase)
Declare an inheritance relationship between types.
static PROPERTY_MANAGER & Instance()
PROPERTY_BASE & AddProperty(PROPERTY_BASE *aProperty, const wxString &aGroup=wxEmptyString)
Register a property.
PROPERTY_BASE & ReplaceProperty(size_t aBase, const wxString &aName, PROPERTY_BASE *aNew, const wxString &aGroup=wxEmptyString)
Replace an existing property for a specific type.
void AddTypeCast(TYPE_CAST_BASE *aCast)
Register a type converter.
A type-safe container of any type.
#define ENUM_TO_WXANY(type)
Macro to define read-only fields (no setter method available)
void setPoint2(wxPoint &p)
virtual const int & getA2() const
virtual void setPoint(const wxPoint &p)
const wxPoint & getPoint4() const
virtual int getA() const =0
void setPoint3(wxPoint p)
virtual void setA(int a)=0
void setPoint4(wxPoint p)
wxPoint getPoint2() const
const wxPoint & getPoint() const
PROPERTY_MANAGER & propMgr
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_AUTO_TEST_SUITE_END()
static struct ENUM_GLOB_DESC _ENUM_GLOB_DESC
static struct CLASS_A_DESC _CLASS_A_DESC
static struct CLASS_D_DESC _CLASS_D_DESC
static struct CLASS_C_DESC _CLASS_C_DESC
static struct CLASS_E_DESC _CLASS_E_DESC
BOOST_AUTO_TEST_CASE(SetGet)
static struct CLASS_B_DESC _CLASS_B_DESC
BOOST_CHECK_EQUAL(result, "25.4")