fltkhs-themes-0.1.0.6: A set of themed widgets that provides drop in replacements to the ones in FLTKHS.

Safe HaskellNone
LanguageHaskell2010

Graphics.UI.FLTK.Theme.Light.Table

Description

A word on the table widgets, the theme does provide overrides of [Table](http:/hackage.haskell.orgpackagefltkhsdocs/Graphics-UI-FLTK-LowLevel-Table.html) and [TableRow](http:/hackage.haskell.orgpackagefltkhsdocs/Graphics-UI-FLTK-LowLevel-TableRow.html) but they are pretty lowlevel widgets requiring you to supply column/row/cell drawing functions. The functions below draw nicely themed cells and can be passed the Table/TableRow constructors.

The idea is they are used in the generic table drawing cell function at each drawing context, something like:

...
table <- tableRowNew
         (Rectangle ...)
         (Just "My Table")
         Nothing
         drawCell
         defaultCustomWidgetFuncs
         defaultCustomTableFuncs
...

drawCell :: (?assets :: Assets) => Ref TableRow -> TableContext -> TableCoordinate -> Rectangle -> IO ()
drawCell t tcontext ... =
  case tcontext of
    ContextRowHeader -> do
      ...
      drawHeader ...
    ContextColHeader -> do
      ...
      drawHeader ...
    ContextCell -> do
      ...
      drawDataCell ...
    _ -> return ()
Synopsis

Documentation

drawDataCell :: (?assets :: Assets) => Color -> Alignments -> Text -> Rectangle -> IO () Source #

Custom cell drawing function

drawHeader :: (?assets :: Assets) => Color -> Alignments -> Text -> Rectangle -> IO () Source #

drawHeaderWithImage :: (Parent a Image, ?assets :: Assets) => Color -> Alignments -> Text -> Ref a -> Rectangle -> IO () Source #

tableCustom Source #

Arguments

:: Rectangle

Bounds of this table

-> Maybe Text

Optional label

-> Maybe (Ref Table -> IO ())

Optional custom table drawing function

-> (Ref Table -> TableContext -> TableCoordinate -> Rectangle -> IO ())

Custom table cell drawing function

-> CustomWidgetFuncs Table

Widget overrides

-> CustomTableFuncs Table

Table overrides

-> IO (Ref Table) 

tableRowNew Source #

Arguments

:: Rectangle

Bounds of this table

-> Maybe Text

Optional label

-> Maybe (Ref TableRow -> IO ())

Optional custom table drawing function

-> (Ref TableRow -> TableContext -> TableCoordinate -> Rectangle -> IO ())

Custom table cell drawing function

-> CustomWidgetFuncs TableRow

Widget overrides

-> CustomTableFuncs TableRow

Table overrides

-> IO (Ref TableRow)