SqlCtrl: new SqlNOption similar to SqlOption, but returns Null on flase (instead of ''0'')

git-svn-id: svn://ultimatepp.org/upp/trunk@3458 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2011-05-26 08:01:42 +00:00
parent 14c88df963
commit 9e0debc328
3 changed files with 16 additions and 0 deletions

View file

@ -54,6 +54,12 @@ Value SqlOption::GetData() const {
return Get() ? "1" : "0";
}
Value SqlNOption::GetData() const
{
if(Get()) return "1";
return Null;
}
void SqlCtrls::Add(SqlId id, Ctrl& ctrl) {
Item& m = item.Add();
m.id = id;

View file

@ -52,6 +52,10 @@ public:
virtual Value GetData() const;
};
class SqlNOption : public SqlOption {
virtual Value GetData() const;
};
class SqlArray : public ArrayCtrl {
public:
virtual void SetData(const Value& v);

View file

@ -8,3 +8,9 @@ ctrl SqlOption {
>Option;
GetStdSize() { sz = GetMinSize(); sz.cx *= 8; sz.cy = max(16, sz.cy); return sz; }
}
ctrl SqlNOption {
group "Push";
>Option;
GetStdSize() { sz = GetMinSize(); sz.cx *= 8; sz.cy = max(16, sz.cy); return sz; }
}