"Reprinted" Understanding and Using Firemonkey Layouts

Source: Internet
Author: User

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:
      • Top
      • Bottom
      • Left
      • Right
    • 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:
      • Top, Bottom, left, right
    • Fill parent, but preserve aspect ratio:
      • Fit, Fitleft, Fitright
    • 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
      • Spacing for children
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.