sliderBar.dcl 1.33 KB
Newer Older
Ronny Wichers Schreur's avatar
Ronny Wichers Schreur committed
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
definition module sliderBar;


//	Version 0.8 to 1.0


import	deltaIOSystem;
from	deltaIOState import ::IOState;


/* A general Slider Bar definition, which is a dialog item
	implemented entirely in Concurrent Clean as a Control.
*/


::	SliderDirection	=	Horizontal | Vertical;
::	SliderPos		:==	Int;
::	SliderMax		:==	Int;


/*	A SliderBar is defined by the following attributes:
	- Id, ItemPos and SelectState, like other DialogItems.
	- SliderDirection: Horizontal or Vertical.
	- SliderPos: the initial position of the slider. This position is always
	             adjusted between 0 and SliderMax.
	- SliderMax: the slider can take on positions between 0 and SliderMax.
*/
SliderBar	::	!DialogItemId !ItemPos !SelectState !SliderDirection
				!SliderPos !SliderMax
				!(DialogFunction s (IOState s))
			->	DialogItem s (IOState s);

/*	ChangeSliderBar moves the slider of the indicated bar to the new
	position. The position is always adjusted between 0 and SliderMax.
*/
ChangeSliderBar		::	!DialogItemId !SliderPos
						!(DialogState s (IOState s))
					->	  DialogState s (IOState s);

/*	GetSliderPosition retrieves the current slider position of the slider
	bar with the indicated id from the DialogInfo parameter. When the id is
	not the id of a SliderBar a run-time error is generated.
*/
GetSliderPosition	::	!DialogItemId !DialogInfo -> SliderPos;