FireMonkey (FMX) is a cross-platform application framework that allows developers to create exciting user interfaces and deliver applications on multiple operating systems (OS). This book will help you learn visual programming with Delphi and FMX.
Starting with an overview of the FMX framework, including a general discussion of the underlying philosophy and approach, you'll then move on to the fundamentals and architectural details of FMX. You'll also cover a significant comparison between Delphi and the Visual Component Library (VCL). Next, you'll focus on the main FMX components, data access/data binding, and style concepts, in addition to understanding how to deliver visually responsive UIs. To address modern application development, the book takes you through topics such as animations and effects, and provides you with a general introduction to parallel programming, specifically targeting UI-related aspects, including application responsiveness. Later, you'll explore the most important cross-platform services in the FMX framework, which are essential for delivering your application on multiple platforms while retaining the single codebase approach. Finally, you'll learn about FMX's built-in 3D functionalities.
By the end of this book, you'll be familiar with the FMX framework and be able to build effective cross-platform apps.
Publisher: Packt
Year: 2020
Language: English
City: Birmingham, United Kingdom
Dedication
About Packt
Foreword
Contributors
Table of Contents
Preface
Section 1: Delphi GUI Programming Frameworks
Chapter 1: Introducing the FireMonkey Framework
Technical requirements
Approaching FireMonkey
Abstracting the visual part of your apps
Looking beyond the UI
Back to the metal
Understanding the strengths and weaknesses
Summary
Chapter 2: Exploring Similarities and Differences with VCL
Technical requirements
Understanding RTL for everyone
Learning about component streaming
Understanding the Style Designer
Learning about components
Handling the placement and sizing of components
Understanding anchors
Learning about alignments
Understanding actions
Learning about data binding
Summary
Section 2: The FMX Framework in Depth
Chapter 3: Mastering Basic Components
Technical requirements
Understanding the TText component
Learning about the TLabel component
Understanding shapes
Learning about the TLine class
Understanding the TRectangle class
Learning about the TCircle component
Managing images effectively
Learning about the MultiResBitmaps unit
TImage
TImageViewer
TImageList
TGlyph
Learning about buttons
TSpeedButton
Summary
Chapter 4: Discovering Lists and Advanced Components
Technical requirements
Learning about lists
TListBox
TListView
Providing data for the list
Item appearances
Custom appearance
Dynamic appearance
TListView's style customization
Basic event handling
Search capabilities
Pull to refresh
Exploring treeviews
Customizing TTreeview's items
Using grids
TGrid and TStringGrid
Customizing TGrid and TStringGrid
Mastering drawers and panels
Drawer mode
NavigationPane mode
Panel mode
Popover mode
PlatformBehavior mode
Custom mode
Summary
Chapter 5: Using FireDAC in FMX Applications
Technical requirements
Learning about the FireDAC library
Understanding the library's composition
Understanding the options system
Exploring FetchOptions properties
Exploring FormatOptions properties
Exploring ResourceOptions properties
Exploring UpdateOptions properties
Working with macros and parameters
Taking advantage of memory tables
Connecting to a database
Introducing Tables, Query, StoredProc, and Command
Understanding dataset persistence
Implementing an onboard database
Exploring the LocalSQL feature
Summary
Chapter 6: Implementing Data Binding
Technical requirements
Introduction to data binding
Approaching LiveBindings
Introducing managed bindings
Understanding what happens under the hood
Mastering real-world data bindings
Introducing BindSources
Binding a field value to a property – TLinkPropertyToField
Binding a dataset field value to a control – TLinkControlToField
Formatting data
Exploring CustomFormat/CustomParse expressions
Understanding LiveBindings methods
Creating the package (FormatFloatPackage)
Implementing the wrapper (FormatFloatInvokable)
Building and installing the package
Testing at design time and using it at runtime
Making custom method calls available
Binding a dataset to a list control – TLinkListControlToField
Filling items with data
Associating images with data
LiveBindings events
Binding a dataset to a grid control – TLinkGridToDataSource
Summary
Chapter 7: Understanding FMX Style Concept
Technical requirements
Learning about multi-platform visual programming
Introducing the Style concept
Understanding the anatomy of a style
Managing style(s) in the IDE
Binding a component to its style
Exploring the style definition of a component
Approaching the TStyleBook component
Learning about Vector styles
Understanding Bitmap styles
Adding animation, triggers, and effects
Managing styles – the TStyleManager component
Understanding the selection algorithm
Loading a style from embedded resources
Learning about platform-native controls
Summary
Chapter 8: Divide and Conquer with TFrameStand
Technical requirements
Introducing TFrameStand
Designing UIs for mobile applications
Learning about the DRY principle
Understanding visual continuity
Exploring TFrameStand – Hello, World!
Implementing views
Understanding the THomeFrame frame
Learning about the TOrdersFrame frame
Understanding the TOrderDetailsFrame frame
Defining the stand(s)
Learning about animations
Defining the fader stand
Defining the slider stand
Learning about TFormStand
Summary
Chapter 9: Building Responsive UIs
Technical requirements
Understanding responsiveness—visual meaning
Exploring Bootstrap's grid system
Understanding the relevant factors of responsiveness
Leveraging device and application peculiarities
Handling changes in device orientation
Considering the field of application
Understanding screen resolution and density
Building visual layouts
Arranging components with TLayout
Letting components flow as text with TFlowLayout
Building grid layouts with TGridLayout
Advanced arrangements with TGridPanelLayout
Introducing FireUI technology
Creating a new view
The Multi-Device Preview window
Using the FireUI Live Preview app
Considering other FireUI capabilities
Exploring TFormStand
Summary
Chapter 10: Orchestrating Transitions and Animations
Technical requirements
Introducing animations and transitions
Learning about interpolation
Understanding non-linear interpolations
Working with the FMXAni demo project
Learning about the TAnimation class
Understanding global animation management
Understanding interpolation modifier functions
Learning about TAnimator shortcuts
Learning about specialized animation components
TFloatAnimation
TFloatKeyAnimation
TColorAnimation
TColorKeyAnimation
TGradientAnimation
TRectAnimation
TBitmapAnimation
TBitmapListAnimation
TPathAnimation
Summary
Section 3: Pushing to The Top: Advanced Topics
Chapter 11: Building Responsive Applications
Technical requirements
Understanding multithreading
Understanding the thread safety of UI frameworks
Synchronous versus asynchronous execution
Utilizing the Synchronize method
Learning about the Queue approach
Exploring threads and tasks
Introducing the TThread class
Understanding a thread's lifespan
Exploring alternative solutions
Introducing the Parallel Programming Library
Introducing the TTask class
Dealing with synchronization
Waiting for a task to complete
Waiting for tasks to finish
Learning about futures
Summary
Further reading
Chapter 12: Exploring Cross-Platform Services
Technical requirements
Accessing the clipboard service
Understanding copying and pasting text
Learning about copying and pasting graphic content
Managing dialog forms
Understanding differences between synchronous versus asynchronous modes
Leveraging touch capabilities
Playing with the form's OnTouch event
Considering the form's OnTap event
Exploring standard gestures
Implementing interactive gestures
Understanding messaging support
Introducing message definitions as data types
Sending messages through the message manager
Subscribing and responding to messages
Using native HTTP client implementations
Getting familiar with Bluetooth support
Scanning for devices
Connecting to a BLE device
Subscribing for notifications
Summary
Chapter 13: Learning about FMX 3D Capabilities
Technical requirements
Introducing 3D programming with FMX
Building a 3D application
Building a 3D "Hello, world!" application
Understanding TDummy and the design-time camera
Setting up a 3D viewport
Understanding lights and materials
Learning about lights
Learning about the materials
Merging 3D and 2D visual objects
Using the TLayer3D component
Merging TFrameStand with 3D visuals
Summary
Other Books You May Enjoy
Index