#include <globals.h>
Public Member Functions | |
Icon () | |
Icon (ICON_ID id, UINT nid) | |
Icon (ICON_ID id, UINT nid, int icon_size) | |
Icon (ICON_TYPE itype, int id, HICON hIcon) | |
Icon (ICON_TYPE itype, int id, int sys_idx) | |
operator ICON_ID () const | |
void | draw (HDC hdc, int x, int y, int cx, int cy, COLORREF bk_color, HBRUSH bk_brush) const |
HBITMAP | create_bitmap (COLORREF bk_color, HBRUSH hbrBkgnd, HDC hdc_wnd) const |
int | add_to_imagelist (HIMAGELIST himl, HDC hdc_wnd, COLORREF bk_color=GetSysColor(COLOR_WINDOW), HBRUSH bk_brush=GetSysColorBrush(COLOR_WINDOW)) const |
int | get_sysiml_idx () const |
HICON | get_hicon () const |
ICON_TYPE | get_icontype () const |
bool | destroy () |
Protected Attributes | |
ICON_ID | _id |
ICON_TYPE | _itype |
HICON | _hicon |
int | _sys_idx |
Definition at line 96 of file globals.h.
Icon::Icon | ( | ) |
Definition at line 246 of file explorer.cpp.
: _id(ICID_UNKNOWN), _itype(IT_STATIC), _hicon(0) { }
Icon::Icon | ( | ICON_ID | id, |
UINT | nid | ||
) |
Icon::Icon | ( | ICON_ID | id, |
UINT | nid, | ||
int | icon_size | ||
) |
Icon::Icon | ( | ICON_TYPE | itype, |
int | id, | ||
HICON | hIcon | ||
) |
Icon::Icon | ( | ICON_TYPE | itype, |
int | id, | ||
int | sys_idx | ||
) |
int Icon::add_to_imagelist | ( | HIMAGELIST | himl, |
HDC | hdc_wnd, | ||
COLORREF | bk_color = GetSysColor(COLOR_WINDOW) , |
||
HBRUSH | bk_brush = GetSysColorBrush(COLOR_WINDOW) |
||
) | const |
Definition at line 310 of file explorer.cpp.
References _hicon, ExplorerGlobals::_icon_cache, _itype, _sys_idx, IconCache::get_sys_imagelist(), ImageList_AddAlphaIcon(), and IT_SYSCACHE.
Referenced by BookmarkList::fill_tree(), and MainFrameBase::FillBookmarks().
{ int ret; if (_itype == IT_SYSCACHE) { HIMAGELIST himl = g_Globals._icon_cache.get_sys_imagelist(); int cx, cy; ImageList_GetIconSize(himl, &cx, &cy); HBITMAP hbmp = CreateCompatibleBitmap(hdc_wnd, cx, cy); HDC hdc = CreateCompatibleDC(hdc_wnd); HBITMAP hbmp_old = SelectBitmap(hdc, hbmp); ImageList_DrawEx(himl, _sys_idx, hdc, 0, 0, cx, cy, bk_color, CLR_DEFAULT, ILD_NORMAL); SelectBitmap(hdc, hbmp_old); DeleteDC(hdc); ret = ImageList_Add(himl, hbmp, 0); DeleteObject(hbmp); } else ret = ImageList_AddAlphaIcon(himl, _hicon, bk_brush, hdc_wnd); return ret; }
HBITMAP Icon::create_bitmap | ( | COLORREF | bk_color, |
HBRUSH | hbrBkgnd, | ||
HDC | hdc_wnd | ||
) | const |
Definition at line 289 of file explorer.cpp.
References _hicon, ExplorerGlobals::_icon_cache, _itype, _sys_idx, create_bitmap_from_icon(), IconCache::get_sys_imagelist(), and IT_SYSCACHE.
Referenced by QuickLaunchBar::AddShortcuts().
{ if (_itype == IT_SYSCACHE) { HIMAGELIST himl = g_Globals._icon_cache.get_sys_imagelist(); int cx, cy; ImageList_GetIconSize(himl, &cx, &cy); HBITMAP hbmp = CreateCompatibleBitmap(hdc_wnd, cx, cy); HDC hdc = CreateCompatibleDC(hdc_wnd); HBITMAP hbmp_old = SelectBitmap(hdc, hbmp); ImageList_DrawEx(himl, _sys_idx, hdc, 0, 0, cx, cy, bk_color, CLR_DEFAULT, ILD_NORMAL); SelectBitmap(hdc, hbmp_old); DeleteDC(hdc); return hbmp; } else return create_bitmap_from_icon(_hicon, hbrBkgnd, hdc_wnd); }
bool Icon::destroy | ( | ) | [inline] |
Definition at line 113 of file globals.h.
References IT_DYNAMIC.
Referenced by IconCache::free_icon().
{if (_itype == IT_DYNAMIC) {DestroyIcon(_hicon); return true;} else return false;}
void Icon::draw | ( | HDC | hdc, |
int | x, | ||
int | y, | ||
int | cx, | ||
int | cy, | ||
COLORREF | bk_color, | ||
HBRUSH | bk_brush | ||
) | const |
Definition at line 281 of file explorer.cpp.
References _hicon, ExplorerGlobals::_icon_cache, _itype, _sys_idx, IconCache::get_sys_imagelist(), and IT_SYSCACHE.
Referenced by Pane::draw_item().
{ if (_itype == IT_SYSCACHE) ImageList_DrawEx(g_Globals._icon_cache.get_sys_imagelist(), _sys_idx, hdc, x, y, cx, cy, bk_color, CLR_DEFAULT, ILD_NORMAL); else DrawIconEx(hdc, x, y, _hicon, cx, cy, 0, bk_brush, DI_NORMAL); }
HICON Icon::get_hicon | ( | ) | const [inline] |
Definition at line 110 of file globals.h.
References IT_SYSCACHE.
Referenced by ShellBrowser::get_image_idx().
{return _itype!=IT_SYSCACHE? _hicon: 0;}
ICON_TYPE Icon::get_icontype | ( | ) | const [inline] |
int Icon::get_sysiml_idx | ( | ) | const [inline] |
Definition at line 109 of file globals.h.
References IT_SYSCACHE.
Referenced by FindProgramDlg::Notify().
{return _itype==IT_SYSCACHE? _sys_idx: -1;}
HICON Icon::_hicon [protected] |
Definition at line 118 of file globals.h.
Referenced by add_to_imagelist(), create_bitmap(), and draw().
ICON_TYPE Icon::_itype [protected] |
Definition at line 117 of file globals.h.
Referenced by add_to_imagelist(), create_bitmap(), and draw().
int Icon::_sys_idx [protected] |
Definition at line 119 of file globals.h.
Referenced by add_to_imagelist(), create_bitmap(), and draw().
ROS Explorer Source Code Documentation
generated on 02.01.2013 by ![]() |