summaryrefslogtreecommitdiff
path: root/vcl/source/control/fixed.cxx
diff options
context:
space:
mode:
authorPhilipp Lohmann [pl] <Philipp.Lohmann@Sun.COM>2010-01-14 19:11:13 +0100
committerPhilipp Lohmann [pl] <Philipp.Lohmann@Sun.COM>2010-01-14 19:11:13 +0100
commit0dc15d0bc9adb9dcd2a1a5deea3f952b8a4e6689 (patch)
tree1fe24b3ce25cdfece23f43d4663f1adff67b6a1d /vcl/source/control/fixed.cxx
parent64e8661d76db6b02396d82b7d1f28dd3088a334f (diff)
parent8765a3bf9f2926a50d0f644e4263782269abe023 (diff)
rebase to DEV300_m69
Diffstat (limited to 'vcl/source/control/fixed.cxx')
-rw-r--r--vcl/source/control/fixed.cxx108
1 files changed, 41 insertions, 67 deletions
diff --git a/vcl/source/control/fixed.cxx b/vcl/source/control/fixed.cxx
index f3ec855c2544..df2673ede10c 100644
--- a/vcl/source/control/fixed.cxx
+++ b/vcl/source/control/fixed.cxx
@@ -33,7 +33,7 @@
#include <vcl/decoview.hxx>
#include <vcl/event.hxx>
#include <vcl/fixed.hxx>
-#include <vcl/controllayout.hxx>
+#include <vcl/controldata.hxx>
#include <vcl/window.h>
#include <tools/rc.h>
@@ -109,40 +109,25 @@ WinBits FixedText::ImplInitStyle( WinBits nStyle )
return nStyle;
}
+// -----------------------------------------------------------------
+
+const Font& FixedText::GetCanonicalFont( const StyleSettings& _rStyle ) const
+{
+ return ( GetStyle() & WB_INFO ) ? _rStyle.GetInfoFont() : _rStyle.GetLabelFont();
+}
+
+// -----------------------------------------------------------------
+const Color& FixedText::GetCanonicalTextColor( const StyleSettings& _rStyle ) const
+{
+ return ( GetStyle() & WB_INFO ) ? _rStyle.GetInfoTextColor() : _rStyle.GetLabelTextColor();
+}
+
// -----------------------------------------------------------------------
void FixedText::ImplInitSettings( BOOL bFont,
BOOL bForeground, BOOL bBackground )
{
- const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
-
- if ( bFont )
- {
- Font aFont;
- if ( GetStyle() & WB_INFO )
- aFont = rStyleSettings.GetInfoFont();
- else
- aFont = rStyleSettings.GetLabelFont();
- if ( IsControlFont() )
- aFont.Merge( GetControlFont() );
- SetZoomedPointFont( aFont );
- }
-
- if ( bForeground || bFont )
- {
- Color aColor;
- if ( IsControlForeground() )
- aColor = GetControlForeground();
- else
- {
- if ( GetStyle() & WB_INFO )
- aColor = rStyleSettings.GetInfoTextColor();
- else
- aColor = rStyleSettings.GetLabelTextColor();
- }
- SetTextColor( aColor );
- SetTextFillColor();
- }
+ Control::ImplInitSettings( bFont, bForeground );
if ( bBackground )
{
@@ -278,17 +263,13 @@ void FixedText::ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
nTextStyle |= TEXT_DRAW_MONO;
if( bFillLayout )
- {
- mpLayoutData->m_aDisplayText = String();
- pDev->DrawText( Rectangle( aPos, rSize ),
- aText,
- nTextStyle,
- &mpLayoutData->m_aUnicodeBoundRects,
- &mpLayoutData->m_aDisplayText
- );
- }
- else
- pDev->DrawText( Rectangle( aPos, rSize ), aText, nTextStyle );
+ mpControlData->mpLayoutData->m_aDisplayText = String();
+
+ Rectangle aRect( Rectangle( aPos, rSize ) );
+ DrawControlText( *pDev, aRect, aText, nTextStyle,
+ bFillLayout ? &mpControlData->mpLayoutData->m_aUnicodeBoundRects : NULL,
+ bFillLayout ? &mpControlData->mpLayoutData->m_aDisplayText : NULL
+ );
}
// -----------------------------------------------------------------------
@@ -446,7 +427,7 @@ Size FixedText::GetOptimalSize(WindowSizeType eType) const
void FixedText::FillLayoutData() const
{
- mpLayoutData = new vcl::ControlLayoutData();
+ mpControlData->mpLayoutData = new vcl::ControlLayoutData();
ImplDraw( const_cast<FixedText*>(this), 0, Point(), GetOutputSizePixel(), true );
}
@@ -468,31 +449,25 @@ WinBits FixedLine::ImplInitStyle( WinBits nStyle )
return nStyle;
}
+// -----------------------------------------------------------------
+
+const Font& FixedLine::GetCanonicalFont( const StyleSettings& _rStyle ) const
+{
+ return _rStyle.GetGroupFont();
+}
+
+// -----------------------------------------------------------------
+const Color& FixedLine::GetCanonicalTextColor( const StyleSettings& _rStyle ) const
+{
+ return _rStyle.GetGroupTextColor();
+}
+
// -----------------------------------------------------------------------
void FixedLine::ImplInitSettings( BOOL bFont,
BOOL bForeground, BOOL bBackground )
{
- const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
-
- if ( bFont )
- {
- Font aFont = rStyleSettings.GetGroupFont();
- if ( IsControlFont() )
- aFont.Merge( GetControlFont() );
- SetZoomedPointFont( aFont );
- }
-
- if ( bForeground || bFont )
- {
- Color aColor;
- if ( IsControlForeground() )
- aColor = GetControlForeground();
- else
- aColor = rStyleSettings.GetGroupTextColor();
- SetTextColor( aColor );
- SetTextFillColor();
- }
+ Control::ImplInitSettings( bFont, bForeground );
if ( bBackground )
{
@@ -526,8 +501,8 @@ void FixedLine::ImplDraw( bool bLayout )
String aText = GetText();
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
WinBits nWinStyle = GetStyle();
- MetricVector* pVector = bLayout ? &mpLayoutData->m_aUnicodeBoundRects : NULL;
- String* pDisplayText = bLayout ? &mpLayoutData->m_aDisplayText : NULL;
+ MetricVector* pVector = bLayout ? &mpControlData->mpLayoutData->m_aUnicodeBoundRects : NULL;
+ String* pDisplayText = bLayout ? &mpControlData->mpLayoutData->m_aDisplayText : NULL;
if ( rStyleSettings.GetOptions() & STYLE_OPTION_MONO )
SetLineColor( Color( COL_BLACK ) );
@@ -574,8 +549,7 @@ void FixedLine::ImplDraw( bool bLayout )
if ( rStyleSettings.GetOptions() & STYLE_OPTION_MONO )
nStyle |= TEXT_DRAW_MONO;
- aRect = GetTextRect( aRect, aText, nStyle );
- DrawText( aRect, aText, nStyle, pVector, pDisplayText );
+ DrawControlText( *this, aRect, aText, nStyle, pVector, pDisplayText );
if( !pVector )
{
@@ -617,7 +591,7 @@ FixedLine::FixedLine( Window* pParent, const ResId& rResId ) :
void FixedLine::FillLayoutData() const
{
- mpLayoutData = new vcl::ControlLayoutData();
+ mpControlData->mpLayoutData = new vcl::ControlLayoutData();
const_cast<FixedLine*>(this)->ImplDraw( true );
}