Show: Delphi C++
Display Preferences

What's New in Delphi and C++Builder XE4

From RAD Studio
Jump to: navigation, search

Go Up to What's New


RAD Studio XE4 is the first release of the FireMonkey mobile platform, featuring Delphi cross-platform application development for the iOS Simulator and iOS Device:

iOS Mobile Application Development

iOS Tutorials: Delphi iOS Application Development
Migrating Delphi Code to iOS from Desktop
FireMonkey Mobile Form Designer

Contents

Getting Started with iOS Application Development (iOS Tutorials)

Walk through our tutorials that get you started doing iOS application development in RAD Studio:

Setting Up Your iOS Development Environment

Using Basic iOS User Interface Elements

Using iOS Device Functionality

Accessing a Database

FireMonkey Changes for XE4

Components for iOS

The following components are new for XE4:

Camera for iOS

  • TCameraComponent is introduced for accessing the front and back camera and flash of a mobile device.

Magnifier Glass

The new FireMonkey TMagnifierGlass component provides a popup magnifier glass for text and images on the iOS platform. You can change the scale, and choose between a circular and a rectangular magnifier glass. The magnifier glass is automatically enabled for iOS text components such as TMemo. Although the magnifier glass is supported on all platforms, it is not automatically enabled on Windows or Mac.

Phone Dialer for iOS

Phone Dialer support is now provided for iOS applications. The new PhoneDialer allows you to make calls, get the cellular service provider information or get information about a specific call.

Pickers for iOS

Text Editing in iOS

  • All text components that inherit from TCustomEdit and TMemo now support the standard editing actions: Cut, Copy, Paste, Select All, Select Word, manual selection (with two selection points), changing the cursor position (with magnifier glass).
  • In addition, the virtual keyboard pops up when a text edit control is selected at run time.

Virtual Keyboard for iOS

WebBrowser for iOS

FireMonkey Frames

  • FireMonkey now has support for frames. See Frames in FireMonkey and Working with Frames.
  • To create a new frame in FireMonkey, choose:
    • File > New > Delphi (or C++Builder) Projects > Delphi (or C++Builder) Files > FireMonkey Frame

Touch and Gestures for iOS

FireMonkey introduces touch and gesture support for iOS applications.

The following interactive gestures are supported in FireMonkey iOS applications:
  • Long tap (Tap-and-Hold, Long-Press, or Press) - NEW, for iOS only
  • Double tap - NEW, for iOS only
  • Pan
  • Rotate
  • Two-Finger Tap
  • Zoom and Pinch

To associate an interactive gesture with a FireMonkey control, find the Touch property in the Object Inspector, and select from the list of Interactive Gestures.

For details about gestures, see Gestures in FireMonkey.

New TListView Component, Compared to Existing TListBox Component

FireMonkey now has two different list components. The two list components provide similar functionality, but each list is intended to be used for distinct purposes:

  • TListView is intended to be used for long, data-bound, scrollable lists, where optimal scrolling performance and responsiveness are required. TListView is supported on all target platforms.
    • You can set group headers to categorize your data alphabetically, by industry, and so on, depending on your data source.
    • You can add items to a TListView by binding to a data source, or by code (Items.Add).
  • TListBox is designed for short lists that are typically no longer than the length of the form and are not intended to be scrolled to any degree.
    • Uses for TListBox include user sign-up and log-in forms, and settings-type list boxes with rounded corners such as those you might see in many iOS applications.
    • You can add items to a TListBox manually (using the Add Items context menu command) or via a data source.

Media Actions for iOS

FireMonkey introduces standard media actions through the FMX.MediaLibrary.Actions unit:

These actions can be accessed from the Action List editor under the Media Library section. For an example of how to use the media library actions see iOS Tutorial: Taking and Sharing a Picture in an iOS Application.

Native Styles for iOS

  • FireMonkey introduces a full set of components with native iOS styling support, including buttons, toolbars, listboxes, sliders and switch controls.
  • Native iOS application styling for iPhone, iPad (Retina and non-Retina) on iOS 5.1 and 6.x are now supported in FireMonkey.
  • The StyleLookup property now supports the native iOS look. You can use StyleLookup to easily switch between different styles for the same control in an iOS application.
  • Antialiasing is disabled by default in iOS. You can enable antialiasing on the iOS Device by changing the FMX.Form.Quality property. On the iOS simulator, antialiasing is always disabled and cannot be enabled.

