Http://delphi.org/2015/12/skill-sprint-using-firemonkey-layouts/?utm_source=feedburner&utm_medium=feed &utm_campaign=feed%3a+delphidotorg+%28delphi.org%29
Skill sprint:using Firemonkey LayoutsPosted on 15-dec-2015 by Jim mckeeth Understanding and using Firemonkey Layouts
Firemonkey and the Fireui makes it easy-to-build one form to rule all the platforms. Combining layout controls and making use of anchors, Alignment, Padding and Margins it's easy-to-make one form that looks and works great on all platforms.
Anchors
- Position relative to one or more edge (s) of Parent:
- Default is Top, left
- Moves with Parent Resize
- Each control have 0 to 4 anchors
Alignment
- Aligns control within parent, setting anchors, size and position.
- Default is None.
- Anchor and fill along edge:
- Fill parent, but preserve aspect ratio:
- Fill along one side of the parent (priority + other edge alignments):
- Mostbottom, Mosttop, Mostleft, Mostright
- Resize only on one axis (width or height)
- Vertical, Vertcenter, Horizontal, Horzcenter
- Miscellaneous
- Client–fills client area, less other children
- Center–no Resize, just centered
- Contents–fills client area, ignoring other children
- Scale–resizes and moves to maintain the relative position and size
Spacing–margins and Padding
- Margins
- Spacing for siblings (and parent edges)
- Padding
Tflowlayout
- Arrange child controls as words in a paragraph
- Controls arranged in order added to layout
- Use ' Move to Front ' or ' Send to back ' to reorder
- Use Tflowlayoutbreak-Forced line break
Tgridlayout
- Arranges child controls in a grid of equal sizes
- Controls flow through grid as parent resizes
- Use itemwidth and itemheight properties
- Customize margins of individual controls
Tgridpanellayout
- Creates a grid of specified rows and columns
- Does the anchor or size of child
- Each cell can contain 1 child control
- You set the Height, Width, Align, and anchors of children
- Controls can span multiple cells
Tscaledlayout
- Stretches child controls as it's resized at runtime
- doesn ' t respect aspect ratios of controls
- Set the Align of the tscaledlayout to Fit to maintain aspect ratio
- Some styles look better zoomed than others. The font grows–it is a bitmap scale.
- Have properties for originalwidth and originalheight –compare to Width and Height to D Etermine scaling.
TScrollBox
- Allows children to take up more space than parent
- Usually anchored to Client
- Only Anchor children to Top & Left (default)
- Scroll to see additional children
- See Also:tvertscrollbox, Thorzscrollbox, Tframedscrollbox and Tframedvertscrollbox
Ttabcontrol
- Control to group child controls into tabs
- Tabs is in a stack with one visible at a time
- tabposition: = Platformdefault to use platform default behavior
- tabposition: = None to hide navigation
- Use ttabchangeaction to animate transitions
Frames
- Reusable pieces of User Interface
- Includes
- The layout
- All the event handlers
- All the code in the Unit
- Create 1 or more Frames, then reposition based on current layout
- Examples:
- In Ttabcontrol for phone
- Side-by-side for Tablet
Tmultiview
- One super panel with multiple modes
- Supported modes
- Platformdefault
- Drawer
- NavigationPane
- Panel
- Popover
- Custom
- Point to Masterpane, Detailpane and definable Masterbutton
- Platformdefault adapts to platform and orientation
- Custom supports user defined layout and behavior
"Reprinted" Understanding and Using Firemonkey Layouts