bazaar: BoostPyTest: exporting the various edit fields

git-svn-id: svn://ultimatepp.org/upp/trunk@3633 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
kohait 2011-07-10 20:20:59 +00:00
parent 5a10e46fab
commit 9bbba24d1d
22 changed files with 618 additions and 123 deletions

View file

@ -0,0 +1,33 @@
#include "Common.h"
using namespace boost::python;
NAMESPACE_UPP
void EditIntSetMin(EditInt& c, int m) { c.MinMax(m, c.GetMax()); }
void EditIntSetMax(EditInt& c, int m) { c.MinMax(c.GetMin(), m); }
void EditIntSetNotNull(EditInt& c, bool b) { c.NotNull(b); }
void EditIntSpinSetInc(EditIntSpin& c, int m) { c.SetInc(m); }
void EditIntSpinShowSpin(EditIntSpin& c, bool b) { c.ShowSpin(b); }
void export_EditInt()
{
ONCELOCK
{
class_<EditInt, bases<EditField>, boost::noncopyable>("EditInt", "Upp EditInt")
.add_property("max", &EditInt::GetMax, &EditIntSetMax)
.add_property("min", &EditInt::GetMin, &EditIntSetMin)
.add_property("notnull", &EditInt::IsNotNull, &EditIntSetNotNull)
;
class_<EditIntNotNull, bases<EditInt>, boost::noncopyable>("EditIntNotNull", "Upp EditIntNotNull")
;
class_<EditIntSpin, bases<EditInt>, boost::noncopyable>("EditIntSpin", "Upp EditIntSpin")
.add_property("inc", &EditIntSpin::GetInc, &EditIntSpinSetInc)
.add_property("showspin", &EditIntSpin::IsSpinVisible, &EditIntSpinShowSpin)
;
class_<EditIntNotNullSpin, bases<EditIntSpin>, boost::noncopyable>("EditIntNotNullSpin", "Upp EditIntNotNullSpin")
;
}
}
END_UPP_NAMESPACE