From: Jeffrey D. <ha...@us...> - 2003-09-26 22:40:35
|
Log Message: ----------- AA -> on for panel + option to turn it off(why would anyone want to turn it off? *shrug* Modified Files: -------------- /cvsroot/decaldev/source/DecalControls: PushButton.cpp PushButton.h Revision Data ------------- Index: PushButton.cpp =================================================================== RCS file: /cvsroot/decaldev/source/DecalControls/PushButton.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- PushButton.cpp 13 Sep 2003 23:59:01 -0000 1.4 +++ PushButton.cpp 26 Sep 2003 22:40:22 -0000 1.5 @@ -137,53 +137,68 @@ STDMETHODIMP cPushButton::SchemaLoad( IView *pView, IUnknown *pSchema ) { - CComPtr< IPluginSite > pPlugin; - m_pSite->get_PluginSite( &pPlugin ); + CComPtr< IPluginSite > pPlugin; + m_pSite->get_PluginSite( &pPlugin ); - // Load some defaults - pPlugin->CreateFontSchema( 14, 0, pSchema, &m_pFont ); - pPlugin->LoadImageSchema( pSchema, &m_pBackground ); + // Load some defaults + pPlugin->CreateFontSchema( 14, 0, pSchema, &m_pFont ); + pPlugin->LoadImageSchema( pSchema, &m_pBackground ); - MSXML::IXMLDOMElementPtr pElement = pSchema; + MSXML::IXMLDOMElementPtr pElement = pSchema; - _variant_t vFaceColor = pElement->getAttribute( _T( "facecolor" ) ), - vTextColor = pElement->getAttribute( _T( "textcolor" ) ), - vText = pElement->getAttribute( _T( "text" ) ); + _variant_t vFaceColor = pElement->getAttribute( _T( "facecolor" ) ), + vTextColor = pElement->getAttribute( _T( "textcolor" ) ), + vText = pElement->getAttribute( _T( "text" ) ), + vAntialias = pElement->getAttribute( _T( "aa" ) ); - if( vFaceColor.vt != VT_NULL ) - { - try - { - m_nFaceColor = static_cast< long >( vFaceColor ); - m_UseFaceColor = true; // GKusnick: Render 3D outline. - } - catch( ... ) - { - // Type conversion error - _ASSERTE( FALSE ); - } - } + if( vFaceColor.vt != VT_NULL ) + { + try + { + m_nFaceColor = static_cast< long >( vFaceColor ); + m_UseFaceColor = true; // GKusnick: Render 3D outline. + } + catch( ... ) + { + // Type conversion error + _ASSERTE( FALSE ); + } + } - if( vTextColor.vt != VT_NULL ) - { - try - { - m_nTextColor = static_cast< long >( vTextColor ); - } - catch( ... ) - { - // Type conversion error - _ASSERTE( FALSE ); - } - } + if( vTextColor.vt != VT_NULL ) + { + try + { + m_nTextColor = static_cast< long >( vTextColor ); + } + catch( ... ) + { + // Type conversion error + _ASSERTE( FALSE ); + } + } - if( vText.vt != VT_NULL ) - { - _ASSERTE( vText.vt == VT_BSTR ); - m_strText = vText.bstrVal; - } + if( vText.vt != VT_NULL ) + { + _ASSERTE( vText.vt == VT_BSTR ); + m_strText = vText.bstrVal; + } - return S_OK; + m_bAA = true; + if( vAntialias.vt != VT_NULL ) + { + try + { + m_bAA = static_cast< bool >( vAntialias ); + } + catch( ... ) + { + // Type conversion error + _ASSERTE( FALSE ); + } + } + + return S_OK; } STDMETHODIMP cPushButton::MouseEnter(struct MouseState *) @@ -313,7 +328,7 @@ // Next, draw the text POINT ptText = { ( !bPressed ) ? m_ptText.x : m_ptText.x + 1, ( !bPressed ) ? m_ptText.y : m_ptText.y + 1 }; - m_pFont->DrawText( &ptText, m_strText, m_nTextColor, pCanvas ); + m_pFont->DrawTextEx( &ptText, m_strText, m_nTextColor, 0, m_bAA ? eAA : 0, pCanvas ); // Nerfgolem 2001.10.11 // Do not render the 3D outline if there's a background image. Index: PushButton.h =================================================================== RCS file: /cvsroot/decaldev/source/DecalControls/PushButton.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- PushButton.h 13 Sep 2003 23:59:01 -0000 1.3 +++ PushButton.h 26 Sep 2003 22:40:22 -0000 1.4 @@ -36,6 +36,7 @@ long m_nFaceColor, m_nTextColor; BOOL m_UseFaceColor; // GKusnick: Render 3D outline. + bool m_bAA; void onCreate(); |