*CtrlLib: Another ArrayCtrl tab order fix

git-svn-id: svn://ultimatepp.org/upp/trunk@2282 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2010-03-29 21:04:31 +00:00
parent 48b7e185b3
commit 39dcdf2217
2 changed files with 5 additions and 4 deletions

View file

@ -643,8 +643,8 @@ void ArrayCtrl::SyncCtrls(int from)
LTIMING("SyncCtrls");
if(!hasctrls)
return;
Ptr<Ctrl> restorefocus = GetFocusChildDeep();
Size sz = GetSize();
Ctrl *p = NULL;
for(int i = from; i < array.GetCount(); i++)
for(int j = 0; j < column.GetCount(); j++) {
bool ct = IsCtrl(i, j);
@ -662,15 +662,15 @@ void ArrayCtrl::SyncCtrls(int from)
if(ct) {
Rect r = GetCellRectM(i, j);
Ctrl& c = GetCellCtrl(i, j);
AddChild(&c);
if(!c.HasFocusDeep() || c.GetParent() != this)
AddChild(&c, p);
p = &c;
if(r.bottom < 0 || r.top > sz.cy)
c.SetRect(-1000, -1000, 1, 1);
else
c.SetRect(r);
}
}
if(restorefocus)
restorefocus->SetFocus();
}
Point ArrayCtrl::FindCellCtrl(Ctrl *ctrl)