Module cSigCJProgressBar.pkg
1//==============================================================================
2// Project : SigCj - VDF Classes for Codejock
3// File : cSigCJProgressBar.pkg
4// Description : VDF Class for Codejock control
5//
6// Revision : $Rev: 675 $
7// $Date: 2011-02-23 10:51:39 -0500 (Wed, 23 Feb 2011) $
8// $Author: martin $ Martin Pincott
9//
10// Requirements : Visual DataFlex 12.1+
11// Codejock SuitePro - Version 12.0.0+
12//
13// Copyright : (c) 2008 VDF SIG UK
14// Visual DataFlex Special Interest Group UK.
15// http://www.vdfsig.co.uk/
16// dev@vdfsig.co.uk
17//
18// This file is part of SigCj.
19//
20// SigCj is free software: you can redistribute it and/or modify
21// it under the terms of the GNU Lesser General Public License
22// as published by the Free Software Foundation, either version
23// 2.1 of the License, or (at your option) any later version.
24//
25// SigCj is distributed in the hope that it will be useful, but
26// WITHOUT ANY WARRANTY; without even the implied warranty of
27// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28// GNU Lesser General Public License for more details.
29//
30// If you have the complete SigCj workspace then a copy of the
31// GNU Lesser General Public License is in the Docs folder. If
32// not, see <http://www.gnu.org/licenses/>.
33//
34//==============================================================================
35
36Use SigCjW_Controls.pkg
37Use cSigCJMethods_Mixin.pkg
38Use StdFont.pkg
39
40Enum_List //ePR_Orientation
41 Define ePR_Horizontal for 0
42 Define ePR_Vertical
43End_Enum_List
44
45Enum_List //ePR_Style
46 Define ePR_BarStandard for 0
47 Define ePR_BarSmooth
48 Define ePR_BarMarquee
49End_Enum_List
50
51{ OverrideProperty=Label_Col_Offset DesignTime=False }
52{ OverrideProperty=Label_Justification_Mode DesignTime=False }
53{ OverrideProperty=Label_Row_Offset DesignTime=False }
54{ OverrideProperty=piMinSize DesignTime=False }
55{ OverrideProperty=Border_Style DesignTime=False }
56{ OverrideProperty=Visible_State DesignTime=False }
57{ OverrideProperty=Attach_Parent_State DesignTime=False }
58{ OverrideProperty=Block_Mouse_State DesignTime=False }
59{ OverrideProperty=Client_Area_State DesignTime=False }
60{ OverrideProperty=Delegation_Mode DesignTime=False }
61{ OverrideProperty=Focus_Mode DesignTime=False }
62{ OverrideProperty=pbBindValue DesignTime=False }
63{ OverrideProperty=peAutoCreate DesignTime=False }
64{ OverrideProperty=peNeighborhood DesignTime=False }
65{ OverrideProperty=Popup_State DesignTime=False }
66{ OverrideProperty=Ring_State DesignTime=False }
67{ OverrideProperty=Scope_State DesignTime=False }
68{ OverrideProperty=Search_Case DesignTime=False }
69{ OverrideProperty=Skip_State DesignTime=False }
70{ OverrideProperty=Help_Id DesignTime=False }
71{ OverrideProperty=Help_Keyword DesignTime=False }
72{ OverrideProperty=psHtmlHelpTopic DesignTime=False }
73{ OverrideProperty=Status_Help DesignTime=False }
74{ OverrideProperty=Use_Parent_Status_Help DesignTime=False }
75{ OverrideProperty=psLicenseKey DesignTime=False }
76{ OverrideProperty=psProgID DesignTime=False }
77{ OverrideProperty=Color DesignTime=False }
78{ OverrideProperty=TextColor DesignTime=False }
79{ OverrideProperty=label DesignTime=False }
80{ OverrideProperty=Enabled_State DesignTime=False }
81{ OverrideProperty=Size InitialValue=13,150 }
82Class cSigCJProgressBar is a cSigCjComProgressBar
83 Import_Class_Protocol cSigCJMethods_Mixin
84
85 //-------------------------------------------------------------------------
86
87 Procedure Construct_Object
88 Forward Send Construct_Object
89
90 //The default COM size is 100 100, make it something sensible
91 Set Size to 13 150
92
93 { DesignTime=False }
94 Property Integer Private_peAppearance OLExtpAppearanceStandard
95
96 { DesignTime=False }
97 Property Integer Private_piBackColor clWhite
98
99 { DesignTime=False }
100 Property Integer Private_piBarColor
101
102 { DesignTime=False }
103 Property Boolean Private_pbEnabled True
104
105 { DesignTime=False }
106 Property Boolean Private_pbFlatStyle False
107
108 { DesignTime=False }
109 Property Integer Private_piForeColor clWindowText
110
111 { DesignTime=False }
112 Property Integer Private_piMarqueeDelay 80
113
114 { DesignTime=False }
115 Property Integer Private_piMax 100
116
117 { DesignTime=False }
118 Property Integer Private_piMin
119
120 { DesignTime=False }
121 Property Integer Private_peOrientation ePR_Horizontal
122
123 { DesignTime=False }
124 Property Integer Private_peStyle ePR_BarStandard
125
126 { DesignTime=False }
127 Property Integer Private_pbStyle_Changing False
128
129 { DesignTime=False }
130 Property String Private_psText
131
132 { DesignTime=False }
133 Property Boolean Private_pbUseVisualStyle False
134
135 { DesignTime=False }
136 Property Integer Private_piValue
137
138 //---------------------------------------------------------------------
139
140 { DesignTime=False }
141 Property boolean Private_pbBold False
142
143 { DesignTime=False }
144 Property Boolean Private_pbItalic False
145
146 { DesignTime=False }
147 Property Boolean Private_pbStrikethrough False
148
149 { DesignTime=False }
150 Property Boolean Private_pbUnderline False
151
152 { DesignTime=False }
153 Property String Private_psFontName "MS Sans Serif"
154
155 { DesignTime=False }
156 Property Number Private_pnFontSize 8.25
157
158 { DesignTime=False }
159 Property Handle Private_hoFont (Create(Self, U_cComStdFont))
160
161 End_Procedure
162
163 { MethodType=Event }
164 Procedure OnCreate
165 Handle hoFont
166 Integer iColor
167
168 Forward Send OnCreate
169
170 //Bar Color depends on the OS so get Controls Color is piBarColor not set
171 If (Private_piBarColor(Self) = 0) Begin
172 Get ComBarColor to iColor
173 Set Private_piBarColor to iColor
174 End
175
176 Set peAppearance to (Private_peAppearance(Self))
177 Set piBackColor to (Private_piBackColor(Self))
178 Set piBarColor to (Private_piBarColor(Self))
179 Set pbEnabled to (Private_pbEnabled(Self))
180 Set pbFlatStyle to (Private_pbFlatStyle(Self))
181 Set piForeColor to (Private_piForeColor(Self))
182 Set piMarqueeDelay to (Private_piMarqueeDelay(Self))
183 Set piMax to (Private_piMax(Self))
184 Set piMin to (Private_piMin(Self))
185 Set peOrientation to (Private_peOrientation(Self))
186 Set peStyle to (Private_peStyle(Self))
187 Set psText to (Private_psText(Self))
188 Set pbUseVisualStyle to (Private_pbUseVisualStyle(Self))
189
190 //Connect the OCX and dataflex FONT objects and set defaults
191 Get Private_hoFont to hoFont
192 Set pvComObject of hoFont to (ComFont(Self))
193 Set ComBold of hoFont to (Private_pbBold(Self))
194 Set ComItalic of hoFont to (Private_pbItalic(Self))
195 Set ComStrikethrough of hoFont to (Private_pbStrikethrough(Self))
196 Set ComUnderline of hoFont to (Private_pbUnderline(Self))
197 Set ComName of hoFont to (Private_psFontName(Self))
198 Set ComSize of hoFont to (Private_pnFontSize(Self))
199 End_Procedure // OnCreate
200
201 //-------------------------------------------------------------------------
202
203 { MethodType=Property Category="CodeJock" InitialValue=False }
204 Procedure Set pbBold Boolean bState
205 Set SigCJProperty Set_Private_pbBold Set_ComBold (Private_hoFont(Self)) to bState
206 End_Procedure
207
208 Function pbBold Returns Boolean
209 Function_Return (SigCJProperty(Self, Get_Private_pbBold, Get_ComBold, Private_hoFont(Self)))
210 End_Function
211
212 //-------------------------------------------------------------------------
213
214 { MethodType=Property Category="CodeJock" InitialValue=False }
215 Procedure Set pbItalic Boolean bState
216 Set SigCJProperty Set_Private_pbItalic Set_ComItalic (Private_hoFont(Self)) to bState
217 End_Procedure
218
219 Function pbItalic Returns Boolean
220 Function_Return (SigCJProperty(Self, Get_Private_pbItalic, Get_ComItalic, Private_hoFont(Self)))
221 End_Function
222
223 //-------------------------------------------------------------------------
224
225 { MethodType=Property Category="CodeJock" InitialValue=False }
226 Procedure Set pbStrikethrough Boolean bState
227 Set SigCJProperty Set_Private_pbStrikethrough Set_ComStrikethrough (Private_hoFont(Self)) to bState
228 End_Procedure
229
230 Function pbStrikethrough Returns Boolean
231 Function_Return (SigCJProperty(Self, Get_Private_pbStrikethrough, Get_ComStrikethrough, Private_hoFont(Self)))
232 End_Function
233
234 //-------------------------------------------------------------------------
235
236 { MethodType=Property Category="CodeJock" InitialValue=False }
237 Procedure Set pbUnderline Boolean bState
238 Set SigCJProperty Set_Private_pbUnderline Set_ComUnderline (Private_hoFont(Self)) to bState
239 End_Procedure
240
241 Function pbUnderline Returns Boolean
242 Function_Return (SigCJProperty(Self, Get_Private_pbUnderline, Get_ComUnderline, Private_hoFont(Self)))
243 End_Function
244
245 //-------------------------------------------------------------------------
246
247 { MethodType=Property Category="CodeJock" InitialValue="MS Sans Serif" }
248 Procedure Set psFontName String sName
249 Set SigCJProperty Set_Private_psFontName Set_ComName (Private_hoFont(Self)) to sName
250 End_Procedure
251
252 Function psFontName Returns String
253 Function_Return (SigCJProperty(Self, Get_Private_psFontName, Get_ComName, Private_hoFont(Self)))
254 End_Function
255
256 //-------------------------------------------------------------------------
257
258 { MethodType=Property Category="CodeJock" InitialValue=8.25 }
259 Procedure Set pnFontSize Number nSize
260 Set SigCJProperty Set_Private_pnFontSize Set_ComSize (Private_hoFont(Self)) to nSize
261 End_Procedure
262
263 Function pnFontSize Returns Number
264 Function_Return (SigCJProperty(Self, Get_Private_pnFontSize, Get_ComSize, Private_hoFont(Self)))
265 End_Function
266
267 //-------------------------------------------------------------------------
268
269 #IF (SigCj_Codejock_Version < 150001)
270 { MethodType=Property Category="CodeJock" InitialValue=OLExtpAppearanceStandard }
271 { EnumList="OLExtpAppearanceStandard, OLExtpAppearanceFlat, OLExtpAppearanceUltraFlat, OLExtpAppearanceOffice2000, OLExtpAppearanceOffice2000, OLExtpAppearanceOffice2003, OLExtpAppearanceOffice2007" }
272 #ELSE
273 { MethodType=Property Category="CodeJock" InitialValue=OLExtpAppearanceStandard }
274 { EnumList="OLExtpAppearanceStandard, OLExtpAppearanceFlat, OLExtpAppearanceUltraFlat, OLExtpAppearanceOffice2000, OLExtpAppearanceOffice2000, OLExtpAppearanceOffice2003, OLExtpAppearanceResource" }
275 #ENDIF
276 Procedure Set peAppearance Integer eAppearance
277 Set SigCJProperty Set_Private_peAppearance Set_ComAppearance to eAppearance
278 End_Procedure
279
280 Function peAppearance Returns Integer
281 Function_Return (SigCJProperty(Self, Get_Private_peAppearance, Get_ComAppearance ))
282 End_Function
283
284 //-------------------------------------------------------------------------
285
286 { MethodType=Property Category="CodeJock" PropertyType=Color InitialValue=clBtnFace }
287 { EnumList= "cl3DDkShadow, cl3DLight, clActiveBorder, clActiveCaption, clAppWorkSpace, clBackground" }
288 { EnumList+="clBtnFace, clBtnHighlight, clBtnShadow, clBtnText, clCaptionText, clGrayText, clHighlight" }
289 { EnumList+="clHighlightText, clInactiveBorder, clInactiveCaption, clInactiveCaptionText, clInfoBk" }
290 { EnumList+="clInfoText, clMenu, clMenuText, clScrollBar, clWindow, clWindowFrame, clWindowText" }
291 { EnumList+="clDefault, clNone, clAqua, clBlack, clBlue, clDkGray, clFuchsia, clGray, clGreen, clLime" }
292 { EnumList+="clLtGray, clMaroon, clNavy, clOlive, clPurple, clRed, clSilver, clTeal, clWhite, clYellow" }
293 Procedure Set piBackColor Integer iColor
294 Set SigCJProperty Set_Private_piBackColor Set_ComBackColor to iColor
295 End_Procedure
296
297 Function piBackColor Returns Integer
298 Function_Return (SigCJProperty(Self, Get_Private_piBackColor, Get_ComBackColor ))
299 End_Function
300
301 //-------------------------------------------------------------------------
302
303 { MethodType=Property Category="CodeJock" PropertyType=Color }
304 { EnumList= "cl3DDkShadow, cl3DLight, clActiveBorder, clActiveCaption, clAppWorkSpace, clBackground" }
305 { EnumList+="clBtnFace, clBtnHighlight, clBtnShadow, clBtnText, clCaptionText, clGrayText, clHighlight" }
306 { EnumList+="clHighlightText, clInactiveBorder, clInactiveCaption, clInactiveCaptionText, clInfoBk" }
307 { EnumList+="clInfoText, clMenu, clMenuText, clScrollBar, clWindow, clWindowFrame, clWindowText" }
308 { EnumList+="clDefault, clNone, clAqua, clBlack, clBlue, clDkGray, clFuchsia, clGray, clGreen, clLime" }
309 { EnumList+="clLtGray, clMaroon, clNavy, clOlive, clPurple, clRed, clSilver, clTeal, clWhite, clYellow" }
310 Procedure Set piBarColor Integer iColor
311 Set SigCJProperty Set_Private_piBarColor Set_ComBarColor to iColor
312 End_Procedure
313
314 Function piBarColor Returns Integer
315 Function_Return (SigCJProperty(Self, Get_Private_piBarColor, Get_ComBarColor ))
316 End_Function
317
318 //-------------------------------------------------------------------------
319
320 { MethodType=Property Category="CodeJock" InitialValue=True }
321 Procedure Set pbEnabled Boolean bState
322 Set SigCJProperty Set_Private_pbEnabled Set_ComEnabled to bState
323 End_Procedure
324
325 Function pbEnabled Returns Boolean
326 Function_Return (SigCJProperty(Self, Get_Private_pbEnabled, Get_ComEnabled ))
327 End_Function
328
329 //-------------------------------------------------------------------------
330
331 { MethodType=Property Category="CodeJock" InitialValue=False }
332 Procedure Set pbFlatStyle Boolean bState
333 Set SigCJProperty Set_Private_pbFlatStyle Set_ComFlatStyle to bState
334 End_Procedure
335
336 Function pbFlatStyle Returns Boolean
337 Function_Return (SigCJProperty(Self, Get_Private_pbFlatStyle, Get_ComFlatStyle ))
338 End_Function
339
340 //-------------------------------------------------------------------------
341
342 { MethodType=Property Category="CodeJock" PropertyType=Color InitialValue=clWindowText }
343 { EnumList= "cl3DDkShadow, cl3DLight, clActiveBorder, clActiveCaption, clAppWorkSpace, clBackground" }
344 { EnumList+="clBtnFace, clBtnHighlight, clBtnShadow, clBtnText, clCaptionText, clGrayText, clHighlight" }
345 { EnumList+="clHighlightText, clInactiveBorder, clInactiveCaption, clInactiveCaptionText, clInfoBk" }
346 { EnumList+="clInfoText, clMenu, clMenuText, clScrollBar, clWindow, clWindowFrame, clWindowText" }
347 { EnumList+="clDefault, clNone, clAqua, clBlack, clBlue, clDkGray, clFuchsia, clGray, clGreen, clLime" }
348 { EnumList+="clLtGray, clMaroon, clNavy, clOlive, clPurple, clRed, clSilver, clTeal, clWhite, clYellow" }
349 Procedure Set piForeColor Integer iColor
350 Set SigCJProperty Set_Private_piForeColor Set_ComForeColor to iColor
351 End_Procedure
352
353 Function piForeColor Returns Integer
354 Function_Return (SigCJProperty(Self, Get_Private_piForeColor, Get_ComForeColor ))
355 End_Function
356
357 //-------------------------------------------------------------------------
358
359 { MethodType=Property Category="CodeJock" InitialValue=80 }
360 Procedure Set piMarqueeDelay Integer iValue
361 Set SigCJProperty Set_Private_piMarqueeDelay Set_ComMarqueeDelay to iValue
362 End_Procedure
363
364 Function piMarqueeDelay Returns Integer
365 Function_Return (SigCJProperty(Self, Get_Private_piMarqueeDelay, Get_ComMarqueeDelay ))
366 End_Function
367
368 //-------------------------------------------------------------------------
369
370 { MethodType=Property Category="CodeJock" InitialValue=100 }
371 Procedure Set piMax Integer iValue
372 Set SigCJProperty Set_Private_piMax Set_ComMax to iValue
373 End_Procedure
374
375 Function piMax Returns Integer
376 Function_Return (SigCJProperty(Self, Get_Private_piMax, Get_ComMax ))
377 End_Function
378
379 //-------------------------------------------------------------------------
380
381 { MethodType=Property Category="CodeJock" InitialValue=0 }
382 Procedure Set piMin Integer iValue
383 Set SigCJProperty Set_Private_piMin Set_ComMin to iValue
384 End_Procedure
385
386 Function piMin Returns Integer
387 Function_Return (SigCJProperty(Self, Get_Private_piMin, Get_ComMin ))
388 End_Function
389
390 //-------------------------------------------------------------------------
391
392 { MethodType=Property Category="CodeJock" InitialValue=ePR_Horizontal }
393 { EnumList="ePR_Horizontal, ePR_Vertical" }
394 Procedure Set peOrientation Integer eOrientation
395 Set SigCJProperty Set_Private_peOrientation Set_ComOrientation to eOrientation
396 End_Procedure
397
398 Function peOrientation Returns Integer
399 Function_Return (SigCJProperty(Self, Get_Private_peOrientation, Get_ComOrientation ))
400 End_Function
401
402 //-------------------------------------------------------------------------
403
404 { MethodType=Property Category="CodeJock" InitialValue=ePR_BarStandard }
405 { EnumList="ePR_BarStandard, ePR_BarSmooth, ePR_BarMarquee" }
406 Procedure Set peStyle Integer eStyle
407 Set SigCJProperty Set_Private_peStyle Set_ComScrolling to eStyle
408
409 Set Private_pbStyle_Changing to True
410 If (eStyle = ePR_BarSmooth) Set pbUseVisualStyle to False
411 If (eStyle = ePR_BarMarquee) Set pbUseVisualStyle to True
412 Set Private_pbStyle_Changing to False
413 End_Procedure
414
415 Function peStyle Returns Integer
416 Function_Return (SigCJProperty(Self, Get_Private_peStyle, Get_ComScrolling ))
417 End_Function
418
419 //-------------------------------------------------------------------------
420
421 { MethodType=Property Category="CodeJock" InitialValue="" }
422 Procedure Set psText String sText
423 Set SigCJProperty Set_Private_psText Set_ComText to sText
424 End_Procedure
425
426 Function psText Returns String
427 Function_Return (SigCJProperty(Self, Get_Private_psText, Get_ComText ))
428 End_Function
429
430 //-------------------------------------------------------------------------
431
432 { MethodType=Property Category="CodeJock" InitialValue=True }
433 Procedure Set pbUseVisualStyle Boolean bState
434 If ((peStyle(Self) = ePR_BarStandard) or Private_pbStyle_Changing(Self)) Begin
435 Set SigCJProperty Set_Private_pbUseVisualStyle Set_ComUseVisualStyle to bState
436 End
437 End_Procedure
438
439 Function pbUseVisualStyle Returns Boolean
440 Function_Return (SigCJProperty(Self, Get_Private_pbUseVisualStyle, Get_ComUseVisualStyle ))
441 End_Function
442
443 //-------------------------------------------------------------------------
444
445 { MethodType=Property Category="CodeJock" InitialValue=0 }
446 Procedure Set piValue Integer iValue
447 Set SigCJProperty Set_Private_piValue Set_ComValue to iValue
448 End_Procedure
449
450 Function piValue Returns Integer
451 Function_Return (SigCJProperty(Self, Get_Private_piValue, Get_ComValue ))
452 End_Function
453
454 //-------------------------------------------------------------------------
455
456End_Class
457
458//==============================================================================
459//End of Package - cSigCJProgressBar.pkg
460//==============================================================================
461