StdControlAttribute.dcl 10.5 KB
Newer Older
Peter Achten's avatar
Peter Achten committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
definition module StdControlAttribute


//	********************************************************************************
//	Clean Standard Object I/O library, version 1.2
//	
//	StdControlAttribute specifies which ControlAttributes are valid for each of the
//	standard controls.
//	Basic comparison operations and retrieval functions are also included.
//	********************************************************************************


import StdControlDef


/*	The following functions specify the valid attributes for each standard control.
*/

19
20
isValidButtonControlAttribute :: !(ControlAttribute .st) -> Bool
/*	ButtonControl		(y = valid, . = invalid)
Peter Achten's avatar
Peter Achten committed
21
22
	ControlActivate		. |	ControlKeyboard		. |	ControlPos			y |
	ControlDeactivate	. |	ControlLook			. |	ControlResize		. |
23
24
	ControlFunction		y |	ControlMinimumSize	. |	ControlSelectState	y |
	ControlHide			y |	ControlModsFunction	y |	ControlTip			y |
Peter Achten's avatar
Peter Achten committed
25
26
27
	ControlHMargin		. |	ControlMouse		. |	ControlViewDomain	. |
	ControlHScroll		. |	ControlOrigin		. |	ControlViewSize		. |
	ControlId			y | ControlOuterSize	. |	ControlVMargin		. |
28
29
	ControlItemSpace	. |	ControlPen			. | ControlVScroll		. |
												  | ControlWidth		y |
Peter Achten's avatar
Peter Achten committed
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
*/

isValidCheckControlAttribute :: !(ControlAttribute .st) -> Bool
/*	CheckControl		(y = valid, . = invalid)
	ControlActivate		. |	ControlKeyboard		. |	ControlPos			y |
	ControlDeactivate	. |	ControlLook			. |	ControlResize		. |
	ControlFunction		. |	ControlMinimumSize	. |	ControlSelectState	y |
	ControlHide			y |	ControlModsFunction	. |	ControlTip			y |
	ControlHMargin		. |	ControlMouse		. |	ControlViewDomain	. |
	ControlHScroll		. |	ControlOrigin		. |	ControlViewSize		. |
	ControlId			y | ControlOuterSize	. |	ControlVMargin		. |
	ControlItemSpace	. |	ControlPen			. |	ControlVScroll		. |
												  | ControlWidth		. |
*/

45
46
47
48
49
isValidCompoundControlAttribute :: !(ControlAttribute .st) -> Bool
/*	CompoundControl		(y = valid, . = invalid)
	ControlActivate		y |	ControlKeyboard		y |	ControlPos			y
	ControlDeactivate	y |	ControlLook			y |	ControlResize		y |
	ControlFunction		. |	ControlMinimumSize	y |	ControlSelectState	y |
Peter Achten's avatar
Peter Achten committed
50
	ControlHide			y |	ControlModsFunction	. |	ControlTip			y |
51
52
53
54
55
	ControlHMargin		y |	ControlMouse		y |	ControlViewDomain	y |
	ControlHScroll		y |	ControlOrigin		y |	ControlViewSize		y |
	ControlId			y | ControlOuterSize	y |	ControlVMargin		y |
	ControlItemSpace	y |	ControlPen			y |	ControlVScroll		y |
												  | ControlWidth		. |
Peter Achten's avatar
Peter Achten committed
56
57
*/

58
59
isValidCustomButtonControlAttribute :: !(ControlAttribute .st) -> Bool
/*	CustomButtonControl	(y = valid, . = invalid)
Peter Achten's avatar
Peter Achten committed
60
61
	ControlActivate		. |	ControlKeyboard		. |	ControlPos			y |
	ControlDeactivate	. |	ControlLook			. |	ControlResize		y |
62
63
	ControlFunction		y |	ControlMinimumSize	y |	ControlSelectState	y |
	ControlHide			y |	ControlModsFunction	y |	ControlTip			y |
Peter Achten's avatar
Peter Achten committed
64
65
66
	ControlHMargin		. |	ControlMouse		. |	ControlViewDomain	. |
	ControlHScroll		. |	ControlOrigin		. |	ControlViewSize		. |
	ControlId			y | ControlOuterSize	. |	ControlVMargin		. |
67
	ControlItemSpace	. |	ControlPen			y |	ControlVScroll		. |
Peter Achten's avatar
Peter Achten committed
68
69
70
												  | ControlWidth		. |
*/

71
72
73
74
75
isValidCustomControlAttribute :: !(ControlAttribute .st) -> Bool
/*	CustomControl		(y = valid, . = invalid)
	ControlActivate		y |	ControlKeyboard		. |	ControlPos			y |
	ControlDeactivate	y |	ControlLook			. |	ControlResize		y |
	ControlFunction		. |	ControlMinimumSize	y |	ControlSelectState	y |
Peter Achten's avatar
Peter Achten committed
76
	ControlHide			y |	ControlModsFunction	. |	ControlTip			y |
77
78
	ControlHMargin		. |	ControlMouse		y |	ControlViewDomain	. |
	ControlHScroll		. |	ControlOrigin		y |	ControlViewSize		. |
Peter Achten's avatar
Peter Achten committed
79
	ControlId			y | ControlOuterSize	. |	ControlVMargin		. |
80
81
	ControlItemSpace	. |	ControlPen			y |	ControlVScroll		. |
												  | ControlWidth		. |
Peter Achten's avatar
Peter Achten committed
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
*/

