Commit caf137b9 authored by Rinus Plasmeijer's avatar Rinus Plasmeijer
Browse files

*** empty log message ***

parent 322cc2bf
......@@ -188,14 +188,19 @@ layoutListForm :: !([BodyTag] [BodyTag] -> [BodyTag])
!(!(InIDataId a) !*HSt -> (Form a,*HSt))
!(InIDataId [a]) !*HSt -> (Form [a],!*HSt) | gForm{|*|}, gUpd{|*|}, gPrint{|*|}, gParse{|*|}, TC a
layoutListForm layoutF formF (init,formid) hst
= case formid.ival of
[] = ({changed = False
# (store,hst) = mkStoreForm (init,formid) id hst // enables to store list with different # elements
# (layout,hst) = layoutListForm` 0 store.value hst
# (store,hst) = mkStoreForm (init,formid) (\list -> layout.value) hst
= (layout,hst)
where
layoutListForm` n [] hst
= ({changed = False
,value = []
,form = []
},hst)
[x:xs]
# (nxs,hst) = layoutListForm layoutF formF (init,setFormId formid xs) hst
# (nx, hst) = formF (init,subFormId formid (toString (length xs)) x) hst
layoutListForm` n [x:xs] hst
# (nxs,hst) = layoutListForm` (n+1) xs hst
# (nx, hst) = formF (init,subFormId formid (toString (n+1)) x) hst
= ({changed = nx.changed || nxs.changed
,value = [nx.value:nxs.value]
,form = layoutF nx.form nxs.form
......@@ -437,7 +442,7 @@ where
++
take nbuttuns [(setmode i index,sbut (toString (i)),set i) \\ i <- [startval,startval+step .. length-1]]
++
if (startval + range < length - 1) [(formid.mode,sbut "++", set (startval + range))] []
if (startval + range < length ) [(formid.mode,sbut "++", set (startval + range))] []
where
set j i = j
range = nbuttuns * step
......
......@@ -28,7 +28,9 @@ mkViewForm :: !(Init,FormId d) !(HBimap d v) !*HSt -> (Form d,!*HSt) | gForm{|
generic gForm a :: !(FormId a) !*HSt -> *(Form a, !*HSt)
generic gUpd a :: UpdMode a -> (UpdMode,a)
:: UpdMode
:: UpdMode = UpdSearch UpdValue Int // search for indicated postion and update it
| UpdCreate [ConsPos] // create new values if necessary
| UpdDone // and just copy the remaining stuff
derive bimap Form, FormId
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment