TMS Analytics for nonlinear multiparametric approximation of surface data

The new version 2.2 of TMS Analytics and Physics pack contains the nonlinear least squares approximation tools. The nonlinear approximation tasks are widely used in statistics to fit experimental data with some random distribution function.

Let us consider the example of surface data fitting with the 2D Gaussian function. The Gaussian distribution of 2 variables x and y (https://en.wikipedia.org/wiki/Gaussian_function) has the following math expression:

Except the amplitude A, the distribution nonlinearly depends on four parameters: center coordinates x0, y0 and deviations sx, sy. The task of fitting data with the Gaussian function is to find optimal values of the four parameters, those minimize the error of the distribution and the experimental data zi(xi,yi), i=1..N.

The approximation task can be solved by the numerical tool with the following code:

var
  variables, coefficients: TArray;
  f: string;
  basis: TNonlinearBasis;
  cValues: TArray;
  appr: TNonlinearApproximator;
  opt: TSolverOptions;
  eValues: TArray;
  eValue: TFloat;
begin
  variables:= TArray.Create('x', 'y'); // 1
  coefficients:= TArray.Create('x0', 'Sx', 'y0', 'Sy'); // 2 
  f:= 'e^-((x-x0)^2/(2*Sx^2)+(y-y0)^2/(2*Sy^2))'; // 3
  basis:= TNonlinearScalarBasis.Create(variables, coefficients, nil, f); // 4 

  appr:= TGaussNewtonLeastSquares.Create; // 5
  appr.C0:= TArray.Create(0.1, 0.1, 0.1, 0.1); // 6
  opt:= TSolverOptions.Create(true);
  opt.MaxIterationCount:= 100;
  opt.Precision:= 0.2;
  appr.Options:= opt; // 7

  cValues:= appr.Approximate(basis, xyData, zData); // 8

  // use basis with optimal coefficients
end;

Line 1: Create array of variable names.
Line 2: Create array of four distribution coefficient names.
Line 3: Set up the approximation function expression.
Line 4: Create the nonlinear basis instance with specified data.
Line 5: Create the appropriate nonlinear approximator instance.
Line 6: Set up initial guess of coefficient values for nonlinear solution.
Line 7: Set up appropriate nonlinear solution options.
Line 8: Solve the problem (finding optimal values).

When optimal values of the Gauss distribution parameters found, they can be used with the basis instance to calculate the distribution function in any specified point (x,y) or for other analysis methods, like derivative calculations and so on.

On the pictures below there are results of the approximation made with some generated noisy data. The result presented as 1D section of the 2D function for two different x values: x=0.0 and x=0.6.

In this sample, we used the TMS FNC Chart to display the values and the approximated function. The advantage of using the TMS FNC Chart is that it can be used both for VCL and FMX applications and we can use the same code to create a VCL Windows application or a FireMonkey cross platform application.
The source code of the example application can be downloaded here.

The TMS Analytics and Physics pack version 2.2 includes also many other useful numerical tools: linear least squares approximation, 1D and 2D integration, ordinary differential equation solution, function analysis. Due to the addition of array and matrix support in version 2.2, many numerical calculations can be implemented in vector form with small and compact formulae. The version can be downloaded from the product page.

Read More

Read More

How I use Linux to write software for multiple target platforms using Wine, Delphi 7, Lazarus and Delphi Berlin

How I use Linux to write software for multiple target platforms:http://kriscode.blogspot.tw/2016/10/how-i-use-linux-to-write-software-for.html – Kris Kamil Jacewicz – Google+ WINE has come a long way. Many things do not have a native look and feel, but so do many Delphi FMX or Lazarus LCL applications. In fact I use quite a few tools (including Mikrotik WinBox) through […] … Read More

Read More

A Busy Summer!

It was a busy summer. There has been so much happening lately that it is difficult to decide where to start.


Earlier this year we launched the milestone RAD Studio 10.2 (aka Tokyo). This August we released Update 10.2.1 that provided a number of highly anticipated quality and feature updates. So, what happened with the BIG September release? As stated before, we are no longer looking for the next BIG release. We want to provide customers the functionality that they need when it is ready and continue to constantly evolve the product ALL the time. We did 10.2.1 in August, but this week you should be looking for the iOS 11 update. We want to make it easier to stay on the latest release and deliver value more often.

 

We do have more work to remove the re-installation requirement altogether, but that is not a small task with almost 70K files involved. The good news is that upgrades today are more seamless and our Product and R&D teams received a lot of acolytes for that. The Linux support is a huge milestone and there is a lot more in 10.2.1 for both mobile and Windows.

 

Our marketing published an awesome magazine to celebrate the progress made with Delphi over the last 22 years I encouraged many of our developers to share this with their supervisors, who think that Delphi is a thing of the past, many were pleasantly surprised. We are running a nice promo for September that goes with the “22” theme, so check-out the site or speak with your partner. It is a great time to upgrade or expand.

 

The VCL framework continues to evolve. I think that with all the technologies out there, we sometimes forget how good it is, and it is only getting better. High DPI support and improved icons make your apps truly stand-out, and we have plenty of more awesome updates in the works. Lately, we’ve spoken a lot with C++ developers, as we try to increase the awareness for C++Builder. It is amazing how much Delphi developers take for granted. While there are OK visual frameworks that support C++, almost nothing comes close to VCL. I am really excited to continue to educate our C++ community on what we can deliver and of course continue to improve the C++ language support.

 

At the end of August, we released Enterprise Connectors. These make integration of applications built with RAD Studio to the most common enterprise applications, such as SAP, Salesforce, Facebook, and many more, very easy. They use a combination of FireDAC, REST, and CData technologies to make user adoption seamless. I think that these give an incredible competitive edge to our developer community, especially considering the speed of development. It is fast development indeed.

 

Just last week we launched the Embarcadero Academy! Making our products more easily accessible for education and making learning easier is a top priority. I feel that a dedicated education site together with a FREE Starter edition that is available for Education purposes are important steps in this direction. I benefit personally… My thirteen-year-old son is learning Delphi and the Academy is making it easy (and inexpensive)! Visit www.embarcaderoacademy.com and find out for yourself.

 

Most importantly, last month we acquired Sencha. This demonstrates again our broader commitment to Developer Tools. Sencha is the home of Ext JS, which is the premier Enterprise framework for JavaScript development. I am super excited for the Ext JS community. Today there are few independent IT organizations with our resources committed to developers. There are also a lot of immediate benefits for our existing Delphi and C++ developers. Over the years RAD Studio provided many Web development options, but none has had the robustness of our core VCL and FMX frameworks. As Web usage exploded, this has contributed for some in the decline of popularity for Delphi. The Ext JS framework is a match to VCL in terms of sophistication and scalability. There are already several good ways to bridge the technologies. As always, we have really smart partners in our technology ecosystems that have developed deeply integrated solutions (e.g. UniGui, Kitto). Developers can also use Ext JS through the REST API connectivity enabled by RAD Server. We will work with our technology partners to make the integration even more seamless.

 

The product team also just published a roadmap updated for September 2017. It includes plans for the upcoming 10.2.2 and 10.3 releases. There are also details on some research areas R&D is exploring. All of this as we continue our commitment to developers in keeping Delphi, C++Builder, and RAD Studio the premier choice for expert developers everywhere.

 

After a busy summer, we are all preparing for a busier fall. The community is full of ideas, Block Chains, more IoT support options, better TFS integration, and as always many ideas for language features. Our PMs are busy evaluating ideas and working with R&D on specs. We are open to technology partners and MVPs to participate and introduce products that expand our capabilities, Woll2Wall made an awesome Beacon Editor with FMX, the much anticipated FMX Linux Clients are out, there are cool FMX designer ideas, so much more to come. We’ll demonstrate a lot of these during CodeRage coming November 7th.

 

This is going to be a productive fall. Get on 10.2.1 and build some awesome apps!

Read More

Read More

Dependency Analysis – Pascal Today

Tools and steps for analysing Delphi or FreePascal code: Dependency Analysis – Pascal Today [WayBack] Used tools: Delphi Unit Dependency Scanner [WayBack] Gephi – The Open Graph Viz Platform [WayBack] yEd – Graph Editor [WayBack] yEd is a free desktop application to quickly create, import, edit, and automatically arrange diagrams. It runs on Windows, Mac OS X, and Unix/Linux. –jeroenFiled […] … Read More

Read More

Delphi and Linux

I'd just like to remind my Slovenian readers that on 28th this month I'll be having a presentation about RAD Studio and Linux in Ljubljana.As the presentation will be given in Slovenian language, the rest of my post containing the description of the presentation is written in that language, too.Vljudno vabljeni na delavnico "RAD Studio in Linux", na kateri si bomo ogledali:Kako namestiti Ubuntu v virtualni računalnik.Kaj storiti, ko namestitev nagaja.Kako pripraviti virtualni računalnik in RAD Studio za delo.Kako napisati konzolno aplikacijo za Windows in Linux, ki streže podatke z uporabo tehnologij FireDAC in DataSnap.Kako napisati grafično aplikacijo za Windows, OS X, iOS, Android, ki prikazuje in spreminja podatke na aplikacijskem strežniku iz prejšnjega koraka.Z nekaj sreče pa še: Kako to grafično aplikacijo pognati na Linuxu inKako konzolno aplikacijo spremeniti v pravi Linux "service".Vstop prost, prosimo vas le, da se vnaprej registrirate, da bomo znali pripraviti zadostno količino kave in prigrizkov ;)--- Published under the Creative Commons Attribution 3.0 license
Read More

