Kaydet (Commit) c299413c authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl Kaydeden (comit) Jan Holesovsky

refactor "HelpTextWindow" - use RenderContext

Change-Id: I6cfcd86fabb2f568b577bb060cccabfe1aebc537
üst a6b9d9a1
...@@ -352,49 +352,49 @@ void HelpTextWindow::ImplShow() ...@@ -352,49 +352,49 @@ void HelpTextWindow::ImplShow()
Update(); Update();
} }
void HelpTextWindow::Paint( vcl::RenderContext& /*rRenderContext*/, const Rectangle& ) void HelpTextWindow::Paint( vcl::RenderContext& rRenderContext, const Rectangle& )
{ {
// paint native background // paint native background
bool bNativeOK = false; bool bNativeOK = false;
if ( IsNativeControlSupported( CTRL_TOOLTIP, PART_ENTIRE_CONTROL ) ) if (rRenderContext.IsNativeControlSupported(CTRL_TOOLTIP, PART_ENTIRE_CONTROL))
{ {
// #i46472# workaround gcc3.3 temporary problem // #i46472# workaround gcc3.3 temporary problem
Rectangle aCtrlRegion( Point( 0, 0 ), GetOutputSizePixel() ); Rectangle aCtrlRegion(Point(0, 0), GetOutputSizePixel());
ImplControlValue aControlValue; ImplControlValue aControlValue;
bNativeOK = DrawNativeControl( CTRL_TOOLTIP, PART_ENTIRE_CONTROL, aCtrlRegion, bNativeOK = rRenderContext.DrawNativeControl(CTRL_TOOLTIP, PART_ENTIRE_CONTROL, aCtrlRegion,
ControlState::NONE, aControlValue, OUString() ); ControlState::NONE, aControlValue, OUString());
} }
// paint text // paint text
if ( mnHelpWinStyle == HELPWINSTYLE_QUICK && maHelpText.getLength() < HELPTEXTMAXLEN) if (mnHelpWinStyle == HELPWINSTYLE_QUICK && maHelpText.getLength() < HELPTEXTMAXLEN)
{ {
if ( mnStyle & QUICKHELP_CTRLTEXT ) if ( mnStyle & QUICKHELP_CTRLTEXT )
DrawCtrlText( maTextRect.TopLeft(), maHelpText ); rRenderContext.DrawCtrlText(maTextRect.TopLeft(), maHelpText);
else else
DrawText( maTextRect.TopLeft(), maHelpText ); rRenderContext.DrawText(maTextRect.TopLeft(), maHelpText);
} }
else // HELPWINSTYLE_BALLOON else // HELPWINSTYLE_BALLOON
{ {
sal_uInt16 nDrawFlags = TEXT_DRAW_MULTILINE|TEXT_DRAW_WORDBREAK| sal_uInt16 nDrawFlags = TEXT_DRAW_MULTILINE|TEXT_DRAW_WORDBREAK|
TEXT_DRAW_LEFT|TEXT_DRAW_TOP; TEXT_DRAW_LEFT|TEXT_DRAW_TOP;
if ( mnStyle & QUICKHELP_CTRLTEXT ) if (mnStyle & QUICKHELP_CTRLTEXT)
nDrawFlags |= TEXT_DRAW_MNEMONIC; nDrawFlags |= TEXT_DRAW_MNEMONIC;
DrawText( maTextRect, maHelpText, nDrawFlags ); rRenderContext.DrawText(maTextRect, maHelpText, nDrawFlags);
} }
// border // border
if( ! bNativeOK ) if (!bNativeOK)
{ {
Size aSz = GetOutputSizePixel(); Size aSz = GetOutputSizePixel();
DrawRect( Rectangle( Point(), aSz ) ); rRenderContext.DrawRect(Rectangle(Point(), aSz));
if ( mnHelpWinStyle == HELPWINSTYLE_BALLOON ) if (mnHelpWinStyle == HELPWINSTYLE_BALLOON)
{ {
aSz.Width() -= 2; aSz.Width() -= 2;
aSz.Height() -= 2; aSz.Height() -= 2;
Color aColor( GetLineColor() ); Color aColor(rRenderContext.GetLineColor());
SetLineColor( ( COL_GRAY ) ); rRenderContext.SetLineColor(COL_GRAY);
DrawRect( Rectangle( Point( 1, 1 ), aSz ) ); rRenderContext.DrawRect(Rectangle(Point(1, 1), aSz));
SetLineColor( aColor ); rRenderContext.SetLineColor(aColor);
} }
} }
} }
......
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