Commit 6fab2a6d authored by Rinus Plasmeijer's avatar Rinus Plasmeijer
Browse files

*** empty log message ***

parent 570378a5
......@@ -156,17 +156,24 @@ derive gParse Single
derive gPrint Single
derive gerda Single
agenda2 = \tst -> agenda` (PullDown (1,100) (0,[toString i \\ i <- [0..10]]) ) tst
instance toString (a,b) | toString a & toString b
where
agenda` date tst
# (date,tst) = STask "SetDate" date tst
# (who,tst) = STask "AskPerson" (PullDown (1,100) (0,[toString i \\ i <- [0..5]])) tst
# ((ok,date),tst) = ((toInt (toString who),"Meeting Request") @: handle date) tst
| ok = returnTask date tst
toString (a,b) = "(" <+++ a <+++ "," <+++ b <+++ ")"
agenda2 = \tst -> agenda` 0 ( Date 0 0 0, Time 0 0 0
) tst
where
agenda` who date tst
# (date,tst) = STask "SetDateAndTime" date tst
# (whoPd,tst) = STask "AskPerson" (PullDown (1,100) (who,[toString i \\ i <- [0..10]])) tst
# ((ok,date),tst) = ((toInt (toString whoPd),"Meeting Request") @: handle date) tst
| ok
# tst = returnF [Txt "Proposal accepted",Br] tst
= returnTask date tst
# tst = returnF [Txt ("No, but can we meet on the " <+++ date <+++ "?"),Br] tst
# (ok,tst) = CTask_button [("Accept",returnV True),("Sorry",returnV False)] tst
| ok = returnV date tst
= mkTask (agenda` date) tst
= mkTask (agenda` (toInt(toString whoPd)) date) tst
where
handle date tst
# tst = returnF [Txt ("Can we meet on the " <+++ date <+++ "?"),Br] tst
......
......@@ -16,6 +16,7 @@ instance toInt PullDownMenu // Current index in pull down list
instance toString PullDownMenu // Corresponding element in pull down list
instance == PasswordBox, HtmlDate, HtmlTime
instance < HtmlDate, HtmlTime
instance toString HtmlDate, HtmlTime
// lay out
:: <-> a b = (<->) infixl 5 a b // place b to the left of a
......
......@@ -428,6 +428,11 @@ where
| hrs0 == hrs1 && min0 < min1 = True
| hrs0 == hrs1 && min0 == min1 && sec0 < sec1 = True
= False
instance toString HtmlTime
where
toString (Time hrs min sec) = toString hrs <+++ ":" <+++ min <+++ ":" <+++ sec
instance == HtmlDate
where
......@@ -440,3 +445,8 @@ where
| year0 == year1 && month0 < month1 = True
| year0 == year1 && month0 == month1 && day0 < day1 = True
= False
instance toString HtmlDate
where
toString (Date day month year) = toString day <+++ "/" <+++ month <+++ "/" <+++ year
......@@ -276,8 +276,6 @@ where
| not activated = tst // not active, return default value
= {tst & html = html +|+ BT bodytag} // active, so perform task or get its result
mkRTask :: String (Task a) *TSt -> ((Task a,Task a),*TSt) | iData a
mkRTask s task tst = let (a,b,c) = mkRTask` s task (incTask tst) in ((a,b),c)
where
......
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