isValidEditControlAttribute :: !(ControlAttribute .st) -> Bool
/*	EditControl			(y = valid, . = invalid)
	ControlActivate		y |	ControlKeyboard		y |	ControlPos			y |
	ControlDeactivate	y |	ControlLook			. |	ControlResize		y |
	ControlFunction		. |	ControlMinimumSize	. |	ControlSelectState	y |
	ControlHide			y |	ControlModsFunction	. |	ControlTip			y |
	ControlHMargin		. |	ControlMouse		. |	ControlViewDomain	. |
	ControlHScroll		. |	ControlOrigin		. |	ControlViewSize		. |
	ControlId			y | ControlOuterSize	. |	ControlVMargin		. |
	ControlItemSpace	. |	ControlPen			. | ControlVScroll		. |
												  | ControlWidth		. |
*/

97
98
isValidLayoutControlAttribute :: !(ControlAttribute .st) -> Bool
/*	LayoutControl		(y = valid, . = invalid)
Peter Achten's avatar
Peter Achten committed
99
	ControlActivate		. |	ControlKeyboard		. |	ControlPos			y |
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
	ControlDeactivate	. |	ControlLook			. |	ControlResize		y |
	ControlFunction		. |	ControlMinimumSize	y |	ControlSelectState	y |
	ControlHide			y |	ControlModsFunction	. |	ControlTip			. |
	ControlHMargin		y |	ControlMouse		. |	ControlViewDomain	. |
	ControlHScroll		. |	ControlOrigin		. |	ControlViewSize		y |
	ControlId			y | ControlOuterSize	y |	ControlVMargin		y |
	ControlItemSpace	y |	ControlPen			. |	ControlVScroll		. | 
												  | ControlWidth		. |
*/

isValidPopUpControlAttribute :: !(ControlAttribute .st) -> Bool
/*	PopUpControl		(y = valid, . = invalid)
	ControlActivate		y |	ControlKeyboard		. |	ControlPos			y |
	ControlDeactivate	y |	ControlLook			. |	ControlResize		. |
	ControlFunction		. |	ControlMinimumSize	. |	ControlSelectState	y |
	ControlHide			y |	ControlModsFunction	. |	ControlTip			y |
Peter Achten's avatar
Peter Achten committed
116
117
118
	ControlHMargin		. |	ControlMouse		. |	ControlViewDomain	. |
	ControlHScroll		. |	ControlOrigin		. |	ControlViewSize		. |
	ControlId			y | ControlOuterSize	. |	ControlVMargin		. |
119
	ControlItemSpace	. |	ControlPen			. |	ControlVScroll		. | 
Peter Achten's avatar
Peter Achten committed
120
121
122
												  | ControlWidth		y |
*/

123
124
isValidRadioControlAttribute :: !(ControlAttribute .st) -> Bool
/*	RadioControl		(y = valid, . = invalid)
Peter Achten's avatar
Peter Achten committed
125
	ControlActivate		. |	ControlKeyboard		. |	ControlPos			y |
126
127
128
	ControlDeactivate	. |	ControlLook			. |	ControlResize		. |
	ControlFunction		. |	ControlMinimumSize	. |	ControlSelectState	y |
	ControlHide			y |	ControlModsFunction	. |	ControlTip			y |
Peter Achten's avatar
Peter Achten committed
129
130
131
	ControlHMargin		. |	ControlMouse		. |	ControlViewDomain	. |
	ControlHScroll		. |	ControlOrigin		. |	ControlViewSize		. |
	ControlId			y | ControlOuterSize	. |	ControlVMargin		. |
132
	ControlItemSpace	. |	ControlPen			. |	ControlVScroll		. | 
Peter Achten's avatar
Peter Achten committed
133
134
135
												  | ControlWidth		. |
*/

136
137
138
139
140
isValidSliderControlAttribute :: !(ControlAttribute .st) -> Bool
/*	SliderControl		(y = valid, . = invalid)
	ControlActivate		. |	ControlKeyboard		. |	ControlPos			y |
	ControlDeactivate	. |	ControlLook			. |	ControlResize		y |
	ControlFunction		. |	ControlMinimumSize	. |	ControlSelectState	y |
Peter Achten's avatar
Peter Achten committed
141
	ControlHide			y |	ControlModsFunction	. |	ControlTip			y |
142
143
	ControlHMargin		. |	ControlMouse		. |	ControlViewDomain	. |
	ControlHScroll		. |	ControlOrigin		. |	ControlViewSize		. |
Peter Achten's avatar
Peter Achten committed
144
	ControlId			y | ControlOuterSize	. |	ControlVMargin		. |
145
	ControlItemSpace	. |	ControlPen			. |	ControlVScroll		. |
Peter Achten's avatar
Peter Achten committed
146
147
148
												  | ControlWidth		. |
*/

