|
OWLNext 7.0
Borland's Object Windows Library for the modern age
|
TIcon, derived from TGdiObject, represents the GDI object icon class. More...
#include <owl/gdiobjec.h>
Classes | |
| struct | TInfo |
Public Types | |
| typedef HICON | THandle |
| TIcon encapsulates an HICON. | |
Public Member Functions | |
| TIcon (HICON handle, TAutoDelete autoDelete=NoAutoDelete) | |
| Creates a TIcon object and sets the Handle data member to the given borrowed handle. | |
| TIcon (HINSTANCE, const TIcon &icon) | |
| Creates a copy of the given icon object. | |
| TIcon (HINSTANCE, TResId) | |
| Creates an icon object from the given resource. | |
| TIcon (HINSTANCE, const tstring &filename, int index) | |
| Creates an icon object from the given resource file. | |
| TIcon (HINSTANCE, const TSize &size, int planes, int bitsPixel, const void *andBits, const void *xorBits) | |
| Creates an icon object with the given values. | |
| TIcon (const void *resBits, uint32 resSize) | |
| Creates an icon object of the given size from the bits found in the resBits buffer. | |
| TIcon (const ICONINFO &iconInfo) | |
| Creates an icon object with the given ICONINFO information. | |
| ~TIcon () | |
| Destroys the icon and frees any memory that the icon occupied. | |
| HICON | GetHandle () const |
| Returns the handle of the icon with type HICON. | |
| operator HICON () const | |
| Typecasting operator that converts this icon's Handle to type HICON (the data type representing the handle to an icon resource). | |
| bool | operator== (const TIcon &other) const |
| Returns true if the handles of two icons are identical. | |
| auto | GetInfo () const -> TInfo |
| Retrieves information about this icon. | |
| auto | GetIconInfo () const -> ICONINFO |
| Retrieves information about this icon. | |
| auto | GetIconInfoEx () const -> ICONINFOEX |
| Retrieves information about this icon. | |
TIcon, derived from TGdiObject, represents the GDI object icon class.
TIcon constructors can create icons from a resource or from explicit information. Because icons are not real GDI objects, the TIcon destructor overloads the base destructor, ~TGdiObject.
Definition at line 670 of file gdiobjec.h.
| typedef HICON owl::TIcon::THandle |
TIcon encapsulates an HICON.
Definition at line 674 of file gdiobjec.h.
| owl::TIcon::TIcon | ( | HICON | handle, |
| TAutoDelete | autoDelete = NoAutoDelete ) |
Creates a TIcon object and sets the Handle data member to the given borrowed handle.
The ShouldDelete data member defaults to false, ensuring that the borrowed handle will not be deleted when the C++ object is destroyed.
Definition at line 22 of file icon.cpp.
References owl::TGdiBase::TGdiBase().
| owl::TIcon::TIcon | ( | HINSTANCE | , |
| const TIcon & | icon ) |
Creates a copy of the given icon object.
Definition at line 31 of file icon.cpp.
References TIcon(), owl::TGdiBase::CheckValid(), and owl::TGdiBase::Handle.
| owl::TIcon::TIcon | ( | HINSTANCE | instance, |
| TResId | resId ) |
Creates an icon object from the given resource.
Definition at line 40 of file icon.cpp.
References owl::TGdiBase::CheckValid(), owl::TGdiBase::Handle, and owl::TGdiBase::ShouldDelete.
| owl::TIcon::TIcon | ( | HINSTANCE | instance, |
| const tstring & | filename, | ||
| int | index ) |
Creates an icon object from the given resource file.
Definition at line 50 of file icon.cpp.
References owl::TGdiBase::CheckValid(), owl::TShell::ExtractIcon(), and owl::TGdiBase::Handle.
| owl::TIcon::TIcon | ( | HINSTANCE | instance, |
| const TSize & | size, | ||
| int | planes, | ||
| int | bitsPixel, | ||
| const void * | andBits, | ||
| const void * | xorBits ) |
Creates an icon object with the given values.
Definition at line 62 of file icon.cpp.
References owl::TGdiBase::CheckValid(), and owl::TGdiBase::Handle.
| owl::TIcon::TIcon | ( | const void * | resBits, |
| uint32 | resSize ) |
Creates an icon object of the given size from the bits found in the resBits buffer.
Definition at line 75 of file icon.cpp.
References owl::TGdiBase::CheckValid(), and owl::TGdiBase::Handle.
| owl::TIcon::TIcon | ( | const ICONINFO & | iconInfo | ) |
Creates an icon object with the given ICONINFO information.
Definition at line 84 of file icon.cpp.
References owl::TGdiBase::CheckValid(), owl::TGdiBase::Handle, and WARN.
| owl::TIcon::~TIcon | ( | ) |
Destroys the icon and frees any memory that the icon occupied.
Definition at line 110 of file icon.cpp.
References owl::TGdiBase::Handle, and owl::TGdiBase::ShouldDelete.
|
inline |
Returns the handle of the icon with type HICON.
Definition at line 1574 of file gdiobjec.h.
References owl::TGdiBase::Handle.
| auto owl::TIcon::GetIconInfo | ( | ) | const -> ICONINFO |
Retrieves information about this icon.
Wrapper for the Windows API function of the same name. Throws TXGdi on failure.
Definition at line 148 of file icon.cpp.
References owl::TXGdi::TXGdi(), GetHandle(), and GetIconInfo().
| auto owl::TIcon::GetIconInfoEx | ( | ) | const -> ICONINFOEX |
Retrieves information about this icon.
Wrapper for the Windows API function of the same name. Throws TXGdi on failure.
Definition at line 167 of file icon.cpp.
References owl::TXGdi::TXGdi(), GetHandle(), and GetIconInfoEx().
| auto owl::TIcon::GetInfo | ( | ) | const -> TInfo |
Retrieves information about this icon.
Throws TXGdi on failure.
Definition at line 120 of file icon.cpp.
References _T, owl::AutoDelete, CHECK, GetIconInfoEx(), and MAX_PATH.
|
inline |
Typecasting operator that converts this icon's Handle to type HICON (the data type representing the handle to an icon resource).
Definition at line 1583 of file gdiobjec.h.
References GetHandle().
|
inline |
Returns true if the handles of two icons are identical.
Definition at line 1591 of file gdiobjec.h.
References TIcon(), and owl::TGdiBase::Handle.