7fd59977 |
1 | -- File: Message_ProgressScale.cdl |
2 | -- Created: Wed Feb 20 15:52:41 2002 |
3 | -- Author: Andrey BETENEV |
4 | -- <abv@doomox> |
5 | ---Copyright: Open CASCADE SA 2002 |
6 | |
7 | |
8 | class ProgressScale from Message |
9 | |
10 | ---Purpose: Internal data structure for scale in ProgressIndicator |
11 | -- |
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 |
18 | -- |
19 | -- NOTE: There is no special protection against bad input data |
20 | -- like min > max etc. except cases when it can cause exception |
21 | |
22 | uses |
23 | HAsciiString from TCollection |
24 | is |
25 | |
26 | Create returns ProgressScale from Message; |
27 | ---Purpose: Creates scale ranged from 0 to 100 with step 1 |
28 | |
29 | ---Scope: Access to fields |
30 | |
31 | SetName(me : out; theName : CString); |
32 | ---C++:inline |
33 | SetName(me : out; theName : HAsciiString from TCollection); |
34 | ---C++:inline |
35 | ---Purpose: Sets scale name |
36 | |
37 | GetName(me) returns HAsciiString from TCollection; |
38 | ---C++:inline |
39 | ---Purpose: Gets scale name |
40 | -- Name may be Null handle if not set |
41 | |
42 | SetMin(me : out; theMin : Real); |
43 | ---C++:inline |
44 | ---Purpose: Sets minimum value of scale |
45 | |
46 | GetMin(me) returns Real; |
47 | ---C++:inline |
48 | ---Purpose: Gets minimum value of scale |
49 | |
50 | SetMax(me : out; theMax : Real); |
51 | ---C++:inline |
52 | ---Purpose: Sets minimum value of scale |
53 | |
54 | GetMax(me) returns Real; |
55 | ---C++:inline |
56 | ---Purpose: Gets minimum value of scale |
57 | |
58 | SetRange (me: out; min, max: Real); |
59 | ---C++: inline |
60 | ---Purpose: Set both min and max |
61 | |
62 | SetStep(me : out; theStep : Real); |
63 | ---C++:inline |
64 | ---Purpose: Sets default step |
65 | |
66 | GetStep(me) returns Real; |
67 | ---C++:inline |
68 | ---Purpose: Gets default step |
69 | |
70 | SetInfinite(me : out; theInfinite : Boolean = Standard_True); |
71 | ---C++:inline |
72 | ---Purpose: Sets flag for infinite scale |
73 | |
74 | GetInfinite(me) returns Boolean; |
75 | ---C++:inline |
76 | ---Purpose: Gets flag for infinite scale |
77 | |
78 | SetScale (me: out; min, max, step: Real; theInfinite : Boolean = Standard_True); |
79 | ---C++: inline |
80 | ---Purpose: Set all scale parameters |
81 | |
82 | ---Scope: Mapping to base scale |
83 | |
84 | SetSpan (me: out; first, last: Real); |
85 | ---C++: inline |
86 | ---Purpose: Defines span occupied by the scale on the basis scale |
87 | |
88 | GetFirst (me) returns Real; |
89 | ---C++: inline |
90 | GetLast (me) returns Real; |
91 | ---C++: inline |
92 | ---Purpose: Return information on span occupied by the scale on the base scale |
93 | |
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 |
97 | |
98 | fields |
99 | |
100 | myName: HAsciiString from TCollection; -- name |
101 | |
102 | myMin, myMax: Real; -- range of a scale |
103 | myStep : Real; -- default step |
104 | myInfinite: Boolean; -- flag for infinite scale |
105 | |
106 | myFirst, myLast : Real; -- span on base scale |
107 | |
108 | end ProgressScale; |