149
150
151
152
153
isValidTextControlAttribute :: !(ControlAttribute .st) -> Bool
/*	TextControl			(y = valid, . = invalid)
	ControlActivate		. |	ControlKeyboard		. |	ControlPos			y |
	ControlDeactivate	. |	ControlLook			. |	ControlResize		. |
	ControlFunction		. |	ControlMinimumSize	. |	ControlSelectState	. |
Peter Achten's avatar
Peter Achten committed
154
	ControlHide			y |	ControlModsFunction	. |	ControlTip			y |
155
156
157
158
159
	ControlHMargin		. |	ControlMouse		. |	ControlViewDomain	. |
	ControlHScroll		. |	ControlOrigin		. |	ControlViewSize		. |
	ControlId			y | ControlOuterSize	. |	ControlVMargin		. |
	ControlItemSpace	. |	ControlPen			. |	ControlVScroll		. |
												  | ControlWidth		y |
Peter Achten's avatar
Peter Achten committed
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
*/


/*	The following functions return True only iff the attribute equals the 
	indicated name.
*/
isControlActivate		:: !(ControlAttribute .st) -> Bool
isControlDeactivate		:: !(ControlAttribute .st) -> Bool
isControlFunction		:: !(ControlAttribute .st) -> Bool
isControlHide			:: !(ControlAttribute .st) -> Bool
isControlHMargin		:: !(ControlAttribute .st) -> Bool
isControlHScroll		:: !(ControlAttribute .st) -> Bool
isControlId				:: !(ControlAttribute .st) -> Bool
isControlItemSpace		:: !(ControlAttribute .st) -> Bool
isControlKeyboard		:: !(ControlAttribute .st) -> Bool
isControlLook			:: !(ControlAttribute .st) -> Bool
isControlMinimumSize	:: !(ControlAttribute .st) -> Bool
isControlModsFunction	:: !(ControlAttribute .st) -> Bool
isControlMouse			:: !(ControlAttribute .st) -> Bool
isControlOrigin			:: !(ControlAttribute .st) -> Bool
isControlOuterSize		:: !(ControlAttribute .st) -> Bool
isControlPen			:: !(ControlAttribute .st) -> Bool
isControlPos			:: !(ControlAttribute .st) -> Bool
isControlResize			:: !(ControlAttribute .st) -> Bool
isControlSelectState	:: !(ControlAttribute .st) -> Bool
isControlTip			:: !(ControlAttribute .st) -> Bool
isControlViewDomain		:: !(ControlAttribute .st) -> Bool
isControlViewSize		:: !(ControlAttribute .st) -> Bool
isControlVMargin		:: !(ControlAttribute .st) -> Bool
isControlVScroll		:: !(ControlAttribute .st) -> Bool
isControlWidth			:: !(ControlAttribute .st) -> Bool


/*	The following functions return the attribute value if appropriate. 
	THESE ARE PARTIAL FUNCTIONS! They are only defined on the corresponding
	attribute.
*/
getControlActivateFun	:: !(ControlAttribute .st) -> IdFun .st
getControlDeactivateFun	:: !(ControlAttribute .st) -> IdFun .st
getControlFun			:: !(ControlAttribute .st) -> IdFun .st
getControlHMarginAtt	:: !(ControlAttribute .st) -> (Int,Int)
getControlHScrollFun	:: !(ControlAttribute .st) -> ScrollFunction
getControlIdAtt			:: !(ControlAttribute .st) -> Id
getControlItemSpaceAtt	:: !(ControlAttribute .st) -> (Int,Int)
getControlKeyboardAtt	:: !(ControlAttribute .st) -> ( KeyboardStateFilter
													  , SelectState
													  , KeyboardFunction .st
													  )
getControlLookAtt		:: !(ControlAttribute .st) -> (Bool,Look)
getControlMinimumSizeAtt:: !(ControlAttribute .st) -> Size
getControlModsFun		:: !(ControlAttribute .st) -> ModifiersFunction .st
getControlMouseAtt		:: !(ControlAttribute .st) -> ( MouseStateFilter
													  , SelectState
													  , MouseFunction .st
													  )
getControlOriginAtt		:: !(ControlAttribute .st) -> Point2
getControlOuterSizeAtt	:: !(ControlAttribute .st) -> Size
getControlPenAtt		:: !(ControlAttribute .st) -> [PenAttribute]
getControlPosAtt		:: !(ControlAttribute .st) -> ItemPos
getControlResizeFun		:: !(ControlAttribute .st) -> ControlResizeFunction
getControlSelectStateAtt:: !(ControlAttribute .st) -> SelectState
getControlTipAtt		:: !(ControlAttribute .st) -> String
getControlViewDomainAtt	:: !(ControlAttribute .st) -> ViewDomain
getControlViewSizeAtt	:: !(ControlAttribute .st) -> Size
getControlVMarginAtt	:: !(ControlAttribute .st) -> (Int,Int)
getControlVScrollFun	:: !(ControlAttribute .st) -> ScrollFunction
getControlWidthAtt		:: !(ControlAttribute .st) -> ControlWidth