CtrlLib: ArrayCtrl::GetSelKeys

git-svn-id: svn://ultimatepp.org/upp/trunk@11287 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2017-08-03 13:07:17 +00:00
parent d7906e81af
commit 09ae240be9
3 changed files with 16 additions and 0 deletions

View file

@ -1552,6 +1552,15 @@ bool ArrayCtrl::IsSel(int i) const
return multiselect ? IsSelected(i) : GetCursor() == i;
}
Vector<int> ArrayCtrl::GetSelKeys() const
{
Vector<int> id;
for(int i = 0; i < GetCount(); i++)
if(IsSel(i))
id.Add(Get(i, 0));
return id;
}
int ArrayCtrl::GetScroll() const
{
return sb;

View file

@ -448,6 +448,7 @@ public:
bool IsSelected(int i) const { return i < array.GetCount() && array[i].select; }
void ClearSelection();
bool IsSel(int i) const;
Vector<int> GetSelKeys() const;
void EnableLine(int i, bool e);
void DisableLine(int i) { EnableLine(i, false); }

View file

@ -2179,6 +2179,12 @@ onst]&]
[s2; If there is selection in the widget, returns true if [*@3 i] is
selected, otherwise returns true if cursor is at [*@3 i].&]
[s3; &]
[s4;%- &]
[s5;:Upp`:`:ArrayCtrl`:`:GetSelKeys`(`)const:%- [_^Upp`:`:Vector^ Vector]<[@(0.0.255) int
]>_[* GetSelKeys]()_[@(0.0.255) const]&]
[s2; Returns keys (elements with index 0) of all selected lines (ordered
by line order).&]
[s3;%- &]
[s4; &]
[s5;:Upp`:`:ArrayCtrl`:`:EnableLine`(int`,bool`): [@(0.0.255) void]_[* EnableLine]([@(0.0.255) i
nt]_[*@3 i], [@(0.0.255) bool]_[*@3 e])&]