28#define PROGRESSBAR_OFFSET 3
29#define PROGRESSBAR_WIN_OFFSET 2
31void ProgressBar::ImplInit()
39 ImplInitSettings(
true,
true,
true );
45 if( pParent && (nOrgStyle &
WB_BORDER) != 0 )
53Size ProgressBar::GetOptimalSize()
const
61 SetOutputSizePixel( GetOptimalSize() );
65void ProgressBar::ImplInitSettings(
bool bFont,
66 bool bForeground,
bool bBackground )
68 const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
77 if( !IsControlBackground() &&
82 EnableChildTransparentMode();
83 SetPaintTransparent(
true );
90 if ( IsControlBackground() )
91 aColor = GetControlBackground();
94 SetBackground( aColor );
98 if ( !(bForeground || bFont) )
102 if ( IsControlForeground() )
103 aColor = GetControlForeground();
104 if ( aColor.
IsRGBEqual( GetBackground().GetColor() ) )
111 GetOutDev()->SetLineColor();
112 GetOutDev()->SetFillColor( aColor );
119void ProgressBar::ImplDrawProgress(
vcl::RenderContext& rRenderContext, sal_uInt16 nNewPerc)
125 Size aSize(GetOutputSizePixel());
127 mnPrgsWidth = (mnPrgsHeight * 2) / 3;
130 sal_uInt16 nMaxCount =
static_cast<sal_uInt16
>(nMaxWidth / (mnPrgsWidth+
PROGRESSBAR_OFFSET));
137 while (((10000 / (10000 / nMaxCount)) * (mnPrgsWidth +
PROGRESSBAR_OFFSET)) > nMaxWidth)
142 mnPercentCount = 10000 / nMaxCount;
144 maPos.setX( (aSize.Width() - nMaxWidth) / 2 );
148 0, nNewPerc * 100, mnPercentCount,
154 ImplDrawProgress(rRenderContext, mnPercent);
157void ProgressBar::Resize()
160 if ( IsReallyVisible() )
164void ProgressBar::SetValue( sal_uInt16 nNewPercent )
166 SAL_WARN_IF( nNewPercent > 100,
"vcl",
"StatusBar::SetProgressValue(): nPercent > 100" );
168 if ( nNewPercent < mnPercent )
171 mnPercent = nNewPercent;
172 if ( IsReallyVisible() )
178 else if ( mnPercent != nNewPercent )
180 mnPercent = nNewPercent;
185 Idle aIdle(
"ProgressBar::SetValue aIdle");
208 ImplInitSettings(
false,
true,
false );
213 ImplInitSettings(
false,
false,
true );
217 Window::StateChanged( nType );
225 ImplInitSettings(
true,
true,
true );
229 Window::DataChanged( rDCEvt );
static void Yield()
Process the next event.
static bool IsQuit()
Has Quit() been called?
sal_uInt8 GetLuminance() const
void DecreaseLuminance(sal_uInt8 cLumDec)
void IncreaseLuminance(sal_uInt8 cLumInc)
bool IsRGBEqual(const Color &rColor) const
DataChangedEventType GetType() const
AllSettingsFlags GetFlags() const
An idle is a timer to be scheduled immediately.
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
const Color & GetHighlightColor() const
const Color & GetFaceColor() const
bool IsNativeControlSupported(ControlType nType, ControlPart nPart) const
Query the platform layer for control support.
#define SAL_WARN_IF(condition, area, stream)
static WinBits clearProgressBarBorder(vcl::Window const *pParent, WinBits nOrgStyle)
#define PROGRESSBAR_WIN_OFFSET
#define PROGRESSBAR_OFFSET
void DrawProgress(vcl::Window *pWindow, vcl::RenderContext &rRenderContext, const Point &rPos, tools::Long nOffset, tools::Long nPrgsWidth, tools::Long nPrgsHeight, sal_uInt16 nPercent1, sal_uInt16 nPercent2, sal_uInt16 nPercentCount, const tools::Rectangle &rFramePosSize)
@ POST_PAINT
Everything running directly after painting.