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 &D::setCond, &D::getCond ) )
195 wxArrayString labels;
198 wxPGChoices newChoices( labels, values );
203 prop->SetChoices( newChoices );
231 ptr->Set(
"A", 100 );
232 ptr->Set(
"point", wxPoint( 100, 200 ) );
238 ptr->Set(
"enumClass", D::enum_class::TESTC );
240 BOOST_CHECK_EQUAL( *ptr->Get<D::enum_class>(
"enumClass" ), D::enum_class::TESTC );
268 BOOST_CHECK_THROW( ptr->Get<wxPoint>(
"A" ), std::invalid_argument );
291 wxArrayString labels;
292 labels.Add(
"TEST1" );
293 labels.Add(
"TEST2" );
294 labels.Add(
"TEST3" );
296 const wxPGChoices& v = prop->
Choices();
300 for (
unsigned int i = 0; i < values.GetCount(); ++i )
305 for (
unsigned int i = 0; i < labels.GetCount(); ++i )
314 wxAny
any = item.
Get( prop );
328 values.Add( D::enum_class::TESTA );
329 values.Add( D::enum_class::TESTB );
330 values.Add( D::enum_class::TESTC );
331 wxArrayString labels;
332 labels.Add(
"TESTA" );
333 labels.Add(
"TESTB" );
334 labels.Add(
"TESTC" );
336 const wxPGChoices& v = prop->
Choices();
340 for (
unsigned int i = 0; i < values.GetCount(); ++i )
345 for (
unsigned int i = 0; i < labels.GetCount(); ++i )
359 BOOST_CHECK( !propCond->
Available( ptr ) );
362 BOOST_CHECK( propCond->
Available( ptr ) );
370 ptr->Set(
"point", wxPoint( 100, 100 ) );
374 ptr->Set(
"point_alias", wxPoint( 300, 300 ) );
384 prop = propMgr.GetProperty(
TYPE_HASH(
D ),
"bool" );
387 prop = propMgr.GetProperty(
TYPE_HASH(
D ),
"replaced_bool" );
400 wxArrayString labels;
404 const wxPGChoices& v = prop->
Choices();
408 for (
unsigned int i = 0; i < values.GetCount(); ++i )
413 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
PROPERTY_BASE & SetAvailableFunc(std::function< bool(INSPECTABLE *)> aFunc)
Set a callback function to determine whether an object provides this property.
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 CLASS_A_DESC _CLASS_A_DESC
static struct CLASS_D_DESC _CLASS_D_DESC
static struct ENUM_GLOB_DESC s_ENUM_GLOB_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")