Commit 0a6ab3fd authored by Bas Lijnse's avatar Bas Lijnse

Added a new HtmlLabel widget type to fix the layout in the date example

git-svn-id: https://svn.cs.ru.nl/repos/iTask-system/branches/fancyTasks@309 63da3aa8-80fd-4f01-9db8-e6ea747a3da2
parent f99e77d0
......@@ -8,11 +8,11 @@ import iDataForms
import Html
import GenLexOrd
derive gForm HtmlTag, HtmlAttr, <->, <|>, DisplayMode, HtmlButton, HtmlCheckbox, HtmlSelect, HtmlTextarea, HtmlPassword, HtmlDate, HtmlTime, RefreshTimer
derive gUpd HtmlTag, HtmlAttr, <->, <|>, DisplayMode, HtmlButton, HtmlCheckbox, HtmlSelect, HtmlTextarea, HtmlPassword, HtmlDate, HtmlTime, RefreshTimer
derive gPrint HtmlTag, HtmlAttr, <->, <|>, DisplayMode, HtmlButton, HtmlCheckbox, HtmlSelect, HtmlTextarea, HtmlPassword, HtmlDate, HtmlTime, RefreshTimer
derive gParse HtmlTag, HtmlAttr, <->, <|>, DisplayMode, HtmlButton, HtmlCheckbox, HtmlSelect, HtmlTextarea, HtmlPassword, HtmlDate, HtmlTime, RefreshTimer
derive gerda HtmlTag, HtmlAttr, <->, <|>, DisplayMode, HtmlButton, HtmlCheckbox, HtmlSelect, HtmlTextarea, HtmlPassword, HtmlDate, HtmlTime, RefreshTimer
derive gForm HtmlTag, HtmlAttr, <->, <|>, DisplayMode, HtmlButton, HtmlCheckbox, HtmlSelect, HtmlTextarea, HtmlPassword, HtmlDate, HtmlTime, HtmlLabel, RefreshTimer
derive gUpd HtmlTag, HtmlAttr, <->, <|>, DisplayMode, HtmlButton, HtmlCheckbox, HtmlSelect, HtmlTextarea, HtmlPassword, HtmlDate, HtmlTime, HtmlLabel, RefreshTimer
derive gPrint HtmlTag, HtmlAttr, <->, <|>, DisplayMode, HtmlButton, HtmlCheckbox, HtmlSelect, HtmlTextarea, HtmlPassword, HtmlDate, HtmlTime, HtmlLabel, RefreshTimer
derive gParse HtmlTag, HtmlAttr, <->, <|>, DisplayMode, HtmlButton, HtmlCheckbox, HtmlSelect, HtmlTextarea, HtmlPassword, HtmlDate, HtmlTime, HtmlLabel, RefreshTimer
derive gerda HtmlTag, HtmlAttr, <->, <|>, DisplayMode, HtmlButton, HtmlCheckbox, HtmlSelect, HtmlTextarea, HtmlPassword, HtmlDate, HtmlTime, HtmlLabel, RefreshTimer
//derive read HtmlTag, HtmlAttr, <->, <|>, DisplayMode, HtmlButton, HtmlCheckbox, HtmlSelect, HtmlTextarea, HtmlPassword, HtmlDate, HtmlTime, RefreshTimer
//derive write HtmlTag, HtmlAttr, <->, <|>, DisplayMode, HtmlButton, HtmlCheckbox, HtmlSelect, HtmlTextarea, HtmlPassword, HtmlDate, HtmlTime, RefreshTimer
......@@ -40,6 +40,7 @@ derive gerda HtmlTag, HtmlAttr, <->, <|>, DisplayMode, HtmlButton, HtmlCheckbox
:: HtmlDate = HtmlDate Int Int Int // Day Month Year
:: HtmlTime = HtmlTime Int Int Int // Hours Minutes Seconds
:: HtmlLabel = HtmlLabel [HtmlTag] // Label used for showing html
//TODO: Change this hacked input, to a nicer way of auto refreshing forms
:: RefreshTimer = RefreshTimer Int // The editor for this type refreshes it's form after n milliseconds
......
......@@ -7,9 +7,9 @@ import iDataForms, iDataFormlib, iDataTrivial, StdBimap
derive gForm [], HtmlTag, HtmlAttr
derive gUpd [], HtmlTag, HtmlAttr, <->, <|>, DisplayMode, HtmlDate, HtmlTime
derive gPrint HtmlTag, HtmlAttr, <->, <|>, DisplayMode, HtmlButton, HtmlCheckbox, HtmlSelect, HtmlTextarea, HtmlPassword, HtmlDate, HtmlTime, RefreshTimer
derive gParse HtmlTag, HtmlAttr, <->, <|>, DisplayMode, HtmlButton, HtmlCheckbox, HtmlSelect, HtmlTextarea, HtmlPassword, HtmlDate, HtmlTime, RefreshTimer
derive gerda HtmlTag, HtmlAttr, <->, <|>, DisplayMode, HtmlButton, HtmlCheckbox, HtmlSelect, HtmlTextarea, HtmlPassword, HtmlDate, HtmlTime, RefreshTimer
derive gPrint HtmlTag, HtmlAttr, <->, <|>, DisplayMode, HtmlButton, HtmlCheckbox, HtmlSelect, HtmlTextarea, HtmlPassword, HtmlDate, HtmlTime, HtmlLabel, RefreshTimer
derive gParse HtmlTag, HtmlAttr, <->, <|>, DisplayMode, HtmlButton, HtmlCheckbox, HtmlSelect, HtmlTextarea, HtmlPassword, HtmlDate, HtmlTime, HtmlLabel, RefreshTimer
derive gerda HtmlTag, HtmlAttr, <->, <|>, DisplayMode, HtmlButton, HtmlCheckbox, HtmlSelect, HtmlTextarea, HtmlPassword, HtmlDate, HtmlTime, HtmlLabel, RefreshTimer
//derive read HtmlTag, HtmlAttr, <->, <|>, DisplayMode, HtmlButton, HtmlCheckbox, HtmlDate, HtmlTime, RadioButton, RadioGroup, PullDownMenu, TextInput, TextArea, PasswordBox, RefreshTimer
//derive write HtmlTag, HtmlAttr, <->, <|>, DisplayMode, HtmlButton, HtmlCheckbox, HtmlDate, HtmlTime, RadioButton, RadioGroup, PullDownMenu, TextInput, TextArea, PasswordBox, RefreshTimer
......@@ -166,7 +166,15 @@ where
where
convert (HtmlSelect _ x)= toInt x
gForm {|HtmlLabel|} (init, formid) hst
= ({ changed = False
, value = formid.ival
, form = html
, inputs = []
},hst)
where
(HtmlLabel html) = formid.ival
//TODO: FIX. toClean no longer exists
gForm {|RefreshTimer|} (init,formid) hst = case formid.ival of
RefreshTimer timeout
......@@ -210,6 +218,10 @@ gUpd{|RefreshTimer|} (UpdSearch cntr upd) cur = (UpdSearch (dec cntr) upd,
gUpd{|RefreshTimer|} (UpdCreate l) _ = (UpdCreate l, RefreshTimer 0) // create default value
gUpd{|RefreshTimer|} mode cur = (mode, cur) // don't change
gUpd{|HtmlLabel|} (UpdSearch 0 upd) cur = (UpdDone, cur) // We don't update
gUpd{|HtmlLabel|} (UpdSearch cntr upd) cur = (UpdSearch cntr upd, cur) // continue search, don't change
gUpd{|HtmlLabel|} (UpdCreate l) _ = (UpdCreate l, HtmlLabel []) // create default value
gUpd{|HtmlLabel|} mode cur = (mode, cur)
// small utility stuf
......
......@@ -43,7 +43,7 @@ where
?>> editTask "Set" input
=>> \(_,date,_,time) -> return_V (date,time)
where
input = (toString (Text "date: "), date, toString (Text "time: "), time)
input = (HtmlLabel [Text "date: "], date, HtmlLabel [Text "time: "], time)
determineDateTime :: (HtmlDate,HtmlTime) -> Task (Bool,(HtmlDate,HtmlTime))
determineDateTime daytime
......
Markdown is supported
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