X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b7cacb43db1e69b87b257a67912b4d52995b070a..8a4325e367b33940ec7aaf3c153246bf7c6ee268:/src/mac/carbon/icon.cpp diff --git a/src/mac/carbon/icon.cpp b/src/mac/carbon/icon.cpp index 7084b59cfc..e774075ae3 100644 --- a/src/mac/carbon/icon.cpp +++ b/src/mac/carbon/icon.cpp @@ -53,6 +53,18 @@ wxIcon::wxIcon( LoadFile( icon_file, (wxBitmapType) flags, desiredWidth, desiredHeight ); } +wxIcon::wxIcon(WXHICON icon, const wxSize& size) + : wxGDIObject() +{ + // as the icon owns that ref, we have to acquire it as well + if (icon) + AcquireIconRef( (IconRef) icon ) ; + + m_refData = new wxIconRefData( icon ) ; + M_ICONDATA->SetWidth( size.x ) ; + M_ICONDATA->SetHeight( size.y ) ; +} + wxIcon::~wxIcon() { } @@ -83,15 +95,15 @@ int wxIcon::GetDepth() const return 32; } -void wxIcon::SetDepth( int depth ) +void wxIcon::SetDepth( int WXUNUSED(depth) ) { } -void wxIcon::SetWidth( int width ) +void wxIcon::SetWidth( int WXUNUSED(width) ) { } -void wxIcon::SetHeight( int height ) +void wxIcon::SetHeight( int WXUNUSED(height) ) { } @@ -126,6 +138,18 @@ bool wxIcon::LoadFile( { theId = kAlertStopIcon ; } + else if ( filename == wxT("wxICON_FOLDER") ) + { + theId = kGenericFolderIcon ; + } + else if ( filename == wxT("wxICON_FOLDER_OPEN") ) + { + theId = kOpenFolderIcon ; + } + else if ( filename == wxT("wxICON_NORMAL_FILE") ) + { + theId = kGenericDocumentIcon ; + } else { #if 0 @@ -235,7 +259,7 @@ void wxIconRefData::Free() IMPLEMENT_DYNAMIC_CLASS(wxICONResourceHandler, wxBitmapHandler) bool wxICONResourceHandler::LoadFile( - wxBitmap *bitmap, const wxString& name, long flags, + wxBitmap *bitmap, const wxString& name, long WXUNUSED(flags), int desiredWidth, int desiredHeight ) { wxIcon icon ;