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

delegate RenderContext, invalidate - prgsbar, scrbar

Change-Id: I05d68be744044cc82c0397fac25518a53c270761
üst c57a5f31
...@@ -63,12 +63,13 @@ private: ...@@ -63,12 +63,13 @@ private:
long mnPrgsHeight; long mnPrgsHeight;
sal_uInt16 mnPercent; sal_uInt16 mnPercent;
sal_uInt16 mnPercentCount; sal_uInt16 mnPercentCount;
sal_uInt16 mnPreviousPercent;
bool mbCalcNew; bool mbCalcNew;
using Window::ImplInit; using Window::ImplInit;
SAL_DLLPRIVATE void ImplInit(); SAL_DLLPRIVATE void ImplInit();
SAL_DLLPRIVATE void ImplInitSettings( bool bFont, bool bForeground, bool bBackground ); SAL_DLLPRIVATE void ImplInitSettings( bool bFont, bool bForeground, bool bBackground );
SAL_DLLPRIVATE void ImplDrawProgress( sal_uInt16 nOldPerc, sal_uInt16 nNewPerc ); SAL_DLLPRIVATE void ImplDrawProgress(vcl::RenderContext& rRenderContext, sal_uInt16 nOldPerc, sal_uInt16 nNewPerc);
public: public:
ProgressBar( vcl::Window* pParent, WinBits nWinBits = WB_STDPROGRESSBAR ); ProgressBar( vcl::Window* pParent, WinBits nWinBits = WB_STDPROGRESSBAR );
......
...@@ -27,8 +27,9 @@ ...@@ -27,8 +27,9 @@
void ProgressBar::ImplInit() void ProgressBar::ImplInit()
{ {
mnPercent = 0; mnPercent = 0;
mbCalcNew = true; mnPreviousPercent = 0;
mbCalcNew = true;
ImplInitSettings( true, true, true ); ImplInitSettings( true, true, true );
} }
...@@ -116,7 +117,7 @@ void ProgressBar::ImplInitSettings( bool bFont, ...@@ -116,7 +117,7 @@ void ProgressBar::ImplInitSettings( bool bFont,
} }
} }
void ProgressBar::ImplDrawProgress( sal_uInt16 nOldPerc, sal_uInt16 nNewPerc ) void ProgressBar::ImplDrawProgress(vcl::RenderContext& /*rRenderContext*/, sal_uInt16 nOldPerc, sal_uInt16 nNewPerc)
{ {
if ( mbCalcNew ) if ( mbCalcNew )
{ {
...@@ -145,9 +146,9 @@ void ProgressBar::ImplDrawProgress( sal_uInt16 nOldPerc, sal_uInt16 nNewPerc ) ...@@ -145,9 +146,9 @@ void ProgressBar::ImplDrawProgress( sal_uInt16 nOldPerc, sal_uInt16 nNewPerc )
Rectangle( Point(), GetSizePixel() ) ); Rectangle( Point(), GetSizePixel() ) );
} }
void ProgressBar::Paint( vcl::RenderContext& /*rRenderContext*/, const Rectangle& ) void ProgressBar::Paint(vcl::RenderContext& rRenderContext, const Rectangle& /*rRect*/)
{ {
ImplDrawProgress( 0, mnPercent ); ImplDrawProgress(rRenderContext, mnPreviousPercent, mnPercent);
} }
void ProgressBar::Resize() void ProgressBar::Resize()
...@@ -165,6 +166,7 @@ void ProgressBar::SetValue( sal_uInt16 nNewPercent ) ...@@ -165,6 +166,7 @@ void ProgressBar::SetValue( sal_uInt16 nNewPercent )
{ {
mbCalcNew = true; mbCalcNew = true;
mnPercent = nNewPercent; mnPercent = nNewPercent;
mnPreviousPercent = 0;
if ( IsReallyVisible() ) if ( IsReallyVisible() )
{ {
Invalidate(); Invalidate();
...@@ -173,8 +175,9 @@ void ProgressBar::SetValue( sal_uInt16 nNewPercent ) ...@@ -173,8 +175,9 @@ void ProgressBar::SetValue( sal_uInt16 nNewPercent )
} }
else else
{ {
ImplDrawProgress( mnPercent, nNewPercent ); mnPreviousPercent = mnPercent;
mnPercent = nNewPercent; mnPercent = nNewPercent;
Invalidate();
} }
} }
......
...@@ -1120,9 +1120,9 @@ void ScrollBar::KeyInput( const KeyEvent& rKEvt ) ...@@ -1120,9 +1120,9 @@ void ScrollBar::KeyInput( const KeyEvent& rKEvt )
Control::KeyInput( rKEvt ); Control::KeyInput( rKEvt );
} }
void ScrollBar::Paint( vcl::RenderContext& /*rRenderContext*/, const Rectangle& ) void ScrollBar::Paint( vcl::RenderContext& rRenderContext, const Rectangle& )
{ {
ImplDraw( SCRBAR_DRAW_ALL, this ); ImplDraw(SCRBAR_DRAW_ALL, &rRenderContext);
} }
void ScrollBar::Resize() void ScrollBar::Resize()
......
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