Deep Dive: Hospitality Survey App Template For RAD Studio 10.2.1 Tokyo

The Hospitality Survey App template can be downloaded through Embarcadero’s GetIt which is built into the RAD Studio IDE. It consists of four different projects that interconnect with each other. The projects are:

  • Hospitality Survey Setup
  • Hospitality Survey EMS
  • Hospitality Survey Admin
  • Hospitality Survey Client

You should deploy and run the projects in the following order:

1) The Hospitality Survey Setup app will help you set up your database, the tables and data, and your EMS user accounts.

2) The Hospitality Survey EMS is the RAD Server side REST resource which both the Hospitality Survey Client and the Hospitality Survey Admin interface with. It should be deployable on Windows and Linux through IIS, Apache, or the stand alone EMS server.

3) The Hospitality Survey Client is a RAD Studio client application for Android, iOS, macOS and Windows. The client application should allow you to select a tenant from your RAD Server and then log in as a user. Once logged in it will download the survey data for your current tenant and allow the survey to be filled out. Once the survey is complete it can be submitted back to the server and a new survey can be started.

4) The Hospitality Survey Admin app is an AngularJS application for the web. You should be able to log into the application with your Tenant ID and RAD Server user ID. The web app should allow you to view statistics and graphs about the results of the survey questions and each individual question and answer. You can also export a list of emails collected from the surveys.

 

