ultimatepp/bazaar/CtrlProp/PropList.cpp
kohait 1814c7ac74 bazaar: CtrlProp, CtrlFinder, CtrlMover, CtrlPos: cleanup and get rid of Visiting interface
git-svn-id: svn://ultimatepp.org/upp/trunk@3752 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2011-08-07 17:22:51 +00:00

56 lines
997 B
C++

#include "PropList.h"
PropListCtrl::PropListCtrl()
{
CtrlLayout(*this);
}
void PropListCtrl::Updated()
{
if(!ctrl)
{
gl.SetData(Null);
sl.SetData(Null);
return;
}
Ctrl& e = *ctrl;
Value v;
bool b;
String t;
b = Props<Ctrl>::Get(e, "listset", v);
ValueArray vs = v;
t << "Set Properties: (" << vs.GetCount() << ")\n" << v;
gl.SetData(t);
v = Value();
b = Props<Ctrl>::Get(e, "listget", v);
t.Clear();
ValueArray vg = v;
t << "Get Properties: (" << vg.GetCount() << ")\n";
{
for(int i = 0; i < vg.GetCount(); i++)
{
String s = vg.Get(i);
Value v;
t << s << " = ";
b = Props<Ctrl>::Get(e, s, v);
if(b) t << v;
else t << "##ERR##";
t << "\n";
}
}
sl.SetData(t);
}
PropList::PropList()
{
SetRect(plc.GetRect());
Add(plc.HSizePos().VSizePos(0,20));
Add(exit.RightPos(0, 64).BottomPos(0, 20));
exit.SetLabel("Close");
exit <<= THISBACK(Acceptor);
//cancel <<= THISBACK(Rejector);
}