Subversion

guisurfer_software

[/] [MainForm.hs] - Rev 1 Go to most recent revision

Compare with Previous - Blame


module MainForm where

import Graphics.UI.WX
import Graphics.UI.WXCore

import Find
import ContactEditor

mainForm :: IO ()
mainForm
  = do -- the application frame
       fr      <- frame         [text := "MainForm"]                               
       pn      <- panel fr []

       -- create file menu  
       file   <- menuPane      [text := "&File"]
       quit   <- menuQuit file [help := "Quit the demo", on command := close fr]

       -- create Help menu
       hlp    <- menuHelp      []
       about  <- menuAbout hlp [help := "About wxHaskell"]

      
       tc <- textCtrl pn []
 
       find   <- button pn [text := "Find", on command :=do {close fr; start find}]
       edit <- button pn [text := "Edit", on command :=do {close fr; start contactEditor}]
       exit <- button pn [text := "Exit", on command := close fr]


       rb   <- radioBox pn Horizontal ["E-mail","Name"]   [text := "Format:"]
       
       -- create statusbar field
       --st <- statusField   [text := "v0.0"]

       -- set the statusbar and menubar
       set fr [ --statusBar := [st],
               layout :=  container pn $ margin 10 $ column 5 [row 5 [widget tc, column 5 [widget find, widget edit, widget exit]], 
                                                               widget rb
                                                              ]
             , menuBar   := [file,hlp]
             -- as an example, put the menu event handler for an about box on the frame.
             ,on (menu about) := infoDialog fr "About wxHaskell" "This is a wxHaskell demo"
              ]



Theme by Vikram Singh | Powered by WebSVN v1.61