.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.29) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Layout::Manager::Compass 3pm" .TH Layout::Manager::Compass 3pm "2016-04-27" "perl v5.22.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Layout::Manager::Compass \- Compass based layout .SH "DESCRIPTION" .IX Header "DESCRIPTION" Layout::Manager::Compass is a layout manager that takes hints based on the four cardinal directions (north, east, south and west) plus a center area that takes up all remaining space (vertically). .PP In other words, the center area will expand to take up all space that is \s-1NOT\s0 used by components placed at the edges. Components at the north and south edges will take up the full width of the container. .PP .Vb 12 \& +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+ \& | north | \& +\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-+ \& | | | | \& | w | | e | \& | e | center | a | \& | s | | s | \& | t | | t | \& | | | | \& +\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-+ \& | south | \& +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+ .Ve .PP Components are placed in the order they are added. If two items are added to the 'north' position then the first item will be rendered above the second. The height of the north edge will equal the height of both components combined. .PP Items in the center split the available space, heightwise. Two center components will each take up 50% of the available height and 100% of the available width. .PP Compass is basically an implementation of Java's BorderLayout .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& $cont\->add_component($comp1, \*(Aqnorth\*(Aq); \& $cont\->add_component($comp2, \*(Aqeast\*(Aq); \& \& my $lm = Layout::Manager::Compass\->new; \& $lm\->do_layout($cont); .Ve .SH "POSITIONING" .IX Header "POSITIONING" When you add a component with \fIadd_component\fR the second argument should be one of: \fBnorth\fR, \fBsouth\fR, \fBeast\fR, \fBwest\fR or \fBcenter\fR. Case doesn't matter. You can also just provide the first letter of the word and it will do the same thing. .SH "METHODS" .IX Header "METHODS" .SS "do_layout" .IX Subsection "do_layout" Size and position the components in this layout. .SH "AUTHOR" .IX Header "AUTHOR" Cory Watson, \f(CW\*(C`\*(C'\fR .SH "COPYRIGHT & LICENSE" .IX Header "COPYRIGHT & LICENSE" Copyright 2008 \- 2010 Cory G Watson .PP This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.