1 -- File: Message_ProgressScale.cdl
2 -- Created: Wed Feb 20 15:52:41 2002
3 -- Author: Andrey BETENEV
5 ---Copyright: Open CASCADE SA 2002
8 class ProgressScale from Message
10 ---Purpose: Internal data structure for scale in ProgressIndicator
12 -- Basically it defines three things:
13 -- - name that can be used for generating user messages
14 -- - limits and characteristics of the current scale,
15 -- along with derived coefficients to map it into basic scale [0-1]
16 -- - methods for conversion of values from current scale
17 -- to basic one and back
19 -- NOTE: There is no special protection against bad input data
20 -- like min > max etc. except cases when it can cause exception
23 HAsciiString from TCollection
26 Create returns ProgressScale from Message;
27 ---Purpose: Creates scale ranged from 0 to 100 with step 1
29 ---Scope: Access to fields
31 SetName(me : out; theName : CString);
33 SetName(me : out; theName : HAsciiString from TCollection);
35 ---Purpose: Sets scale name
37 GetName(me) returns HAsciiString from TCollection;
39 ---Purpose: Gets scale name
40 -- Name may be Null handle if not set
42 SetMin(me : out; theMin : Real);
44 ---Purpose: Sets minimum value of scale
46 GetMin(me) returns Real;
48 ---Purpose: Gets minimum value of scale
50 SetMax(me : out; theMax : Real);
52 ---Purpose: Sets minimum value of scale
54 GetMax(me) returns Real;
56 ---Purpose: Gets minimum value of scale
58 SetRange (me: out; min, max: Real);
60 ---Purpose: Set both min and max
62 SetStep(me : out; theStep : Real);
64 ---Purpose: Sets default step
66 GetStep(me) returns Real;
68 ---Purpose: Gets default step
70 SetInfinite(me : out; theInfinite : Boolean = Standard_True);
72 ---Purpose: Sets flag for infinite scale
74 GetInfinite(me) returns Boolean;
76 ---Purpose: Gets flag for infinite scale
78 SetScale (me: out; min, max, step: Real; theInfinite : Boolean = Standard_True);
80 ---Purpose: Set all scale parameters
82 ---Scope: Mapping to base scale
84 SetSpan (me: out; first, last: Real);
86 ---Purpose: Defines span occupied by the scale on the basis scale
88 GetFirst (me) returns Real;
90 GetLast (me) returns Real;
92 ---Purpose: Return information on span occupied by the scale on the base scale
94 LocalToBase (me; val: Real) returns Real;
95 BaseToLocal (me; val: Real) returns Real;
96 ---Purpose: Convert value from this scale to base one and back
100 myName: HAsciiString from TCollection; -- name
102 myMin, myMax: Real; -- range of a scale
103 myStep : Real; -- default step
104 myInfinite: Boolean; -- flag for infinite scale
106 myFirst, myLast : Real; -- span on base scale