Source codeContentsIndex
Notepad
Description
A simple drag and drop field.
Synopsis
data Notepad a
data NotepadItem a
newNotepad :: (CItem c, Container par) => par -> ScrollType -> Size -> Maybe (NotepadState c) -> [Config (Notepad c)] -> IO (Notepad c)
createNotepadItem :: (CItem c) => c -> Notepad c -> Bool -> [Config (NotepadItem c)] -> IO (NotepadItem c)
getFreeItemPosition :: (CItem c) => Notepad c -> IO Position
getItemValue :: NotepadItem a -> IO a
data ScrollType
= Scrolled
| NotScrolled
module Name
setName :: (CItem c) => NotepadItem c -> Name -> IO ()
updNotepadScrollRegion :: Notepad a -> IO ()
selectAll :: Notepad a -> IO ()
deselectAll :: Notepad a -> IO ()
selectItem :: Notepad a -> NotepadItem a -> IO ()
selectAnotherItem :: Notepad a -> NotepadItem a -> IO ()
selectItemsWithin :: Position -> Position -> Notepad a -> IO ()
deselectItem :: Notepad a -> NotepadItem a -> IO ()
getItems :: Notepad a -> IO [NotepadItem a]
getSelectedItems :: Notepad a -> IO [NotepadItem a]
isNotepadItemSelected :: Notepad a -> NotepadItem a -> IO Bool
deleteItem :: (CItem c) => Notepad c -> NotepadItem c -> IO ()
clearNotepad :: Notepad a -> IO ()
undoLastMotion :: Notepad a -> IO ()
bindNotepadEv :: Notepad a -> IO (Event (NotepadEvent a), IO ())
data NotepadEvent a
= Dropped (NotepadItem a, [NotepadItem a])
| Selected (NotepadItem a)
| Deselected (NotepadItem a)
| Doubleclick (NotepadItem a)
| Rightclick [NotepadItem a]
| ReleaseSelection
| ReleaseMovement EventInfo
data NotepadExportItem c = NotepadExportItem {
val :: c
pos :: Position
selected :: Bool
}
type NotepadState c = [NotepadExportItem c]
exportNotepadState :: (CItem c) => Notepad c -> IO (NotepadState c)
importNotepadState :: (CItem c) => Notepad c -> NotepadState c -> IO ()
module CItem
Documentation
data Notepad a
The Notepad datatype.
data NotepadItem a
The NotepadItem datatype.
newNotepad
:: (CItem c, Container par)
=> par the parent widget (which has to be a container widget).
-> ScrollType the scrolltype for this notepad.
-> Size the size of the notepad items images for this notepad.
-> Maybe (NotepadState c) an optional previous notepad state to recover.
-> [Config (Notepad c)] the list of configuration options for this notepad.
-> IO (Notepad c) A notepad.
Constructs a new notepad and returns a handler.
createNotepadItem
:: (CItem c)
=> c the notepad item's value.
-> Notepad c the concerned notepad.
-> Bool True if the notepad's scrollregion should be updated.
-> [Config (NotepadItem c)] the list of configuration options for this notepad item.
-> IO (NotepadItem c) A notepad item.
Creates a new notepad item and returns a handler.
getFreeItemPosition
:: (CItem c)
=> Notepad c the concerned notepad.
-> IO Position the free position on the notepad.
Returns a free item position on the notepad.
getItemValue :: NotepadItem a -> IO a
Gets the value from a notepad item.
data ScrollType
The ScrollType datatype.
Constructors
Scrolled
NotScrolled
module Name
setName :: (CItem c) => NotepadItem c -> Name -> IO ()
updNotepadScrollRegion :: Notepad a -> IO ()
selectAll
:: Notepad a the concerned notepad.
-> IO () None.
Selects all items inside the notepad.
deselectAll
:: Notepad a the concerned notepad.
-> IO () None.
Deselects all items inside the notepad.
selectItem
:: Notepad a the concerned notepad.
-> NotepadItem a the concerned notepad item.
-> IO () None.
Selects a specific notepad item.
selectAnotherItem
:: Notepad a the concerned notepad.
-> NotepadItem a the concerned notepad item.
-> IO () None.
Adds an item to the notepad's selection.
selectItemsWithin
:: Position the upper left coordinate of the region.
-> Position the lower right coordinate of the region.
-> Notepad a the concerned notepad.
-> IO () None.
Selects all items within the specified region.
deselectItem
:: Notepad a the concerned notepad.
-> NotepadItem a the concerned notepad item.
-> IO () None.
Deselects a notepad item.
getItems
:: Notepad a the concerned notepad.
-> IO [NotepadItem a] A list of the contained notepad items.
Gets the items from a notepad.
getSelectedItems
:: Notepad a the concerned notepad.
-> IO [NotepadItem a] A list of the selected notepad items.
Gets the selected items from a notepad.
isNotepadItemSelected
:: Notepad a the concerned notepad.
-> NotepadItem a the concerned notepad item.
-> IO Bool True if the given notepad item is selected, otherwise False.
True if the given notepad item is selected.
deleteItem
:: (CItem c)
=> Notepad c the concerned notepad.
-> NotepadItem c the concerned notepad item.
-> IO () None.
Deletes an item from a notepad.
clearNotepad
:: Notepad a the concerned notepad.
-> IO () None.
Deletes all items from a notepad.
undoLastMotion :: Notepad a -> IO ()
Internal (for use with GenGUI).
bindNotepadEv
:: Notepad a the concerned notepad.
-> IO (Event (NotepadEvent a), IO ()) A pair of (event, unbind action).
Binds a listener for notepad events to the notepad and returns a corresponding event and an unbind action.
data NotepadEvent a
The NotepadEvent datatype.
Constructors
Dropped (NotepadItem a, [NotepadItem a]) Drop event.
Selected (NotepadItem a) Selection event.
Deselected (NotepadItem a) Deselection event.
Doubleclick (NotepadItem a) Doubleclick event.
Rightclick [NotepadItem a] Rightclick event.
ReleaseSelection Buttonrelease after a selection.
ReleaseMovement EventInfo Buttonrelease after a movement.
data NotepadExportItem c
Constructors
NotepadExportItem
val :: c
pos :: Position
selected :: Bool
type NotepadState c = [NotepadExportItem c]
exportNotepadState
:: (CItem c)
=> Notepad c the concerned notepad.
-> IO (NotepadState c) The notepad's state.
Exports a notepad's state.
importNotepadState
:: (CItem c)
=> Notepad c the concerned notepad.
-> NotepadState c
-> IO () None.
Imports a notepad's state.
module CItem
Produced by Haddock version 0.3