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