xref: /trunk/main/svtools/inc/svtools/prgsbar.hxx (revision 01aa44aa)
1*01aa44aaSAndrew Rist /**************************************************************
2*01aa44aaSAndrew Rist  *
3*01aa44aaSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*01aa44aaSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*01aa44aaSAndrew Rist  * distributed with this work for additional information
6*01aa44aaSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*01aa44aaSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*01aa44aaSAndrew Rist  * "License"); you may not use this file except in compliance
9*01aa44aaSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*01aa44aaSAndrew Rist  *
11*01aa44aaSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*01aa44aaSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*01aa44aaSAndrew Rist  * software distributed under the License is distributed on an
15*01aa44aaSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*01aa44aaSAndrew Rist  * KIND, either express or implied.  See the License for the
17*01aa44aaSAndrew Rist  * specific language governing permissions and limitations
18*01aa44aaSAndrew Rist  * under the License.
19*01aa44aaSAndrew Rist  *
20*01aa44aaSAndrew Rist  *************************************************************/
21*01aa44aaSAndrew Rist 
22*01aa44aaSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _PRGSBAR_HXX
25cdf0e10cSrcweir #define _PRGSBAR_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include "svtools/svtdllapi.h"
28cdf0e10cSrcweir #include <vcl/window.hxx>
29cdf0e10cSrcweir 
30cdf0e10cSrcweir /*************************************************************************
31cdf0e10cSrcweir 
32cdf0e10cSrcweir Beschreibung
33cdf0e10cSrcweir ============
34cdf0e10cSrcweir 
35cdf0e10cSrcweir class ProgressBar
36cdf0e10cSrcweir 
37cdf0e10cSrcweir Diese Klasse dient zur Anzeige einer Progress-Anzeige.
38cdf0e10cSrcweir 
39cdf0e10cSrcweir --------------------------------------------------------------------------
40cdf0e10cSrcweir 
41cdf0e10cSrcweir WinBits
42cdf0e10cSrcweir 
43cdf0e10cSrcweir WB_BORDER			Border um das Fenster
44cdf0e10cSrcweir WB_3DLOOK			3D-Darstellung
45cdf0e10cSrcweir 
46cdf0e10cSrcweir --------------------------------------------------------------------------
47cdf0e10cSrcweir 
48cdf0e10cSrcweir Methoden
49cdf0e10cSrcweir 
50cdf0e10cSrcweir Mit SetValue() setzt man einen Prozent-Wert zwischen 0 und 100. Wenn Werte
51cdf0e10cSrcweir groesser 100 gesetzt werden, faengt das letzte Rechteck an zu blinken.
52cdf0e10cSrcweir 
53cdf0e10cSrcweir *************************************************************************/
54cdf0e10cSrcweir 
55cdf0e10cSrcweir // -----------
56cdf0e10cSrcweir // - WinBits -
57cdf0e10cSrcweir // -----------
58cdf0e10cSrcweir 
59cdf0e10cSrcweir #define WB_STDPROGRESSBAR		WB_BORDER
60cdf0e10cSrcweir 
61cdf0e10cSrcweir // ---------------
62cdf0e10cSrcweir // - ProgressBar -
63cdf0e10cSrcweir // ---------------
64cdf0e10cSrcweir 
65cdf0e10cSrcweir class SVT_DLLPUBLIC ProgressBar : public Window
66cdf0e10cSrcweir {
67cdf0e10cSrcweir private:
68cdf0e10cSrcweir 	Point				maPos;
69cdf0e10cSrcweir 	long				mnPrgsWidth;
70cdf0e10cSrcweir 	long				mnPrgsHeight;
71cdf0e10cSrcweir 	sal_uInt16				mnPercent;
72cdf0e10cSrcweir 	sal_uInt16				mnPercentCount;
73cdf0e10cSrcweir 	sal_Bool				mbCalcNew;
74cdf0e10cSrcweir 
75cdf0e10cSrcweir #ifdef _SV_PRGSBAR_CXX
76cdf0e10cSrcweir     using Window::ImplInit;
77cdf0e10cSrcweir 	SVT_DLLPRIVATE void				ImplInit();
78cdf0e10cSrcweir 	SVT_DLLPRIVATE void				ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground );
79cdf0e10cSrcweir 	SVT_DLLPRIVATE void				ImplDrawProgress( sal_uInt16 nOldPerc, sal_uInt16 nNewPerc );
80cdf0e10cSrcweir #endif
81cdf0e10cSrcweir 
82cdf0e10cSrcweir public:
83cdf0e10cSrcweir 						ProgressBar( Window* pParent, WinBits nWinBits = WB_STDPROGRESSBAR );
84cdf0e10cSrcweir 						ProgressBar( Window* pParent, const ResId& rResId );
85cdf0e10cSrcweir 						~ProgressBar();
86cdf0e10cSrcweir 
87cdf0e10cSrcweir 	virtual void		Paint( const Rectangle& rRect );
88cdf0e10cSrcweir 	virtual void		Resize();
89cdf0e10cSrcweir 	virtual void		StateChanged( StateChangedType nStateChange );
90cdf0e10cSrcweir 	virtual void		DataChanged( const DataChangedEvent& rDCEvt );
91cdf0e10cSrcweir 
92cdf0e10cSrcweir 	void				SetValue( sal_uInt16 nNewPercent );
GetValue() const93cdf0e10cSrcweir 	sal_uInt16				GetValue() const { return mnPercent; }
94cdf0e10cSrcweir };
95cdf0e10cSrcweir 
96cdf0e10cSrcweir #endif	// _PRGSBAR_HXX
97