|
From: <kr_...@us...> - 2003-03-26 10:38:37
|
Update of /cvsroot/htoolkit/gio/src/Graphics/UI/GIO
In directory sc8-pr-cvs1:/tmp/cvs-serv11160/src/Graphics/UI/GIO
Added Files:
CommonDialogs.hs Messages.hs
Removed Files:
FileDialog.hs
Log Message:
FileDialog module is renamed to CommonDialogs. The CommonDialog exports all file related dialogs and dialogs for Font and Color selection. The Messages module exports all message alerts
--- NEW FILE: CommonDialogs.hs ---
-----------------------------------------------------------------------------------------
{-| Module : CommonDialogs
Copyright : (c) Krasimir Angelov 2003
License : BSD-style
Maintainer : ka2...@ya...
Stability : provisional
Portability : portable
Common dialogs.
-}
-----------------------------------------------------------------------------------------
module Graphics.UI.GIO.CommonDialogs
( runDirectoryDialog
, runInputFileDialog
, runOutputFileDialog
, runFontDialog
, runColorDialog
) where
import Graphics.UI.GIO.Types
import qualified Graphics.UI.Port as Lib
{--------------------------------------------------------------------
Just simple wrappers
--------------------------------------------------------------------}
-- | Run a dialog to select an input file. Returns 'Nothing' when cancelled.
runInputFileDialog :: IO (Maybe String)
runInputFileDialog = Lib.runInputFileDialog
-- | Run a dialog to select an output file. Takes both a prompt message and a
-- suggested filename as arguments. Returns 'Nothing' when cancelled.
runOutputFileDialog :: String -> String -> IO (Maybe String)
runOutputFileDialog = Lib.runOutputFileDialog
-- | Runs a dialog to select a directory. Returns 'Nothing' when cancelled.
runDirectoryDialog :: IO (Maybe String)
runDirectoryDialog = Lib.runDirectoryDialog
-- | Run a dialog to select a font. Returns 'Nothing' when cancelled.
runFontDialog :: IO (Maybe FontDef)
runFontDialog = Lib.runFontDialog
-- | Run a dialog to select a color. Returns 'Nothing' when cancelled.
runColorDialog :: IO (Maybe Color)
runColorDialog = Lib.runColorDialog
--- NEW FILE: Messages.hs ---
-----------------------------------------------------------------------------------------
{-| Module : Messages
Copyright : (c) Krasimir Angelov 2003
License : BSD-style
Maintainer : ka2...@ya...
Stability : provisional
Portability : portable
The message functions create, display, and operate a message box. The
message box contains an application-defined message and any combination
of predefined icons and push buttons.
-}
-----------------------------------------------------------------------------------------
module Graphics.UI.GIO.Messages
( messageAlert
, messageConfirm
, messageWarning
, messageQuestion
, messageError
, QuestionAnswer(..)
, messageCancelQuestion
, messageConfirmSave
) where
import Graphics.UI.Port (QuestionAnswer(..))
import qualified Graphics.UI.Port as Lib
-- | The messageAlert box provides an OK button and an image which indicates that
-- the given message is just for information.
messageAlert :: String -> IO ()
messageAlert = Lib.messageAlert
-- | The messageConfirm box, like the 'messageAlert' box provides an OK button, and in addition
-- a Cancel button. An image indicates that the given message is just for information.
-- The function returns True when the box is closed with the OK button; in all other cases it returns False.
messageConfirm :: String -> IO Bool
messageConfirm = Lib.messageConfirm
-- | The messageWarning box provides an OK button and an image which indicates that
-- the given message is a warning.
messageWarning :: String -> IO ()
messageWarning = Lib.messageWarning
-- | The messageQuestion box provides Yes and No buttons and an image which indicates that
-- the given message is a question. The function returns True for Yes button and False for No answer.
messageQuestion :: String -> IO Bool
messageQuestion = Lib.messageQuestion
-- | The messageError box provides OK and Cancel buttons and an image which indicates that
-- it is an error message. The function returns True when the box is closed
-- with the OK button; in all other cases it returns False.
messageError :: String -> IO Bool
messageError = Lib.messageError
-- | The messageCancelQuestion box like the 'messageQuestion' box provides an Yes and No buttons,and in addition
-- a Cancel button. An image indicates that the given message is a question.
messageCancelQuestion :: String -> IO QuestionAnswer
messageCancelQuestion = Lib.messageCancelQuestion
-- | The messageConfirmSave box is applicable when the application asks whether the document should be saved or not.
messageConfirmSave :: String -> IO QuestionAnswer
messageConfirmSave = Lib.messageConfirmSave
--- FileDialog.hs DELETED ---
|