Kaydet (Commit) e27ee95c authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl

pass RenderContext to PreparePaint in TreeListBox

Change-Id: I32961f5cd511b9ecc756e99ca95e4e9ddbc6b795
üst a97fc29f
......@@ -98,31 +98,32 @@ void OCreationList::Paint(vcl::RenderContext& rRenderContext, const Rectangle& _
rRenderContext.SetFont(m_aOriginalFont);
}
void OCreationList::PreparePaint( SvTreeListEntry* _pEntry )
void OCreationList::PreparePaint(vcl::RenderContext& rRenderContext, SvTreeListEntry* _pEntry)
{
Wallpaper aEntryBackground( m_aOriginalBackgroundColor );
if ( _pEntry )
Wallpaper aEntryBackground(m_aOriginalBackgroundColor);
if (_pEntry)
{
if ( _pEntry == GetCurEntry() )
if (_pEntry == GetCurEntry())
{
// draw a selection background
bool bIsMouseDownEntry = ( _pEntry == m_pMouseDownEntry );
DrawSelectionBackground( GetBoundingRect( _pEntry ), bIsMouseDownEntry ? 1 : 2, false, true, false );
vcl::RenderTools::DrawSelectionBackground(rRenderContext, *this, GetBoundingRect(_pEntry),
bIsMouseDownEntry ? 1 : 2, false, true, false );
if ( bIsMouseDownEntry )
if (bIsMouseDownEntry)
{
vcl::Font aFont( GetFont() );
aFont.SetColor( GetSettings().GetStyleSettings().GetHighlightTextColor() );
Control::SetFont( aFont );
vcl::Font aFont(rRenderContext.GetFont());
aFont.SetColor(rRenderContext.GetSettings().GetStyleSettings().GetHighlightTextColor());
rRenderContext.SetFont(aFont);
}
// and temporary set a transparent background, for all the other
// paint operations the SvTreeListBox is going to do
aEntryBackground = Wallpaper( Color( COL_TRANSPARENT ) );
aEntryBackground = Wallpaper(Color(COL_TRANSPARENT));
}
}
SetBackground( aEntryBackground );
rRenderContext.SetBackground(aEntryBackground);
}
void OCreationList::SelectSearchEntry( const void* _pEntry )
......
......@@ -61,7 +61,7 @@ namespace dbaui
virtual void MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE;
virtual void MouseButtonUp( const MouseEvent& rMEvt ) SAL_OVERRIDE;
virtual void KeyInput( const KeyEvent& rKEvt ) SAL_OVERRIDE;
virtual void Paint( vcl::RenderContext& rRenderContext, const Rectangle& rRect ) SAL_OVERRIDE;
virtual void Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect) SAL_OVERRIDE;
virtual void StartDrag( sal_Int8 _nAction, const Point& _rPosPixel ) SAL_OVERRIDE;
virtual void GetFocus() SAL_OVERRIDE;
virtual void LoseFocus() SAL_OVERRIDE;
......@@ -71,7 +71,7 @@ namespace dbaui
void updateHelpText();
protected:
virtual void PreparePaint( SvTreeListEntry* _pEntry ) SAL_OVERRIDE;
virtual void PreparePaint(vcl::RenderContext& rRenderContext, SvTreeListEntry* _pEntry) SAL_OVERRIDE;
virtual Rectangle GetFocusRect( SvTreeListEntry* _pEntry, long _nLine ) SAL_OVERRIDE;
virtual void ModelHasCleared() SAL_OVERRIDE;
......
......@@ -617,7 +617,7 @@ protected:
virtual void Command( const CommandEvent& rCEvt ) SAL_OVERRIDE;
virtual void RequestHelp( const HelpEvent& rHEvt ) SAL_OVERRIDE;
virtual void PreparePaint( SvTreeListEntry* );
virtual void PreparePaint(vcl::RenderContext& rRenderContext, SvTreeListEntry* pEntry);
virtual void DataChanged( const DataChangedEvent& rDCEvt ) SAL_OVERRIDE;
void InitSettings(bool bFont, bool bForeground, bool bBackground);
......
......@@ -2565,7 +2565,7 @@ void SvTreeListBox::AdjustEntryHeightAndRecalc( const vcl::Font& rFont )
void SvTreeListBox::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect)
{
Control::Paint(rRenderContext, rRect);
if(nTreeFlags & SvTreeFlags::RECALCTABS)
if (nTreeFlags & SvTreeFlags::RECALCTABS)
SetTabs();
pImp->Paint(rRenderContext, rRect);
......@@ -2837,21 +2837,20 @@ SvTreeListEntry* SvTreeListBox::GetCurEntry() const
void SvTreeListBox::ImplInitStyle()
{
const WinBits nWindowStyle = GetStyle();
nTreeFlags |= SvTreeFlags::RECALCTABS;
if( nWindowStyle & WB_SORT )
if (nWindowStyle & WB_SORT)
{
GetModel()->SetSortMode( SortAscending );
GetModel()->SetCompareHdl( LINK(this,SvTreeListBox,DefaultCompare));
GetModel()->SetSortMode(SortAscending);
GetModel()->SetCompareHdl(LINK(this, SvTreeListBox, DefaultCompare));
}
else
{
GetModel()->SetSortMode( SortNone );
GetModel()->SetCompareHdl( Link<>() );
GetModel()->SetSortMode(SortNone);
GetModel()->SetCompareHdl(Link<>());
}
pImp->SetStyle( nWindowStyle );
pImp->SetStyle(nWindowStyle);
pImp->Resize();
Invalidate();
}
......@@ -2884,7 +2883,7 @@ long SvTreeListBox::PaintEntry1(SvTreeListEntry* pEntry, long nLine, vcl::Render
Rectangle aRect; // multi purpose
bool bHorSBar = pImp->HasHorScrollBar();
PreparePaint(pEntry);
PreparePaint(rRenderContext, pEntry);
pImp->UpdateContextBmpWidthMax(pEntry);
......@@ -2986,7 +2985,7 @@ long SvTreeListBox::PaintEntry1(SvTreeListEntry* pEntry, long nLine, vcl::Render
{
// if the face color is bright then the deactive color is also bright
// -> so you can't see any deactive selection
if ( bHideSelection && !rSettings.GetFaceColor().IsBright()
if (bHideSelection && !rSettings.GetFaceColor().IsBright()
&& aWallpaper.GetColor().IsBright() != rSettings.GetDeactiveColor().IsBright())
{
aNewWallColor = rSettings.GetDeactiveColor();
......@@ -3054,7 +3053,7 @@ long SvTreeListBox::PaintEntry1(SvTreeListEntry* pEntry, long nLine, vcl::Render
// A custom selection that starts at a tab position > 0, do not fill
// the background of the 0th item, else e.g. we might not be able to
// realize tab listboxes with lines.
if (!(nCurTab==0 && (nTreeFlags & SvTreeFlags::USESEL) && nFirstSelTab))
if (!(nCurTab == 0 && (nTreeFlags & SvTreeFlags::USESEL) && nFirstSelTab))
{
rRenderContext.SetFillColor(aWallpaper.GetColor());
// this case may occur for smaller horizontal resizes
......@@ -3087,7 +3086,7 @@ long SvTreeListBox::PaintEntry1(SvTreeListEntry* pEntry, long nLine, vcl::Render
// cursor emphasis
rRenderContext.SetFillColor();
Color aOldLineColor = rRenderContext.GetLineColor();
SetLineColor(Color(COL_BLACK));
rRenderContext.SetLineColor(Color(COL_BLACK));
aRect = GetFocusRect(pEntry, nLine);
aRect.Top()++;
aRect.Bottom()--;
......@@ -3197,7 +3196,7 @@ long SvTreeListBox::PaintEntry1(SvTreeListEntry* pEntry, long nLine, vcl::Render
return 0; // nRowLen;
}
void SvTreeListBox::PreparePaint( SvTreeListEntry* )
void SvTreeListBox::PreparePaint(vcl::RenderContext& /*rRenderContext*/, SvTreeListEntry* /*pEntry*/)
{
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment