ArrayCtrl, GLCtrl fixes

git-svn-id: svn://ultimatepp.org/upp/trunk@845 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2009-02-09 08:22:34 +00:00
parent 8a25975d47
commit e9ddea1edf
4 changed files with 34 additions and 1 deletions

View file

@ -425,7 +425,21 @@ String TextSettings::Get(const char *group, const char *key) const
{
int itemi = settings.Find(group);
return itemi < 0 ? Null : settings.Get(group).Get(key, Null);
}
String TextSettings::Get(int groupIndex, const char *key) const
{
return groupIndex >= 0 && groupIndex < settings.GetCount() ?
settings[groupIndex].Get(key, Null) : Null;
}
String TextSettings::Get(int groupIndex, int keyIndex) const
{
if (groupIndex >= 0 && groupIndex < settings.GetCount())
return keyIndex >= 0 && keyIndex < settings[groupIndex].GetCount() ?
settings[groupIndex][keyIndex] : Null;
else
return Null;
}
// --------------------------------------------------------------

View file

@ -300,12 +300,20 @@ class TextSettings {
public:
String Get(const char *group, const char *key) const;
String Get(const char *key) const { return Get("", key); }
String Get(int groupIndex, const char *key) const;
String Get(int groupIndex, int keyIndex) const;
String operator()(const char *group, const char *key) const { return Get(group, key); }
String operator()(const char *key) const { return Get(key); }
void Clear() { settings.Clear(); }
void Load(const char *filename);
int GetGroupCount() { return settings.GetCount(); }
int GetKeyCount(int group) { return settings[group].GetCount(); }
String GetGroupName(int groupIndex) { return settings.GetKey(groupIndex); }
String GetKey(int groupIndex, int keyIndex) { return settings[groupIndex].GetKey(keyIndex); }
};
// ------------------- Advanced streaming --------------------

View file

@ -1114,6 +1114,14 @@ bool ArrayCtrl::AcceptRow() {
Column& m = column[i];
if(m.edit && !m.edit->Accept())
return false;
if(IsCtrl(cursor, i)) {
Ctrl *c = GetCtrl(cursor, i).ctrl;
acceptingrow++;
bool b = c->Accept();
acceptingrow--;
if(!b)
return false;
}
}
for(i = 0; i < control.GetCount(); i++)
if(!control[i].ctrl->Accept())

View file

@ -132,6 +132,9 @@ public:
void StdView();
void InitPickMatrix() { picking.InitPickMatrix(); }
void Refresh() { pane.Refresh(); }
Vector<int> Pick(int x, int y);
};