summaryrefslogtreecommitdiff
path: root/src/mir_core
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-01-17 23:14:12 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-01-17 23:14:32 +0300
commitdcfb8826d85930581d179164afb1522c88074b2d (patch)
treee2b57adef41bcfbed8038b3f8844e6edbbea736d /src/mir_core
parentfc14cd04c3894702603bb4db7e56258608c5c8d7 (diff)
no need to copy that stuff each time
Diffstat (limited to 'src/mir_core')
-rw-r--r--src/mir_core/src/CCtrlTreeView.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/mir_core/src/CCtrlTreeView.cpp b/src/mir_core/src/CCtrlTreeView.cpp
index 0a8ba4e8b2..52c7df846b 100644
--- a/src/mir_core/src/CCtrlTreeView.cpp
+++ b/src/mir_core/src/CCtrlTreeView.cpp
@@ -22,6 +22,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "stdafx.h"
+int ImageList_AddIcon_IconLibLoaded(HIMAGELIST hIml, int iconId)
+{
+ HICON hIcon = Skin_LoadIcon(iconId);
+ int res = ImageList_AddIcon(hIml, hIcon);
+ IcoLib_ReleaseIcon(hIcon);
+ return res;
+}
+
/////////////////////////////////////////////////////////////////////////////////////////
// CCtrlTreeView
@@ -51,6 +59,21 @@ void CCtrlTreeView::OnInit()
if (m_bDndEnabled)
Subclass();
+
+ if (m_bCheckBox) {
+ HIMAGELIST himlCheckBoxes = ::ImageList_Create(16, 16, ILC_COLOR32 | ILC_MASK, 2, 2);
+ ::ImageList_AddIcon_IconLibLoaded(himlCheckBoxes, SKINICON_OTHER_NOTICK);
+ ::ImageList_AddIcon_IconLibLoaded(himlCheckBoxes, SKINICON_OTHER_TICK);
+ SetImageList(himlCheckBoxes, TVSIL_NORMAL);
+ }
+}
+
+void CCtrlTreeView::OnDestroy()
+{
+ if (m_bCheckBox)
+ ::ImageList_Destroy(GetImageList(TVSIL_NORMAL));
+
+ CSuper::OnDestroy();
}
HTREEITEM CCtrlTreeView::MoveItemAbove(HTREEITEM hItem, HTREEITEM hInsertAfter, HTREEITEM hParent)