Using Styles in XE4

  • FireMonkey bitmap-based styles now include native styling for iOS, Windows, and Mac.
  • You can create your own custom bitmap-based styles using the included Bitmap Style Designer.
  • You can also work with vector styles in FireMonkey desktop and mobile apps.
    • When using vector styles in iOS apps, there are some limitations with regard to stroke painting and clipping, and gradients have a limit of 4 key-points.

Support Added for Retina Display of 3D Components

All FireMonkey 3D components automatically work in hi-res mode when run on Retina devices. There are no additional properties required.

FireMonkey 3D components include:

Mac OS X Fullscreen Mode

FireMonkey offers fullscreen support, including the two-arrows icon Fullscreen2.png that appears in the top right-hand corner in a Mac application, allowing to go into or out of fullscreen mode.

  • To enable the fullscreen icon, use the ShowFullScreenIcon property.
  • To start the application in fullscreen mode, use the FullScreen property.

For more information see Fullscreen Mode on Mac OS X.

Sensors

FireMonkey introduces support for multiple sensors. A list of supported sensors can be seen in the FMX.Sensors unit:

See also IOS Tutorial: Using Location Sensors on the iOS Device.

Text Layout and Text Service Enhancements

The implementation of rendering functionality is moved from FMX.Text to a new unit FMX.TextLayout.

For more information, see:

Text Layout

FireMonkey introduces iOS support for TTextLayout and also provides new functionalities:

Text Service

  • Actions for manipulating the text, such as selected text manipulation, line drawing and cursor manipulation functions are available for iOS.
  • Standard actions are exposed by ITextActions.

FireMonkey Services

Platform Services

FireMonkey XE4 introduces a feature called Platform Services that is useful for returning whether the platform that will run your application actually supports a given service or not.
For more information see FireMonkey Platform Services.

Notification Center for iOS

Notifications are ways for an application that is not running in the foreground to let its users know about useful information for them.
A new unit is introduced: FMX.Notification

Margins and Padding for FireMonkey Controls

In FireMonkey XE4 the behavior of Margins and Padding are exchanged:

  • Padding adds space to the inner side of a control.
  • Margins adds space to the outer side of a control.

Now margins and padding in FireMonkey respect the CSS Box Model and the established definition used in VCL.

For more information about how to use Margins and Padding see Aligning with Margins and Padding and Using Common Layout-Related Properties of a FireMonkey Component.

New FireMonkey Units

  • FMX.WebBrowser
  • FMX.Sensors (introduced before XE4)
  • FMX.Pickers
  • FMX.PhoneDialer
  • FMX.MedialLibrary.Actions
  • FMX.MagnifierGlass
  • FMX.InertialMovement
  • FMX.Header
  • FMX.Controls.3D

Refactored FireMonkey Classes

Some FireMonkey classes have been moved to different units.

Examples of refactoring in FireMonkey:

These refactoring changes should be transparent to you, as long as the new parent unit (such as FMX.StdCtrls) is referenced in #include or uses, and you do not specify the old unit name (such as FMX.Controls) in references to the classes in question. However, if you are migrating a pre-existing project that uses FMX.TForm3D, you might need to add the new unit name (FMX.Forms3D) in your #include or uses. For a more complete list of refactored classes, see Refactored FireMonkey Classes in XE4.


Caret Property Now Published

The Caret property in the TEdit, TClearingEdit, and TMemo controls is re-declared with the published visibility. Therefore, the Caret property of these controls appears in the Object Inspector.

HScrollBar and VScrollBar Now Protected

HScrollBar and VScrollBar are re-declared as protected properties of TScrollBox and its inheritors, such as TMemo:

Improvements in Action List editor

The Categories pane shows the hierarchical tree of names of the Actions.TContainedAction.Category properties belonging to actions in an action list. This tree might contain several levels of branches. For example, the category File (branch of the top level) might contain the Export sub-category (branch of the second level) containing several actions. In this case the Category property in the Object Inspector shows both File and Export categories concatenated with a dot (File.Export).

FireMonkey Advanced Platform-Independent Scrolling Engine

Scrolling under iOS is more sophisticated than the default scrolling under Windows. The TAniCalculations class provides the universal scrolling engine supporting all iOS scrolling features. The TAniCalculations scrolling engine provides the same physical scrolling features under all platforms, so that FireMonkey uses the scrolling behavior of the target platform (OS X, Windows, or iOS).

By default, on each platform the TAniCalculations scrolling engine gets scrolling behavior properties that provide the standard scrolling behavior for the platform. But you can programmatically set values of scrolling properties, which emulate scrolling behavior typical for other platforms. For example, you can select emulation of iOS scrolling behavior under Windows and vice versa.

Here are some of the scrolling parameters that you can set or specify:

Platform Assistant (PAServer) Changes for XE4

Installer and Name Changes on the Mac

On the Mac, the Platform Assistant has changed as follows:

  • Platform Assistant installer:
    • The installer for the Platform Assistant on the Mac has changed, and it is now named RADPAServerXE4.pkg. You can obtain the installer in two places:

On Windows, only the install directory has changed:

  • The paserver.exe file is installed in C:\Program Files\Embarcadero\RADPAServer\n.n.
    Previously, the folder name was C:\Program Files\Embarcadero\RAD Studio\n.n\PAServer.
  • Platform Assistant installer is unchanged, and its name remains setup_paserver.exe.
  • The name of the Platform Assistant server is also unchanged: paserver.exe.

Help Reorganized for PAServer

The help for the Platform Assistant has been reorganized and is now located in the Command Line Utilities section:

Delphi Compiler Changes for XE4

Two New Delphi Mobile Compilers for iOS

The iOS target platform is supported only in Delphi mobile applications, which use one of the two new Delphi mobile compilers available in XE4:

Differences between Delphi Desktop Compilers and Delphi Mobile Compilers

The two Delphi mobile compilers (DCCIOSARM and DCCIOS32) are quite different from the Delphi desktop compilers (DCC32, DCC64, DCCOSX). The mobile compilers can be considered a "Next Generation" of the Delphi language, and the mobile platform is a new step in the continuing evolution of the Delphi language. Keep in mind, however, that the language differences typically are not related to platform differences.

To summarize:

  • No inline assembly is supported on iOS, but four atomic intrinsic functions are supported by the Delphi mobile compiilers
  • COM is not supported
  • Automatic Reference Counting is on by default for classes as well as interfaces, strings and dynamic arrays.
  • Seven of the older string types are not supported on iOS:
    • AnsiString
    • WideString
    • AnsiChar and PAnsiChar
    • PWideChar
    • OpenString
    • ShortString
  • Strings are changing:
    • Strings on iOS are 0-based instead of 1-based (requiring possible changes to string handling routines)
      You can use the new Delphi compiler directive {$ZEROBASEDSTRINGS} to change the string indexing scheme locally. However, the RTL for the Delphi mobile compilers uses 0-based strings, so you must use 0-based strings when you are using the RTL in a Delphi mobile app. For example, {$ZEROBASEDSTRINGS} is useful if you have an isolated instance of in-place string editing that you cannot migrate to 0-based indexing at the moment. It is not safe to use {$ZEROBASEDSTRINGS} for code larger than a snippet; do not use {$ZEROBASEDSTRINGS} for an entire module or application.
    • For all string handling, we recommend using TStringHelper functions. See Migrating Delphi Code to iOS from Desktop for examples.
    • For editing a string in place, we recommend using TStringBuilder.
    • Strings are very likely to become immutable (constant) in the future, and at that time you will not be able to index into a string as an array and manipulate the characters in a string.
      If you attempt to modify a string, the Delphi mobile compilers might emit the message W1068 Modifying strings in place may not be supported in the future (Delphi).
      You can specify whether the message x1068 is emitted as a warning or an error. In the Hints and Warnings page, set the warning "Modifying strings in-place...." to "true" or "error".
Note: The With statement might not be supported in the future by the mobile compilers or new compilers. We recommend that you refactor or rewrite any With statements in your code base, and eliminate With statements where possible.

For more information about writing code for the Delphi mobile compilers, see Migrating Delphi Code to iOS from Desktop.

New Delphi Compiler Conditionals

The following new conditionals are introduced in XE4:

  • AUTOREFCOUNT
  • CPUARM
  • EXTERNAL_LINKER
  • IOS
  • NEXTGEN
  • UNDERSCOREIMPORTNAME
  • WEAKREF
  • WEAKINSTREF
  • WEAKINTREF

For more information, see "Predefined Conditionals" in Conditional compilation (Delphi).

New Delphi Compiler Directives

The following new compiler directives are introduced in XE4:

For more information, see Delphi Compiler Directives (List) Index.

New Delphi Compiler Attributes

The following new compiler attributes are introduced in XE4:

IDE Changes for XE4

FireMonkey iOS Mobile Application Wizard

New FireMonkey Mobile Wizard

You can use one of the mobile application templates as your starting point when you create a new application. A template is a predefined mobile application, a project that contains forms that are preconfigured with components. For more information, see FireMonkey Mobile Application Templates.
New target platforms for iOS:
iOS Device and iOS Simulator

iOS Target Platforms Supported

The iOS mobile target platforms are now represented in the Target Platforms node of the Project Manager.

When you create a FireMonkey Mobile Application, there are two basic iOS target platforms that you can select (iOS Simulator and iOS Device).

As the target platform for the next build, you can select:

  • iOS Device (for an iOS device connected to your Mac), which is any of the following:
    • Debug (for development cycles)
    • Ad-hoc (for private distribution)
    • App Store (for submitting your app to the App Store)
  • iOS Simulator (for the iOS simulator running on Mac OS X; the default iOS app), which is any of the following:
    • iPad
    • iPhone (the default)
    • iPhone 5

You can add iOS Device and iOS Simulator to your custom run-time packages, and build them for those platforms, so your components can be used in those platforms as well.

New Mobile Form Designer with the iPhone design device selected

New Mobile Form Designer

RAD Studio introduces the FireMonkey Mobile Form Designer, a special Form Designer for mobile applications.

In addition to the features of the Form Designer, the Mobile Form Designer provides Design Devices, which are preset forms with the appearance and dimensions of actual mobile devices, to give you a better idea of the final look and feel of your application on those devices.

You can also change the default design device used in new mobile forms from Tools > Options > Environment Options > Form Designer > Default Mobile Device.

Connection Profiles and SDKs (Replacing Remote Profiles)

Remote profiles have been renamed and split into two pages:

  • Connection profiles – A connection profile defines the connection to a running instance of the Platform Assistant.
  • SDKs – A software development kit (SDK) defines a list of paths to files and folders on a target platform, as well as a local copy of those files.

In situations where you previously needed a remote profile, you now need a connection profile.

You only need an SDK to build the following cross-platform applications:

  • C++ desktop applications for the OS X platform
  • Delphi mobile applications for the iOS Device platform

You can manage your connection profiles on the Tools > Options > Environment Options > Connection Profile Manager page (see Creating and Testing a Connection Profile on the Development PC).
You can manage SDKs on the Tools > Options > Environment Options > SDK Manager page (see Adding and Configuring an SDK).

You can export your remote profiles on previous versions of RAD Studio, and import them either as a connection profile or as an SDK. You can import the same remote profile twice, once as a connection profile on the Connection Profile Manager and once as an SDK on the SDK Manager.

To configure the connection profile and the SDK assigned to a target platform, right-click the target platform node under Target Platforms, on the Project Manager, and click Properties to open the Platform Properties dialog. See Activating and Configuring the Target Platform.

API Implementation of Connection Profiles and SDKs

The PlatformAPI unit has been updated and extended with new interfaces for managing connection profiles and SDKs. Interfaces are self-documenting, but you can find helpful comments in the code.

IDE and Project Options Changes

Form Designer

The Embedded Designer option is no longer available on the Tools > Options > Environment Options > Form Designer page.

Application Options

For icons in FireMonkey desktop and mobile applications, you can now define icon files on the Project > Options > Application page as follows:

  • .ico files are used for the Win32 and Win64 target platforms.
  • .icns files are used for Mac OS X.
  • .png files are used to represent your application on iPhone and iPad devices, as well as in the App Store.

RAD Studio contains a number of different-sized PNG icons for iPhone, iPad, and App Store. For example, two of the provided icon files are FM_ApplicationIcon_72x72.png and FMApplicationIcon_144X144.png.

Version Info

  • The new UIDeviceFamily key has been added to the Version Info page in Project Options. This value is used when filtering your application on the App Store, so you must assign the right value. Possible values are:
    • iPhone - Support for both iPhone and iPod Touch devices
    • iPad - Support for iPad devices
    • iPhone & iPad - Support for iPhone, iPod Touch, and iPad devices (This is the default value.)
  • The new Orientation tab enables you to specify custom orientation for your iOS apps:
    • Portrait (vertical)
    • Upside down portrait
    • Landscape (horizontal, with the Home button on the left)
    • Inverted landscape (horizontal, with the Home button on the right)
