XE Plus Pack – Release 17

After a much longer testing phase than expected, the newest release of XE Plus Pack for Delphi XE6 and Delphi XE7 is now available for download.

XE6 Plus Pack – Download for XE6
XE7 Plus Pack – Download for XE7

The main new feature for Release 17 is the ability to quickly generate and apply all of the required icon and splash images required for a mobile (iPhone or Android) application.

Image Generator

This new feature is called Image Generator and is accessible from the Project menu in the IDE. It is only available when a FireMonkey project is loaded within the IDE.

Image Generator - Design

You have the ability to add use three elements to compose your splash images.

  1. App Icon
  2. Backgroun
  3. Company Logo

Image Generator - Output

Once the images have been generated, you can review the final creations before applying the images to the correct elements in the active project. The images are applied for All Configurations. It does not support selecting whether to apply the images to Debug and/or Release. An enhancement for the next release – if deemed necessary.

The details of the design can be save to an “xeppsettings” file in the same folder as the project. Currently this is a binary file, however it will be changed to an XML or text readable file for easier use with source control.

More information about the Image Generator expert will be available soon.

View Units Dialog

An enhancement has been made to the View Units dialog which is updated due to the Visual Forms feature. This new dialog now gives the option of viewing either the selected files thumbnail (if available) or all available thumbnails. Additional options will be added to the View Units dialog in future releases.

View Units - Single View

To toggle the thumbnail view mode, use F8.

View Units - Thumbnail View

Did you purchased XE Plus Pack?

If you previously purchased XE Plus Pack and have moved onto Delphi XE2 or above, please contact me for you free upgrade license details.

Clarification

XE Plus Pack ONLY works with Delphi XE.

The XE2 Plus Pack and above (the name changes for the supported IDE) is not free.

I have no plans to make it free. However, a license purchased for XE2 Plus Pack (or above) will work with any Embarcadero released IDE from Delphi XE2. So the same key will work with XE3, XE4, XE5, XE6, XE7 (see below) and even XE8 if that is what the next release will be called…

XE7 Plus Pack

The Delphi XE7 Plus Pack is currently in beta and was held back due to Update 1. It should be available to trial in a week or so.

Existing users can contact me for access to the beta.

 

XE Plus Pack – Free License details

Grab your free license details for Delphi XE Plus Pack.

http://www.jed-software.com/xepp.htm

 

License Details

Name: XE Plus Pack - Free License
Key: 02B537-8A808F-EFE83C-00E6EE-8BA946-3076F6-052F5F-CFC103-022F85-A28C71-006084

 

How to register

Download the trial version: http://www.jed-software.com/files/XEPlusPackTrial.zip

Use the Help | Register XE{x} Plus Pack… menu item to register.

 

Further install and help is available from http://www.jed-software.com/xepp_support.htm or email, support@jed-software.com.

 

Important info

  1. Only works for Delphi XE version.

 

FireMonkey – TArc and Retina, not the best of friends

Last week I noticed a post on www.fmxexpress.com that showed a different UI for a progress bar. So instead of starting work on something I should have, I turned the code into a component and added the ability to change the colours used when displayed.

I’d known TArc didn’t render nicely on a Retina device because I was using it to render a navigation UI concept. Which I’ve had to shelve because of this issue.

The control does look good under other platforms (untested under Android – issues not anticipated though).

You can download the full source code for the control from the Quality Central report lodged for the rendering issue. It looks like you will need to use a native client to download from the QC report as it doesn’t look like you can from the web client.

The control has the following “license” in the main unit:

{

TCircleProgress is based on code made open source by developer OneChen.

Original Code Link: https://github.com/OneChen/ProgressCircle
How I found out link: http://www.fmxexpress.com/build-a-progress-spinner-using-objects-in-delphi-xe6-firemonkey-on-android-and-ios/

Developer of this component: Jeremy North (jeremy.north@gmail.com)

DO NOT PAY FOR THIS COMPONENT. DONATE TO THE ORIGINAL AUTHOR OF THE IDEA IF YOU WANT TO CONTRIBUTE.

Disclaimer: This code is provided free of charge, bugs and all.

}

 

Windows

 

The Windows capture actually shows another drawing bug with FireMonkey. Notice how the rectangle at the top has two black dots in the top left and top right corners. This happens when you eliminate sides from a rectangle and maintain one full side to be drawn. Something that I’ve reported previously.

Report No: 122616 (RAID: 47827) Status: Open
Removing Sides can leave unwanted dots in corners
http://qc.embarcadero.com/wc/qcmain.aspx?d=122616

 

OS X

 

iOS

 

NOTE: This isn’t an issue for just TArc though, it is an issue with the GPU canvas. In previous versions, you could disable the usage of the GPU canvas, however with XE6 – the option to switch it off has been deprecated.

 

Zoomed view under iOS

 

Report No: 126186 (RAID: 52756) Status: Open
[Retina] [iOS] TArc doesn’t rendering nicely on a Retina device
http://qc.embarcadero.com/wc/qcmain.aspx?d=126186

 

Reported and opened. Hopefully in the next release, this rendering issue is addressed.

XE Plus Pack – Release 14

Release 14 is now available to all existing XE Plus Pack users. Release 14 also brings support for Delphi XE5.

The reason why the XE5 release was delayed was that the addition on iOS 7 support and a couple of changes to internal IDE component names (which made no sense to change) broke two of my experts. Needless to say, I was waiting for Update 1 to be released before making the XE5 version available.

NOTE: The XE5 release works with or without update 1 and with or without iOS 7 support.

Introducing Debug Visualizer Wizard

