+int wxIcon::GetHeight() const
+{
+ wxCHECK_MSG( Ok(), -1, wxT("invalid icon") );
+
+ return M_ICONDATA->GetHeight();
+}
+
+int wxIcon::GetDepth() const
+{
+ return 32;
+}
+
+void wxIcon::SetDepth( int depth )
+{
+}
+
+void wxIcon::SetWidth( int width )
+{
+}
+
+void wxIcon::SetHeight( int height )
+{
+}
+
+bool wxIcon::Ok() const
+{
+ return m_refData != NULL ;
+}
+
+bool wxIcon::LoadFile(
+ const wxString& filename, wxBitmapType type,
+ int desiredWidth, int desiredHeight )
+{
+ UnRef();
+
+ if ( type == wxBITMAP_TYPE_ICON_RESOURCE )
+ {
+ OSType theId = 0 ;
+
+ if ( filename == wxT("wxICON_INFORMATION") )
+ {
+ theId = kAlertNoteIcon ;
+ }
+ else if ( filename == wxT("wxICON_QUESTION") )
+ {
+ theId = kAlertCautionIcon ;
+ }
+ else if ( filename == wxT("wxICON_WARNING") )
+ {
+ theId = kAlertCautionIcon ;
+ }
+ else if ( filename == wxT("wxICON_ERROR") )
+ {
+ theId = kAlertStopIcon ;
+ }
+ else
+ {
+#if 0
+ Str255 theName ;
+ OSType theType ;
+ wxMacStringToPascal( name , theName ) ;
+
+ Handle resHandle = GetNamedResource( 'cicn' , theName ) ;
+ if ( resHandle != 0L )
+ {
+ GetResInfo( resHandle , &theId , &theType , theName ) ;
+ ReleaseResource( resHandle ) ;
+ }
+#endif
+ }
+
+ if ( theId != 0 )
+ {
+ IconRef iconRef = NULL ;
+ verify_noerr( GetIconRef( kOnSystemDisk, kSystemIconsCreator, theId, &iconRef ) ) ;
+ if ( iconRef )
+ {
+ m_refData = new wxIconRefData( (WXHICON) iconRef ) ;
+
+ return true ;
+ }
+ }
+
+ return false ;
+ }
+ else
+ {
+ wxBitmapHandler *handler = wxBitmap::FindHandler( type );
+
+ if ( handler )
+ {
+ wxBitmap bmp ;
+ if ( handler->LoadFile( &bmp , filename, type, desiredWidth, desiredHeight ))
+ {
+ CopyFromBitmap( bmp ) ;
+
+ return true ;
+ }
+
+ return false ;
+ }
+ else
+ {
+#if wxUSE_IMAGE
+ wxImage loadimage( filename, type );
+ if (loadimage.Ok())
+ {
+ if ( desiredWidth == -1 )
+ desiredWidth = loadimage.GetWidth() ;
+ if ( desiredHeight == -1 )
+ desiredHeight = loadimage.GetHeight() ;
+ if ( desiredWidth != loadimage.GetWidth() || desiredHeight != loadimage.GetHeight() )
+ loadimage.Rescale( desiredWidth , desiredHeight ) ;
+
+ wxBitmap bmp( loadimage );
+ CopyFromBitmap( bmp ) ;
+
+ return true;
+ }
+#endif
+ }
+ }
+ return true ;
+}
+
+void wxIcon::CopyFromBitmap( const wxBitmap& bmp )