ultimatepp/bazaar/CtrlProp/EditString.icpp
kohait 9b18b6c807 bazaar: Property, ValueCtrl, CtrlProp: namespace fixes and some cleanup
git-svn-id: svn://ultimatepp.org/upp/trunk@3865 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2011-09-15 23:17:59 +00:00

23 lines
1.2 KiB
Text

#include "CtrlPropCommon.h"
NAMESPACE_UPP
bool PropSetMaxLen(const Value& v, EditString& o) { if(!IsNumber(v)) return false; o.MaxLen(v); return true; }
bool PropGetMaxLen(Value& v, const EditString& o) { v = o.GetMaxLength(); return true; }
bool PropSetTrimLeft(const Value& v, EditString& o) { if(!IsNumber(v)) return false; o.TrimLeft(v); return true; }
bool PropGetTrimLeft(Value& v, const EditString& o) { v = o.IsTrimLeft(); return true; }
bool PropSetTrimRight(const Value& v, EditString& o) { if(!IsNumber(v)) return false; o.TrimRight(v); return true; }
bool PropGetTrimRight(Value& v, const EditString& o) { v = o.IsTrimRight(); return true; }
bool PropSetNotNull(const Value& v, EditString& o) { if(!IsNumber(v)) return false; o.NotNull(v); return true; }
bool PropGetNotNull(Value& v, const EditString& o) { v = o.IsNotNull(); return true; }
PROPERTIES(EditString, EditField)
PROPERTY("maxlen", PropSetMaxLen, PropGetMaxLen)
PROPERTY("trimleft", PropSetTrimLeft, PropGetTrimLeft)
PROPERTY("trimrigth", PropSetTrimRight, PropGetTrimRight)
PROPERTY("notnull", PropSetNotNull, PropGetNotNull)
END_PROPERTIES
PROPS(Ctrl, EditString, EditField)
END_UPP_NAMESPACE