This expert is a repository wizard to help made Debug Visualizers without needing to go into much detail about their implementation. It allows you to concentrate on creating custom visualizers which is perhaps one of the most unappreciated IDE features.

Those paying attention will know that this wizard is based off the Blaise Pascal Magazine article written back in the days of Delphi 2010. The code was upgraded and the templates improved and now available from Delphi XE thought to Delphi XE5.

Debug Visualizer Wizard (release 14)

Fixes

There have also been a number of fixes under the hood, however two that will be noticeable are:

  1. Support for adding bookmarks with the bookmark guide when the editor is not docked.
  2. Improved tracing output.

Pricing

XE Plus Pack still costs just 40 Euros and can be purchased cheaper if ordering four or more licenses (contact us for quotes).

  • Purchase XE Plus Pack and get the Delphi XE version.
  • Purchase XE2 Plus Pack and get support for Delphi XE2 -> Delphi XE5.

http://jed-software.com/xepp_purchase.htm

Download

Download your required version from the download page.

To try XE5 Plus Pack download the trial version.

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: Extending TFloatAnimation to support maximum loops

Background

In response to a QC report I wrote early last year I decided to implement a LoopCount property on the TFloatAnimation component.

Report No: 105140 Status: Open
Add a LoopCount property to the TAnimation class
http://qc.embarcadero.com/wc/qcmain.aspx?d=105140

Class Definition

  TJSCustomLoopCountFloatAnimation = class(TFloatAnimation)
  public
    type
      TAnimationLoopEvent = reference to procedure (Sender: TObject; const LoopNumber: Integer; var Cancel: Boolean);
  private
    FLoopCount: Integer;
    FCheckingLooping: Boolean;
    FOnLoop: TAnimationLoopEvent;
  protected
    FLoopsComplete: Integer;
    procedure FirstFrame; override;
    procedure DoLoop(var ACancel: Boolean); virtual;
    procedure ProcessAnimation; override;
  public
    constructor Create(AOwner: TComponent); override;
    property LoopCount: Integer read FLoopCount write FLoopCount default 3;
    property OnLoop: TAnimationLoopEvent read FOnLoop write FOnLoop;
  end;

Nothing that interesting in the new descendant. New property called LoopCount to control the number of loops and a new event that gets triggered each time a loop completes.

The published component publishes the new property and event but also changes the default values for two existing properties. It makes sense to set Loop to true when the new class is for enhancing the looping ability and if you’re looping, generally AutoReverse will be set to true.

  TJSLoopCountFloatAnimation = class(TJSCustomLoopCountFloatAnimation)
  published
    property AutoReverse default True;
    property Loop default True;
    property LoopCount;
    property OnLoop;
  end;

Implementation

I won’t post all of the code here because you can download from the link provided below, just a couple of snippets.

We need to override the FirstFrame method to initialise a couple of variables we use.

  • Checking to see if the LoopCount property is valid (raise an exception if it isn’t)
  • Initialise the variable to zero that counts the interactions
  • Make sure we are going to be checking the animation process for loops

Most of the work occurs in the overridden ProcessAnimation method.

procedure TJSCustomLoopCountFloatAnimation.ProcessAnimation;
var
  LCtx: TRttiContext;
  LType: TRttiType;
  LField: TRttiField;
  LCancel: Boolean;
begin
  inherited;
  if FCheckingLooping then
  begin
    LType := LCtx.GetType(Self.ClassInfo);
    if Assigned(LType) then
    begin
      LField := LType.GetField('FTime');
      if LField <> nil then
      begin
        if LField.GetValue(Self).AsExtended = 0 then
        begin
          Inc(FLoopsComplete);
          LCancel := False;
          if FLoopsComplete > 1 then
            DoLoop(LCancel);
          // The first time through, FTime is 0 so we need to offset this by
          // adding 1 when checking for completion
          if LCancel or (FLoopsComplete = LoopCount + 1) then
          begin
            LField := LType.GetField('FRunning');
            if LField <> nil then
              LField.SetValue(Self, False);
          end;
        end;
      end;
    end;
  end;
end;

Thanks to extended RTTI we can access a couple of private fields that we need to determine if a loop has been completed. This occurs when the FTime variable is zero. There is one issue with using this value and that is that the first “Loop” should be ignored since the first time ProcessAnimation is called FTime is zero so by the logic used, a loop has completed. This is why the DoLoop method is only called if the FLoopsComplete variable is greater than one.

Naturally it is possible to handle this one-off situation differently using a “First Time Through” variable but under the circumstances, I decided to go with the solution in place.

Once the LoopsComplete value is one greater than the LoopCount (refer to the above two paragraphs if you’ve already forgotten about why) the private field FRunning is set to False. Setting FRunning to false, stops the animation immediately.

Why not just call the public Stop method instead of going to the trouble of setting a private field? The answer to that is found in the ProcessTick method of the animation control (incidently, why isn’t this method virtual?).

  ...
  ProcessAnimation; // <==== We set FRunning to false here
  DoProcess;

  if not FRunning then
  begin
    if Assigned(AniThread) then
      TAniThread(AniThread).FAniList.Remove(Self);
    DoFinish;
  end;
  ...

By setting FRunning to false within our ProcessAnimation override, we are avoiding another frame being processed before the animation is stopped. This is because the Stop method calls ProcessAnimation and DoProcess as well.

Download

You can download the component and a cheesy demo application from the link provided. There is no package for the component to install it into your IDE, this is left as an exercise for the reader :-).

Loop Animation Demo (short video – 39KB)

Download LoopCount Component and Demo

NOTE: Before downloading the source code you must agree to the license displayed below.

License Start




This space intentionally left blank…



License End