- data Layout
- sizerFromLayout :: Window a -> Layout -> IO (Sizer ())
- type TabPage = (String, Bitmap (), Layout)
- windowSetLayout :: Window a -> Layout -> IO ()
- layoutFromWindow :: Window a -> Layout
- windowReFit :: Window a -> IO ()
- windowReFitMinimal :: Window a -> IO ()
- windowReLayout :: Window a -> IO ()
- windowReLayoutMinimal :: Window a -> IO ()
- class Widget w where
- label :: String -> Layout
- rule :: Int -> Int -> Layout
- hrule :: Int -> Layout
- vrule :: Int -> Layout
- sizer :: Sizer a -> Layout
- row :: Int -> [Layout] -> Layout
- column :: Int -> [Layout] -> Layout
- grid :: Int -> Int -> [[Layout]] -> Layout
- boxed :: String -> Layout -> Layout
- container :: Window a -> Layout -> Layout
- tab :: String -> Layout -> TabPage
- imageTab :: String -> Bitmap () -> Layout -> TabPage
- tabs :: Notebook a -> [TabPage] -> Layout
- hsplit :: SplitterWindow a -> Int -> Int -> Layout -> Layout -> Layout
- vsplit :: SplitterWindow a -> Int -> Int -> Layout -> Layout -> Layout
- glue :: Layout
- hglue :: Layout
- vglue :: Layout
- space :: Int -> Int -> Layout
- hspace :: Int -> Layout
- vspace :: Int -> Layout
- empty :: Layout
- dynamic :: Layout -> Layout
- static :: Layout -> Layout
- stretch :: Layout -> Layout
- hstretch :: Layout -> Layout
- vstretch :: Layout -> Layout
- minsize :: Size -> Layout -> Layout
- rigid :: Layout -> Layout
- shaped :: Layout -> Layout
- expand :: Layout -> Layout
- fill :: Layout -> Layout
- hfill :: Layout -> Layout
- vfill :: Layout -> Layout
- margin :: Int -> Layout -> Layout
- marginWidth :: Int -> Layout -> Layout
- marginNone :: Layout -> Layout
- marginLeft :: Layout -> Layout
- marginTop :: Layout -> Layout
- marginRight :: Layout -> Layout
- marginBottom :: Layout -> Layout
- floatTopLeft :: Layout -> Layout
- floatTop :: Layout -> Layout
- floatTopRight :: Layout -> Layout
- floatLeft :: Layout -> Layout
- floatCentre :: Layout -> Layout
- floatCenter :: Layout -> Layout
- floatRight :: Layout -> Layout
- floatBottomLeft :: Layout -> Layout
- floatBottom :: Layout -> Layout
- floatBottomRight :: Layout -> Layout
- hfloatLeft :: Layout -> Layout
- hfloatCentre :: Layout -> Layout
- hfloatCenter :: Layout -> Layout
- hfloatRight :: Layout -> Layout
- vfloatTop :: Layout -> Layout
- vfloatCentre :: Layout -> Layout
- vfloatCenter :: Layout -> Layout
- vfloatBottom :: Layout -> Layout
- centre :: Layout -> Layout
- alignTopLeft :: Layout -> Layout
- alignTop :: Layout -> Layout
- alignTopRight :: Layout -> Layout
- alignLeft :: Layout -> Layout
- alignCentre :: Layout -> Layout
- alignCenter :: Layout -> Layout
- alignRight :: Layout -> Layout
- alignBottomLeft :: Layout -> Layout
- alignBottom :: Layout -> Layout
- alignBottomRight :: Layout -> Layout
- halignLeft :: Layout -> Layout
- halignCentre :: Layout -> Layout
- halignCenter :: Layout -> Layout
- halignRight :: Layout -> Layout
- valignTop :: Layout -> Layout
- valignCentre :: Layout -> Layout
- valignCenter :: Layout -> Layout
- valignBottom :: Layout -> Layout
Types
sizerFromLayout :: Window a -> Layout -> IO (Sizer ())
type TabPage = (String, Bitmap (), Layout)
A tab page in a notebook: a title, a possible bitmap and a layout.
Window
windowSetLayout :: Window a -> Layout -> IO ()
Set the layout of a window (automatically calls sizerFromLayout
).
layoutFromWindow :: Window a -> Layout
(primitive) Lift a basic control to a Layout
.
windowReFit :: Window a -> IO ()
Fits a widget properly by calling windowReLayout
on
the parent frame or dialog (windowGetFrameParent
).
windowReFitMinimal :: Window a -> IO ()
Fits a widget properly by calling windowReLayout
on
the parent frame or dialog (windowGetFrameParent
).
windowReLayout :: Window a -> IO ()
Re-invoke layout algorithm to fit a window around its
children. It will enlarge when the current
client size is too small, but not shrink when the window
is already large enough. (in contrast, windowReLayoutMinimal
will
also shrink a window so that it always minimally sized).
windowReLayoutMinimal :: Window a -> IO ()
Re-invoke layout algorithm to fit a window around its
children. It will resize the window to its minimal
acceptable size (windowFit
).
Layouts
Widgets
class Widget w where
Anything in the widget class can be layed out.
(primitive) Create a static label label (= StaticText
).
Containers
row :: Int -> [Layout] -> Layout
Layout elements in a horizontal direction with a certain amount of space between the elements.
column :: Int -> [Layout] -> Layout
Layout elements in a vertical direction with a certain amount of space between the elements.
grid :: Int -> Int -> [[Layout]] -> Layout
(primitive) The expression (grid w h rows
) creates a grid of rows
. The w
argument
is the extra horizontal space between elements and h
the extra vertical space between elements.
(implemented using the FlexGrid
sizer).
Only when all elements of a column have horizontal stretch (see stretch
and hstretch
), the entire
column will stretch horizontally, and the same holds for rows with vertical stretch.
When any column or row in a grid can stretch, the grid itself will also stretch in that direction
and the grid will expand
to fill the assigned area by default (instead of being static
).
imageTab :: String -> Bitmap () -> Layout -> TabPage
Create a tab page with a certain title, icon, and layout.
hsplit :: SplitterWindow a -> Int -> Int -> Layout -> Layout -> Layout
Add a horizontal sash bar between two windows. The two integer arguments specify the width of the sash bar (5) and the initial height of the top pane respectively.
vsplit :: SplitterWindow a -> Int -> Int -> Layout -> Layout -> Layout
Add a vertical sash bar between two windows. The two integer arguments specify the width of the sash bar (5) and the initial width of the left pane respectively.
Glue
Whitespace
Transformers
Adjust the minimal size of a control dynamically when the content changes.
This is used for example to correctly layout static text or buttons when the
text or label changes at runtime. This property is automatically set for
StaticText
, label
s, and button
s.
Stretch
(primitive) The layout is not stretchable. In a grid
, the row and column that contain this layout will
not be resizeable. Note that a static
layout can still be assigned an area that is larger
than its preferred size due to grid alignment constraints.
(default, except for containers like grid
and boxed
where it depends on the child layouts).
(primitive) The layout is stretchable and can be assigned a larger area in both the horizontal and vertical
direction. See also combinators like fill
and floatCentre
.
(primitive) The layout is stretchable in the horizontal direction. See also combinators like hfill
and hfloatCentre
.
(primitive) The layout is stretchable in the vertical direction. See also combinators like vfill
and vfloatCentre
.
Expansion
(primitive) Expand the layout to fill the assigned area but maintain the original proportions of the layout. Note that the layout can still be aligned in a horizontal or vertical direction.
(primitive) Expand the layout to fill the assigned area entirely, even when the original proportions can not
be maintained. Note that alignment will have no effect on such layout. See also fill
.
Fill
Margin
marginWidth :: Int -> Layout -> Layout
(primitive) Set the width of the margin (default is 10 pixels).
marginNone :: Layout -> Layout
(primitive) Remove the margin of a layout (default).
marginLeft :: Layout -> Layout
(primitive) Add a margin to the left.
marginRight :: Layout -> Layout
(primitive) Add a right margin.
marginBottom :: Layout -> Layout
(primitive) Add a margin to the bottom.
Floating alignment
floatTopLeft :: Layout -> Layout
Make the layout stretchable and align it in the top-left corner of the assigned area (default).
Make the layout stretchable and align it centered on the top of the assigned area.
floatTopRight :: Layout -> Layout
Make the layout stretchable and align it to the top-right of the assigned area.
Make the layout stretchable and align it centered to the left of the assigned area.
floatCentre :: Layout -> Layout
Make the layout stretchable and align it in the center of the assigned area.
floatCenter :: Layout -> Layout
Make the layout stretchable and align it in the center of the assigned area.
floatRight :: Layout -> Layout
Make the layout stretchable and align it centered to the right of the assigned area.
floatBottomLeft :: Layout -> Layout
Make the layout stretchable and align it to the bottom-left of the assigned area.
floatBottom :: Layout -> Layout
Make the layout stretchable and align it centered on the bottom of the assigned area.
floatBottomRight :: Layout -> Layout
Make the layout stretchable and align it to the bottom-right of the assigned area.
Horizontal floating alignment
hfloatLeft :: Layout -> Layout
Make the layout horizontally stretchable and align to the left.
hfloatCentre :: Layout -> Layout
Make the layout horizontally stretchable and align to the center.
hfloatCenter :: Layout -> Layout
Make the layout horizontally stretchable and align to the center.
hfloatRight :: Layout -> Layout
Make the layout horizontally stretchable and align to the right.
Vertical floating alignment
vfloatCentre :: Layout -> Layout
Make the layout vertically stretchable and align to the center.
vfloatCenter :: Layout -> Layout
Make the layout vertically stretchable and align to the center.
vfloatBottom :: Layout -> Layout
Make the layout vertically stretchable and align to the bottom.
Alignment
alignTopLeft :: Layout -> Layout
Align the layout in the top-left corner of the assigned area (default).
alignTopRight :: Layout -> Layout
Align the layout to the top-right of the assigned area.
alignCentre :: Layout -> Layout
Align the layout in the center of the assigned area.
alignCenter :: Layout -> Layout
Align the layout in the center of the assigned area.
alignRight :: Layout -> Layout
Align the layout centered to the right of the assigned area.
alignBottomLeft :: Layout -> Layout
Align the layout to the bottom-left of the assigned area.
alignBottom :: Layout -> Layout
Align the layout centered on the bottom of the assigned area.
alignBottomRight :: Layout -> Layout
Align the layout to the bottom-right of the assigned area.
Horizontal alignment
halignLeft :: Layout -> Layout
(primitive) Align horizontally to the left when the layout is assigned to a larger area (default).
halignCentre :: Layout -> Layout
(primitive) Center horizontally when assigned to a larger area.
halignCenter :: Layout -> Layout
(primitive) Center horizontally when assigned to a larger area.
halignRight :: Layout -> Layout
(primitive) Align horizontally to the right when the layout is assigned to a larger area.
Vertical alignment
(primitive) Align vertically to the top when the layout is assigned to a larger area (default).
valignCentre :: Layout -> Layout
(primitive) Center vertically when the layout is assigned to a larger area.
valignCenter :: Layout -> Layout
(primitive) Center vertically when the layout is assigned to a larger area.
valignBottom :: Layout -> Layout
(primitive) Align vertically to the bottom when the layout is assigned to a larger area.