Log Message:
-----------
outlines and stuff
Modified Files:
--------------
/cvsroot/decaldev/source/DecalControls:
Checkbox.cpp
Checkbox.h
Edit.cpp
Edit.h
Revision Data
-------------
Index: Checkbox.cpp
===================================================================
RCS file: /cvsroot/decaldev/source/DecalControls/Checkbox.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- Checkbox.cpp 26 Sep 2003 22:57:54 -0000 1.4
+++ Checkbox.cpp 27 Sep 2003 06:49:03 -0000 1.5
@@ -130,6 +130,7 @@
vTextColor = pElement->getAttribute( _T( "textcolor" ) ),
vRightToLeft = pElement->getAttribute( _T( "righttoleft" ) ),
vChecked = pElement->getAttribute( _T( "checked" ) ),
+ vOutline = pElement->getAttribute( _T( "outlinecolor" ) ),
vAntialias = pElement->getAttribute( _T( "aa" ) );
// Text must exist
@@ -175,6 +176,22 @@
}
}
+ m_nOutlineColor = 0;
+ m_bOutline = false;
+ if( vOutline.vt != VT_NULL )
+ {
+ try
+ {
+ m_bOutline = true;
+ m_nOutlineColor = static_cast< long >( vOutline );
+ }
+ catch( ... )
+ {
+ // Type conversion error
+ _ASSERTE( FALSE );
+ }
+ }
+
m_bAA = true;
if( vAntialias.vt != VT_NULL )
{
@@ -251,7 +268,16 @@
pPlugin->GetIconCache( &szIcon, &pIcon );
pIcon->DrawIcon( &m_ptCheck, ( bChecked ) ? 0x0600128B : 0x0600128D, 0, pCanvas );
- m_pFont->DrawTextEx( &m_ptText, m_strText, m_nTextColor, 0, m_bAA ? eAA : 0, pCanvas );
+
+ long lFlags = 0;
+
+ if( m_bAA )
+ lFlags |= eAA;
+
+ if( m_bOutline )
+ lFlags |= eOutlined;
+
+ m_pFont->DrawTextEx( &m_ptText, m_strText, m_nTextColor, m_nOutlineColor, lFlags, pCanvas );
return S_OK;
}
Index: Checkbox.h
===================================================================
RCS file: /cvsroot/decaldev/source/DecalControls/Checkbox.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- Checkbox.h 26 Sep 2003 22:57:54 -0000 1.3
+++ Checkbox.h 27 Sep 2003 06:49:03 -0000 1.4
@@ -31,8 +31,8 @@
VARIANT_BOOL m_bChecked,
m_bRightToLeft;
- long m_nTextColor;
- bool m_bAA;
+ long m_nTextColor, m_nOutlineColor;
+ bool m_bAA, m_bOutline;
POINT m_ptText,
m_ptCheck;
Index: Edit.cpp
===================================================================
RCS file: /cvsroot/decaldev/source/DecalControls/Edit.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- Edit.cpp 26 Sep 2003 22:57:54 -0000 1.6
+++ Edit.cpp 27 Sep 2003 06:49:03 -0000 1.7
@@ -229,13 +229,21 @@
// Nothing to draw huzzah!
return S_OK;
+ long lFlags = 0;
+
+ if( m_bAA )
+ lFlags |= eAA;
+
+ if( m_bOutline )
+ lFlags |= eOutlined;
+
// Draw the text
POINT ptText = { -m_nOffset, 0 };
if( m_strText.length() > 0 )
if (m_bPassword) {
- m_pFont->DrawTextEx( &ptText, _bstr_t( m_strPass.c_str() ), m_nTextColor, 0, m_bAA ? eAA : 0, pCanvas );
+ m_pFont->DrawTextEx( &ptText, _bstr_t( m_strPass.c_str() ), m_nTextColor, m_nOutlineColor, lFlags, pCanvas );
} else {
- m_pFont->DrawTextEx( &ptText, _bstr_t( m_strText.c_str() ), m_nTextColor, 0, m_bAA ? eAA : 0, pCanvas );
+ m_pFont->DrawTextEx( &ptText, _bstr_t( m_strText.c_str() ), m_nTextColor, m_nOutlineColor, lFlags, pCanvas );
}
if( m_bCapture && m_bDrawCaret )
@@ -758,6 +766,7 @@
vMarginX = pElement->getAttribute( _T( "marginx" ) ),
vMarginY = pElement->getAttribute( _T( "marginy" ) ),
vPassword = pElement->getAttribute( _T( "password" ) ),
+ vOutline = pElement->getAttribute( _T( "outlinecolor" ) ),
vAntialias = pElement->getAttribute( _T( "aa" ) );
if( vText.vt != VT_NULL )
@@ -829,6 +838,21 @@
m_strPass.append("*");
}
+ m_nOutlineColor = 0;
+ m_bOutline = false;
+ if( vOutline.vt != VT_NULL )
+ {
+ try
+ {
+ m_bOutline = true;
+ m_nOutlineColor = static_cast< long >( vOutline );
+ }
+ catch( ... )
+ {
+ // Type conversion error
+ _ASSERTE( FALSE );
+ }
+ }
m_bAA = true;
if( vAntialias.vt != VT_NULL )
Index: Edit.h
===================================================================
RCS file: /cvsroot/decaldev/source/DecalControls/Edit.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- Edit.h 26 Sep 2003 22:57:54 -0000 1.6
+++ Edit.h 27 Sep 2003 06:49:03 -0000 1.7
@@ -36,12 +36,14 @@
bool m_bDrawCaret;
bool m_bPassword;
bool m_bSelecting;
+ bool m_bOutline;
bool m_bAA;
long m_nCaretChar, m_nCaret, m_nOffset,
m_nCaretHeight,
m_nSelStart, m_nSelStartChar,
- m_nTextColor;
+ m_nTextColor, m_nOutlineColor;
+
std::string m_strText;
|