From 31d123e5ccf4fae7b3fd64a2b3fa9e024c851330 Mon Sep 17 00:00:00 2001 From: cxl Date: Mon, 6 Mar 2017 10:03:34 +0000 Subject: [PATCH] ArrayCtrl: AcceptRow now public and documented git-svn-id: svn://ultimatepp.org/upp/trunk@10901 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/CtrlLib/ArrayCtrl.cpp | 1 + uppsrc/CtrlLib/ArrayCtrl.h | 2 +- uppsrc/CtrlLib/src.tpp/ArrayCtrl$en-us.tpp | 9 +++++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/uppsrc/CtrlLib/ArrayCtrl.cpp b/uppsrc/CtrlLib/ArrayCtrl.cpp index 0523a8a2d..d05c2abb6 100644 --- a/uppsrc/CtrlLib/ArrayCtrl.cpp +++ b/uppsrc/CtrlLib/ArrayCtrl.cpp @@ -1246,6 +1246,7 @@ bool ArrayCtrl::UpdateRow() { } } if(iv) { + RefreshRow(cursor); InvalidateCache(cursor); WhenArrayAction(); } diff --git a/uppsrc/CtrlLib/ArrayCtrl.h b/uppsrc/CtrlLib/ArrayCtrl.h index ca00985d2..3b17e6737 100644 --- a/uppsrc/CtrlLib/ArrayCtrl.h +++ b/uppsrc/CtrlLib/ArrayCtrl.h @@ -290,7 +290,6 @@ private: void AfterSet(int i); void Reline(int i, int y); - bool AcceptRow(); void Remove0(int i); void DisableCtrls(); void SetCtrls(); @@ -519,6 +518,7 @@ public: int GetScroll() const; void ScrollTo(int sc); void ShowAppendLine(); + bool AcceptRow(); void Move(int d); void SwapUp(); diff --git a/uppsrc/CtrlLib/src.tpp/ArrayCtrl$en-us.tpp b/uppsrc/CtrlLib/src.tpp/ArrayCtrl$en-us.tpp index 8bb2abed6..5f9275e6f 100644 --- a/uppsrc/CtrlLib/src.tpp/ArrayCtrl$en-us.tpp +++ b/uppsrc/CtrlLib/src.tpp/ArrayCtrl$en-us.tpp @@ -546,6 +546,15 @@ values.&] [s2; Show an additional pseudo`-row at the table end. When clicked, a new row is appended to the array.&] [s3; &] +[s4;%- &] +[s5;:Upp`:`:ArrayCtrl`:`:AcceptRow`(`):%- [@(0.0.255) bool]_[* AcceptRow]()&] +[s2; When there are slave widgets (connected using AddCtrl), the +visible content of ArrayCtrl line is normally updated when cursor +moves to another line (and the move is prevented if any slave +widget has invalid value). This method tries to check for invalid +values and updates the row immediately. Returns true if there +were no invalid values in slave widgets.&] +[s3;%- &] [s4; &] [s5;:ArrayCtrl`:`:IsEdit`(`)const: [@(0.0.255) bool]_[* IsEdit]()_[@(0.0.255) const]&] [s2; Checks whether the array is currently being edited.&]