ultimatepp/bazaar/Gen/VTypes.h
kohait 308edc1f5d various fixes and reworks
bazaar: Gen: Ctrl::LogPos RichValue expose (needs my forum patch with template<> SetNull);
WhitEnterAction: fixes LostFocus useless double invokes
PopUpC: higly customizable now, supports Accept/Reject/Backup/Restore behaviour similar to TopWindow, WithCloserKeys template mapps the ENTER/ESC key functionality without ok/cancel/exit buttons
LogPosCtrl: major extend, supports new PopUpC, closer buttons gone, uses RichValue<Ctrl::LogPos>
ValueCtrl: port to new PopUpC
CtrProp: port to use new PopUpCand RichValue<Ctrl::LogPos>


git-svn-id: svn://ultimatepp.org/upp/trunk@3820 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2011-09-04 22:16:18 +00:00

38 lines
1.5 KiB
C++

#ifndef _Gen_VTypes_h_
#define _Gen_VTypes_h_
#include <Core/Core.h>
#include <CtrlCore/CtrlCore.h>
NAMESPACE_UPP
const dword LOGPOS_V = 97;
template<> inline dword ValueTypeNo(const Ctrl::LogPos*) { return LOGPOS_V; }
template<> inline bool IsNull(const Ctrl::LogPos& l) { return l.x.IsEmpty() || l.y.IsEmpty(); }
template<> inline void SetNull(Ctrl::LogPos& l) { l.x = l.y = Ctrl::Logc(); }
inline Ctrl::LogPos Nvl(Ctrl::LogPos a, Ctrl::LogPos b) { return IsNull(a) ? b : a; }
inline Ctrl::LogPos Nvl(Ctrl::LogPos a) { return Nvl(a, Ctrl::LogPos()); }
template<> inline unsigned ValueGetHashValue(const Ctrl::LogPos& l) {
CombineHash ch;
ch << l.x.GetAlign() << l.x.GetA() << l.x.GetB();
ch << l.y.GetAlign() << l.y.GetA() << l.y.GetB();
return ch;
}
inline bool operator==(const Value& v, const Ctrl::LogPos& x) { return RichValue<Ctrl::LogPos>::Extract(v) == x; }
inline bool operator==(const Ctrl::LogPos& x, const Value& v) { return RichValue<Ctrl::LogPos>::Extract(v) == x; }
inline bool operator!=(const Value& v, const Ctrl::LogPos& x) { return RichValue<Ctrl::LogPos>::Extract(v) != x; }
inline bool operator!=(const Ctrl::LogPos& x, const Value& v) { return RichValue<Ctrl::LogPos>::Extract(v) != x; }
template<> String AsString(const Ctrl::LogPos& pos);
template<> Stream& operator%(Stream& s, Ctrl::LogPos& pos);
template<> void Xmlize(XmlIO xml, Ctrl::LogPos& pos);
END_UPP_NAMESPACE
#endif