From 0943ae89e869ded753e5fbc5b64dca458a8f31b8 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 8 May 2021 18:18:34 +0300 Subject: CCtrlListView::MoveItem, CCtrlListView::SetCurSel, CCtrlCombo::SelectData - new useful methods (cherry picked from commit 9661e86b4d2e1280b6e5e562ffafb46d1b6c0817) --- include/m_gui.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include') diff --git a/include/m_gui.h b/include/m_gui.h index 152abae62c..25bd775638 100644 --- a/include/m_gui.h +++ b/include/m_gui.h @@ -949,6 +949,9 @@ public: bool OnApply() override; void OnReset() override; + // selects line with userdata passed. returns index of this line or -1 + int SelectData(LPARAM data); + // Control interface int AddString(const wchar_t *text, LPARAM data = 0); int AddStringA(const char *text, LPARAM data = 0); @@ -985,6 +988,11 @@ class MIR_CORE_EXPORT CCtrlListView : public CCtrlBase public: CCtrlListView(CDlgBase *dlg, int ctrlId); + // direction = -1 or 1. returns new item index + int MoveItem(int idx, int direction); + + void SetCurSel(int idx); + // Classic LV interface DWORD ApproximateViewRect(int cx, int cy, int iCount); void Arrange(UINT code); -- cgit v1.2.3