X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0004982c831f56c65c390fb617711ff52595c2f3..92c0fc34c104c8d7c12d6a3b78ea232690fc23f4:/interface/wx/icon.h?ds=inline diff --git a/interface/wx/icon.h b/interface/wx/icon.h index b51860c24e..eff8124923 100644 --- a/interface/wx/icon.h +++ b/interface/wx/icon.h @@ -2,8 +2,7 @@ // Name: icon.h // Purpose: interface of wxIcon // Author: wxWidgets team -// RCS-ID: $Id$ -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -50,7 +49,7 @@ @see @ref overview_bitmap, @ref overview_bitmap_supportedformats, wxDC::DrawIcon, wxCursor */ -class wxIcon : public wxBitmap +class wxIcon : public wxGDIObject { public: /** @@ -90,24 +89,17 @@ public: @param bits Specifies an array of pixel values. @param width - Specifies the width of the bitmap. + The width of the image. @param height - Specifies the height of the bitmap. - @param depth - Specifies the depth of the bitmap. - If this is omitted, then a value of 1 (monochrome bitmap) is used. - */ - wxIcon(const char bits[], int width, int height, int depth = 1); + The height of the image. + @beginWxPerlOnly + In wxPerl use Wx::Icon->newBits(bits, width, height, depth = -1); + @endWxPerlOnly - /** - Creates a new icon. A depth of ::wxICON_SCREEN_DEPTH indicates the - depth of the current screen or visual. - - Some platforms only support 1 for monochrome and ::wxICON_SCREEN_DEPTH for - the current colour setting. + @onlyfor{wxmsw,wxosx} */ - wxIcon(int width, int height, int depth = wxICON_SCREEN_DEPTH); + wxIcon(const char bits[], int width, int height); /** Creates a bitmap from XPM data. @@ -125,17 +117,21 @@ public: the appropriate platform, or an icon resource on Windows. @code - wxIcon icon(wxICON(mondrian)); + wxIcon icon(wxICON(sample)); // Equivalent to: #if defined(__WXGTK__) || defined(__WXMOTIF__) - wxIcon icon(mondrian_xpm); + wxIcon icon(sample_xpm); #endif #if defined(__WXMSW__) - wxIcon icon("mondrian"); + wxIcon icon("sample"); #endif @endcode + + @beginWxPerlOnly + In wxPerl use Wx::Icon->newFromXPM(data). + @endWxPerlOnly */ wxIcon(const char* const* bits); @@ -182,6 +178,35 @@ public: */ virtual ~wxIcon(); + /** + Attach a Windows icon handle. + + This wxMSW-specific method allows to assign a native Windows @c HICON + (which must be castes to @c WXHICON opaque handle type) to wxIcon. + Notice that this means that the @c HICON will be destroyed by wxIcon + when it is destroyed. + + @return @true if successful. + + @onlyfor{wxmsw} + + @since 2.9.5 + */ + bool CreateFromHICON(WXHICON icon); + + /** + Returns disabled (dimmed) version of the icon. + + This method is available in wxIcon only under wxMSW, other ports only + have it in wxBitmap. You can always use wxImage::ConvertToDisabled() + and create the icon from wxImage manually however. + + @onlyfor{wxmsw} + + @since 2.9.0 + */ + wxIcon ConvertToDisabled(unsigned char brightness = 255) const; + /** Copies @a bmp bitmap to this icon. Under MS Windows the bitmap must have mask colour set. @@ -271,7 +296,7 @@ public: @param icon Icon to assign. */ - wxIcon operator =(const wxIcon& icon); + wxIcon& operator=(const wxIcon& icon); }; /**