From: <kr_...@us...> - 2003-11-24 22:41:31
|
Update of /cvsroot/htoolkit/gio/src/Graphics/UI/GIO In directory sc8-pr-cvs1:/tmp/cvs-serv6285/src/Graphics/UI/GIO Modified Files: Controls.hs Log Message: Add support for DateEntry control Index: Controls.hs =================================================================== RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/Controls.hs,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** Controls.hs 23 Nov 2003 16:29:13 -0000 1.40 --- Controls.hs 24 Nov 2003 22:41:28 -0000 1.41 *************** *** 31,34 **** --- 31,38 ---- , Entry, entry, readOnly, password + -- * DateEntry + -- | A date entry control is a rectangular widget in which the user can enter a date. + , DateEntry, dateEntry + -- * Choice & Popup -- | The choice control consists of a list box combined with a label control. *************** *** 126,129 **** --- 130,134 ---- import Graphics.UI.GIO.Layout import Control.Monad(when, mapM_, filterM) + import System.Time(ClockTime) -------------------------------------------------------------------- *************** *** 264,267 **** --- 269,298 ---- password :: Attr Entry Bool password = newStdAttr ehandle Port.getEditPassword Port.setEditPassword + + -------------------------------------------------------------------- + -- DateEntry + -------------------------------------------------------------------- + -- | A date entry control. + data DateEntry = DateEntry + { dehandle :: !WindowHandle + , deparent :: !WindowHandle + } + + -- | Create an entry. + dateEntry :: Container w => [Prop DateEntry] -> w -> IO DateEntry + dateEntry props w = do + de <- do hentry <- Port.createDateEntry (hwindow w) + return (DateEntry hentry (hwindow w)) + set de props + return de + + instance Tipped DateEntry where + tooltip = newStdAttr dehandle Port.getControlTip Port.setControlTip + + instance Control DateEntry where + pack = stdPack deparent dehandle Port.getDateEntryRequestSize + + instance Valued DateEntry ClockTime where + value = newStdAttr dehandle Port.getDateEntryValue Port.setDateEntryValue -------------------------------------------------------------------- |