… in ACTION!
David Intersimone “David I”
Vice President of Developer Relations and Chief Evangelist
[email protected]
RAD Studio XE2 Overview
FireMonkey Overview
FireMonkey Principles
Applied FireMonkey
Platform Considerations
End-to-End FireMonkey
Android and iOS mobile development with RadPHP XE2
Delphi for 64-bit Windows
Summary and Close
RAD Studio XE Overview
Windows, Macintosh, Web and Mobile Development
RAD Studio XE2
…and more!
Fast Native applications for Windows,
Macintosh, Web and Mobile
• Write app once, compile
for multiple platforms
• Data-rich, Component-based
• Delphi and C++
native code performance
• Delphi for 64-bit Windows
• VCL Styles
• RadPHP for full
visual web development
The Next Generation Business Application Platform
• Stunning HD and 3D
Business Applications
• Native Power and Performance
• Connect with any Data
and Services
• Full Suite of UI Controls
• Visualize Live Data
• Styled Vector UIs
without coding
• Communicate with Animations
• No-Code Hardware Effects
Applications that Connect Everywhere
• High-speed connectivity
to popular databases
• Multi-tier applications
• Clients on multiple
computers and devices
• Connect to the world
of data, services,
and the cloud
Mobile choices for you and your users
• Native mobile apps for DataSnap
– iOS, Android, Blackberry,
and Windows Phone 7
– Delphi and C++Builder DataSnap Servers
• Mobile-optimized PHP web apps
– Web apps that look great
– Web apps that work great on mobile
– Package applications for distribution
– Sell on Apple App Store and Android
RAD Studio XE2 - Editions for Every Developer
Starter (Delphi/C++Builder)
Beyond XE2
• Frequent and regular FireMonkey updates
• Expanded Mobile UI and Device support including
– Location, Camera, Accelerometers, etc.
• Next generation compilers
Delphi compiler - multiple HW/OS targets
RAD C++ compiler - multiple HW/OS targets
64bit RAD C++
GPU computing
Parallel programming
Delphi and C++ native ARM Support
• Extended iOS support
• Android support
• Win8/Metro support - Intel & ARM
FireMonkey Overview
The Next Generation Application Development Platform
Next generation CPU/GPU powered application platform for
business, enabling developers to rapidly build visually engaging
HD and 3D applications with blazing performance on
Windows, Mac and Mobile
FireMonkey is
Application Development Platform
Mac OS
Business/Industry Software Stuck in Past
• 90’s Windows user experiences
• Confined to mouse/keyboard interaction
• Complex to learn - slow to use
Consumer Software - Innovative User Experience
• Media and graphics rich user experiences
• Intuitive and interactive – easy to learn
• Touch and motion interaction
Consumer Software Renaissance
Media and graphics Rich user experiences
Intuitive and interactive – easy to learn
Simulated real world physics
Touch and motion interaction
Key Markets
ISV’s / Packaged Software
Healthcare / Medical
Financial Services
Aviation & Automotive
Shortcomings of Today’s Solutions
Script and VM/JIT engines lack UX (User Experience)
performance, responsiveness, and hardware accessibility for
desktop business, ISV, and Vertical industry applications
FireMonkey is not …
Game Engine
User Experience
UE Richness
UE Performance
Business SW
is stuck here
FireMonkey – Rich Business Applications
More visually stunning and interactive
More power and performance
More connected
FireMonkey – Rich Business Applications
More visually stunning and interactive
More power and performance
More connected
HD Forms
High performance GPU powered Scalable Vector Uis
Maximum resolution on any device
Hundreds of visual UI components
GPU based Style Engine to control UI look & feel
HUDs with transparencies and transition effects
3D Forms
• GPU powered 3D Forms
• Hardware based lighting, textures, and animation
• 3D Forms can contain HD UI elements and effects
Effects & Animation
• 50+ Photoshop-like GPU Effects
• Simultaneous multiple effects without performance hit
• Path based animation for all HD and 3D UI and graphics
Delphi and C++ project types
HD and 3D business apps and database
Using Styles
Using Effects and Animations
FireMonkey – Rich Business Applications
More visually stunning and interactive
More power and performance
More connected
Development Speed – Fast Prototyping
• Rapid Application Development to reduce development time
• Show customers what they are looking for with fast prototyping
• Easily move from prototype to production without wasted effort
Development Speed - Built-in Components
• Built-in advanced components to increase quality and
functionality including:
user interface components
web apps
• Extend and customize components
• Create your own components
• Use free and commercial components created by the
developer community
Native CPU/GPU Application Platform
• Compile natively to Windows, Mac, and iOS
• Application, database, and animation are CPU powered
• All UI, graphics, and effects are GPU powered
• Pixel Shader
• Simple native Windows/Mac/iOS demo
FireMonkey – Rich Business Applications
More visually stunning and interactive
More power and performance
More connected
Enterprise Database Connectivity
• Built-in native connectivity to all popular databases
• Connectivity with Amazon and Azure cloud services
LiveBindings Data Visualization
• Connect any UI, HD, or 3D graphics to any data source
• Create active “interdependent” bindings
VCL and FireMonkey together
MIDA VCL to FireMonkey converter – first look
Overview Summary
Quickly create visually stunning HD and 3D
business applications with blazing native
performance on Windows, Mac and iOS
Ensure high performance of your business
applications by utilizing the full GPU power of
today’s hardware
Handle any architecture requirement with the
ability to easily connect to multiple devices,
databases, protocols and services
FireMonkey Principles
Lights! Camera! Action!
“FireMonkey” – HD, 3D, and GPU
• FireMonkey takes advantage of GPU whenever possible
• HD Form can be rendered on a computer without a
GPU with a few restrictions:
– No TViewport3D, No Shader based Filters
• A 3D Form requires a GPU - performs sophisticated
transitions and manipulations of the user interface…
… in other words, a 3D form may be the best
choice for building a sophisticated HD user interface
Comparing VCL & FMX
• FMX and VCL share Common Ancestry
• TObject
• After TComponent dramatically different…
Courtesy: Ray Konopka
Raize Software
Courtesy: Ray Konopka
Raize Software
Courtesy: Ray Konopka
Raize Software
Comparing VCL & FMX
Event model is the same
Persistence is shared
No Component Messages in FMX
Coordinate System
– Origin is upper left
– VCL – Integer
– FMX – Floating-point
• Property changes
– Caption ➜ Text (except for TForm)
– Left, Top ➜ Position.X, Position.Y
Courtesy: Ray Konopka
Raize Software
Owners, Parents, and Children
• Concept of Ownership is the same
• FMX has the notion of Parent, but it is not quite
the same as in VCL
• Any control can be the parent of another control
– Not restricted to container-like controls.
– e.g. a TEdit can be the parent of a TLabel
• Child objects share attributes of parent
– Coordinate space
– Visibility & Opacity
– Rotation & Scale.
Courtesy: Ray Konopka
Raize Software
TCanvas Differences
• More abstract in FMX than in VCL
– i.e. not a direct wrapper around device context
• Fills and Strokes handled by separate calls
– FillRect
– DrawRect
• Text displayed using FillText
– Draws text and fills with specified TBrush
– Allows gradient fills in text
• However, rarely use TCanvas directly
– Use primitives instead.
Courtesy: Ray Konopka
Raize Software
Supported Platforms
• RTL is shared between VCL & FMX
• VCL and FMX are more than Component
Libraries, they are Application frameworks
• As a result, you cannot intermix VCL & FMX in the
same application.
Courtesy: Ray Konopka
Raize Software
3D Programming
• One object model to target multiple platforms
• FM uses right-handed orientation in 3D
• Hardware acceleration
– Windows – DirectX
– MacOS – OpenGL
– iOS – OpenGL ES
FireMonkey Graphics Architecture
*) Delphi only in XE2
FireMonkey Technology
• Windows - Direct2D for HD, Direct3D for 3D
• Note: FireMonkey can use GDI+ for HD vector
forms/controls, when GPU is not available
• Mac - Quartz for HD, OpenGL for 3D
• iOS - Core:Graphics for HD, OpenGL/ES for 3D
FireMonkey graphic elements
• HD
– TLayout, TScaledLayout
– TGridLayout, TScrollBox
– Shapes
• 3D
TLayout3D, TLayer3D
TCamera, TLight
Shapes including TMesh, TModel3D, TGrid3D
• Grids
– TStringGrid, TGrid
When to use HD, 3D, Animations, Effects
• UI guidelines and things to consider
– Effects (glow) to draw attention to control
– Animations for appearance of UI elements
– Opacity – dim parts of a complex form
– Move non-focus parts of 3D UI into the distance
– Using a 2D mouse in a 3D world – button use
– Use ViewPort3D in an HD form
• Controls Demo – scaling forms/controls
• Lights, Camera, Action!
Applied FireMonkey
Styles, Animations, Filters and LiveBindings
Applied FireMonkey
Building Components
FireMonkey Styles
• FireMonkey Stylebook
Any object inherited from TBaseObject
Set StyleName to identify
Found using FindStyleResource method from parented object
Stored In / Loaded From a stream file
• FireMonkey Styles
A collection of FireMonkey resource style
WPF type of implementation
Styles can be inherited, saved, loaded
Look and Feel style files for Win7, MacOS, iOS and custom
“FireMonkey” – Animation
Used to modify property values over time
Machine speed independent
Can be looped and / or reversed
Can follow a variety of time / value curves
Can be triggered by MouseOver, Focus,
Visibility, etc.
“FireMonkey” – Effects / Filters
• Can be applied to bitmaps
• Can be applied to controls
• Can be triggered by MouseOver, Focus,
Visibility, etc.
• GPU shader based implementation
Building FireMonkey Components
• Bruno/Ray slides
• Docwilki
FireMonkey Components - The Process
• Basically the same as creating VCL components
• Prepare for new component
– Create a new directory
– Create a test application
• Create the component unit
– Manually or Component Expert?
– Name the component
– Create the component class
• Test runtime behavior
– Dynamically create component in test application.
Courtesy: Ray Konopka
Raize Software
The Process (cont.)
• Register and install component
– Register component in a new or existing
registration unit
– Add component unit to a runtime package
– Add registration unit to design package
• which will require the runtime package
– Build packages, deploy, install
• Test design-time behavior.
Courtesy: Ray Konopka
Raize Software
Creating new Styles
• Use the built-in Style Designer
• Save to *.style file
• Create separate styles to handle platform
Courtesy: Ray Konopka
Raize Software
Component Guidelines
• Use Styles
– Name style elements appropriately
– Be sure to document all Style contracts
• Utilize primitives for painting whenever
– When used within styles, they can be replaced or
• Complex controls can be built through code
with styled components.
Courtesy: Ray Konopka
Raize Software
LiveBinding Engine
• Allows developers to create live binding in run-time between
components/objects at design-time.
• The LiveBinding visual components use the engine:
– TBindScope for bindings to components
– TBindScopeDB for bindings to databases
– TBindingsList for holding of binding lists
• A number of conversion services in the box and allows to create
new conversion service
• Automatic updates
– Expressions automatically re-evaluated when a variable (e.g.;
property) referenced by an expression has changed value.
– Requires - external notification – Notify(object, ‘variable’);
Expression Engine – Simple Expressions
• Operators: +, -, /, *
• Literals: ‘abc’, 1, 1.23, True, False, nil
• Scope: Provides symbols and values available to an expression.
Includes operators. Scopes may be nested.
• TDictionaryScope: Associates a name with an object
• Expression string: String to evaluate
• TBindingExpression: Expression engine object which holds a
scope and expression string.
• Evaluate: Expression engine processes the expression string and
returns a value.
• TValue: Delphi RTTI representation of a value. May be an
object, string, integer, array, etc.
Expression Engine – Simple Expressions
• Built-in Methods: Global methods registered by the
expression engine
• WrapObject(): Create a scope which exposes members of
the object, including properties and methods
• RTTI: Delphi RTTI is used by expression engine to access
the member of an object
• Self: A scope can be associated with “Self”. Members can
be accessed without a qualifier.
• Association: A scope can be associated with a name. The
name is used as a qualifier.
• Custom Methods: Global methods registered in user code
Expression Engine – Binding, Scope, etc
• Binding: Expressions are used to assign from one
value to another
• Input expression and scope: Evaluated to get the
input value
• Output expression and scope: Evaluated to get the
output location
• Managed: Managed bindings are owned by the
expression engine and may be automatically reevaluated.
• Unmanaged: Unmanaged bindings are owned by
application and must be explicitly evaluated by
calling Evaluate.
Expression Engine – Unmanaged Bindings
• Output Converters
– Used when assigning the value of the input to the
location of the output.
– Typically used to handle assignment of mismatched
types such as integer to string.
Expression Engine – Managed Bindings
• Notify()
– The Notify method informs the manager that the
value of an object/property has changed.
– The manager will re-evaluate dependent bindings.
• Events
– Events are called during expression evaluation.
• OnAssigning
• OnAssign
• OnException
Components – Unmanaged Binding
• TBindExpression
– Component to create a managed or unmanaged binding
– Properties
• TBindScope
– Component to wrap a TObject in a scope
– Properties
• DataObject
Components – Unmanaged Bindings
• TBindExprItems
– Component to create one or more managed or
unmanaged binding
– Properties
FormatExpressions collection
Components – Designing TBindExpression
• TBindingsList: List of binding components such as
• Bindings List Editor: Edits the list of binding components
• TBindExpression
– properties
• Active
– Binding expressions are evaluated when Active is set to True
• AutoActivate
– Set Active when the component is loaded
• Expression Editor
– Edit the expression strings of a binding component
– Test expressions
• Styles
– Loading a style from resource, file?
– Modifying styles at design time and runtime
• Style Lookup, Apply Style?
• Animations and effects
• LiveBindings
– BindScopeDB – uses DataSource
– Managed and Unmanaged bindings
– Circle example method for condition test returning
• Building components - TRkDialogButtons for FMX
Platform Considerations
Deployment to Windows, OSX and iOS
Platform Considerations
• Project Types
• Windows, Mac, iOS
• Project | Deployment
– Feature Files
– Additional files
• Platform Assistant
– Debugging, Deployment
– Win32, Win64, Mac
FireMonkey and Cross Platform
• FM is a platform that supports
Operating System
• Compile / Run on all platforms we support *
• * subset for mobile platforms
FireMonkey iOS
UI design on Windows
Handling devices, orientation
Code for iOS hardware, file system, OS
Anders’ slides
iOS User Interface Guidelines
• Find the problems… ;)
– Green buttons? Maybe…
– Button font size?
– Scroll bars?
iOS User Interface Guidelines
• That’s better!
• Need to turn off scroll bars!
• Edit box at the bottom? No!
– Has to be upper half of screen
– Why?
iOS User Interface Guidelines
• We’re getting somewhere!
• But wait…
• Rounded corners?
iOS User Interface Guidelines
• Nice!
• Modeled after the Contacts app
– Edit boxes have labels in them
– Text fields are right adjusted
• Minute details remain
– Text in memo should be padded more
– Maybe Panel with Label and Edit (LJ) inside?
– Button should have rounded edges to it
iOS User Interface Guidelines
• Close!
• 
iOS User Interface Guidelines Resources
• iOS Human Interface Guidelines web site
• Apple’s iOS Human Interface Guidelines
Handling Multi-Platform issues
TMenuBar – UseOSMenu property
Dialogs, ShowMessage
File System – IOUtils – Win/Mac
Malcolm’s hidden user files
TRegistry vs TIniFile
TOSVersion (run time), conditional defines
(compile time)
• File Volume/Path issues
• DLLs, Dylibs
• Debugging
• TOSversion database example
• UseMenuBar
• iOS client applications
End-to-End FireMonkey
Enterprise Solutions
Enterprise Landscape
End-to-End FireMonkey
FireMonkey client and …
• Scenario 1: Remote RDBMS or Cloud Storage
• Scenario 2: XML/SOAP & JSON/REST Web Services
• Scenario 3: Delphi/C++ DataSnap server deployed to EC2 cloud
• Scenario 4: Delphi FM iOS client to DataSnap server
• Scenario 5: FireMonkey client connected to Enterprise
Infrastructure – JEE, CORBA, and .NET
Scenario 5: FireMonkey & .NET Web Service
.NET WCF web service
Embarcadero Prism console application
FireMonkey client
WSDL importer and HTTPRIO component
• Embarcadero Prism WCF calculator service
Android and iOS app development
with RadPHP XE2
JQueryMobile visual,
development of mobile
optimized web pages
Create iOS and
applications that
you can sell on the
Apple and Android
app stores
• RadPHP XE2 – web mobile client
• RadPHP XE2 – native mobile clients
Delphi 64-bit
What’s the same?
Integer, Longint, Cardinal – still 32bits
Int64, UInt64 – still 64bits
UnicodeString, AnsiString, WideString
Runtime Library (RTL)
SysUtils, Classes, etc…
What’s different?
NativeInt, NativeUint – 64bits
Pointer (all pointers) – 64bits
Dynamic Arrays – 64bit indexing
Floating point math - Double
Delphi 32 and 64-bit Pointer Types
Pointer types
Class instance
Class reference
Procedure pointer
Dynamic array
Delphi/32 Delphi/64
4 bytes
8 bytes
Delphi 64-bit on Windows
• Same Windows API
– CreateWindowEx, PeekMessage,
• Same Delphi RTL
– SysUtils, Classes,
Generics.Collections, etc…
• Same VCL
– Forms, Graphics, Controls, Menus,
Delphi 64-bit on Windows – some gotcha’s
• SizeOf(Pointer) <> SizeOf(Integer)
– Integer<->Pointer casts will break in 64bit
– SizeOf(THandle) = SizeOf(Pointer)
– All Handles = SizeOf(Pointer) (HWND, HDC, etc..).
• All code in process must be 64bit
– Must have 64bit versions of external non-Delphi libraries (DLLs)
• One, and only one, calling convention
– register, pascal, cdecl, stdcall are ignored.
• safecall is still “special”
• Old “pointer math” code may break
– Works in 32 and 64bit: MyPtr := PByte(P) + 10;
• TList’s internal FList is now a TPointerList. Used to be a PPointerList. Removing ^
should be sufficient to port from 32-bit to 64-bit.
• Tag property is now a NativeInt (32-bit vs 64-bit)
Delphi 64-bit on Windows – some gotcha’s
• Inline Assembly
– Cannot mix asm blocks with Pascal code
– Only procedural level asm blocks supported
– Stack must be 16-byte aligned at each call instruction
– Define locals for temp storage
– Do not modify the RSP stack pointer
– New unified calling convention. First 4 parameters in registers, RCX, RDX,
R8, R9 (or XMM0-XMM3)
• Exception unwinding
– No change for pure Delphi code. Exceptions function identically.
– Inline Assembly can cause exception unwinding to fail if not properly
• SHL/SHR – 32-bit values (Integer et al) will only shift in 32-bit space. 64-bit
values will of course shift in 64-bit space.
• No Extended type in 64-bit. Use TExtendedRec80 if necessary (binary files with
Extendeds in them for instance)
Windows API gotcha’s
• SetWindowLong / GetWindowLong should be
replaced by SetWindowLongPtr /
GetWindowLongPtr for GWLP_HINSTANCE,
GWLP_WNDPROC, etc… as they return pointers and
– Pointers passed to SetWindowLongPtr should be typecasted to LONG_PTR and not to Integer / Longint.
• SetWindowLong mapped to SetWindowLongPtr in
– Calls to our declaration of SetWindowLong are safe, as
long as they are cast correctly.
Windows API gotcha’s (con’t)
• Use explicit casts to WPARAM and LPARAM
where appropriate.
– Example: Passing pointers through SendMessage
SendMessage(hWnd, WM_SETTEXT, 0,
• Use LRESULT to cast message results
– Example: Message.Result := LRESULT(Self);
• Message cracker records (TWMxxx) changed
– Alignment changes and field-size changes
• FireMonkey - The Next Generation Business
Application Platform
• Fully harness the powerful GPU graphics hardware
• Rapidly build visually spectacular applications
• Invest in one platform and deploy to numerous OS-s
• Delphi and C++ compiled, native executable
• Fully programmable animations and effects
• Your imagination is the only limit !!!
RAD Studio XE2
The ultimate application development suite for Windows, Mac, mobile and Web
• Deliver Fast Native Applications
on Windows, Mac, Web and Mobile
• Speed Up Your Development Process with RAD
• Create Visually Stunning and Interactive
Business Applications
• Build Applications that Connect Everywhere
• Break Free from Grids – Visualize Live Data
RAD Studio XE2 samples on SourceForge
FireMonkey components Guide
Anders Ohlsson FireMonkey iOS blog
CodeRage 6 – session replays
RAIZE Software
MIDA VCL to FireMonkey Converter
Nabídky pro
konec roku 2011
Získejte licence navíc
S nákupem licence Delphi nebo RAD
Studia XE2, plné verze nebo upgrade
edice …
… získáte všechny tyto nástroje
FastCube – ZDARMA
FastCube – ZDARMA
DB Optimizer XE2 – ZDARMA
FastCube – ZDARMA
DB Optimizer XE2 – ZDARMA
DB Change Manager XE2 – ZDARMA
Nabídka platí pro objednávky podané od 3.11. do 30.12.2011
Produkty získané zdarma si musíte vyžádat do 15.1.2012
Co je co
• Rapid SQL XE2 – je integrované vývojové prostředí jazyka
SQL, které vám umožní vytvářet výkonný kód SQL pro
vaše aplikace napsané v Delphi a C++Builderu.
• Fastcube – je nástroj pro efektivní analýzu dat.
• DB Optimizer XE2 – pomůže vám zvýšit celkový výkon
vašich databázových aplikací a maximalizovat odezvu
• DB Change Manager XE2 – umožní vám sledovat a
zvládat změny v používaných databázích stejným
způsobem, jakým například sledujete změny zdrojového
Pamatujte taky, že …
• Možnost upgrade z verze 2007 na verzi novější skončí zároveň s
koncem roku 2011
• S nákupem verze XE2 produktu z rodiny RAD Studio XE2 získáte i
starší verze XE, 2010, 2009, 2007 a Delphi 7 či C++Builder 6
• S nákupem verze XE2 získáte to, co zatím nemáte a jinde
– 64bitový kompilátor Delphi pro aplikace, které využijí možnosti
nejnovějšího hardware
– Skutečně oslňující vizuální obchodní aplikace vytvořené pomocí
komponent FireMonkey™
– Výkonné nativní aplikace pro Windows, Mac a iOS
– LiveBindings™ dovolící propojit jakýkoli vizuální prvek s libovolným
typem dat
– Propojitenost s mobilními systémy a cloudem pomocí vícevrstvé
technologie DataSnap
Další informace najdete zde
Borland s.r.o.
Belgická 15, 120 00 Praha 2, CZ
e-mail: [email protected]
telefon: +420 273 132 190
Thank You
[email protected]

similar documents