libraries/lib-theme/Theme.cpp
/// Writes a series of Macro definitions that can be used in the include file.
Writes a series of Macro definitions that can be used in the include file.
Writes a series of Macro definitions that can be used in the include file .
void ThemeBase::WriteImageDefs( )
{
   EnsureInitialised();
   int i;
   wxFFile File( FileNames::ThemeImageDefsAsCee(), wxT("wb") );
   if( !File.IsOpened() )
      return;
   teResourceFlags PrevFlags = (teResourceFlags)-1;
   for(i = 0; i < (int)mImages.size(); i++)
   {
      wxImage &SrcImage = mImages[i];
      if( PrevFlags != mBitmapFlags[i] )
      {
         PrevFlags = (teResourceFlags)mBitmapFlags[i];
         int t = (int)PrevFlags;
         wxString Temp;
         if( t==0 ) Temp = wxT(" resFlagNone ");
         if( t & resFlagPaired )   Temp += wxT(" resFlagPaired ");
         if( t & resFlagCursor )   Temp += wxT(" resFlagCursor ");
         if( t & resFlagNewLine )  Temp += wxT(" resFlagNewLine ");
         if( t & resFlagInternal ) Temp += wxT(" resFlagInternal ");
         Temp.Replace( wxT("  "), wxT(" | ") );
         File.Write( wxString::Format( wxT("\r\n   SET_THEME_FLAGS( %s );\r\n"),
            Temp ));
      }
      File.Write( wxString::Format(
         wxT("   DEFINE_IMAGE( bmp%s, wxImage( %i, %i ), wxT(\"%s\"));\r\n"),
         mBitmapNames[i],
         SrcImage.GetWidth(),
         SrcImage.GetHeight(),
         mBitmapNames[i]
         ));
   }
}
void ThemeBase :: WriteImageDefs ( ) { EnsureInitialised ( ) ; int i ; wxFFile File ( FileNames :: ThemeImageDefsAsCee ( ) , wxT ( " " ) ) ; if ( ! File . IsOpened ( ) ) return ; teResourceFlags PrevFlags = ( teResourceFlags ) - 1 ; for ( i = 0 ; i < ( int ) mImages . size ( ) ; i ++ ) { wxImage & SrcImage = mImages [ i ] ; if ( PrevFlags != mBitmapFlags [ i ] ) { PrevFlags = ( teResourceFlags ) mBitmapFlags [ i ] ; int t = ( int ) PrevFlags ; wxString Temp ; if ( t == 0 ) Temp = wxT ( " " ) ; if ( t & resFlagPaired ) Temp += wxT ( " " ) ; if ( t & resFlagCursor ) Temp += wxT ( " " ) ; if ( t & resFlagNewLine ) Temp += wxT ( " " ) ; if ( t & resFlagInternal ) Temp += wxT ( " " ) ; Temp . Replace ( wxT ( " " ) , wxT ( " " ) ) ; File . Write ( wxString :: Format ( wxT ( " \r \n \r \n " ) , Temp ) ) ; } File . Write ( wxString :: Format ( wxT ( " \" \" \r \n " ) , mBitmapNames [ i ] , SrcImage . GetWidth ( ) , SrcImage . GetHeight ( ) , mBitmapNames [ i ] ) ) ; } }
Writes a series of Macro definitions that can be used in the include file.
Writes a series of Macro definitions that can be used in the include file .
// No href in html.  Uses title not alt.