diff --git a/uppsrc/CtrlLib/ArrayCtrl.cpp b/uppsrc/CtrlLib/ArrayCtrl.cpp index 550ee62e0..debee793a 100644 --- a/uppsrc/CtrlLib/ArrayCtrl.cpp +++ b/uppsrc/CtrlLib/ArrayCtrl.cpp @@ -1333,7 +1333,7 @@ void ArrayCtrl::ClearModify() { control[i].ctrl->ClearModify(); } -bool ArrayCtrl::AcceptRow() { +bool ArrayCtrl::AcceptRow(bool endedit) { ASSERT(IsCursor()); if(acceptingrow) // prevent recursion return true; @@ -1342,7 +1342,7 @@ bool ArrayCtrl::AcceptRow() { Column& m = column[i]; if(m.edit && !m.edit->Accept()) return false; - if(IsCtrl(cursor, i)) { + if(IsCtrl(cursor, i) && !endedit) { Ctrl *c = GetCellCtrl(cursor, i).ctrl; acceptingrow++; bool b = c->Accept(); @@ -1363,7 +1363,8 @@ bool ArrayCtrl::AcceptRow() { } bool b = editmode; EndEdit(); - SetCtrls(); + if(!endedit) + SetCtrls(); ClearModify(); if(b) WhenAcceptEdit(); @@ -1665,7 +1666,7 @@ void ArrayCtrl::DoPoint(Point p, bool dosel) { SetCursor0(clickpos.y, dosel); else if(IsCursor()) - AcceptRow(); + AcceptRow(true); // true not to reenable ctrls if(!HasFocusDeep()) SetWantFocus(); } diff --git a/uppsrc/CtrlLib/ArrayCtrl.h b/uppsrc/CtrlLib/ArrayCtrl.h index 78127beb4..ed958bce8 100644 --- a/uppsrc/CtrlLib/ArrayCtrl.h +++ b/uppsrc/CtrlLib/ArrayCtrl.h @@ -535,7 +535,7 @@ public: int GetScroll() const; void ScrollTo(int sc); void ShowAppendLine(); - bool AcceptRow(); + bool AcceptRow(bool endedit = false); void Move(int d); void SwapUp(); diff --git a/uppsrc/Draw/Display.cpp b/uppsrc/Draw/Display.cpp index f38e45e8e..d2b0c7cef 100644 --- a/uppsrc/Draw/Display.cpp +++ b/uppsrc/Draw/Display.cpp @@ -148,6 +148,8 @@ void StdDisplayClass::Paint0(Draw& w, const Rect& r, const Value& q, else txt = IsString(q) ? q : StdConvert().Format(q); Size tsz = GetTLTextSize(txt, font); + if(txt.GetCount() == 0) + tsz.cy = 0; if(a == ALIGN_RIGHT) x = r.right - tsz.cx; if(a == ALIGN_CENTER) @@ -190,6 +192,8 @@ Size StdDisplayClass::GetStdSize(const Value& q) const else txt = IsString(q) ? q : StdConvert().Format(q); Size sz = GetTLTextSize(txt, font); + if(txt.GetCount() == 0) + sz.cy = 0; return Size(sz.cx + isz.cx, max(sz.cy, isz.cy)); }