Posts tagged ‘XE4’

XE Plus Pack – Release 12 (XE4 Support)

Release 12 of XE Plus Pack is now available for download which includes XE4 support.

Users can download the required version from the download page.

To try XE4 Plus Pack download the trial version.

Users of XE2 Plus Pack and XE3 Plus Pack can use their existing registration details to unlock XE4 Plus Pack.

New in Release 12 (for all)

Smart Desktops

Allows you to synchronize your desktops between computers and installations. This is just the first part of the Smart Desktop feature, with additional features being added in future releases.

http://www.jed-software.com/help/SmartDesktops/SmartDesktops.html

New in Release 12 (for XE4 only)

– Component editor for the TTabControl FireMonkey component that allows you to switch between pages using the form designer context menu, or a link at the bottom of the object inspector.

Embarcadero: Don’t hide behind bad design

Recently I created an QC report to try and get the default wizard behaviour changed to be user friendly.

The issue is that the description text for the wizard item only shows when the mouse is hovered over the item. This means that keyboard navigation will never show the description nor will just opening the dialog initially, unless you magically have your mouse in the wrong spot.

Apparently, this is the way the wizard has been designed.

Report No: 115353 (RAID: 38977) Status: Closed
The mobile wizard doesn’t show a description using you hover over the item
http://qc.embarcadero.com/wc/qcmain.aspx?d=115353

Mobile Wizard comparison screen captures

Another item that is also “As Designed” is the text used to describe the blank application item in the wizard. This text states:

“The Blank Application Template is a jumping off point for creating a completely custom mobile application.”

Now I acknowledge that English was the subject I liked the least at school but that sentence could be improved.

Here are a couple of alternatives that I’ve thought about in the past ten seconds.

  1. “The Blank Application Template is the starting point for creating a custom mobile application.”
  2. “Use the Blank Application Template to create a custom mobile application.”

Perhaps you can add your own.

XE4 Mobile Tip #2 – Loading local HTML content

I’ve already answered this on the newsgroups however it deserves a little more attention.

The most important thing to do when deploying additional files with your app is to make sure they are prefixed with “StartUp/”. This tells the deployment manager to deploy these files with the application and place them in the folder specified after the StartUp/ prefix. This prefix is case sensitive.

Here is a screen capture of the deployment manager for the sample project available for download at the end of this post.

Deployment Manager

Verify file is included without running the app

You can even verify that the files have been deployed with the app by looking in the Applications section of your device in the XCode Organizer.

XCode Organizer

Sample code

The code below loads the content of the file into the WebBrowser control that is on the form.

unit Unit288;

interface

uses
  System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, FMX.Types,
  FMX.Controls, FMX.Forms, FMX.Dialogs, FMX.WebBrowser, FMX.StdCtrls, FMX.Layouts;

type
  TForm288 = class(TForm)
    LoadHtmlButton: TButton;
    WebBrowser1: TWebBrowser;
    Layout1: TLayout;
    procedure LoadHtmlButtonClick(Sender: TObject);
  end;

var
  Form288: TForm288;

implementation

uses
  IOUtils;

{$R *.fmx}

procedure TForm288.LoadHtmlButtonClick(Sender: TObject);
var
  LFilename: string;
begin
  LFilename := TPath.GetDocumentsPath + '/index.html';
  if TFile.Exists(LFilename) then
    WebBrowser1.Navigate('file://' + LFilename)
  else
    MessageDlg(Format('File not found: %s', [LFilename]), TMsgDlgType.mtError, [TMsgDlgBtn.mbClose], 0);
end;

end.

Works on my device!

Device Test (portrait)
Device Test (landscape)

Download the Code

Download the sample project.

A couple of notes

  • You wouldn’t deploy a static file to the Documents folder unless you wanted it to be backed up (via iTunes or iCloud) with other user data.
  • The best location for static files is Library/Application Support/, this is content that is generated when the application runs, or is included with the application.

XE4 Mobile Tip #1 – Disable the GPU Canvas

If you don’t like circles with jagged edges, you can disable the GPU canvas.

Using the GPU Canvas:

GPU Canvas

Not using the GPU Canvas:

Non-GPU Canvas

Full image comparison at 200% using Beyond Compare. Click to enlarge to full size (2600 x 1540).

Canvas Comparison

NOTE: If you see other drawing issues, enable the GPU canvas again just to see if it is a canvas issue.

Disabling the GPU Canvas

To disable the GPU canvas you must modify the project file source.

Add FMX.Platform and FMX.Consts to the uses clause. I suggest adding these items after the FMX.Forms entry but before any other units. You MUST leave System.StartUpCopy as the first unit in the uses clause.

Before Application.Initialize is called, enter this line:

TPlatformServices.Current.GlobalFlags.Add(GlobalDisableiOSGPUCanvas, True);

FireMonkey Style – TStyleTag (Part 2)

Part 1 – http://jed-software.com/blog/?p=699

Along with the missing registration of TStyleTag, the following components cannot be used in styles without hand editing FMX or Style files.

  1. TFontObject
  2. TBrushObject

I’ve updated the package to now register these missing style components so you can use them in custom styles.

Download Package

The change is straight forward if you have already downloaded and installed the previous package.

The register procedure should now look something like this:

procedure Register;
begin
  RegisterComponents('Shapes', [TStyleTag, TFontObject, TBrushObject]);
end;

NOTE: You may want to register them to a different palette location.

 

FireMonkey Style – TStyleTag

There appears to be an oversight by Embarcadero with the TStyleTag component not being registered for use.

TStyleTag is a handy little component that allows you to add it to a style definition and have it store an Integer, Float or String value. This is used in some of the default styles, one place being the TTrackBar where it is used to hold the default thumb size of the track item.

This allows you to retrieve the thumb size depending on the default style (Windows or Mac) and adjust your user interface depending on the value.

TStyleTag Component

I’ve created a package that your can compile and install into the IDE to register this component.

Download Package

The component doesn’t have to only be used in a style definition, you can drop it directly on your form if you have a use for its functionality.

NOTE: While the component is used in the default Windows and Mac styles, it doesn’t seem to be used in the other FireMonkey styles. Although I did only look in a couple of them. Perhaps something that will be address in an update.