In Depth Developer Guide Webinar


[YoutubeButton url=’https://www.youtube.com/watch?v=1KTv5hVCF_M’]

 

Hospitality Survey Setup

Start: Your EMS Server should already be setup and running.

Step 1: Set a path for your stores database. Set the path to the EMSServer database.

The stores database is created, used, and populated with data in Step 4.

The EMSServer database link is used to populate the drop down of Tenant IDs in Step 3.

Step 2: Setup the demo users on the EMS Server using the EMS API.

You will need your EMSServer Host, Port, and Tenant IDs in this step. The Setup will connect to your EMSServer and create groups and users for the template.

You can create Tenant IDs using this tutorial:

http://docwiki.embarcadero.com/RADStudio/Tokyo/en/RAD_Server_Multi-Tenancy_Support#EMS_Multi-Tenant_Console

Step 3: Customize the questions to be asked in the survey for each tenant. A blank tenant_id will be asked to all tenants.

You can customize the questions in your survey on Step 3. The fields are:

  • ID – An ID for the question.
  • name – A short name for the question with no spaces.
  • title – The text of the question as it will appear in the survey.
  • type – The type of question controls which question template is loaded on the client. The existing types are: rating, yesno, edit, options
  • options – If the type of the question is set to options this field is used to populate the options. It’s value is a JSON array of options.
  • value – The value is where the user submitted data is stored. It can be left blank but could be used to provide a default answer.
  • category – The category of the question. This field is provided for expandability.
  • tenant_id – The tenant ID of the question. If the tenant_id field is blank all tenants will get the question. If it is set to a tenant only that tenant will get the question.

 

Be sure to update the tenant IDs to to match your tenant IDs.

Pressing the Re-Generate button will create new INSERT queries on Step 4.

Step 4: Create the tables and insert the questions data into your stores database with the Initialize All button.

This step contains the SQL setup queries for the stores database. There are three tables which will be set up which are: SURVEYS, QUESTIONS, RESULTS

Each table will be dropped and re-created when the queries are run (any existing data in the tables will be lost). In the third TMemo field the SQL queries from your questions defined in Step 3 will appear.

Pressing the Initialize All button will execute the SQL queries against your defined stores database from Step 1.

Complete: After step 4 the databases and users should be setup and ready for you to use the client and admin areas.

Your EMS database and users should be setup at this point. You should be able to connect the Hospitality Survey EMS package to your new stores database and compile the package.

Once your Hospitality Survey EMS package is running in the EMS Development Server you should be able to open and compile the Hospitality Survey Client.

After you submit some survey results via the Hospitality Survey Client you should be able to log into the Hospitality Survey Admin and see your results.

 

Hospitality Survey EMS

The Hospitality Survey EMS is the RAD Server module for the Hospitality Survey Client and the Hospitality Survey Admin to interface with.

The end points mainly return the FireDAC JSON format which can be easily loaded in to a RAD Studio client or access via standard JSON in a non-RAD Studio environment.

 

Endpoints:

GET /survey/ – Download the survey questions in FireDAC JSON format.

GET /survey/results/* – Download the survey results in a paged fashion in FireDAC JSON format. The page number is placed where the * is.

GET /survey/stats/all – Download various stats about the survey results in FireDAC JSON format.

GET /survey/details/* – Download the questions and answers from a specific survey ID in FireDAC JSON format. The survey ID is placed where the * is.

GET /survey/emails/csv – Download a list of all of the email addresses from completed surveys in CSV format.

 

GET /tenants/ – Download a list of the server Tenants which are active in FireDAC JSON format.

 

 

The endpoints are defined like this in code:

// SurveyModule.pas

[ResourceName('survey')]

//

procedure Get(const AContext: TEndpointContext; const ARequest: TEndpointRequest; const AResponse: TEndpointResponse);

//

[ResourceSuffix('{query}/*')]

procedure GetData(const AContext: TEndpointContext; const ARequest: TEndpointRequest; const AResponse: TEndpointResponse);

//

[ResourceSuffix('{query}')]

procedure PostData(const AContext: TEndpointContext; const ARequest: TEndpointRequest; const AResponse: TEndpointResponse);

//

//

if ARequest.Params.Values['query'] = 'results' then

if ARequest.Params.Values['query'] = 'stats' then

if ARequest.Params.Values['query'] = 'details' then

if ARequest.Params.Values['query'] = 'emails' then

//

//

// TenantModule.pas

[ResourceName('tenants')]

procedure Get(const AContext: TEndpointContext; const ARequest: TEndpointRequest; const AResponse: TEndpointResponse);



 

The variable in the /survey/results/* and /survey/details/* endpoints is accessed via ARequest.Segments object like below:

//

  if ASegments.Count = 3 then // first segment is "survey" second is "results or "details" third segment is the variable

  begin

    SurveyId := ASegments.Items[2];

  end;

User permissions:

User permissions are governed by the {$DEFINE GROUPPERMISSIONS}. You can comment or uncomment this line for dev and live deployments. User permissions are ignored when {$DEFINE GROUPPERMISSIONS} is commented out.

 

Hospitality Survey Admin

The Hospitality Survey Admin dashboard project which was built in AngularJS. The Admin Dashboard connects to RAD Server on the backend via a REST API. The stats that are displayed are for data that has been collected in the Hospitality Survey Client. AngularJS is a popular framework for building web applications. It uses straight Javascript and HTML as it’s template language. The data binding functionality that it offers eliminates a lot of the CRUD code you would normally have to build. AngularJS uses HTML as it’s View and Javascript as it’s Controller. You can quickly consume JSON from REST end points and display it using AngularJS. 

You should be able to log into the Admin area using a Tenant ID and Tenant Secret plus the login and password for a user in the Managers Group. For this template the default user is Manager1.

Note: You must log in with your Tenant ID as the Store ID and not the Tenant Name.

Installation:

Copy index.html and the img, js, and styles subdirectories to your web server. Optimally you should place them on the same web server as your RAD Server DLL or Shared Object file. They could be placed in an admin subdirectory. You can place them on a different web server than RAD Server but you will need to make sure that your CORS Access-Control-Allow-Origin is set up correctly.

Within the js/admin.js file you should configure the $scope.ServerURL variable to point to the host where you RAD Server install is located. The default is: http://localhost:8080/

 

CORS Accept permissions:

Within the js/admin.js file you can configure the CORS settings for dev and live versions within the $scope.getHeader function. By default it is setup for development. When you want to switch to the live version (and enable user permissions) you can uncomment the line containing the X-Embarcadero-Session-Token and comment out the line without it. Switch back and forth between the two as needed.

There is a similar setting in the Hospitality Survey EMS server for configuring permissions for dev or live.

 

REST Endpoints & FireDAC

The Hospitality Survey EMS endpoint returns FireDAC tables as JSON. This allows interchangable compatibility between RAD Studio and clients like AngularJS. Here is an example of walking through the FireDAC table JSON tree to get to the records: data[“FDBS”][“Manager”][“TableList”][0][“RowList”]

In addition to AngularJS the Admin Dashboard also utilizes Chart.js, BootStrap, and a custom Bootstrap style. The Bootstrap style is from BootsWatch.com and you should be able to go there and get other styles. If you replace the existing style in the project with one of the other styles on BootsWatch.com it should just drop it without any other effort and you will have an entirely new look (just like how FireMonkey styles work). Chart.js is available from Chartjs.org which is a great Javascript library for displaying chart data dynamically in the browser. The Chart.js library has a special shim for AngularJS which facilitates the data exchange between AngularJS and Chart.js. Lastly, BootStrap is used which provides visual theming on HTML form elements (among other things). There is also a special shim for AngularJS which facilitates the easy integration with BootStrap.

 

Hospitality Survey Client

The Hospitality Survey Client connects to the Hospitality Survey EMS server on multiple end points for downloading and upload data. It is built to be cross platform on Android, iOS, macOS, and Windows using a single codebase and single UI.

The survey is dynamically generated based on the questions that are downloaded from the Hospitality Survey EMS server. Each question is assigned to a TFrame which displays that type of question.

Architecture:

The architecture of the app is built in a rapid application development style using TTabControl for handling pages and individual frames for each page. TActionList is used to consolidate much of the code in the MainForm.

 

Forms:

uMainForm.pas – Contains the main form of the application including the TTabControl with the design time frames.

uTenantListForm.pas – Contains a separate form for selecting the active Tenant ID.

 

DataModules:

uTenantsDM.pas – Contains the non visual components for downloading the Tenant list.

 

Design Time Frames:

uStoreLoginFrame.pas – Contains the store login frame.

uLoginFrame.pas – Contains the user login frame.

uMenuFrame.pas – Contains the main menu of the application including the Take Survey button.

uFinishFrame.pas – Contains the final frame of the application including the Thank You button after a survey has been completed.

uBackendFrame.pas – Contains the non-visual components for downloading survey data and uploading the results.

uProgressFrame.pas – Contains the animated progress controls which are displayed when the application is doing work.

 

Dynamic Frames:

uComboBoxFrame.pas – Contains the combo box survey question type.

uCompleteFrame.pas – Contains the complete button for the survey.

uEditFrame.pas – Contains the edit survey question type.

uRatingBarFrame.pas – Contains the star rating track bar survey question type.

uSurveyHeaderFrame.pas – Contains the header for the top of the survey.

uYesNoFrame.pas – Contains the Yes/No survey question type.

 

If you want to make changes to the design time frames be sure to edit the frame itself and not the version of it that is embedded in the MainForm. This will keep your changes consolidated in one place. If you changes don’t update in the MainForm you can delete the Frame from the MainForm and re-add it. Be sure to add it to the correct Tab and set to Align Client after you add the frame.

Note: You must log in with your Tenant ID as the Store ID and not the Tenant Name.

Credits:

Restaurant Image: http://www.freeimages.com/photo/restaurant-1233046

 

Hospitality Survey Editor

There is also a Hospitality Survey Editor app which will connect to your existing Hospitality Survey database and allow you to customize the questions which are asked in the client. The questions are stored in a table in the database and then downloaded to the client as JSON through RAD Server. The Hospitality Survey Client app loads the JSON and then dynamically creates the input fields using TFrames.

The Hospitality Survey Editor app was created by stripping down the Hospitality Survey Setup app and connecting it directly to the Hospitality Survey database.

Download the full source code for the Hospitality Survey Editor in FireMonkey for Delphi 10.2 Tokyo.

Read More

Read More

Formatted emails (HTML email) from TAdvRichEditor

Our TAdvRichEditor UI control has everything on-board to generate HTML from its rich document content, including exporting images that are possibly used in the document. Although generating this HTML can be easily done via the TAdvRichEditorHTMLIO non-visual component connected to the TAdvRichEditor, we frequently receive support emails from users struggling to use the generated HTML to send it as email with the Indy components (TIdMessage, TidSMPT).

Therefore, we decided not only to create a sample code snippet to show how this can be done, but also to create a non-visual component (available in the latest TMS Component Pack release) to reduce the code to generate such email message to the minimum possible, that is, to one line of code:

    emailio.GenerateEmail(idmessage);

But, back to full code first that shows how to use the Indy components to generate HTML emails with embedded images as this can be generally applied for cases also where no TAdvRichEditor is used.

Drop a TIdMessage component on the form. We create a multipart message, with a part for the plain text version of the email, a part for the HTML email header and a part for the HTML itself. Then we add attachments to the message where ContentDisposition is set to ‘inline’ and the ContentID is set to the ID used in the HTML image reference cid attribute. So, if we have in the HTML code an image reference like:


then the ContentID for the attachment containing the image will be :

ContentID := 'imageref1';

Now, let’s put this together using a TAdvRichEditor, TAdvRichEditorHTMLIO, idMessage on the form. We set AdvRichEditorHTMLIO.RichEditor to the TAdvRichEditor instance we want to export. It is very important to set AdvRichEditor.HTMLImages to igID as this instructs the TAdvRichEditor to export images references as CID URI attributes. The export to HTML and image files from TAdvRichEditor becomes:

var
  i: integer;
begin
  AdvRichEditor1.HTMLImages := igID;
  // we save the output to a temporary HTML file
  AdvRichEditorHTMLIO1.Save('.
icheditor.html');

  for i := 0 to AdvRichEditor1.HTMLImageList.Count - 1 do
    begin
      // we prepare the images as temporary images files for use as attachments for the message
      AdvRichEditor1.HTMLImageList.Items[i].SaveToFile('.img'+i.ToString+'.png');
    end;
end;

As you can see, the images to be used in the export are available via the collection AdvRichEditor.HTMLImageList. From there, we can save the images to file to be used as attachments for the Indy idMessage. The code to construct the idMessage from here becomes:

  idMessage1.IsEncoded := True ;
  idMessage1.ContentType := 'multipart/alternative';
  idMessage1.ClearBody;

  with TIdText.Create(idMessage1.MessageParts, nil) do
  begin
    // here we include the text as plain text
    Body.Text := AdvRichEditor1.PlainText;
    ContentType := 'text/plain';
  end;

  with TIdText.Create(idMessage1.MessageParts, nil) do
  begin
    ContentType := 'multipart/related; type="text/html"';
  end;

  with TIdText.Create(idMessage1.MessageParts, nil) do
  begin
    // we load the content from the temporary HTML file
    Body.LoadFromFile('.
icheditor.html');
    ContentType := 'text/html';
    ParentPart := 1;
  end;

  // here we loop over images to add all as attachments 
  for i := 0 to FRichEditor.HTMLImageList.Count - 1 do
  begin
    with TIdAttachmentFile.Create(idMessage1.MessageParts,  + '.img' + i.ToString + '.png') do
    begin
      ContentID := 'image'+ i.ToString;
      ContentType := 'image/png';
      ContentDisposition := 'inline';
      ParentPart := 1;
    end;
  end;

When the idMessage message has been created, it is straightforward to send it via the idSMTP component, i.e., this is minimally:

  IdMessage1.From.Address := 'info@tmssoftware.com';
  IdMessage1.Recipients.Add.Address := 'bruno@tmssoftware.com';
  IdMessage1.Sender.Address := 'info@tmssoftware.com';

  idsmtp1.Host := 'smtp.mailserver.com';
  IdSMTP1.Connect;
  idsmtp1.Send(idMessage1);
  idsmtp1.Disconnect();

With this code now explained, let’s introduce the class TAdvRichEditorEmailIO included in unit AdvRichEditorEMailIO.pas in the latest version 8.7.3.0 of TMS Component Pack. With this class, we can reduce the code to send a HTML email from TAdvRichEditor to:

  AdvRichEditorEMailIO.GenerateEmail(idmessage);
  idMessage.Subject := 'A HTML email from TAdvRichEditor';

  idSMTP1.Host := 'smtp.mailserver.com';
  IdSMTP1.Connect;
  idSMTP1.Send(idMessage);
  idSMTP1.Disconnect();

The resulting Delphi application looks like this:

and when opening the email sent in MS Outlook, it looks like:

You can easily get started to build your own HTML formatted text email client. You can download the source code of the application here and you can compile and use this with the latest TMS Component Pack release. In the next updates of TMS FMX UI Pack that also includes the FireMonkey version of our rich editor component, we’ll also include a FireMonkey version of the HTML email creator class and the same applies for the cross-framework version of the rich editor in the TMS FNC UI Pack.

Read More

Read More

Join us in The Netherlands and Germany at several upcoming Delphi conferences

We look forward to connect with you at the upcoming conferences!

TMS will be present at following Delphi events:

The LAB – European Delphi & C++Builder Conference 2017
19 September 2017 – Eindoven, The Netherlands

TMS software will be present with a booth where you can meet us and find out about our latest product offerings.
Bruno Fierens will give a session about VCL & FMX Delphi applications based on Google Maps and TMS WebGMaps. He will demonstrate how locations on the map can be indicated in different ways, how addresses can be associated with locations, how locations can be coupled to pictures and how to load POI files and visualize the POIs on the map. Furthermore, route directions can be calculated, displayed and imported & exported for exchange with navigation systems or smartphone apps. Finally the GeoJSON file format is explained and it is shown how these can be used together with Google Maps.Dutch spoken

Foren-Tage 2017
23 September 2017 – Hamburg, Germany

TMS software will be present with a booth where you can meet us and find out about our latest product offerings.
Bruno Fierens will give a session about VCL & FMX Delphi applications based on Google Maps and TMS WebGMaps. He will demonstrate how locations on the map can be indicated in different ways, how addresses can be associated with locations, how locations can be coupled to pictures and how to load POI files and visualize the POIs on the map. Furthermore, route directions can be calculated, displayed and imported & exported for exchange with navigation systems or smartphone apps. Finally the GeoJSON file format is explained and it is shown how these can be used together with Google Maps.

EKON 21
24 October – Cologne, Germany

Bruno Fierens will give a presentation about creating cross-framework UI controls. The similarities and differences between the two key UI frameworks VCL and FMX that come with Delphi are explained. With this knowledge, it is possible to create an abstraction layer that allows to create UI controls that will work both in VCL applications and in FMX applications (and also in the LCL framework).
The abstraction layer FNC (Framework Neutral Components) is introduced and explained and with the help of this FNC layer, it is demonstrated to create a UI control from scratch for VCL, FMX and LCL.

TMS hands-on training day
23 November 2017 – Meerbusch-Büderich, Germany

After an introduction on the latest news from Embarcadero, the first half of the day will be devoted to an in-depth look at TMS VCL components, in particular TAdvStringGrid and TAdvTreeView. In the second part of the day, focus will be on cross-platform development and cross platform UI controls. We’ll round up the day with a look at Google Maps integration and a “What’s cooking in the labs” session.
Sessions will be in German.

Read More

Read More