StdControlDef.icl 4.4 KB
Newer Older
Peter Achten's avatar
Peter Achten committed
1
2
3
4
5
6
7
8
implementation module StdControlDef


//	Clean Object I/O library, version 1.2

//	Definition of controls.


9
import	StdIOCommon, StdPictureDef
Peter Achten's avatar
Peter Achten committed
10
11
12
13
14
15
16
17


::	ButtonControl       ls pst = ButtonControl       String                                           [ControlAttribute *(ls,pst)]
::	CheckControl        ls pst = CheckControl        [CheckControlItem *(ls,pst)] RowsOrColumns       [ControlAttribute *(ls,pst)]
::	CompoundControl   c ls pst = CompoundControl     (c ls pst)                                       [ControlAttribute *(ls,pst)]
::	CustomButtonControl ls pst = CustomButtonControl Size Look                                        [ControlAttribute *(ls,pst)]
::	CustomControl       ls pst = CustomControl       Size Look                                        [ControlAttribute *(ls,pst)]
::	EditControl         ls pst = EditControl         String ControlWidth NrLines                      [ControlAttribute *(ls,pst)]
18
::	LayoutControl     c ls pst = LayoutControl       (c ls pst)                                       [ControlAttribute *(ls,pst)]
Peter Achten's avatar
Peter Achten committed
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
::	PopUpControl        ls pst = PopUpControl        [PopUpControlItem *(ls,pst)]               Index [ControlAttribute *(ls,pst)]
::	RadioControl        ls pst = RadioControl        [RadioControlItem *(ls,pst)] RowsOrColumns Index [ControlAttribute *(ls,pst)]
::	SliderControl       ls pst = SliderControl       Direction ControlWidth SliderState               (SliderAction     *(ls,pst))
                                                                                                      [ControlAttribute *(ls,pst)]
::	TextControl         ls pst = TextControl         String                                           [ControlAttribute *(ls,pst)]

::	CheckControlItem st	:==	(String, Maybe ControlWidth, MarkState, IdFun st)
::	PopUpControlItem st	:==	(String,                                IdFun st)
::	RadioControlItem st	:==	(String, Maybe ControlWidth,            IdFun st)
::	NrLines				:==	Int
::	RowsOrColumns
	=	Rows			Int
	|	Columns			Int
::	ControlWidth									// The width of the control:
	=	PixelWidth		Int							// the exact number of pixels
	|	TextWidth		String						// the exact string width in dialog font
	|	ContentWidth	String						// width of the control as if string is its content

::	ControlAttribute st                             // Default:
 // General control attributes:
	=	ControlActivate     (IdFun             st)  // id
	|	ControlDeactivate   (IdFun             st)  // id
	|	ControlFunction     (IdFun             st)  // id
	|	ControlHide                                 // initially visible
	|	ControlId           Id                      // no id
	|	ControlKeyboard     KeyboardStateFilter SelectState (KeyboardFunction st)
		                                            // no keyboard input/overruled
	|	ControlMinimumSize  Size                    // zero
	|	ControlModsFunction (ModifiersFunction st)  // ControlFunction
	|	ControlMouse        MouseStateFilter    SelectState (MouseFunction st)
		                                            // no mouse input/overruled
	|	ControlPen			[PenAttribute]			// default pen attributes
	|	ControlPos          ItemPos                 // (RightTo previous,zero)
	|	ControlResize       ControlResizeFunction   // no resize
	|	ControlSelectState  SelectState             // control Able
	|	ControlTip          String                  // no tip
	|	ControlWidth		ControlWidth			// system derived
 //	For CompoundControls only:
	|	ControlHMargin      Int Int                 // system dependent
	|	ControlHScroll      ScrollFunction          // no horizontal scrolling
	|	ControlItemSpace    Int Int                 // system dependent
60
	|	ControlLook         Bool Look               // control has white background
Peter Achten's avatar
Peter Achten committed
61
62
63
64
65
66
67
68
	|	ControlOrigin       Point2                  // Left top of ViewDomain
	|	ControlOuterSize	Size					// enclose elements
	|	ControlViewDomain   ViewDomain              // {zero,max range}
	|	ControlViewSize     Size                    // enclose elements
	|	ControlVMargin      Int Int                 // system dependent
	|	ControlVScroll      ScrollFunction          // no vertical   scrolling

::	ControlResizeFunction
69
70
71
72
	:==	Size ->                                     // current control outer size
		Size ->                                     // old     parent  view  size
		Size ->                                     // new     parent  view  size
		Size                                        // new     control outer size
Peter Achten's avatar
Peter Achten committed
73
74
::	ControlType
	:==	String