Source codeContentsIndex
GenGUI
Description
A generic graphical user interface.
Synopsis
data GenGUI c
newGenGUI :: (CItem c) => Maybe (GenGUIState c) -> Bool -> IO (GenGUI c)
setStatus :: (CItem c) => GenGUI c -> String -> IO ()
clearStatus :: (CItem c) => GenGUI c -> IO ()
updateTextArea :: (CItem c) => GenGUI c -> [MarkupText] -> IO ()
clearTextArea :: (CItem c) => GenGUI c -> IO ()
genGUIMainMenu :: (CItem c) => GenGUI c -> Menu
data NewItem c
= LeafItem c (Maybe (Position, Bool))
| FolderItem c [NewItem c] (Maybe (Bool, Bool))
data Item c
data Name = Name {
short :: (Int -> String)
full :: String
}
class (Eq c) => CItem c where
getName :: c -> IO Name
getIcon :: c -> IO Image
root :: (CItem c) => GenGUI c -> IO (Item c)
openedFolder :: (CItem c) => GenGUI c -> IO (Maybe (Item c))
addItem :: (CItem c) => GenGUI c -> Item c -> NewItem c -> IO (Item c)
children :: (CItem c) => Item c -> IO [Item c]
content :: (CItem c) => Item c -> c
data GenGUIEvent c
= FocusTreeList (Maybe (Item c))
| SelectTreeList (Maybe (Item c))
| FocusNotepad (Item c, Bool)
| Dropped (Item c, [Item c])
| Doubleclick (Item c)
| Rightclick [Item c]
| Addition (Item c)
| DroppedOnTextArea [Item c]
bindGenGUIEv :: (CItem c) => GenGUI c -> IO (Event (GenGUIEvent c), IO ())
type GenGUIState c = [NewItem c]
exportGenGUIState :: (CItem c) => GenGUI c -> IO (GenGUIState c)
Documentation
data GenGUI c
The GenGUI datatye.
newGenGUI
:: (CItem c)
=> Maybe (GenGUIState c) an optional GenGUI state to recover.
-> Bool True if lleaves should be displayed in the tree list.
-> IO (GenGUI c) A gui.
Constructs a new gui and returns a handler.
setStatus :: (CItem c) => GenGUI c -> String -> IO ()
Sets the status label's text.
clearStatus :: (CItem c) => GenGUI c -> IO ()
Clears the status label.
updateTextArea :: (CItem c) => GenGUI c -> [MarkupText] -> IO ()
Displays the given markup text on the editor pane.
clearTextArea :: (CItem c) => GenGUI c -> IO ()
Clears the editor pane.
genGUIMainMenu :: (CItem c) => GenGUI c -> Menu
Gets the gui's menu container.
data NewItem c
External representation of gengui objects.
Constructors
LeafItem c (Maybe (Position, Bool))
FolderItem c [NewItem c] (Maybe (Bool, Bool))
data Item c
internal object representation
data Name
The Name datatype.
Constructors
Name
short :: (Int -> String)
full :: String
class (Eq c) => CItem c where
Objects with a name and an icon.
Methods
getName :: c -> IO Name
Gets the object's name.
getIcon :: c -> IO Image
Gets the object's icon.
Instances
(CItem c) => CItem (Item c)
root :: (CItem c) => GenGUI c -> IO (Item c)
GenGUI's root object.
openedFolder :: (CItem c) => GenGUI c -> IO (Maybe (Item c))
Gets the item that is currently open (displayed on notepad).
addItem
:: (CItem c)
=> GenGUI c the concerned gui.
-> Item c the parent (folder) object.
-> NewItem c the external representation of the new object.
-> IO (Item c) the internal representation of the new object.
Adds a gengui object.
children :: (CItem c) => Item c -> IO [Item c]
Gets the children from a folder item.
content :: (CItem c) => Item c -> c
Returns the CItem content of an item.
data GenGUIEvent c
The GenGUIEvent datatype.
Constructors
FocusTreeList (Maybe (Item c))
SelectTreeList (Maybe (Item c))
FocusNotepad (Item c, Bool)
Dropped (Item c, [Item c])
Doubleclick (Item c)
Rightclick [Item c]
Addition (Item c)
DroppedOnTextArea [Item c]
bindGenGUIEv
:: (CItem c)
=> GenGUI c the concerned gui.
-> IO (Event (GenGUIEvent c), IO ()) A pair of (event, unbind action).
Binds a listener for gengui events to the gengui and returns a corresponding event and an unbind action.
type GenGUIState c = [NewItem c]
The gui's state.
exportGenGUIState
:: (CItem c)
=> GenGUI c the concerned GenGUI.
-> IO (GenGUIState c) the gui's state.
Exports the gui's state.
Produced by Haddock version 0.3