Commit 69ac9ae1 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 92c564f0
......@@ -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.
*/
......@@ -3,18 +3,25 @@ implementation module StdControl
// Clean Object I/O library, version 1.2
// Operations to change controls using their Ids only.
// Operations to change controls.
import StdBool, StdList, StdMisc, StdTuple
import commondef, controlaccess, controlinternal, id, iostate, windowaccess, wstate
import StdBool, StdFunc, StdList, StdMisc, StdTuple
import commondef, controlaccess, controlinternal, controlvalidate, id, iostate, StdControlClass, windowaccess, windowcontrols, wstate
from controllayout import layoutControls
from receiverid import unbindRIds
from StdPSt import appPIO
from windowclipstate import invalidateWindowClipState`
from wstateaccess import iswindowitemspace`, getwindowitemspace`,
iswindowhmargin`, getwindowhmargin`,
iswindowvmargin`, getwindowvmargin`
from ostoolbox import OSNewToolbox
from ostoolbox import OSNewToolbox
StdControlFatalError :: String String -> .x
StdControlFatalError function error
= FatalError function "StdControl" error
/* The function isOkControlId can be used to filter out the proper IdParent records.
*/
isOkControlId :: !SystemId !(.x,!Maybe IdParent) -> (!Bool,(.x,Id))
......@@ -127,6 +134,294 @@ setWindow windowId f ioState
= ioState
/* controlSize calculates the size of the given control.
*/
controlSize :: !(cdef .ls (PSt .l)) !Bool !(Maybe (Int,Int)) !(Maybe (Int,Int)) !(Maybe (Int,Int)) !(PSt .l)
-> (!Size,!PSt .l) | Controls cdef
controlSize cdef isWindow hMargins vMargins itemSpaces pState
# (cs,pState) = controlToHandles cdef pState
itemHs = map ControlStateToWElementHandle cs
# (tb,ioState) = getIOToolbox pState.io
# (wMetrics,ioState)= IOStGetOSWindowMetrics ioState
hMargins = case hMargins of
(Just (left,right)) -> (max 0 left,max 0 right)
_ -> if isWindow (0,0) (wMetrics.osmHorMargin,wMetrics.osmHorMargin)
vMargins = case vMargins of
(Just (top,bottom)) -> (max 0 top,max 0 bottom)
_ -> if isWindow (0,0) (wMetrics.osmVerMargin,wMetrics.osmVerMargin)
itemSpaces = case itemSpaces of
(Just (hor,vert)) -> (max 0 hor,max 0 vert)
_ -> (wMetrics.osmHorItemSpace,wMetrics.osmVerItemSpace)
domain = {viewDomainRange & corner1=zero}
# (derSize,_,tb) = layoutControls wMetrics hMargins vMargins itemSpaces zero zero [(domain,zero)] itemHs tb
# ioState = setIOToolbox tb ioState
# pState = {pState & io=ioState}
= (derSize,pState)
/* openControls adds controls to the indicated window.
*/
openControls :: !Id .ls (cdef .ls (PSt .l)) !(PSt .l) -> (!ErrorReport,!PSt .l) | Controls cdef
openControls wId ls newControls pState
# (found,wDevice,ioState) = IOStGetDevice WindowDevice pState.io
| not found
= (ErrorUnknownObject,{pState & io=ioState})
# wHs = WindowSystemStateGetWindowHandles wDevice
# (found,wsH,wHs) = getWindowHandlesWindow (toWID wId) wHs
| not found
= (ErrorUnknownObject,{pState & io=IOStSetDevice (WindowSystemState wHs) ioState})
// Mike //
# (wKind,wsH) = getWindowStateHandleWindowKind wsH
| wKind==IsGameWindow
= (OtherError "WrongObject",{pState & io=IOStSetDevice (WindowSystemState (setWindowHandlesWindow wsH wHs)) ioState})
///
# (cs,pState) = controlToHandles newControls {pState & io=ioState}
# newItemHs = map ControlStateToWElementHandle cs
(currentIds,wsH) = getWindowStateHandleIds wsH
(disjoint,newItemHs) = disjointControlIds currentIds newItemHs
| not disjoint
= (ErrorIdsInUse,appPIO (IOStSetDevice (WindowSystemState (setWindowHandlesWindow wsH wHs))) pState)
# (rt,ioState) = IOStGetReceiverTable pState.io
# (it,ioState) = IOStGetIdTable ioState
# (ioId,ioState) = IOStGetIOId ioState
(ok,newItemHs,rt,it) = controlIdsAreConsistent ioId wId newItemHs rt it
# ioState = IOStSetIdTable it ioState
# ioState = IOStSetReceiverTable rt ioState
| not ok
# ioState = IOStSetDevice (WindowSystemState (setWindowHandlesWindow wsH wHs)) ioState
# pState = {pState & io=ioState}
= (ErrorIdsInUse,pState)
| otherwise
# (wMetrics,ioState) = IOStGetOSWindowMetrics ioState
# (wsH,ioState) = accIOToolbox (opencontrols wMetrics ls newItemHs wsH) ioState
# ioState = IOStSetDevice (WindowSystemState (setWindowHandlesWindow wsH wHs)) ioState
# pState = {pState & io=ioState}
= (NoError,pState)
/* getWindowStateHandleIds returns all Ids of the controls in this window.
This function is used by open(Compound)Controls.
*/
getWindowStateHandleIds :: !(WindowStateHandle .pst) -> (![Id],!WindowStateHandle .pst)
getWindowStateHandleIds wsH=:{wshHandle=Just wlsH=:{wlsHandle=wH=:{whItems}}}
# (ids,itemHs) = getWElementControlIds whItems
= (ids,{wsH & wshHandle=Just {wlsH & wlsHandle={wH & whItems=itemHs}}})
getWindowStateHandleIds _
= StdControlFatalError "getWindowStateHandleIds" "unexpected window placeholder argument"
/* getParentWindowId controlId returns the Id of the parent window/dialog if this
exists and belongs to the same interactive process.
This function is used by openCompoundControls, openPopUpControlItems, closePopUpControlItems.
*/
getParentWindowId :: !Id !(IOSt .l) -> (!Maybe Id,!IOSt .l)
getParentWindowId controlId ioState
# (it,ioState) = IOStGetIdTable ioState
maybeParent = getIdParent controlId it
| isNothing maybeParent
= (Nothing,ioState)
# parent = fromJust maybeParent
| parent.idpDevice<>WindowDevice
= (Nothing,ioState)
# (pid,ioState) = IOStGetIOId ioState
| parent.idpIOId<>pid
= (Nothing,ioState)
| otherwise
= (Just parent.idpId,ioState)
/* openCompoundControls adds controls to the indicated CompoundControl of the indicated window.
*/
openCompoundControls :: !Id .ls (cdef .ls (PSt .l)) !(PSt .l) -> (!ErrorReport,!PSt .l) | Controls cdef
openCompoundControls cId ls newControls pState=:{io=ioState}
# (maybeId,ioState) = getParentWindowId cId ioState
| isNothing maybeId
= (ErrorUnknownObject,{pState & io=ioState})
# wId = fromJust maybeId
# (found,wDevice,ioState) = IOStGetDevice WindowDevice ioState
| not found
= (ErrorUnknownObject,{pState & io=ioState})
# wHs = WindowSystemStateGetWindowHandles wDevice
# (found,wsH,wHs) = getWindowHandlesWindow (toWID wId) wHs
| not found
= (ErrorUnknownObject,{pState & io=IOStSetDevice (WindowSystemState wHs) ioState})
// Mike //
# (wKind,wsH) = getWindowStateHandleWindowKind wsH
| wKind==IsGameWindow
= (OtherError "WrongObject",{pState & io=IOStSetDevice (WindowSystemState (setWindowHandlesWindow wsH wHs)) ioState})
///
# (cs,pState) = controlToHandles newControls {pState & io=ioState}
# newItemHs = map ControlStateToWElementHandle cs
(currentIds,wsH) = getWindowStateHandleIds wsH
(disjoint,newItemHs) = disjointControlIds currentIds newItemHs
| not disjoint
= (ErrorIdsInUse,appPIO (IOStSetDevice (WindowSystemState (setWindowHandlesWindow wsH wHs))) pState)
# (rt,ioState) = IOStGetReceiverTable pState.io
# (it,ioState) = IOStGetIdTable ioState
# (ioId,ioState) = IOStGetIOId ioState
(ok,newItemHs,rt,it) = controlIdsAreConsistent ioId wId newItemHs rt it
# ioState = IOStSetIdTable it ioState
# ioState = IOStSetReceiverTable rt ioState
| not ok
# ioState = IOStSetDevice (WindowSystemState (setWindowHandlesWindow wsH wHs)) ioState
# pState = {pState & io=ioState}
= (ErrorIdsInUse,pState)
| otherwise
# (osdInfo, ioState) = IOStGetOSDInfo ioState
# (wMetrics,ioState) = IOStGetOSWindowMetrics ioState
# (tb,ioState) = getIOToolbox ioState
# (ok,wsH,tb) = opencompoundcontrols osdInfo wMetrics cId ls newItemHs wsH tb
# ioState = setIOToolbox tb ioState
# ioState = IOStSetDevice (WindowSystemState (setWindowHandlesWindow wsH wHs)) ioState
# pState = {pState & io=ioState}
= (if ok NoError ErrorUnknownObject,pState)
/* openPopUpControlItems opens items to the PopUpControl of the indicated window/dialogue.
*/
openPopUpControlItems :: !Id !Index ![PopUpControlItem (PSt .l)] !(IOSt .l) -> IOSt .l
openPopUpControlItems popUpId index items ioState
| isEmpty items
= ioState
# (maybeId,ioState) = getParentWindowId popUpId ioState
| isNothing maybeId
= ioState
# wId = fromJust maybeId
# (found,wDevice,ioState) = IOStGetDevice WindowDevice ioState
| not found
= ioState
# wHs = WindowSystemStateGetWindowHandles wDevice
# (found,wsH,wHs) = getWindowHandlesWindow (toWID wId) wHs
| not found
= IOStSetDevice (WindowSystemState wHs) ioState
// Mike //
# (wKind,wsH) = getWindowStateHandleWindowKind wsH
| wKind==IsGameWindow
= IOStSetDevice (WindowSystemState (setWindowHandlesWindow wsH wHs)) ioState
///
| otherwise
# (tb,ioState) = getIOToolbox ioState
# (wsH,tb) = openpopupcontrolitems popUpId index items wsH tb
# ioState = setIOToolbox tb ioState
= IOStSetDevice (WindowSystemState (setWindowHandlesWindow wsH wHs)) ioState
where
openpopupcontrolitems :: !Id !Index ![PopUpControlItem (PSt .l)] !(WindowStateHandle (PSt .l)) !*OSToolbox
-> (!WindowStateHandle (PSt .l), !*OSToolbox)
openpopupcontrolitems popUpId index items wsH=:{wshIds={wPtr},wshHandle=Just wlsH=:{wlsHandle=wH}} tb
# (wH,tb) = openpopupitems popUpId index items wPtr wH tb
= ({wsH & wshHandle=Just {wlsH & wlsHandle=wH}},tb)
openpopupcontrolitems _ _ _ _ _
= StdControlFatalError "openPopUpControlItems" "unexpected window placeholder argument"
/* closeControls closes the controls in the indicated window.
*/
closeControls :: !Id [Id] !Bool !(IOSt .l) -> IOSt .l
closeControls wId ids relayout ioState
# (found,wDevice,ioState) = IOStGetDevice WindowDevice ioState
| not found
= ioState
# wHs = WindowSystemStateGetWindowHandles wDevice
# (found,wsH,wHs) = getWindowHandlesWindow (toWID wId) wHs
| not found
= IOStSetDevice (WindowSystemState wHs) ioState
// Mike //
# (wKind,wsH) = getWindowStateHandleWindowKind wsH
| wKind==IsGameWindow
= IOStSetDevice (WindowSystemState (setWindowHandlesWindow wsH wHs)) ioState
///
| otherwise
# (wMetrics,ioState) = IOStGetOSWindowMetrics ioState
# (tb,ioState) = getIOToolbox ioState
# (freeRIds,freeIds,disposeFun,wsH,tb) = closecontrols wMetrics ids relayout wsH tb
# ioState = setIOToolbox tb ioState
# ioState = unbindRIds freeRIds ioState
# (idtable,ioState) = IOStGetIdTable ioState
(_,idtable) = removeIdsFromIdTable (freeRIds++freeIds) idtable
# ioState = IOStSetIdTable idtable ioState
# (f,ioState) = IOStGetInitIO ioState
# ioState = IOStSetInitIO ((appPIO (appIOToolbox disposeFun)) o f) ioState
= IOStSetDevice (WindowSystemState (setWindowHandlesWindow wsH wHs)) ioState
/* closeAllControls closes all controls from the indicated window.
*/
closeAllControls :: !Id !(IOSt .l) -> IOSt .l
closeAllControls wId ioState
# (found,wDevice,ioState) = IOStGetDevice WindowDevice ioState
| not found
= ioState
# wHs = WindowSystemStateGetWindowHandles wDevice
# (found,wsH,wHs) = getWindowHandlesWindow (toWID wId) wHs
| not found
= IOStSetDevice (WindowSystemState wHs) ioState
| otherwise
# (tb,ioState) = getIOToolbox ioState
# (freeRIds,freeIds,disposeFun,wsH,tb) = closeallcontrols wsH tb
# ioState = setIOToolbox tb ioState
# ioState = unbindRIds freeRIds ioState
# (idtable,ioState) = IOStGetIdTable ioState
(_,idtable) = removeIdsFromIdTable (freeRIds++freeIds) idtable
# ioState = IOStSetIdTable idtable ioState
# (f,ioState) = IOStGetInitIO ioState
# ioState = IOStSetInitIO ((appPIO (appIOToolbox disposeFun)) o f) ioState
= IOStSetDevice (WindowSystemState (setWindowHandlesWindow wsH wHs)) ioState
/* closePopUpControlItems closes items from the indicated PopUpControl in the indicated window/dialogue.
*/
closePopUpControlItems :: !Id ![Index] !(IOSt .l) -> IOSt .l
closePopUpControlItems popUpId indexs ioState
| isEmpty indexs
= ioState
# (maybeId,ioState) = getParentWindowId popUpId ioState
| isNothing maybeId
= ioState
# (found,wDevice,ioState) = IOStGetDevice WindowDevice ioState
| not found
= ioState
# wHs = WindowSystemStateGetWindowHandles wDevice
(found,wsH,wHs) = getWindowHandlesWindow (toWID (fromJust maybeId)) wHs
| not found
= IOStSetDevice (WindowSystemState wHs) ioState
| otherwise
# (tb,ioState) = getIOToolbox ioState
# (wsH,tb) = closepopupcontrolitems popUpId indexs wsH tb
# ioState = setIOToolbox tb ioState
= IOStSetDevice (WindowSystemState (setWindowHandlesWindow wsH wHs)) ioState
where
closepopupcontrolitems :: !Id ![Index] !(WindowStateHandle (PSt .l)) !*OSToolbox
-> (!WindowStateHandle (PSt .l), !*OSToolbox)
closepopupcontrolitems popUpId indexs wsH=:{wshIds={wPtr},wshHandle=Just wlsH=:{wlsHandle=wH}} tb
# (wH,tb) = closepopupitems popUpId indexs wPtr wH tb
= ({wsH & wshHandle=Just {wlsH & wlsHandle=wH}},tb)
closepopupcontrolitems _ _ _ _
= StdControlFatalError "closepopupcontrolitems" "unexpected window placeholder argument"
/* setControlPos changes the position of the indicated control.
*/
setControlPos :: !Id ![(Id,ItemPos)] !(IOSt .l) -> (!Bool,!IOSt .l)
setControlPos wId newPoss ioState
# (found,wDevice,ioState) = IOStGetDevice WindowDevice ioState
| not found
= (False,ioState)
# wHs = WindowSystemStateGetWindowHandles wDevice
# (found,wsH,wHs) = getWindowHandlesWindow (toWID wId) wHs
| not found
= (False,IOStSetDevice (WindowSystemState wHs) ioState)
// Mike //
# (wKind,wsH) = getWindowStateHandleWindowKind wsH
| wKind==IsGameWindow
= (False,IOStSetDevice (WindowSystemState (setWindowHandlesWindow wsH wHs)) ioState)
///
| otherwise
# (wMetrics,ioState) = IOStGetOSWindowMetrics ioState
# (tb,ioState) = getIOToolbox ioState
# (ok,wsH,tb) = setcontrolpositions wMetrics newPoss wsH tb
# ioState = setIOToolbox tb ioState
wHs = setWindowHandlesWindow wsH wHs
= (ok,IOStSetDevice (WindowSystemState wHs) ioState)
// Show/Hide controls.
showControls :: ![Id] !(IOSt .l) -> IOSt .l
......@@ -456,7 +751,7 @@ snd3thd3 tuple :== (t2,t3) where (_,t2,t3) = tuple
getControlLayouts :: ![Id] !WState -> [(Bool,(Maybe ItemPos,Vector2))]
getControlLayouts ids wstate
= map snd3thd3 (snd (getcontrolslayouts (getWStateControls wstate) (ids,map (\id->(id,defaultBool,defaultValue)) ids)))
= map snd3thd3 (snd (getcontrolslayouts (getWStateControls wstate) (ids,[(id,defaultBool,defaultValue) \\ id<-ids])))
where
defaultBool = False
defaultValue= (Nothing,zero)
......@@ -466,7 +761,7 @@ getControlLayout id wstate = hd (getControlLayouts [id] wstate)
getControlViewSizes :: ![Id] !WState -> [(Bool,Size)]
getControlViewSizes ids wstate=:{wMetrics}
= map snd3thd3 (snd (getcontrolsviewsizes wMetrics (getWStateControls wstate) (ids,map (\id->(id,defaultBool,defaultValue)) ids)))
= map snd3thd3 (snd (getcontrolsviewsizes wMetrics (getWStateControls wstate) (ids,[(id,defaultBool,defaultValue) \\ id<-ids])))
where
defaultBool = False
defaultValue= zero
......@@ -476,7 +771,7 @@ getControlViewSize id wstate = hd (getControlViewSizes [id] wstate)
getControlOuterSizes :: ![Id] !WState -> [(Bool,Size)]
getControlOuterSizes ids wstate=:{wMetrics}
= map snd3thd3 (snd (getcontrolsoutersizes wMetrics (getWStateControls wstate) (ids,map (\id->(id,defaultBool,defaultValue)) ids)))
= map snd3thd3 (snd (getcontrolsoutersizes wMetrics (getWStateControls wstate) (ids,[(id,defaultBool,defaultValue) \\ id<-ids])))
where
defaultBool = False
defaultValue= zero
......@@ -486,7 +781,7 @@ getControlOuterSize id wstate = hd (getControlOuterSizes [id] wstate)
getControlSelectStates :: ![Id] !WState -> [(Bool,SelectState)]
getControlSelectStates ids wstate
= map snd3thd3 (snd (getcontrolsselects (getWStateControls wstate) (ids,map (\id->(id,defaultBool,defaultValue)) ids)))
= map snd3thd3 (snd (getcontrolsselects (getWStateControls wstate) (ids,[(id,defaultBool,defaultValue) \\ id<-ids])))
where
defaultBool = False
defaultValue= Able
......@@ -496,7 +791,7 @@ getControlSelectState id wstate = hd (getControlSelectStates [id] wstate)
getControlShowStates :: ![Id] !WState -> [(Bool,Bool)]
getControlShowStates ids wstate
= map snd3thd3 (snd (getcontrolsshowstates (getWStateControls wstate) (ids,map (\id->(id,defaultBool,defaultValue)) ids)))
= map snd3thd3 (snd (getcontrolsshowstates (getWStateControls wstate) (ids,[(id,defaultBool,defaultValue) \\ id<-ids])))
where
defaultBool = False
defaultValue= False
......@@ -506,7 +801,7 @@ getControlShowState id wstate = hd (getControlShowStates [id] wstate)
getControlTexts :: ![Id] !WState -> [(Bool,Maybe String)]
getControlTexts ids wstate
= map snd3thd3 (snd (getcontrolstexts (getWStateControls wstate) (ids,map (\id->(id,defaultBool,defaultValue)) ids)))
= map snd3thd3 (snd (getcontrolstexts (getWStateControls wstate) (ids,[(id,defaultBool,defaultValue) \\ id<-ids])))
where
defaultBool = False
defaultValue= Nothing
......@@ -516,7 +811,7 @@ getControlText id wstate = hd (getControlTexts [id] wstate)
getControlNrLines :: ![Id] !WState -> [(Bool,Maybe NrLines)]
getControlNrLines ids wstate
= map snd3thd3 (snd (getcontrolsnrlines (getWStateControls wstate) (ids,map (\id->(id,defaultBool,defaultValue)) ids)))
= map snd3thd3 (snd (getcontrolsnrlines (getWStateControls wstate) (ids,[(id,defaultBool,defaultValue) \\ id<-ids])))
where
defaultBool = False
defaultValue= Nothing
......@@ -526,7 +821,7 @@ getControlNrLine id wstate = hd (getControlNrLines [id] wstate)
getControlLooks :: ![Id] !WState -> [(Bool,Maybe (Bool,Look))]
getControlLooks ids wstate
= map snd3thd3 (snd (getcontrolslooks (getWStateControls wstate) (ids,map (\id->(id,defaultBool,defaultValue)) ids)))
= map snd3thd3 (snd (getcontrolslooks (getWStateControls wstate) (ids,[(id,defaultBool,defaultValue) \\ id<-ids])))
where
defaultBool = False
defaultValue= Nothing
......@@ -536,7 +831,7 @@ getControlLook id wstate = hd (getControlLooks [id] wstate)
getControlMinimumSizes :: ![Id] !WState -> [(Bool,Maybe Size)]
getControlMinimumSizes ids wstate
= map snd3thd3 (snd (getcontrolsminsizes (getWStateControls wstate) (ids,map (\id->(id,defaultBool,defaultValue)) ids)))
= map snd3thd3 (snd (getcontrolsminsizes (getWStateControls wstate) (ids,[(id,defaultBool,defaultValue) \\ id<-ids])))
where
defaultBool = False
defaultValue= Nothing
......@@ -546,7 +841,7 @@ getControlMinimumSize id wstate = hd (getControlMinimumSizes [id] wstate)