diff options
Diffstat (limited to 'windirstat/myimagelist.h')
-rw-r--r-- | windirstat/myimagelist.h | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/windirstat/myimagelist.h b/windirstat/myimagelist.h new file mode 100644 index 0000000..4567290 --- /dev/null +++ b/windirstat/myimagelist.h @@ -0,0 +1,61 @@ +// myimagelist.h - Declaration of CMyImageList +// +// WinDirStat - Directory Statistics +// Copyright (C) 2003 Bernhard Seifert +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// Author: bseifert@users.sourceforge.net, bseifert@daccord.net + +#pragma once + +// +// CMyImageList. Both CDirstatView and CTypeView use this central +// image list. It caches the system image list images as needed, +// and adds 4 special images at initialization. +// This is because I don't want to deal with two images lists. +// +class CMyImageList: public CImageList +{ +public: + CMyImageList(); + virtual ~CMyImageList(); + + void Initialize(); + + int GetMyComputerImage(); + int GetMountPointImage(); + int GetFolderImage(); + int GetFileImage(LPCTSTR path); + int GetExtImageAndDescription(LPCTSTR ext, CString& description); + + int GetFilesFolderImage(); + int GetFreeSpaceImage(); + int GetUnknownImage(); + int GetEmptyImage(); + +protected: + int CacheIcon(LPCTSTR path, UINT flags, CString *psTypeName = NULL); + CString GetADriveSpec(); + void AddCustomImages(); + + CMap<int, int, int, int> m_indexMap; // system image list index -> our index + + int m_filesFolderImage; // <Files> + int m_freeSpaceImage; // <Free Space> + int m_unknownImage; // <Unknown> + int m_emptyImage; // For items whose image cannot be found +}; + |