- Str255 theName ;
- short theId ;
- OSType theType ;
- strcpy( (char*) theName , name ) ;
- c2pstr( (char*) theName ) ;
-
- Handle resHandle = GetNamedResource( 'cicn' , theName ) ;
- GetResInfo( resHandle , &theId , &theType , theName ) ;
- ReleaseResource( resHandle ) ;
-
- CIconHandle theIcon = (CIconHandle ) GetCIcon( theId ) ;
- if ( theIcon )
- {
- M_ICONHANDLERDATA->m_hIcon = theIcon ;
- M_ICONHANDLERDATA->m_width = 32 ;
- M_ICONHANDLERDATA->m_height = 32 ;
-
- M_ICONHANDLERDATA->m_depth = 8 ;
- M_ICONHANDLERDATA->m_ok = true ;
- M_ICONHANDLERDATA->m_numColors = 256 ;
- return TRUE ;
- }
- return FALSE ;
+ short theId = -1 ;
+ if ( name == wxT("wxICON_INFORMATION") )
+ {
+ theId = kNoteIcon ;
+ }
+ else if ( name == wxT("wxICON_QUESTION") )
+ {
+ theId = kCautionIcon ;
+ }
+ else if ( name == wxT("wxICON_WARNING") )
+ {
+ theId = kCautionIcon ;
+ }
+ else if ( name == wxT("wxICON_ERROR") )
+ {
+ theId = kStopIcon ;
+ }
+ else
+ {
+ Str255 theName ;
+ OSType theType ;
+ wxMacStringToPascal( name , theName ) ;
+
+ Handle resHandle = GetNamedResource( 'cicn' , theName ) ;
+ if ( resHandle != 0L )
+ {
+ GetResInfo( resHandle , &theId , &theType , theName ) ;
+ ReleaseResource( resHandle ) ;
+ }
+ }
+ if ( theId != -1 )
+ {
+ CIconHandle theIcon = (CIconHandle ) GetCIcon( theId ) ;
+ if ( theIcon )
+ {
+ M_BITMAPHANDLERDATA->m_hIcon = theIcon ;
+ M_BITMAPHANDLERDATA->m_width = 32 ;
+ M_BITMAPHANDLERDATA->m_height = 32 ;
+
+ M_BITMAPHANDLERDATA->m_depth = 8 ;
+ M_BITMAPHANDLERDATA->m_ok = true ;
+ M_BITMAPHANDLERDATA->m_numColors = 256 ;
+ M_BITMAPHANDLERDATA->m_bitmapType = kMacBitmapTypeIcon ;
+ return TRUE ;
+ }
+ }
+ return FALSE ;