You can specify one orientation (meaning that your app displays in only the specified orientation) or several orientations (meaning that your app uses the specified orientations, as determined by the rotation of the device itself).
You can also specify orientation in your code by using FMX.Forms.TFormOrientation.

Provisioning

On the Provisioning page, you can now configure the following three new build types for the iOS Device target platform:

  • Debug - Build your application to run on a device plugged into your Mac; typically used during development and debugging.
  • Ad-hoc - Build for testing and distribution to a limited number of devices
  • AppStore - Final build for distribution in the App Store

See Completing the Provisioning Page for details.

Delphi Compiler Project Options

The project options pages related to Delphi compilers have been updated to provide additional options. These options let you take advantage of the new features introduced by the new compilers for iOS Device and iOS Simulator platforms.

Delphi compiler project options are summarized for the two mobile compilers on their separate pages:

C++ Compiler Changes for XE4

The new C++ 64-bit Windows compiler (BCC64.EXE) was introduced in XE3 and is part of XE4 and ongoing RAD Studio releases.

The XE4 release contains significant bug fixes for C++Builder.

For more information, see What's New in C++Builder 64-Bit Windows.

Database Changes for XE4

  • Added InterBase ToGo in XE4 support: now you can use InterBase as your embedded database in your iOS application
  • Added SQLite support for iOS applications
  • Added IBExpress support for iOS
  • Added Midas Client Components for iOS
  • Added DataSnap Connectors support for the latest platforms
  • Added FireDAC, a powerful set of Universal Data Access Components for developing database applications in Delphi and C++Builder.

A number of new units have been added, such as:

DataSnap Changes for XE4

  • Native DataSnap Client support for iOS independent of the DataSnap connectors through HTTP, HTTPS, TCP/IP, and REST.

LiveBindings Changes for XE4

  • Enhanced and extended ListBox capabilities for iOS
  • Added embedded search
  • Expanded LiveBindings support for ListBox

Run-Time Library (RTL) Changes for XE4

Debugger Changes for XE4

The debugger now supports debugging of iOS applications that are running on either the iOS Simulator or the iOS Device.

Application Samples Changes for XE4

New sets of samples include iOS Mobile and iOS Code Snippets (both described below). The existing application samples have been migrated from XE3 to XE4; this includes FireMonkey desktop, database, DataSnap, LiveBindings, Delphi, C++, RTL, VCL, and other categories.

For XE4, the location of the SourceForge repository has changed. The new URL for the application samples repository is: http://sourceforge.net/p/radstudiodemos/code/HEAD/tree/branches/RadStudio_XE4/

Using the new user-friendly interface on the SourceForge site, you can browse the contents of each folder and easily download projects and files.

For more information about the samples that are installed with the product, see Samples Descriptions.

New FireMonkey iOS Samples

The following iOS application samples are delivered in the FireMonkeyMobile folder in your samples directory, typically located here:
C:\Users\Public\Public Documents\RAD Studio\n.n\Samples\FireMonkeyMobile

Each folder contains a minimal Readme file, and the PhotoEditorDemo contains in addition a more detailed readme.txt file.

New FireMonkey iOS Code Snippets

A set of FireMonkey iOS Code Snippets are installed with the product. The iOS code snippets are short, targeted Delphi samples that help you understand how to implement basic iOS functionality such as accelerometer, gyroscope, and notifications.

  • You can find the iOS code snippets in the application samples in your product installation, typically here:
    C:\Users\Public\Public Documents\RAD Studio\n.n\Samples\iOSCodeSnippets

Online Help Changes for XE4

Checkbox to Display or Hide Inherited Members

On the pages that list the class methods, properties, and events in the Libraries wiki, there is a new checkbox that enables you to display or hide the inherited members:

  • When inherited members are displayed, the list displays all of the inherited members as well as the locally declared members:
InheritedOn.png
  • When inherited members are hidden, the list displays only the members that are declared in the class:
InheritedOff.png

PAServer Help Reorganized

The help topic "Installing and Running the Platform Assistant (paserver) on the Target Platform" has been split into separate topics, as follows:

Some Notable New Help Topics

Some Notable New Code Examples

See Also

Personal tools
In other languages