Commit 0a6b09b2 authored by Peter Achten's avatar Peter Achten
Browse files

(PA) Hiding/Showing controls improved.

CompoundControl/LayoutControl introduced.
Some control functions in StdWindow moved to StdControl.
parent bd389557
......@@ -156,8 +156,9 @@ OScreateGameWindow :: !Bool !(!Int,!Int) !Int !*OSToolbox -> (![DelayActivationI
creates a CustomButtonControl in the window identified by parentWindow.
OScreateCustomControl parentWindow parentPos able pos size
creates a CustomControl in the window identified by parentWindow.
OScreateCompoundControl parentWindow parentPos show able pos size hScrollInfo vScrollInfo
OScreateCompoundControl parentWindow parentPos show able isTransparent pos size hScrollInfo vScrollInfo
creates a CompoundControl in the window identified by parentWindow.
The Boolean isTransparent should be True iff the CompoundControl has no ControlLook attribute.
*/
:: OKorCANCEL
= OK | CANCEL | NORMAL
......@@ -189,7 +190,7 @@ OScreateCustomControl :: !OSWindowPtr !(!Int,!Int) !Bool !Bool !(!Int,!Int) !(!
, cbiState :: (Int,Int,Int,Int) // Its (min,thumb,max,thumbsize) settings
}
OScreateCompoundControl :: !OSWindowMetrics !OSWindowPtr !(!Int,!Int) !Bool !Bool !(!Int,!Int) !(!Int,!Int)
OScreateCompoundControl :: !OSWindowMetrics !OSWindowPtr !(!Int,!Int) !Bool !Bool !Bool !(!Int,!Int) !(!Int,!Int)
!ScrollbarInfo !ScrollbarInfo !*OSToolbox
-> (!OSWindowPtr,!OSWindowPtr,!OSWindowPtr,!*OSToolbox)
......
......@@ -580,17 +580,17 @@ OScreateCustomControl parentWindow parentPos show able (x,y) (w,h) tb
, cbiState :: (Int,Int,Int,Int) // Its (min,thumb,max,thumbsize) settings
}
OScreateCompoundControl :: !OSWindowMetrics !OSWindowPtr !(!Int,!Int) !Bool !Bool !(!Int,!Int) !(!Int,!Int)
OScreateCompoundControl :: !OSWindowMetrics !OSWindowPtr !(!Int,!Int) !Bool !Bool !Bool !(!Int,!Int) !(!Int,!Int)
!ScrollbarInfo
!ScrollbarInfo
!*OSToolbox
-> (!OSWindowPtr,!OSWindowPtr,!OSWindowPtr,!*OSToolbox)
OScreateCompoundControl wMetrics parentWindow parentPos show able (x,y) (w,h)
OScreateCompoundControl wMetrics parentWindow parentPos show able isTransparent (x,y) (w,h)
hInfo=:{cbiHasScroll=hasHScroll}
vInfo=:{cbiHasScroll=hasVScroll} tb
# (x,y) = (x-fst parentPos,y-snd parentPos)
scrollFlags = (if hasHScroll WS_HSCROLL 0) bitor (if hasVScroll WS_VSCROLL 0)
createcci = Rq6Cci CcRqCREATECOMPOUND parentWindow x y w h scrollFlags
createcci = Rq6Cci CcRqCREATECOMPOUND parentWindow (x<<16+(y<<16)>>16) w h scrollFlags (toInt isTransparent)
# (returncci,tb)= IssueCleanRequest2 osIgnoreCallback createcci tb
compoundPtr = case returncci.ccMsg of
CcRETURN1 -> returncci.p1
......
......@@ -1001,7 +1001,7 @@ where
= (itemH.wItemNr,WItemHandle itemH)
// otherwise
= (0,WItemHandle itemH)
| kind<>IsCompoundControl
| not (isRecursiveControl kind)
= (0,WItemHandle itemH)
| otherwise
# (itemNr,itemHs) = getControlsKeyFocusItemNr` activated cPtr itemH.wItems
......
......@@ -8,9 +8,73 @@ definition module StdControl
// ********************************************************************************
from StdFunc import St
import StdControlDef, StdMaybe
from StdPSt import PSt, IOSt
import StdControlClass
controlSize :: !(cdef .ls (PSt .l)) !Bool
!(Maybe (Int,Int)) !(Maybe (Int,Int)) !(Maybe (Int,Int))
!(PSt .l)
-> (!Size,!PSt .l) | Controls cdef
/* controlSize calculates the size of the given control definition as it would be
opened as an element of a window/dialog.
The Boolean argument determines whether a window (True) or a dialog (False) is
intended.
The Maybe arguments are the prefered horizontal margins, vertical margins, and
item spaces (see also the (Window/Control)(H/V)Margin and
(Window/Control)ItemSpace attributes). If Nothing is specified, their
default values with respect to the window/dialog are used.
*/
/* Functions that change the set of controls in windows/dialogues.
*/
openControls :: !Id .ls (cdef .ls (PSt .l)) !(PSt .l)
-> (!ErrorReport,!PSt .l)
| Controls cdef
openCompoundControls :: !Id .ls (cdef .ls (PSt .l)) !(PSt .l)
-> (!ErrorReport,!PSt .l)
| Controls cdef
openPopUpControlItems :: !Id !Index ![PopUpControlItem (PSt .l)]
!(IOSt .l) -> IOSt .l
/* openControls
adds the given controls argument to the indicated window or dialog.
openCompoundControls
adds the given controls argument to the indicated compound control.
openPopUpControlItems
adds the PopUpControlItems to the indicated PopUpControl behind the item at
the given index position (counted from 1).
The window/dialog is not resized.
These functions have no effect in case the indicated window/dialog/compound
control could not be found (ErrorUnknownObject) or if controls are opened with
duplicate Ids (ErrorIdsInUse).
*/
closeControls :: !Id [Id] !Bool !(IOSt .l) -> IOSt .l
/* closeControls removes the indicated controls (second argument) from the
indicated window (first argument) and recalculates the layout iff the Boolean
argument is True.
*/
closeAllControls :: !Id !(IOSt .l) -> IOSt .l
/* closeAllControls removes all controls from the indicated window.
*/
closePopUpControlItems :: !Id ![Index] !(IOSt .l) -> IOSt .l
/* closePopUpControlItems closes PopUpControlItems by their Index position of the
indicated PopUpControl.
If the currently checked element of a PopUpControl is closed, the first
remaining element of that PopUpControl will be checked.
*/
setControlPos :: !Id ![(Id,ItemPos)] !(IOSt .l) -> (!Bool,!IOSt .l)
/* setControlPos changes the current layout position of the indicated controls to
their new positions.
If there are relatively laynout controls, then their layout also changes. The
window is not resized.
The Boolean result is False iff the window is unknown.
*/
/* Functions that change the state of controls.
......@@ -304,13 +368,13 @@ getControlScrollFunction:: ! Id !WState
getControlItemSpaces :: ![Id] !WState -> [(Bool,Maybe (Int,Int))]
getControlItemSpace :: ! Id !WState -> (Bool,Maybe (Int,Int))
/* getControlItemSpace(s) yields (Just (horizontal space,vertical space)) of the
indicated CompoundControl. If the control is not such a control, then Nothing
is yielded.
indicated (Compound/Layout)Control. If the control is not such a control, then
Nothing is yielded.
*/
getControlMargins :: ![Id] !WState -> [(Bool,Maybe ((Int,Int),(Int,Int)))]
getControlMargin :: ! Id !WState -> (Bool,Maybe ((Int,Int),(Int,Int)))
/* getControlMargins yields (Just (ControlHMargin,ControlVMargin)) of the
indicated CompoundControl. If the control is not such a control, then Nothing
is yielded.
indicated (Compound/Layout)Control. If the control is not such a control, then
Nothing is yielded.
*/
This diff is collapsed.
......@@ -16,17 +16,17 @@ import StdControlDef
/* The following functions specify the valid attributes for each standard control.
*/
isValidRadioControlAttribute :: !(ControlAttribute .st) -> Bool
/* RadioControl (y = valid, . = invalid)
isValidButtonControlAttribute :: !(ControlAttribute .st) -> Bool
/* ButtonControl (y = valid, . = invalid)
ControlActivate . | ControlKeyboard . | ControlPos y |
ControlDeactivate . | ControlLook . | ControlResize . |
ControlFunction . | ControlMinimumSize . | ControlSelectState y |
ControlHide y | ControlModsFunction . | ControlTip y |
ControlFunction y | ControlMinimumSize . | ControlSelectState y |
ControlHide y | ControlModsFunction y | ControlTip y |
ControlHMargin . | ControlMouse . | ControlViewDomain . |
ControlHScroll . | ControlOrigin . | ControlViewSize . |
ControlId y | ControlOuterSize . | ControlVMargin . |
ControlItemSpace . | ControlPen . | ControlVScroll . |
| ControlWidth . |
ControlItemSpace . | ControlPen . | ControlVScroll . |
| ControlWidth y |
*/
isValidCheckControlAttribute :: !(ControlAttribute .st) -> Bool
......@@ -42,43 +42,43 @@ isValidCheckControlAttribute :: !(ControlAttribute .st) -> Bool
| ControlWidth . |
*/
isValidPopUpControlAttribute :: !(ControlAttribute .st) -> Bool
/* PopUpControl (y = valid, . = invalid)
ControlActivate y | ControlKeyboard . | ControlPos y |
ControlDeactivate y | ControlLook . | ControlResize . |
ControlFunction . | ControlMinimumSize . | ControlSelectState y |
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 |
ControlHide y | ControlModsFunction . | ControlTip y |
ControlHMargin . | ControlMouse . | ControlViewDomain . |
ControlHScroll . | ControlOrigin . | ControlViewSize . |
ControlId y | ControlOuterSize . | ControlVMargin . |
ControlItemSpace . | ControlPen . | ControlVScroll . |
| ControlWidth y |
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 . |
*/
isValidSliderControlAttribute :: !(ControlAttribute .st) -> Bool
/* SliderControl (y = valid, . = invalid)
isValidCustomButtonControlAttribute :: !(ControlAttribute .st) -> Bool
/* CustomButtonControl (y = valid, . = invalid)
ControlActivate . | ControlKeyboard . | ControlPos y |
ControlDeactivate . | ControlLook . | ControlResize y |
ControlFunction . | ControlMinimumSize . | ControlSelectState y |
ControlHide y | ControlModsFunction . | ControlTip y |
ControlFunction y | ControlMinimumSize y | ControlSelectState y |
ControlHide y | ControlModsFunction y | ControlTip y |
ControlHMargin . | ControlMouse . | ControlViewDomain . |
ControlHScroll . | ControlOrigin . | ControlViewSize . |
ControlId y | ControlOuterSize . | ControlVMargin . |
ControlItemSpace . | ControlPen . | ControlVScroll . |
ControlItemSpace . | ControlPen y | ControlVScroll . |
| ControlWidth . |
*/
isValidTextControlAttribute :: !(ControlAttribute .st) -> Bool
/* TextControl (y = valid, . = invalid)
ControlActivate . | ControlKeyboard . | ControlPos y |
ControlDeactivate . | ControlLook . | ControlResize . |
ControlFunction . | ControlMinimumSize . | ControlSelectState . |
isValidCustomControlAttribute :: !(ControlAttribute .st) -> Bool
/* CustomControl (y = valid, . = invalid)
ControlActivate y | ControlKeyboard . | ControlPos y |
ControlDeactivate y | ControlLook . | ControlResize y |
ControlFunction . | ControlMinimumSize y | ControlSelectState y |
ControlHide y | ControlModsFunction . | ControlTip y |
ControlHMargin . | ControlMouse . | ControlViewDomain . |
ControlHScroll . | ControlOrigin . | ControlViewSize . |
ControlHMargin . | ControlMouse y | ControlViewDomain . |
ControlHScroll . | ControlOrigin y | ControlViewSize . |
ControlId y | ControlOuterSize . | ControlVMargin . |
ControlItemSpace . | ControlPen . | ControlVScroll . |
| ControlWidth y |
ControlItemSpace . | ControlPen y | ControlVScroll . |
| ControlWidth . |
*/
isValidEditControlAttribute :: !(ControlAttribute .st) -> Bool
......@@ -94,56 +94,69 @@ isValidEditControlAttribute :: !(ControlAttribute .st) -> Bool
| ControlWidth . |
*/
isValidButtonControlAttribute :: !(ControlAttribute .st) -> Bool
/* ButtonControl (y = valid, . = invalid)
isValidLayoutControlAttribute :: !(ControlAttribute .st) -> Bool
/* LayoutControl (y = valid, . = invalid)
ControlActivate . | ControlKeyboard . | ControlPos y |
ControlDeactivate . | ControlLook . | ControlResize . |
ControlFunction y | ControlMinimumSize . | ControlSelectState y |
ControlHide y | ControlModsFunction y | ControlTip y |
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 |
ControlHMargin . | ControlMouse . | ControlViewDomain . |
ControlHScroll . | ControlOrigin . | ControlViewSize . |
ControlId y | ControlOuterSize . | ControlVMargin . |
ControlItemSpace . | ControlPen . | ControlVScroll . |
ControlItemSpace . | ControlPen . | ControlVScroll . |
| ControlWidth y |
*/
isValidCustomButtonControlAttribute :: !(ControlAttribute .st) -> Bool
/* CustomButtonControl (y = valid, . = invalid)
isValidRadioControlAttribute :: !(ControlAttribute .st) -> Bool
/* RadioControl (y = valid, . = invalid)
ControlActivate . | ControlKeyboard . | ControlPos y |
ControlDeactivate . | ControlLook . | ControlResize y |
ControlFunction y | ControlMinimumSize y | ControlSelectState y |
ControlHide y | ControlModsFunction y | ControlTip 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 y | ControlVScroll . |
ControlItemSpace . | ControlPen . | ControlVScroll . |
| ControlWidth . |
*/
isValidCustomControlAttribute :: !(ControlAttribute .st) -> Bool
/* CustomControl (y = valid, . = invalid)
ControlActivate y | ControlKeyboard . | ControlPos y |
ControlDeactivate y | ControlLook . | ControlResize y |
ControlFunction . | ControlMinimumSize y | ControlSelectState y |
isValidSliderControlAttribute :: !(ControlAttribute .st) -> Bool
/* SliderControl (y = valid, . = invalid)
ControlActivate . | ControlKeyboard . | ControlPos y |
ControlDeactivate . | ControlLook . | ControlResize y |
ControlFunction . | ControlMinimumSize . | ControlSelectState y |
ControlHide y | ControlModsFunction . | ControlTip y |
ControlHMargin . | ControlMouse y | ControlViewDomain . |
ControlHScroll . | ControlOrigin y | ControlViewSize . |
ControlHMargin . | ControlMouse . | ControlViewDomain . |
ControlHScroll . | ControlOrigin . | ControlViewSize . |
ControlId y | ControlOuterSize . | ControlVMargin . |
ControlItemSpace . | ControlPen y | ControlVScroll . |
ControlItemSpace . | ControlPen . | ControlVScroll . |
| ControlWidth . |
*/
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 |
isValidTextControlAttribute :: !(ControlAttribute .st) -> Bool
/* TextControl (y = valid, . = invalid)
ControlActivate . | ControlKeyboard . | ControlPos y |
ControlDeactivate . | ControlLook . | ControlResize . |
ControlFunction . | ControlMinimumSize . | ControlSelectState . |
ControlHide y | ControlModsFunction . | ControlTip y |
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 . |
ControlHMargin . | ControlMouse . | ControlViewDomain . |
ControlHScroll . | ControlOrigin . | ControlViewSize . |
ControlId y | ControlOuterSize . | ControlVMargin . |
ControlItemSpace . | ControlPen . | ControlVScroll . |
| ControlWidth y |
*/
......
......@@ -12,62 +12,6 @@ implementation module StdControlAttribute
import StdControlDef
isValidRadioControlAttribute :: !(ControlAttribute .st) -> Bool
isValidRadioControlAttribute (ControlId _) = True
isValidRadioControlAttribute (ControlPos _) = True
isValidRadioControlAttribute (ControlSelectState _) = True
isValidRadioControlAttribute ControlHide = True
isValidRadioControlAttribute (ControlTip _) = True
isValidRadioControlAttribute _ = False
isValidCheckControlAttribute :: !(ControlAttribute .st) -> Bool
isValidCheckControlAttribute (ControlId _) = True
isValidCheckControlAttribute (ControlPos _) = True
isValidCheckControlAttribute (ControlSelectState _) = True
isValidCheckControlAttribute ControlHide = True
isValidCheckControlAttribute (ControlTip _) = True
isValidCheckControlAttribute _ = False
isValidPopUpControlAttribute :: !(ControlAttribute .st) -> Bool
isValidPopUpControlAttribute (ControlId _) = True
isValidPopUpControlAttribute (ControlPos _) = True
isValidPopUpControlAttribute (ControlSelectState _) = True
isValidPopUpControlAttribute ControlHide = True
isValidPopUpControlAttribute (ControlActivate _) = True
isValidPopUpControlAttribute (ControlDeactivate _) = True
isValidPopUpControlAttribute (ControlTip _) = True
isValidPopUpControlAttribute (ControlWidth _) = True
isValidPopUpControlAttribute _ = False
isValidSliderControlAttribute :: !(ControlAttribute .st) -> Bool
isValidSliderControlAttribute (ControlId _)= True
isValidSliderControlAttribute (ControlPos _)= True
isValidSliderControlAttribute (ControlResize _)= True
isValidSliderControlAttribute (ControlSelectState _)= True
isValidSliderControlAttribute ControlHide = True
isValidSliderControlAttribute (ControlTip _)= True
isValidSliderControlAttribute _ = False
isValidTextControlAttribute :: !(ControlAttribute .st) -> Bool
isValidTextControlAttribute (ControlId _) = True
isValidTextControlAttribute (ControlPos _) = True
isValidTextControlAttribute ControlHide = True
isValidTextControlAttribute (ControlTip _) = True
isValidTextControlAttribute (ControlWidth _) = True
isValidTextControlAttribute _ = False
isValidEditControlAttribute :: !(ControlAttribute .st) -> Bool
isValidEditControlAttribute (ControlId _) = True
isValidEditControlAttribute (ControlPos _) = True
isValidEditControlAttribute (ControlResize _) = True
isValidEditControlAttribute (ControlSelectState _) = True
isValidEditControlAttribute ControlHide = True
isValidEditControlAttribute (ControlTip _) = True
isValidEditControlAttribute (ControlActivate _) = True
isValidEditControlAttribute (ControlDeactivate _) = True
isValidEditControlAttribute (ControlKeyboard _ _ _) = True
isValidEditControlAttribute _ = False
isValidButtonControlAttribute :: !(ControlAttribute .st) -> Bool
isValidButtonControlAttribute (ControlId _) = True
isValidButtonControlAttribute (ControlPos _) = True
......@@ -79,6 +23,19 @@ isValidButtonControlAttribute (ControlTip _) = True
isValidButtonControlAttribute (ControlWidth _) = True
isValidButtonControlAttribute _ = False
isValidCheckControlAttribute :: !(ControlAttribute .st) -> Bool
isValidCheckControlAttribute (ControlId _) = True
isValidCheckControlAttribute (ControlPos _) = True
isValidCheckControlAttribute (ControlSelectState _) = True
isValidCheckControlAttribute ControlHide = True
isValidCheckControlAttribute (ControlTip _) = True
isValidCheckControlAttribute _ = False
isValidCompoundControlAttribute :: !(ControlAttribute .st) -> Bool
isValidCompoundControlAttribute (ControlFunction _) = False
isValidCompoundControlAttribute (ControlModsFunction _) = False
isValidCompoundControlAttribute _ = True
isValidCustomButtonControlAttribute :: !(ControlAttribute .st) -> Bool
isValidCustomButtonControlAttribute (ControlId _) = True
isValidCustomButtonControlAttribute (ControlPen _) = True
......@@ -107,10 +64,67 @@ isValidCustomControlAttribute (ControlKeyboard _ _ _) = True
isValidCustomControlAttribute (ControlTip _) = True
isValidCustomControlAttribute _ = False
isValidCompoundControlAttribute :: !(ControlAttribute .st) -> Bool
isValidCompoundControlAttribute (ControlFunction _) = False
isValidCompoundControlAttribute (ControlModsFunction _) = False
isValidCompoundControlAttribute _ = True
isValidEditControlAttribute :: !(ControlAttribute .st) -> Bool
isValidEditControlAttribute (ControlId _) = True
isValidEditControlAttribute (ControlPos _) = True
isValidEditControlAttribute (ControlResize _) = True
isValidEditControlAttribute (ControlSelectState _) = True
isValidEditControlAttribute ControlHide = True
isValidEditControlAttribute (ControlTip _) = True
isValidEditControlAttribute (ControlActivate _) = True
isValidEditControlAttribute (ControlDeactivate _) = True
isValidEditControlAttribute (ControlKeyboard _ _ _) = True
isValidEditControlAttribute _ = False
isValidLayoutControlAttribute :: !(ControlAttribute .st) -> Bool
isValidLayoutControlAttribute ControlHide = True
isValidLayoutControlAttribute (ControlHMargin _ _) = True
isValidLayoutControlAttribute (ControlId _) = True
isValidLayoutControlAttribute (ControlItemSpace _ _)= True
isValidLayoutControlAttribute (ControlMinimumSize _)= True
isValidLayoutControlAttribute (ControlOuterSize _)= True
isValidLayoutControlAttribute (ControlPos _) = True
isValidLayoutControlAttribute (ControlResize _) = True
isValidLayoutControlAttribute (ControlSelectState _)= True
isValidLayoutControlAttribute (ControlViewSize _) = True
isValidLayoutControlAttribute (ControlVMargin _ _)= True
isValidLayoutControlAttribute _ = False
isValidPopUpControlAttribute :: !(ControlAttribute .st) -> Bool
isValidPopUpControlAttribute (ControlId _) = True
isValidPopUpControlAttribute (ControlPos _) = True
isValidPopUpControlAttribute (ControlSelectState _) = True
isValidPopUpControlAttribute ControlHide = True
isValidPopUpControlAttribute (ControlActivate _) = True
isValidPopUpControlAttribute (ControlDeactivate _) = True
isValidPopUpControlAttribute (ControlTip _) = True
isValidPopUpControlAttribute (ControlWidth _) = True
isValidPopUpControlAttribute _ = False
isValidRadioControlAttribute :: !(ControlAttribute .st) -> Bool
isValidRadioControlAttribute (ControlId _) = True
isValidRadioControlAttribute (ControlPos _) = True
isValidRadioControlAttribute (ControlSelectState _) = True
isValidRadioControlAttribute ControlHide = True
isValidRadioControlAttribute (ControlTip _) = True
isValidRadioControlAttribute _ = False
isValidSliderControlAttribute :: !(ControlAttribute .st) -> Bool
isValidSliderControlAttribute (ControlId _)= True
isValidSliderControlAttribute (ControlPos _)= True
isValidSliderControlAttribute (ControlResize _)= True
isValidSliderControlAttribute (ControlSelectState _)= True
isValidSliderControlAttribute ControlHide = True
isValidSliderControlAttribute (ControlTip _)= True
isValidSliderControlAttribute _ = False
isValidTextControlAttribute :: !(ControlAttribute .st) -> Bool
isValidTextControlAttribute (ControlId _) = True
isValidTextControlAttribute (ControlPos _) = True
isValidTextControlAttribute ControlHide = True
isValidTextControlAttribute (ControlTip _) = True
isValidTextControlAttribute (ControlWidth _) = True
isValidTextControlAttribute _ = False
isControlActivate :: !(ControlAttribute .st) -> Bool
......
......@@ -8,7 +8,7 @@ definition module StdControlClass
// ********************************************************************************
import StdIOCommon, StdControlDef
import StdControlDef
from windowhandle import ControlState
from StdPSt import PSt, IOSt
......@@ -24,13 +24,15 @@ instance Controls (NewLS c) | Controls c
instance Controls (ListLS c) | Controls c
instance Controls NilLS
instance Controls ((:+:) c1 c2) | Controls c1 & Controls c2
instance Controls RadioControl
instance Controls ButtonControl
instance Controls CheckControl
instance Controls (CompoundControl c) | Controls c
instance Controls CustomButtonControl
instance Controls CustomControl
instance Controls EditControl
instance Controls (LayoutControl c) | Controls c
instance Controls PopUpControl
instance Controls RadioControl
instance Controls SliderControl
instance Controls TextControl
instance Controls EditControl
instance Controls ButtonControl
instance Controls CustomButtonControl
instance Controls CustomControl
instance Controls (CompoundControl c) | Controls c
......@@ -24,6 +24,8 @@ import StdIOCommon, StdPictureDef
= CustomControl Size Look [ControlAttribute *(ls,pst)]
:: EditControl ls pst
= EditControl String ControlWidth NrLines [ControlAttribute *(ls,pst)]
:: LayoutControl c ls pst
= LayoutControl (c ls pst) [ControlAttribute *(ls,pst)]
:: PopUpControl ls pst
= PopUpControl [PopUpControlItem *(ls,pst)] Index
[ControlAttribute *(ls,pst)]
......@@ -80,9 +82,9 @@ import StdIOCommon, StdPictureDef
| ControlVScroll ScrollFunction // no vertical scrolling
:: ControlResizeFunction
:== Size -> // current control size
Size -> // old window size
Size -> // new window size
Size // new control size
:== Size -> // current control outer size
Size -> // old parent view size
Size -> // new parent view size
Size // new control outer size
:: ControlType
:== String
......@@ -15,6 +15,7 @@ import StdIOCommon, StdPictureDef
:: 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)]
:: LayoutControl c ls pst = LayoutControl (c ls pst) [ControlAttribute *(ls,pst)]
:: 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))
......@@ -56,7 +57,7 @@ import StdIOCommon, StdPictureDef
| ControlHMargin Int Int // system dependent
| ControlHScroll ScrollFunction // no horizontal scrolling
| ControlItemSpace Int Int // system dependent
| ControlLook Bool Look // control is transparant