Quantcast
Channel: TMS Software
Viewing all 1006 articles
Browse latest View live

High performance tree list in FMX

$
0
0

Intro

TMS Software Delphi  Components
The multi-device, true native app platform The FireMonkey® framework is the app development and runtime platform behind RAD Studio, Delphi and C++Builder. FireMonkey is designed for teams building multi-device, true native apps for Windows, OS X, Android and iOS, and getting them to app stores and enterprises fast.
source: https://www.embarcadero.com/products/rad-studio/fm-application-platform

FMX (FireMonkey) released in 2011 and shortly after we delivered a first set of components. Today, we want to show you the TTMSFNCTreeView component, a component with high performance virtual and collection-based modes able to deal with millions of nodes.

TMS Software Delphi  Components

Features

Below is a list of the most important features the TTMSFNCTreeView has to offer. The features are not limited to this list, but this will give you a quick insight on what we offer to be able to create a hierarchical tree list in FireMonkey.

  • Multi-line HTML formatted text
  • Various built-in column editors
  • Multi-column support
  • Fixed and variable node height
  • High performance virtual and collection-based modes
  • Multiple events for custom drawing and customization of default drawing
  • Multiple events for all kinds of interactions such as editing, expand / collapse and selection
  • Auto-sizing and stretching of columns
  • Mouse and keyboard interaction
  • Nodes with checkbox, radiobutton, image, disabled nodes
  • Nodes extending over multiple columns
  • Sorting, Filtering
  • Clipboard support
  • Keyboard lookup
  • Reordering
  • Drag & Drop


Learn More!

Want to learn more about what the TTMSFNCTreeView can do? Here is a video that highlights some of the above features through a demo application.



Download & Explore!

The TTMSFNCTreeView component is part of the TMS FNC UI Pack, which, on top of FMX, also offers the ability to write your code once and target other frameworks (VCL, LCL and WEB). You can download a full featured trial version of the TMS FNC UI Pack and start exploring the capabilities of the TTMSFNCTreeView component.

Coming up

The TTMSFNCTreeView is the third of a series of components that is covered to empower your FMX (FireMonkey) developments. We started the series with a general overview of the most important components that we have to offer, followed by the TTMSFNCRichEditor and the TTMSFNCPlanner. Next up will be the TTMSFNCKanbanBoard component, a highly configurable workflow visualization component.




Introducing FNC Grid Excel Bridge components

$
0
0

TMS Software Delphi  Components

In the last weeks, we've been working on a component to allow you to import and export FNC Grids to the xlsx file format. We've also used the opportunity to rename the existing "Grid Filters" and "FMX Grid Filters" to "VCL Grid Excel Bridge" and "FNC Grid Excel Bridge" because the word "Filter" has a different meaning in a grid. We hope the new "Bridge" naming proves less ambiguous.

Same as the "Filters" before, the new Bridge components are free, but they require to have both TMS FNC UI Pack and TMS FlexCel licenses.

You can get the components here:

And the documentation is available here:

So what is the state now if you want to export or import a grid to/from Excel?  We have the following choices:

  1. (VCL Only) You can use StringGrid.SaveToXLS and StringGrid.LoadFromXLS. Those methods will use OLE Automation under the hood, and so they require that Excel is installed in the machine. Because they need Excel, they can only work on Windows.
  2. You can use TAdvGridExcelIO (VCL), TTMSFMXGridExcelIO (FMX) and TTMSFNCGridExcelIO (FNC). Those components use an older trimmed-down FlexCel 3 to do their job. Because they use FlexCel 3, which predates the XLSX file format, they can only work with XLS files, not XLSX.
  3. You can use the "TMS Grid Excel Bridge" components. Those components use an existing  FlexCel 7 to do the work, and so they can export to xls and xlsx, but also HTML and PDF.  Because they require a FlexCel license, they can access the full FlexCel behind it, to do extra customization. Just as an an example: You could add conditional formats to the generated files, as shown in the example here: https://doc.tmssoftware.com/grid-excel-bridge/fnc/guides/user-guide.html#customizing-the-export.



Note: FNCGrid already supports exporting to PDF and HTML natively, you don't need the bridge components for that. But if you are customizing the xlsx output, you might want to have a PDF or HTML exported with those customizations, and that's where the Bridge's exporting to HTML and PDF can be useful.


Up to now, the "Bridges" had support for VCL Grids and FMX Grids. With the release of FNC Bridge, we are extending the first-class Excel exporting and importing to FNC.

Note that in FNC, we only support VCL and FMX at the moment (all platforms). We can't support Lazarus or WebCore because FlexCel doesn't support them yet.

So to finish this small post, I'd like to show how it works. We'll try adding export support for the FNC Grid in the "ClientDataset" demo. This is the grid:

TMS Software Delphi  Components

We dropped a TTMSFNCGridExcelExportComponent, and wrote the code:

TMSFNCGridExcelExport1.Export('r:\test.xlsx');

And we got this result:

TMS Software Delphi  Components

The checkboxes work in Excel, they are not images. But they will be exported as images to HTML and PDF.


Next, we tried with HTML:

  TMSFNCGridExcelExport1.ExportHtml('r:\test.html', THtmlExportMode.SingleSheet);

And we got:

TMS Software Delphi  Components

Finally we went for the PDF export. We could also have tried the one-liner, but in this case it would end up with 2 pages. The grid is too wide and the right part of it goes to the second page. But here is where the power of having full access to the FlexCel engine can help. We could export this file to xlsx, then set the print options in the xlsx file to fit to one page, and only then export to PDF:

    
  var xls := TXlsFile.Create(1, true);
  try
    TMSFNCGridExcelExport1.Export(xls);
    var Pdf := TFlexCelPdfExport.Create(xls, true);
    try
      xls.PrintToFit := true;
      xls.PrintNumberOfHorizontalPages := 1;
      xls.PageHeader := '&L FNC Grid Excel Export Demo&RPage &P of &N';
      Pdf.ExportAllVisibleSheets('r:\test.pdf', false, '');
    finally
      Pdf.Free;
    end;
  finally
    FreeAndNil(xls);
  end;
Just for fun, we also added a page header, and we could have customized the result a lot more. Like for example setting the PDF author or signing the PDF file.

Here is the PDF we got:

TMS Software Delphi  Components



New Delphi productivity developer tool from new TMS FNC partner

$
0
0

TMS Software Delphi  Components

It is with great pleasure that we announce today there is not only a new partner in our TMS FNC Partner program but also a new innovative productivity developer tool for Delphi developers to manage better the workflow with testers & end-users for VCL and FMX applications.

New TMS FNC Partner


We are glad to welcome Neil Laskowski from SwiftExpat in the TMS FNC Partner program. The TMS FNC Partner program is all about supporting Delphi developers offering valuable tools built upon our FNC framework. If you also develop tools or components based on the FNC framework, have a look at the our FNC Partner program!

New productivity developer tool


Runtime Toolkit from SwiftExpat helps developers to gather information & feedback from testers and end-users in a structured way and get and apply this feedback to the applications. When running the application, the users can enable a runtime inspector and modify any components property on forms and immediately see the effect of the update visually on the form. At the same time, the details of the update are stored in a file together with a form screenshot before and after the update and this can be sent back to the developer(s). As such, this is an ideal tool to let users send back corrections for possible language related issues, UI colors and UI control layout issues. And this is for Delphi developers building VCL applications as well as FMX applications.

A closer look at the capabilities of Runtime Toolkit


This is a comprehensive overview of the features of Runtime Toolkit:

Inspect

Feature-rich components are hard to get right (have you ever missed a setting?) RunTime ToolKit gives you access to component properties to diagnose defects. Apply property changes and see the effect realtime to eliminate guesswork. Marshal will capture the changes in a session for you to review offline.

Fine Tune

RunTime ToolKit addresses the challenges faced with user interface elements such as fine tuning color schemes, ensuring translated fields are displayed properly, and resizing controls.

Engage

Clients expect to see changes quickly. Modifying at runtime can get you valuable feedback when engaging with a client.

Implement

Marshal was designed around ease of implementation. With the drag of a button you place the Marshal control in your application and instrument your existing code. Marshal creates its own form without cluttering your application form.

Diagnose

Inspecting components at runtime allows you to diagnose configuration or data driven behavior. Inspect the items collection to ensure the data was loaded and determine if the item is hidden.

Record

Capture the details and integrate the fixes into your source code immediately or at your own pace. Marshal records each change to component properties in a session which can be reviewed offline in Caddie.

Compare Before and After

Marshal automatically captures screen shots before and after property modifications. Visually compare the details of the form before and after a change.

Target Deployment

Deploy instrumented code during testing or to beta users. Marshal can be controlled using build configurations to target specific builds.

Vendor Agnostic

Designed to work with controls from any vendor, Marshal is fully functional in an application that uses no other FNC controls. Partnering with FNC leverages technologies to deliver better tools.

Visit SwiftExpat and get started


You can visit the Runtime Toolkit page from SwiftExpat and discover how Runtime Toolkit can help you increase your developer productivity.

Have you also developed interesting components or add-on tools based on our FNC framework, get in touch! We want to learn about it and when applicable, also welcome you in the TMS FNC partner program.


VCL Grid goodies #3

$
0
0

TMS Software Delphi  Components

Today, we have a look at another often overlooked but yet convenient feature of TAdvStringGrid (and also TDBAdvGrid) from the TMS VCL UI Pack: HoverButtons!

Activating HoverButtons

With the HoverButtons, you can quickly setup actions to be performed on rows in the grid where the mouse is hovering. It is enabled by just setting grid.HoverButtons.Enabled = true. This means, that when the mouse hovers over a row, a small panel hosting buttons will appear at a column of choice in the grid. This column is set with grid.HoverButtons.Column. WIth the property grid.HoverButtons.Position, you can specify in what relative position with respect to this column the panel should appear. 


TMS Software Delphi  Components


Configuring the buttons 

To add any number of buttons on the panel, the collection grid.HoverButtons.Buttons can be used. This is a collection of the type THoverButtonsCollectionItem and allows to set the caption of such button, an imagelist ImageIndex, a picture, the hint, enabled state of the button ...

TMS Software Delphi  Components

Just add any number of buttons needed for different actions to be performed on the row.

Reacting to HoverButtons clicks

When a button on the HoverButtons panel is clicked, this triggers the event OnHoverButtonClick returning the index of the button clicked. Performing the different actions for the different button clicks as such is simple:

procedure TForm1.AdvStringGrid1HoverButtonClick(Sender: TObject; ARow: Integer;
  AButton: THoverButtonsCollectionItem);
begin
  case AButton.Index of
  0: begin
       // select the entire row and copy it to the clipboard
       AdvStringGrid1.SelectRows(ARow,1);
       AdvStringGrid1.CopySelectionToClipboard;
     end;
  1: begin 
       // invoke the inplace editor for the 2nd column cell
       AdvStringGrid1.Col := 2;
       AdvStringGrid1.ShowInplaceEdit;
     end;
  2: AdvStringGrid1.RemoveRows(ARow,1);
  end;
end;

Hovering & hints

Now we are discussing hovering, we can as well highlight another small but neat feature of the grid and that is to show the content of cells via a hint when the mouse hovers the cell. This is activated by setting grid.ShowHint = true as well as grid.HintShowLargeText = true. Whenever the text does not fit in the size of the cell, the grid will automatically display it as hint text for the cell. As a standard Delphi hint is just a single line of text hint, we add the TMS THTMLHint component on the form. This will replace the standard Delphi VCL hint and this hint can display multiple lines of text. The THTMLHint component also offers a MaxWidth property with which we can set the maximum width of hints to be displayed. And of course, if the text exceeds this MaxWidth, it will be rendered wordwrapped (and even formatted) in the HTMLHint. No code needs to be written for this. Drop a THTMLHint on the form, set HTMLHint.MaxWidth property and set the grid properties grid.ShowHint = true and grid.HintShowLargeText = true. The effect can be seen in this recording.

TMS Software Delphi  Components
Want more goodies?

Looking for more interesting features in the VCL TAdvStringGrid or in other components uncovered? Let us know what you want to see demonstrated in a next episode!



Webinar: TMS WEB Core with HTML/Bootstrap templates (Portuguese)

$
0
0

TMS Software Delphi  Components

Register for the free webinar "TMS WEB Core with HTML/Bootstrap templates". The webinar is scheduled on March 25, 2021 16h00 UTC  17h00 UTC (17h CET – 18h CET) at the TMS Web Academy!


"TMS WEB Core with HTML/Bootstrap templates"

Ivan de Souza, former senior consultant at Embarcadero Brazil will demonstrate how to create web applications with Delphi and TMS WEB Core and use HTML with Bootstrap to create modern, responsive and good looking web user interfaces.  You will learn techniques to bind Object Pascal user interface control logic to existing HTML & CSS.

Visit our calendar of events and register today!
NOTE: The webinar will be presented in Portuguese!


“TMS Web Core com templates HTML/Bootstrap”

25 de Março de 2021 / 13h (Horário de Brasília)

Ivan de Souza, ex-consultor sênior da Embarcadero Brasil, irá demonstrar como criar aplicações web usando Delphi e TMS Web Core, com HTML e Bootstrap, para criar aplicações web com visual moderno e responsivo. Você irá aprender técnicas para ligar a lógica de interface escrita em Object Pascal em templates HTML e CSS existentes. O webinar será realizado em sua maior parte em português, tendo algumas interações em inglês com o CEO da TMS, Bruno Fierens. 



TMS Aurelius 5 is here! Come see it Live!

$
0
0

TMS Aurelius 5 has been released with lots of new features!

Photo by Tony Hand on Unsplash

Photo by Tony Hand on Unsplash

As we have antecipated in a previous blog post, lots of new features were expected for the next major release of TMS Aurelius, our state-of-art ORM framework for Delphi. And indeed, Aurelius 5 was released last week!

The what's new section in the documentation provides you can see the full list of new features, improvements and bug fixes. Here are the major new features, and at the end of this article we have a special invitation for you!

Data Validation

You can now add data validation via attributes directly to your entity classes.

  [Entity, Automapping]
  [Filter('Multitenant')]
  TTrack = class
  strict private
    FId: Integer;
    [Required] FName: string;
    FGenre: TGenre;
    FComposer: Nullable<string>;
    [Range(0, 3600000)] FMilliseconds: Nullable<Integer>;
    FTenantId: Nullable<string>;
    function GetDuration: string;
  public

All fields will be proper validated according to the validation attributes applied. With a few lines you will guarantee that the entity will be persisted with a valid state.

The above class is part of the Music Library demo provided with TMS Aurelius (trial and registered versions).

Note how the track name is required, and the duration must not be greater than one hour (3600000 milliseconds). If you try to save something with wrong data, Aurelius will automatically prevent the user from doing so and raise an exception:

Data Validation Example

Global filters and multitenancy

Aurelius now includes global filter mechanism. Users will be able to define filters globally, including parameters, and choose which entities will have it applied.

The Music Library demo was made multitenant with a few lines of code. The entities were marked with a new global filter definition:

  [Entity, Automapping]
  [FilterDef('Multitenant', '{TenantId} = :TenantId')]
  [FilterDefParam('Multitenant', 'TenantId', TypeInfo(string))]
  [Filter('Multitenant')]
  TGenre = class
  strict private
    FId: Integer;
    [Required] FName: string;
    FTenantId: Nullable<string>;

And, from that, Aurelius allows you to enforce values in filter (to prevent a wrong tenant id to be saved) and also enable filters to retrieve data:

  Manager.EnableFilter('Multitenant')
    .SetParam('tenantId', CurrentTenant);

That was it! Music Library demo is now multitenant, with a few UI changes to allow the end-user to choose which tenant to use, data is now fully separated between tenants.

Data Validation Example

Attribute-based event handlers

Events are an important feature of any framework, and with Aurelius is not different. It provides several events you can use to add custom business logic. You can add specific code just before an entity is being saved, after an entity is deleted, when an SQL is being executed, among others.

But now you can add event handlers directly in your classes, using attributes. You can use it for logging for example, or even to add custom, more complex data validation.

The Music Library demo also shows how to do it:

  TGenre = class
    {...}
  public
    [OnValidate]
    function Validate: IValidationResult;

{...}

function TGenre.Validate: IValidationResult;
begin
  if SameText(Name, 'Experimental') then
    Result := TValidationResult.Failed('Experimental music is not allowed')
  else
    Result := TValidationResult.Success;
end;

Such validation will be applied, and Experimental genres will not be allowed in our Music Library app!

Come See it Live!

There are more new features, actually: TObjectManager.AddOwnership method, Aurelius Dataset can now refresh fields directly from objects and automatically destroy the source list, etc.

But, what about if you come and see the new features live, in action, with a more deep explanation?

The free webinar "Introducing Aurelius 5" will be held next Wednesday, March 24th, at 4pm UTC at the TMS Web Academy.

In this webinar, Wagner Landgraf, TMS Aurelius architect, will explain to newcomers what TMS Aurelius is about, how to use it, and then show all the new features in action, with real code.

And of course, it will be a live session: you can ask questions and participate! Register now for the "Introducing Aurelius 5" webinar and learn more about this amazing ORM framework!



TMS FNC Maps v1.4 released!

$
0
0

What's new? 

The second TMS FNC Maps update of 2021 includes integrated directions for Google Maps and MapKit along with map rotation in TTMSFNCMapKit.


Introducing TTMSFNCMapKit

A new stand-alone component for Apple MapKit JS is available in TMS FNC Maps v1.4.: TTMSFNCMapKit includes integrated directions and map rotation as component specific features with more to come in the near future.


Integrated directions with step by step instructions

TTMSFNCGoogleMaps and the new TTMSFNCMapKit component now include support for directions out of the box. All you have to do is drop one component on the form, assign a valid API Key and you're good to go! Addresses and locations are geocoded automatically and the calculated route is displayed on the map with just a single line of code.

    TMSFNCMapKit1.AddDirections('New York', 'Washington DC');

Optional configuration parameters are available including but not limited to:

  • Polyline color and width
  • Hide markers or polyline or both
  • Indicate if travelling by car or on foot

Also, step by step instructions and route details (displayed in the bottom-left corner of the screenshot below) are returned in an event. 

TMS Software Delphi  Components


Map Rotation

Another new feature exclusive to the TTMSFNCMapKit component is the ability to rotate the map programmatically. Again with only one line code the rotation of the map can be changed.

  TMSFNCMapKit1.Options.MapRotation := TMSFNCMapKit1.Options.MapRotation + 45;


TMS Software Delphi  Components


Update Now!

Update now to get all the latest and greatest TMS FNC Maps updates and get started exploring the new features!



Your familiar HotSpot Image comes to the TMS FNC UI Pack v3.3

$
0
0

We have a new major release of the TMS FNC UI Pack, next to some fixes and new features, we have added the TTTMSFNCHotSpotImage to the already extensive set of powerful and feature-rich UI controls that can be used cross framework and cross platform with just one code base.

TMS FNC Controls can be simultaneously used on these frameworks:


TMS FNC Controls can be simultaneously used on these operating systems/browsers:


TMS FNC Controls can be simultaneously used on these IDE's:

 

TTMSFNCHotSpotImage

This component is already known to VCL and FMX users and for the TMS WEB Core users who don't know the component, you can compare it with the idea of an Image Map.

The TTMSFNCHotSpotImage (further referred to as 'hotspotimage') gives you the ability to choose one image and then add different areas (hotspots) with which you can interact and each of them can have their own appearance.

TMS Software Delphi  Components


TTMSFNCHotSpotImageEditor

Our team considers the convenience of visually creating and configuring your components, that is why an editor was created to help you design your hotspots. This can be done in designtime by a double click or right-click on the hotspotimage. To give you full control over your hotspotimage, the editor is also available in runtime.


TMS Software Delphi  Components


Hotspotimage Demo

To let you get more familiar with the component, we have created a demo application that you can find here.

This topic describes the steps we have taken to create such a demo application. It is a simple example of a selection game that shows a lot of features. You'll need to find the correct country for a given capital.

The TTMSFNCHotSpotImageEditor (further referred to as 'hotspotimage editor') can be used to create the hotspots of the different countries. All of the following can be done in the code as well. But to give an example of the possibilities, we will explain how to this visually.

The image can be added in the editor or with the Bitmap property.

On the top of the editor there is a toolbar that can be used to create or manipulate the poylgons. Because there is a high contrast and the edgy shape of the different countries, the Magic Wand was the perfect tool to create the polygons. In the panel on the right, you have the buttons 'Hover', 'Selected' and 'Down'. With these buttons you can change the appearance for the different states. If none of the hotspots are selected in the listbox, then you are able to change the default appearance used on newly created hotspots in the different pages. On the other hand, if you select a hotspot, you can change the appearance for the specific hotspot. This way, I've changed the Fill kind of the polygon to a texture with an image of the flag. You can also change the stroke and font used by the hotspot.

To change the name of the different hotspots, select the hotspot in the listbox, edit the text in the edit box and click on the 'Change Name' button.

Now let's have a look at the code that is used. Besides the code used to change the settings between game mode and normal selection mode, only two specific events are needed.

The event OnSelectedHotSpotChange where the check is added to see if the selection is allowed.
As it would not be helpful to unselect a hotspot while playing the game.

procedure TForm2.TMSFNCHotSpotImage1SelectedHotSpotChange(Sender: TObject; AIndex: Integer; var Allow: Boolean);
begin
  if (AIndex >= 0) and not TMSFNCHotSpotImage1.HotSpots[AIndex].Selected then
    Allow := True
  else
    Allow := False;
end;

If it is allowed, then we can catch the change of the index with the event OnSelectedHotSpotChanged.

In this event we check if the name of the selected hotspot is the same as the one we were looking for.
if that is the case we add a point to our score and pick a new random country. If not, then the selected index is set back to false and if the answer was wrong for the second time, then we retrieve the hotspot by its name and and fill that one with a red color.

procedure TForm2.TMSFNCHotSpotImage1SelectedHotSpotChanged(Sender: TObject; AIndex: Integer);
var
  hsIdx: Integer;
begin
  if (length(countries) > 0) and Start then
  begin
    if TMSFNCHotSpotImage1.HotSpots[AIndex].Name = countries[idx] then
    begin
      Label2.Text := cities[idx] + ' is the capital of ' + countries[idx] + ' ('+ Point.ToString+')';
      Score := Score + Point;
      Label3.Text := Score.ToString + '/10';

      Delete(cities, idx, 1);
      Delete(countries, idx, 1);
      NextCapital;
    end
    else
    begin
      TMSFNCHotSpotImage1.HotSpots[AIndex].Selected := False;
      Point := Point - 0.5;

      if Point = 0 then
      begin
        hsIdx := TMSFNCHotSpotImage1.GetHotSpotIndexByName(countries[idx]);
        if hsIdx > -1 then
        begin
          TMSFNCHotSpotImage1.HotSpots[hsIdx].Appearance.SelectedFill.Color := gcTomato;
          TMSFNCHotSpotImage1.HotSpots[hsIdx].Selected := True;
        end;

        Label2.Text := cities[idx] + ' is not the capital of ' + TMSFNCHotSpotImage1.HotSpots[AIndex].Name + ' but ' + countries[idx] + ' (Next question)';

        Delete(cities, idx, 1);
        Delete(countries, idx, 1);

        NextCapital;
      end
      else
        Label2.Text := cities[idx] + ' is not the capital of ' + TMSFNCHotSpotImage1.HotSpots[AIndex].Name + ' ('+Point.ToString+')';
    end;
  end;
end;

The rest of the code can be found in the demo folder of the TMS FNC UI Pack.

This video of Gjalt's 101 gives you a quick example on how the 'Hover Bitmap' property is used:





Multi component, multi data source binding in FNC

$
0
0

Intro

We have been working on multi component, multi data source binding for quite some time now, providing a foundation for future improvements and new features and today we can proudly announce that TMS FNC Core 2.5 makes the first version available via the TTMSFNCDataBinder component. The TTMSFNCDataBinder component is a non-visual component that acts as a bridge between components and datasources and uses RTTI to detect bindable properties.


Read-only

Important to know is that this initial release of the TTMSNCDataBinder component supports read-only data binding. It listens to dataset changes, and automatically updates values in the component. In future updates, writing data to the dataset is planned as well as updating the active record based on the selection.


Supported modes

The TTMSFNCDataBinder component supports 4 modes:

  • single value
  • list
  • column/list
  • grid (via interface)


TMS Software Delphi  Components

To point out how a binding is done, below is a sample of binding a single value and a list component. (Based on TTMSFNCHTMLText and TTMSFNCListBox)

single value

TMS Software Delphi  Components

procedure TFormDataBinding.UpdateLinks;
var
  it: TTMSFNCDataBinderItem;
begin
  TMSFNCDataBinder1.BeginUpdate;
  it := TMSFNCDataBinder1.Items.Add;
  it.&Object := TMSFNCHTMLText1;
  it.BindType := dbbtSingleValue;
  it.DataSource := DataSource1;
  it.FieldName := 'Common_Name';
  it.PropertyName := 'Text';
  TMSFNCDataBinder1.EndUpdate;
  TMSFNCDataBinder1.Active := True;
end;
The below code actually sets up the same binding as the code above with a convenience method ConnectSingle.

procedure TFormDataBinding.UpdateLinks;
begin
  TMSFNCDataBinder1.ConnectSingle(TMSFNCHTMLText1, DataSource1, 'Text', 'Common_Name');
  TMSFNCDataBinder1.Active := True;
end;

list
procedure TFormDataBinding.UpdateLinks;
var
  it: TTMSFNCDataBinderItem;
begin
  TMSFNCDataBinder1.BeginUpdate;
  it := TMSFNCDataBinder1.Items.Add;
  it.&Object := ListBox1;
  it.BindType := dbbtList;
  it.DataSource := DataSource1;
  it.FieldName := 'Common_Name';
  it.PropertyName := 'Items';
  TMSFNCDataBinder1.EndUpdate;
  TMSFNCDataBinder1.Active := True;
end;


Again as with the single value binding, the below code uses a convenience method to add an item and set all the properties in one go.


procedure TFormDataBinding.UpdateLinks;
begin
  TMSFNCDataBinder1.ConnectList(ListBox1, DataSource1, 'Items', 'Common_Name');
  TMSFNCDataBinder1.Active := True;
end;

TMS Software Delphi  Components


HTML template

For the single value and list bindings, there is support to add a HTML template instead of binding to a specific field name. The HTML template supports multiple fields as long as they follow a specific kind of format. The HTML itself is based on the mini HTML reference (https://www.tmssoftware.com/site/minihtml.asp)

The format for adding fields is: <#FIELDNAME>.

So when applying this to the single value binding for example we can add an item using the

TMSFNCDataBinder1.ConnectSingleHTMLTemplate(TMSFNCHTMLText1, DataSource1, 'Text', '<b>Name: <#COMMON_NAME></b><br/><#NOTES>');

or

procedure TFormDataBinding.UpdateLinks;
var
  it: TTMSFNCDataBinderItem;
begin
  TMSFNCDataBinder1.BeginUpdate;
  it := TMSFNCDataBinder1.Items.Add;
  it.&Object := TMSFNCHTMLText1;
  it.BindType := dbbtSingleValue;
  it.DataSource := DataSource1;
  it.PropertyName := 'Text';
  it.HTMLTemplate := '<b>Name: <#COMMON_NAME></b><br/><#NOTES>';
  TMSFNCDataBinder1.EndUpdate;
  TMSFNCDataBinder1.Active := True;
end;


TMS Software Delphi  Components


Editor

The databinder component installs an editor that is available at designtime and at runtime. The editor allows to visually edit the bindings that you have set up. You can also create, update and delete new or existing bindings. To start it at runtime, call

TMSFNCDataBinder1.ShowEditor;

At designtime, you can right-click the TTMSFNCDataBinder component and select “Edit…” to start the editor.

TMS Software Delphi  Components


Want to know more?

Active registered users of FNC (TMS FNC Core) can download the update and get started right away! A demo ("Databinding"), is included in the distribution and there is separate documentation that gives more details on what the TTMSFNCDataBinder component can do and can mean for your application.





Workflow visualization and organization in FMX

$
0
0

Intro

TMS Software Delphi  Components
The multi-device, true native app platform The FireMonkey® framework is the app development and runtime platform behind RAD Studio, Delphi and C++Builder. FireMonkey is designed for teams building multi-device, true native apps for Windows, OS X, Android and iOS, and getting them to app stores and enterprises fast.
source: https://www.embarcadero.com/products/rad-studio/fm-application-platform

FMX (FireMonkey) released in 2011 and shortly after we delivered a first set of components. Today, we want to show you the TTMSFNCKanbanBoard component, a highly configurable workflow visualization and organization component.

TMS Software Delphi  Components

Features

Below is a list of the most important features the TTMSFNCKanbanBoard has to offer. The features are not limited to this list, but this will give you a quick insight on what we offer to be able to create an application that visualizes a workflow environment in FireMonkey.

  • Multi collapsible column support
  • Filtering and Sorting
  • Item autosizing
  • HTML formatted text support
  • Collapsible items
  • Database adapter
  • Drag & Drop support
  • Editing support
  • Fully customizable column & item appearance & custom Kanban board item drawing
  • Optional header & footer per column


Learn More!

Want to learn more about what the TTMSFNCKanbanBoard can do? Here is a video that highlights some of the above features through a demo application.





Download & Explore!

The TTMSFNCKanbanBoard component is part of the TMS FNC UI Pack, which, on top of FMX, also offers the ability to write your code once and target other frameworks (VCL, LCL and WEB). You can download a full featured trial version of the TMS FNC UI Pack and start exploring the capabilities of the TTMSFNCKanbanBoard component.

Coming up

The TTMSFNCKanbanBoard is the fourth of a series of components that is covered to empower your FMX (FireMonkey) developments. We started the series with a general overview of the most important components that we have to offer, followed by the TTMSFNCRichEditorTTMSFNCPlanner and the TTMSFNCTreeView. Next up will be the TTMSFNCGrid, a feature rich and powerful grid component.



REST API Server with Delphi and XData 5: Read and Watch

$
0
0

TMS XData 5 has been released with lots of new features!

Photo by Glenn Carstens-Peters on Unsplash

Photo by Glenn Carstens-Peters on Unsplash

In addition to the recent release of TMS Aurelius 5, a new major version of TMS XData has been also released.

TMS XData 5 is the fifth major version of our framework to build multitier applications, including REST API server, and interface-based API client. It makes it easy to build server-side services that reach a broad range of clients, including browsers and mobile devices.

Among several features, TMS XData provides:

  • Automatic serialization/deserialization of pure Delphi objects, primitive types, method parameters;
  • Authentication and Authorization;
  • Powerful routing mechanism: route endpoints to methods in your code;
  • Automatic, zero-code Swagger/SwaggerUI support;
  • Interface-based client allows type-safe client applications without additional code;
  • Smooth TMS Aurelius integration allows CRUD endpoints of database entities automatically.

The new features released with XData 5 were also antecipated in a previous blog post,

The what's new section in the documentation provides you with a full list, but here we will list a few:

Attribute-based Authorization

Developers will be able to just add authorization attributes to methods (service operations) or entities (automatic CRUD endpoints) and everything will be applied accordingly. Fine-tuning the protection of your REST API will never be as simple.

  [Authorize]
  IDocumentService = interface(IInvokable)
    procedure Insert(Value: TDoc);

    [AuthorizeScopes('user, editor')]
    procedure Modify(Value: TDoc);

    [AuthorizeScopes('admin')]
    procedure Delete(DocId: string);

    [AuthorizeClaims('email')]
    procedure Approve(DocId: string);
  end;

In the example above, all methods (endpoints) require authentication, because the interface has an Authorize attribute that propagates to all methods. So, to invoke Insert, user must be authenticated. Still, to invoke Modify, the user must be authenticated and have either user or editor scope in its credentials. He must be admin to invoke Delete, and finally to approve a document, user must have an email in its claims.

It's also worth noting that the same strategy applies to entities that generate automatic CRUD endpoints:

  [Entity, Automapping]
  [EntityAuthorize]
  [EntityAuthorizeScopes('editor', [TEntitySetPermission.Modify, TEntitySetPermission.Insert])]
  [EntityAuthorizeScopes('admin', [TEntitySetPermission.Delete])]
  TCustomer = class
  {...}
  public
    property Id: Integer read FId write FId;
    property Name: string read FName write FName;
  end;

To access customer endpoints, user must be authenticated. But he must have editor privileges to modify and insert (PUT and POST) and must be admin to invoke DELETE. Easy and straightforward.

Async/Await Support in Web Applications

TMS XData is smoothly integrated with TMS Web Core, the TMS framework to build web applications.

Now your can use async/await mechanism in TXDataWebClient methods that invoke XData server endpoints. As an example, invoking a XData REST API endpoint asynchronously will be as easy as doing this:

PendingOrders := await(XClient.List<TOrder>('$filter=Status eq pending'));
if PendingOrders.Count = 0 then
  Exit; // no pending orders to process

The single line above will build the HTTP request with proper URL endpoint and HTTP method, invoke it, deserialize the returned JSON into a list of TOrder objects, and all asynchronously! The await function will guarantee that the next line will be executed only after the async execution is executed. Can't get easier than that.

Multitenant Servers

This is a feature released with TMS Aurelius, which now has the global filter mechanism, allowing you to build multitenant applications.

But XData now includes a few nice mechanisms to integrate with such Aurelius filters that makes building multitenant servers very easily!

From a single handler for the event OnManagerCreate, you can enable the "Multitenant" filter for all requests:

  Manager.EnableFilter('Multitenant')
    .SetParam('tenantId', 'acme');

After you've enabled the "Multitenant" filter passing the proper id, you can use the Aurelius object manager as usual. But any request you do, like in the example, asking a list of products, will add the tenant filter.

Requests will not only apply global filters for queries, but also will enforce the filter in INSERT, UPDATE and DELETE operations.

Also building multi-database multitenant server will also be easy with the new TMultiTenantConnectionPool:

  FMultiPool := TMultiTenantConnectionPool.Create(
    TXDataHttpHeaderTenantResolver.Create('tenant-id'),
    TDBConnectionPoolFactory.Create
    );

The pool will automatically choose the correct database based on the HTTP header tenant-id - or any other criteria you might choose. All transparently.

Come See it Live!

Want to know more about XData? Want to see the new features live?

The free webinar "Introducing XData 5" will be held next Wednesday, March 31st, at 4pm UTC at the TMS Web Academy.

In this webinar, Wagner Landgraf, TMS XData architect, will explain to newcomers what TMS XData is about, how to use it, and then show all the new features in action, with real code.

And of course, it will be a live session: you can ask questions and participate! Register now for the "Introducing XData 5" webinar and learn more about this amazing REST API framework!



What's cooking in the TMS Labs: moving Delphi and FNC forward (and backward)!

$
0
0

Our ever growing FNC framework now already brings a whole portfolio of components to a myriad of devices and operating systems: Windows, Android, iOS, macOS, Linux, Raspbian, Web ....

So, it is clear that our R&D team is always looking out for new technology and trying to be ahead of the curve. For this reason, our team was excited to be involved in a very forward looking project for a customer that brings Delphi and our FNC framework again on the bleeding edge of technology. 

For this project, we researched how we could bring the FNC framework to a new M1 CPU + NVidia Titan V based device that features an AI driven holographic display. We tweaked the Delphi OSX64 compiler to produce M1 CPU code as well as NVidia SIMD GPU instructions to render FNC on the holographic display. When we received the test device here, the results are without a doubt stunning! You can see a glimpse here:

TMS Software Delphi  Components

While playing with this cutting-edge technology, our team mesmerized how predictions of technology in movies of the seventies and eighties already got real and we wondered therefore, if we could bring Delphi and FNC at the same time to this for us nostalgic area. A first attempt was to port FNC to the Sharp LR35902 processor and after this was successful, it permitted us to run FNC on the Nintendo Game Boy. It is surprising how crisp the FNC graphics are rendered on the small Game Boy LCD screen as you can witness here:

TMS Software Delphi  Components

And this achievement inspired us to go back in time even further. Surprisingly this was somewhat easier as making Delphi compile on a Intel 8080 CP/M machine. We tweaked the original Turbo Pascal 8086 compiler to use only 8080 instructions and got it working. It was however a lot more effort to downscale the FNC graphics abstraction layer to a 80x25 character CRT screen. But as you know by now, we are not scared to make our hands dirty in such challenging task. It is with pride that we can share the first FNC components now also running on a CP/M driven Intel 8080 machine from 1974 connected to a Sperry Univac Uniscope 200 terminal. 

TMS Software Delphi  Components

Are you still using devices for which you like to use Delphi and FNC? Let us know, it could become the next challenge of our team! We look forward to hear what nostalgic or futuristic device you would which to bring alive with your beloved development tools.



Qualicodex Software: new TMS consulting partner

$
0
0

 TMS Software Delphi  Components


We are proud to announce a new collaboration with the team from Qualicodex Software in Brazil to assist users of Delphi in combination with TMS products. From today, Qualicodex Software is our consulting partner for Portuguese and English speaking software developers and software development companies.


Ivan Souza is a Software Engineer and a certified Delphi developer since the first version and professor of the Distributed Systems discipline at the West University of Santa Catarina, he started his career in the first versions of Object Pascal, even before Delphi and today he is always looking for updates on new technologies. He worked at Embarcadero Brasil as a Senior Consultant, is an active member of the Delphi community and coordinates the DelphiCodex channel on Youtube. He participated in several conferences and webinars, always providing high quality content to the community.

In addition to consulting with Delphi, Ivan also has knowledge and expertise in the technologies that are used by incredible tools, like Web, application servers, databases, distributed systems, IoT, etc.

He started his qualification in the tools of tmssoftware with TMS WEB Core, TMS XData and TMS Aurelius. At the moment he is developing an entire ecosystem where these tools are used together with the best in information processing environment (Linux, Desktop, Mobile, Databases, NoSQL, IA, etc ...)

This partnership is the beginning of a great friendship! Doing it with love, dedication and respect is the secret. Delphi is the key!


At the same time, we would like to take the opportunity to mention that we still wish to extend our consulting partner network, foremost in the Asia area, Australia, Canada, South Africa. If you are Delphi developer with TMS component expertise and offering consulting services, get in touch and we will be happy to discuss how we can move forward!



What's coming in TMS WEB Core v1.7 Ancona

$
0
0

TMS Software Delphi  Components

The new version v1.7 of TMS WEB Core has been in development for about 6 months by now. Many of its features were already in development in parallel to v1.6. And yes, our team already is working on v1.8! It will not come as a surprise to you that in v1.7 there are new game-changing features in TMS WEB Core also.

Those who have been following the TMS WEB Core development since the first version TMS WEB Core v1.0 Brescia will know that we name the releases after cities along the famous historic race “MilleMiglia”. To be more precise, the legendary race of 1955. And as such, after we visited the city Pesaro with v1.6, for v1.7 we land in Ancona. The historical meaning of the word “Ancona” is elbow which is commonly associated with the shape of the coastline. After the 'elbow' Ancona, there are new sights towards the more southern coasts of Italy.

Enough history! Let's bring an overview of what our team has been working on for TMS WEB Core v1.7 Ancona.

1) Components wrapping browser API for local file access

The W3C consortium proposed an API forlocal file access from Web browser applications and Google Chrome implements it already. Given that Microsoft uses the Google Chromium engine, it is also available in Microsoft Edge Chromium. With TMS WEB Core, you can take a head start, explore, and start using this with its three components today:

  • TWebLocalTextFile
  • TWebLocalBinaryFile
  • TWebLocalFolder.

These components allow you to directly open text and binary files from the local file system as well as traverse the local file system’s folder structure from a Web application. Of course, for security reasons, the users have to give their consent first.

2) Popup menu component and popup menu support in components

In TMS WEB Core, we offered the regular TWebMainMenu since its inception and now we completed this trend with the new TWebPopupMenu. It works very similar to a Windows VCL TPopupMenu. Simply drop a TWebPopupMenu on your Web forms and assign it to control.PopupMenu to obtain an automatic context menu for controls.

TMS Software Delphi  Components

3) USB device access

TMS Software Delphi  Components
The times that software developers thought you could never use a Web application for controlling your machine's hardware are officially over. We already introduced support for Bluetooth with our TWebBluetooth component, and with this release we add two new components TWebUSBSerial and TWebUSBHID that allow you to write applications communicating with locally connected USB devices using a serial protocol or the HID protocol. This opens up a whole new field of applications that can be implemented using Web technologies.


4) TWebStringGrid & TWebDBGrid extensions

We added a whole range of new grid features in TWebStringGrid and TWebDBGrid. There are now:

  • Methods to insert & remove rows
  • A range of different inplace editor types
  • Cell merging and cell splitting
  • Loading and saving to streams
  • Loading from a stringlist with CSV data
  • Direct access to grid data as TJSArray
  • Add checkboxes to the grid

TMS Software Delphi  Components

5) Async methods

There is no way around it in the Web browser, there are different APIs that can only be used in an asynchronous way. The reason for this is very clear: Always guarantee a responsive UI even when lengthy operations are taking place in the application.

Many developers struggle with implementing sequential logic for processes that occur asynchronously. We already offered anonymous methods that can be used to handle results of methods asynchronously, but, in v1.7, we added a whole range of async methods to classes. With a simple await() construct around an async method, you can write your code as-if it were synchronous and sequential, but, behind the scenes, the browser still handles it asynchronously and keeps your UI responsive. The components to perform HTTP(S) requests for example, load data from a URL, load images from URL, etc... now all have async equivalents making you write code that is cleaner and consequently easier to maintain.

var
  ms: TMemoryStream;
begin
  ms := TMemoryStream.Create;
  try
    await(boolean,ABinaryFile.LoadStream(ms));
    ms.Position := 0;
    webmemo2.lines.LoadFromStream(ms);
  finally
    ms.Free;
  end;
end;

6) Miletus framework

This is probably the biggest feature of TMS WEB Core v1.7! Miletus is a framework for creating native desktop applications with Web technologies. It permits to create wonderful and modern user-interfaces using (and in many cases reusing) HTML/CSS templates.
TMS Software Delphi  Components
Still, it allows to run as a desktop application and to access desktop features normally reserved for a native desktop app. This includes:

  • local file access
  • operating system menu
  • drag & drop interaction with the operating system
  • access to the taskbar
  • access to local databases (SQLite, MSSQL, PostgreSQL, mySQL, MS Access)
  • so much more... 

This first introduction of Miletus in TMS WEB Core offers the capability to create Win32 and Win64 native single EXE file applications with a size below 10MB. And in the near future, we will add macOS and Linux to that.

Stay tuned for another blog with a more detailed overview of the Miletus features. An additional benefit of Miletus is that we developed this framework from the ground up as opposed to a similar framework called Electron that is from a 3rd party. This means that for the future, we have full control to design any feature set we want for Miletus.

7) TWebSocketClient method added to send & receive binary data

When communicating with a web socket server, TWebSocketClient can now directly send & receive binary data whereas in previous versions this had to be sent as Base64 encoded string data.

8) TWebForm extended

We added more flexibility to the TWebForm. This includes:

  • Option to have a close button in the caption
  • Property to choose whether a shadow border is used or not
  • ElementCaptionClassName property added to allow the use of CSS for the caption
  • OnDOMContentLoaded event added, that signals when the browser loaded the entire DOM content
  • OnHashChange event added to handle browser back & forward buttons

9) New server-side filtering + multi-tenant support in TWebFireStoreClientDataSet

We have also significantly improved TWebFireStoreClientDataSet. Now, TWebFireStoreClientDataSet supports to create more flexible and more performant Web client applications using Google's Firestore as the backend for data storage. In the new version, it is possible to specify server-side filters. This facilitates not only multi-tenant scenarios but also increases performance by minimizing data returned from the server.

10) Numerous smaller extensions & improvements to various components & IDE integration

Not only was the TMS WEB Core framework improved in almost any corner, the IDE integration got further fine-tuning as well. The capability to use environment variables in the compiler path with the $() syntax was added. The same is possible with custom compiler directives. And finally, also the pas2js compiler & RTL were updated to the latest version v2.0.4.


Planning

The first step is that we will release the beta version of TMS WEB Core v1.7 in the next few days to all TMS ALL-ACCESS users and registered users of TMS WEB Core. We expect the upgrade process should be smooth and painless as we paid a huge amount of attention to backwards compatibility. This is proven by the fact that we did not have to make any modifications to the meanwhile over 100 demos included. However, we want to put the v1.7 beta into your hands first and listen closely to your feedback. That allows us to apply further polish where needed.

After this beta period, TMS WEB Core v1.7 Ancona will be officially released, and our team will continue to work hard on the next milestones.

TMS WEB Core for Visual Studio Code v1.3

The new version v1.3 of TMS WEB Core for Visual Studio Code is also around the corner. The major new feature of v1.3 will be extensibility via 3rd party components with a package system and with this, the whole portfolio of TMS FNC components will also become usable at design-time in Visual Studio Code. The TMS WEB Core framework will be at the same level as TMS WEB Core v1.7 for Delphi & Lazarus. The only feature that will not yet be included in TMS WEB Core for Visual Studio Code v1.3 is Miletus support. That is reserved for v1.4 and with this, it is expected to already bring Miletus for Windows, macOS, and Linux.

TMS WEB Core v1.8

There are several ongoing new developments for TMS WEB Core that we cannot reveal yet, but it is clear that v1.8 will come with Miletus support for macOS and Linux. We already have proof of concept versions working in the lab, but further work is needed before this is considered “feature complete”. This will very likely be the case in v1.8.


Get started today!

The only constant in software development is change. Web technologies open up exciting new capabilities for us Delphi, Lazarus, or Object Pascal developers in general. It allows us to create with RAD component-based techniques and a strongly-typed object-oriented language no-deploy web applications. Further, we may create PWAs for iOS and Android that can be installed and run offline when needed. Best of all, we do not need to conform to Apple or Google store censorship. Alternatively, you can create  cross-platform desktop applications with Electron or Miletus at the same time. 

We are of course curious to hear what you like the most about TMS WEB Core v1.7 Ancona or what you wish to see in future versions of TMS WEB Core! We look forward to discussing all these great milestones with you!

Webinar

If you want to see the new capabilities in TMS WEB Core 1.7 Ancona demonstrated live and ask questions, we have organized this opportunity for you! Attend our free webinar on April 8, 2021, from 15h00 to 16h00 UTC (17h00 - 18h00 CEST).  Register for the webinar here.



Lambdas in FlexCel

$
0
0

TMS Software Delphi  Components

As you might know, some months ago Microsoft released support for lambda functions in Excel. It was no small change: Lambdas turned the calculation engine into turing-complete, and they can change your spreadsheets in fundamental ways.

The main reason why you might want lambdas is that they allow you to define user-defined functions in a spreadsheet, using only other formulas. No VBA or macros required. But Lambda functions are much more: they are real first-class functions that you can pass around. They can even do variable captures like a Lambda in C# or an anonymous method in Delphi.

Even with them being only months old, there are a lot of articles and posts about them. So we will not repeat those here, and we will instead focus on a question that we have heard a lot lately: When is FlexCel going to support Lambdas?

And the answer is, of course, today. But wait! Let me look at the date... and let me look at the other post today on this site about running FNC in a Sperry Univac Uniscope 200... What can I say? Lambdas weren't supposed to ship on April 1st; they were supposed to ship weeks ago. But we kept finding small stuff to polish. As it is usual in FlexCel development, we wanted to cover all cases that we could and make sure everything worked as it should. And as it is usual too, we were late and I am writing this post in April 1st.

You can download FlexCel 7.9 on our site, and start adding lambdas and lets everywhere. Just the usual advice: "With great power comes great responsibility". As powerful as they are, it is simple to abuse them and end up with spreadsheets only a mother could love. Or understand. I've already seen pages-long lambdas written in many places, and one has to wonder how you are supposed to debug those formulas once something goes wrong. Right now, Excel tools for debugging lambdas are quite poor.

Tales from the trenches

Following a one post tradition, I am reviving the "tales from the trenches" section for this post. This is the section where I write about small details we find in our daily development. Of course, every day has a different tale, so I've chosen one at random to close this entry.

Schrödinger parameter names.
When we wrote the validation code for parameter names, we assumed that they would follow the same rules as Excel names. In particular, you can't have a name that is also a valid cell reference. So you can't have a name named "A1" or "R1C1". You can't either name a name "R" or "C" since that means "Full Row" and "Full Column" in R1C1 notation.

But, while you can't name a parameter "A1", you can name it "C". So how does this work? How does Excel know that when I write "=Sum(C)" I refer to the parameter C and not to the entire column?
The only way to find out was to try it, so I set the reference mode in Excel to R1C1, and went to write the formula `=Lambda(C,Sum(C))`

It gave an error of invalid name. So I tried now with `=Lambda(A1,Sum(A1))`, and Excel happily accepted it.

Valid parameter names depend on the reference mode you are using. And we coded FlexCel the same way: If you are in R1C1, FlexCel will allow "a1" as parameter name, but no "C" or "R". If you are in A1 mode, the reverse.

Now, if you are like us, this probably raised even more questions. The formulas are saved to xlsx files as text, but always in A1 reference style.
So imagine we are in Excel in R1C1 mode and write the formula `=LAMBDA(A1, A1 *R1C1)`
As formulas in xlsx files are saved in A1 notation no matter the mode, this would be saved as `=LAMBDA(A1, A1 * A1)`. But the first A1 in the expression is the parameter, and the second is a cell reference. And if you try it, you'll see that Excel figures out which is which.

As you can see below, the formula =Lambda(A1, A1+A1) is evaluating to 10: Cell A1 is 7 and parameter A1 is 3. So the sum is 10.

But if you want to edit the formula, it will not let you, as it won't be able to figure out which A1 is which.

TMS Software Delphi  Components

Ok, so where is the trick? Because you can't know which one is which one from the formula above. Luckily the answer is simple: the formulas in xlsx are saved as `=xlfn.LAMBDA(xlpm.A1, xlpm.A1 * A1)`, so when reading the file, you can know which ones are parameters and which are cells. And yes, I can hear you say: What if I name a parameter "xlpm.A1"?  The answer is that you can't, because dots are not allowed in parameter names. All bases are covered.




Coming in TMS WEB Core v1.7: Miletus

$
0
0

TMS Software Delphi  Components
When it comes to bringing web applications to a desktop enviroment the choice falls on Electron as it's the most popular framework among web developers. We offer support for Electron applications already, but the downside is always there: it's a 3rd party solution that we have no control over.

At the end of the last year we asked ourselves if we can provide an alternative that fits us better. A few months later here we are about to release a beta version of TMS WEB Core v1.7 with Miletus!

What is Miletus exactly?

Named after Thales of Miletus, Miletus is a framework that enables TMS WEB Applications to run as desktop applications and it also provides access for native features. In a nutshell, you can fully reuse code created for a web application, take advantage of HTML/CSS for creating a modern & spectacular responsive user interface, access local files & local databases or closely integrate with operating system capabilities and still easily deploy the application as standalone executable.

Our colleague Holger Flick explains it in more detail how one could create such Miletus application with TMS WEB Core:


Let's take a look at the available classes, functions and components that will enable you to interact with native operating system functionalities!

Classes and functions

  • TMiletusStringList: Read and write local text files.
  • TMiletusBinaryDataStream: Similarly to TMiletusStringList this enables you to write and read local binary files. It also provides multiple formats to access the data.
  • TMiletusClipboard: Read from and write to the OS clipboard.
  • TMiletusShell: Exposes some shell functionalities: open a file with its default application, open an external URL with the default browser, move files to the trash and show files in the containing folder.
  • GetCursorPos: Returns the position of the cursor.
  • GetMiletusPath: Returns the common paths.
  • StartFileDrag: Start dragging a file from your application to any destination where the file is accepted.

Components

  • TMiletusOpenDialog: Displays a native open dialog and returns the selected path(s).
  • TMiletusSaveDialog: Similarly to TMiletusOpenDialog, it displays a native save dialog and returns the selected path.
  • TMiletusMessageBox: Shows a native message dialog. The labels, the dialog type, the buttons and the verification checkbox are all customizable.
  • TMiletusErrorBox: Shows a native error message dialog.
  • TMiletusMainMenu: Creates and appends a native main menu to the form where it's dropped.
  • TMiletusPopupMenu: Creates and displays a native popup menu 
  • TMiletusNotificationCenter: Allows you to show notifications on the operating system. 
  • TMiletusWindow: Allows the creation of multiple application windows which can be linked to forms or other sources.
  • TMiletusTrayIcon: Creates a tray icon on the OS tray. An optional popup menu can be assigned to it.
  • TMiletusFileWatcher: Monitors a list of files for changes. Each file has its own event handler which will be triggered when the file has changed.
  • TMiletusGlobalShortcuts: Add a list of keyboards shortcuts that will be recognized even when the application is not in focus. 

What about database support?

We also added support for local databases! The component TMiletusClientDataSet makes it easy for a Miletus application to create and use local databases by a familiar syntax of using TClientDataSet. It also allows a seamless integration of multiple types of databases with data-aware components like TWebDBGrid, TWebDBTableControl, TWebDBEdit etc... All the database operations can be done in the standard Delphi way through the TMiletusClientDataSet component. 

We prepared 5 database drivers to be used with TMiletusClientDataSet:
  • TMiletusAccessDBDriver for MS Access databases
  • TMiletusMySQLDBDriver for MySQL databases
  • TMiletusSQLiteDBDriver for SQLite databases
  • TMiletusPostgreSQLDBDriver for PostreSQL databases
  • TMiletusMSSQLDBDriver for MS SQL databases

Future plans

While the beta version of TMS WEB Core v1.7 is about to be released with built-in Miletus support for creating Win32 or Win64 applications, we are already working hard on bringing Miletus to both macOS and Linux as a cross platform alternative in TMS WEB Core v1.8! April Fool's Day has already passed but if you still have any doubts here's a sneak peek of our TodoList demo running on macOS! It is the exact same project as the Miletus TodoList demo for Windows but packaged as macOS application.

TMS Software Delphi  Components
As we have full control now with this technology to expose operating system features to the Miletus app and to define how such application integrates with the operating system on Windows, macOS and Linux, we will continue to extend OS integration support. We are eager to learn for what type of applications and for what functionality you would wish to use this technology! 


Sneak preview of what's coming in FNC

$
0
0

Intro

There are a lot of things going on in the TMS labs at the moment. We announced a lot of great improvements and new features for the upcoming TMS WEB Core 1.7 (https://tmssoftware.com/site/blog.asp?post=772) as well as a couple of past and future platforms FNC runs on (April Fools' Day joke ...). Today we are proud to announce a new platform is coming for FNC. (NOT an April Fools' Day joke !).


Sneak preview

Before we want to announce exactly which platform is going to be supported in all it's glory, here is a sneak preview.

TMS Software Delphi  Components


What's coming?

TMS Software Delphi  Components

FMXLinux official support is coming in the near future! We are currently working hard to make all FNC components compatible with FMXLinux which means there will be a TTMSFNCWebBrowser based on WebKit (https://webkitgtk.org/), a REST based TTMSFNCCloudBase working with Curl (https://curl.se/), PDF export based on our own implementation and much much more! Of course, you can also expect all components that are working based on TMS FNC Core to have FMXLinux support. Stay tuned for more info coming real soon!




#WEBWONDERS : Making web async easy

$
0
0

TMS Software Delphi  Components

Even these Delphi developers who have only set the very first steps into web client development will realize that quite a few important functionalities in web clients are executed only asynchronously by the browser. 

Why asynchronous?

First of all, why did the creators of browser implement certain functionality only asynchronously? The answer to this question is quite simple. For the developers behind the browser, the user experience comes first and a UI that freezes is a big no-go. At all times, the user interface should remain response. The user should never get the impression that the browser or the machine hangs while navigating on the internet. Now, several operations happening in the browser client application can by nature have a fairly unpredictable time to execute. So, no such function should stop the execution of user interface handling code in the browser. 

Traditionally, the browser developers solved this "issue" by JavaScript event handlers that are called asynchronously when the result of a certain operation is ready and meanwhile, any other code can continue to execute. This is no different in TMS WEB Core web client applications written in Object Pascal (but of course compiled to JavaScript by the pas2js compiler). Here, we typically solved this with the Object Pascal event paradigm. When a class instance method is invoked that can only have its result asynchronously, this class instance triggers an event handler when the underlying function completed. When the pas2js compiler also introduced support for anonymous methods, we offered for various such asynchronous operations, anonymous result handlers. To focus on this, let's take the example of a TWebHttpRequest class. This class permits to invoke HTTP(s) requests from the web client application. Clearly, this is an operation with an unpredictable duration, hence, the result of the request should be asynchronously handled.

Classic approaches

Example 1: handling via an event:

// method starting the HTTP request
procedure TForm1.WebButton1Click(Sender: TObject);
begin
  WebHttpRequest1.URL := 'https://www.tmssoftware.com/sample.json';
  WebHttpRequest1.Execute();
end;

// TWebHTTPRequest event handler for OnResponse
procedure TForm1.WebHttpRequest1Response(Sender: TObject; AResponse: string);
var
  jo: TJSONObject;
  jv: TJSONValue;
begin
  jo := TJSONObject.Create;
  try
    jv := jo.ParseJSONValue(AResponse)
    // do any further processing here on the parsed JSON
  finally
  end;
end;

Example 2: handling via an anonymous method:

procedure TForm1.WebButton1Click(Sender: TObject);
begin
  WebHttpRequest1.URL := 'https://www.tmssoftware.com/sample.json';
WebHttpRequest1.Execute( procedure(AResponse: string; ARequest: TJSXMLHttpRequest) var jo: TJSOBject; jv: TJSONObject; begin jv := TJSONObject.Create; try jv.ParseJSONValue(AResponse); // do any further processing here on the parsed JSON finally end; end); end;

Introducing promises

Now, while the implementation using anonymous methods probably leads to fairly readable code, imagine needing to handle with multiple HTTP requests that depend on each other, which is in web development a fairly common use-case. While you can in theory invoke another http request from the anonymous method handler that is in turn also handled by a new anonymous method handler, you can see that it quickly becomes clumsy.

In the JavaScript world, a more elegant solution was introduced in 2015 with the ES6 standard and by now, any modern browser adopted this and supports it. The good news is that the pas2js v2.0 compiler also embraced and adopted JavaScript promises and offers a Pascal styled equivalent. If you want to read all about JavaScript promises, there are many good resources, but this is a well-written and concise one. In a nutshell, with pas2js v2.0, we can decorate a method with the async keyword or attribute and when having done so, it allows to use the await() function to (asynchronously) wait for a result of a function returning a promise. When the function is successful, it returns the promises, when not, it triggers an exception we can handle. By using this await(), we can further write our code as if the execution was sequential (i.e. synchronous) and our brain seems to be programmed to understand this kind of logic much better. 

Now, in TMS WEB Core v1.7, we have already introduced in many components functions returning promises where you can use at application level, await() constructs to handle the code 'sequentially'. An example of this is the TWebHttpRequest.Perform: TJSPromise function that now allows to perform HTTP requests and deal with these with an await. The equivalent code for the first two examples becomes:

procedure TForm1.WebButton1Click(Sender: TObject);
var
  req: TJSXMLHttpRequest;
  jo: TJSONOBject;
begin
  WebHttpRequest1.URL := 'https://www.tmssoftware.com/sample.json';
  try
     req := await(TJSXMLHttpRequest, WebHttpRequest1.Perform());
     jo := TJSONObject.Create;
     jv := jo.ParseJSONValue(string(req.response));
except // handle failure to execute request here end; end;
There is only one important note here!  As the form method WebButton1Click() has a promise handler, it needs to be marked with the async decorator or attribute!  This can be done for example with:
type
  TForm1 = class(TWebForm)
    [async]
    procedure WebButton1Click(Sender: TObject);
  end;
If you are like me, I think you will agree this is a more elegant way to write the code.

TMS WEB Core v1.7 includes many new TJSPromise functions

With the new upcoming v1.7 release, we overhauled the code already significantly, offering equivalent TJSPromise returning functions in many components and classes that were before based on class event handlers or anonymous methods for handling asynchronous behavior.  Don't worry, all existing event handlers and anonymous method handlers are still there for backwards compatibility!
Another class that was revised to offer promises was TWebForm. To show a new form, also here asynchronous behavior happens, as the form's HTML template needs to be loaded via a HTTP request. When a form was shown, an anonymous method construct was also introduced to mimic showing a form modally. Before TMS WEB Core v1.7, showing a new form modally could be done with the following code:
var
  newform: TForm2;

begin
  newform := TForm2.CreateNew(procedure(AForm: TObject)
    begin
      // anonymous method needed as the form is asynchronously loaded and initialized
      (AForm as TForm2).frm2Edit.Text := WebEdit1.Text;
    end
  );
  newform.Caption := 'Child form';

  // asynchronously handling closing the form via an anonymous method
  newform.ShowModal(procedure(AValue: TModalResult)
  begin
    ShowMessage('Form 2 closed with new value:"'+newform.frm2Edit.Text+'"');
    WebEdit1.Text := newform.frm2Edit.Text;
    newform.Free; 
  end
  );
end;
In TMS WEB Core v1.7, the TWebForm class got two TJSPromise functions, one to load the form and one to execute the form. With this approach, the code becomes way more readable:
procedure TForm1.WebButton1Click(Sender: TObject);
var
  newform: TForm2;
  mr: TModalResult;
begin
  newform := TForm2.Create(Self);
  newform.Caption := 'Child form';
  // load file HTML template + controls
  await(TForm2, newform.Load());

  // init control after loading
  newform.frm2Edit.Text := WebEdit1.Text;

  try
    // excute form and wait for close
    mr := await(TModalResult, newform.Execute);
    ShowMessage('Form 2 closed with new value:"'+newform.frm2Edit.Text+'"');
    WebEdit1.Text := newform.frm2Edit.Text;
  finally
    newform.Free;
  end;
end;

Just like we do in our components, embrace the new promises / await constructs in your code with the new TMS WEB Core v1.7 and it will make your code more elegant and cleaner!
Oh, and of course, the same applies to the upcoming TMS WEB Core for Visual Studio Code.

TMS WEB Core v1.7 beta will be shortly accessible for all TMS ALL-ACCESS users and later this month via an official release.
We look forward to your feedback & comments! Happy coding meanwhile.

Learn more about TMS WEB Core 1.7 Ancona?




Introducing TMS WEB Core for Visual Studio Code 1.3

$
0
0

We are on the verge of rolling out the first beta of the next milestone of our TMS WEB Core for Visual Studio Code product. This is the version v1.3 and along all TMS WEB Core framework enhancements that will come in TMS WEB Core for Delphi 1.7, the new release v1.3 will introduce the major new feature that is package support. Learn all about in in our upcoming free webinar!

Package support comes to TMS WEB Core for Visual Studio Code

Package support is what will enable software developers to install packages containing component code for install of components for design-time use. While it is perfectly possible to use custom components with the current release of TMS WEB Core for Visual Studio Code, it was restricted to use these components at runtime. So, developers had to create and instantiate classes of components in code. 
With the new release, we will bring the RAD experience also for custom components. You write your custom component, add its source code to a package and then compile and install the package in the IDE. After this step, the registered component classes are added on the tool palette and can be dragged on the form designer and can be customized visually by changing properties via the object inspector. Our architect of TMS WEB Core for Visual Studio Code created this video for you to explain this:



FNC comes to TMS WEB Core for Visual Studio Code

Yes, the exciting news is not just that you can now add custom components for design-time use in TMS WEB Core for Visual Studio Code, but also that the entire range of TMS FNC components becomes available for use with TMS WEB Core for Visual Studio. We lost count of the total number of FNC components but this must meanwhile be approaching 300 or perhaps more. So yes, you will be able to install

into TMS WEB Core for Visual Studio Code and use all of these components for creating classic web client applications, PWA's (Progressive Web Applications) or Electron based cross-platform desktop apps* for Windows, macOS and Linux. And of course, you will be able to develop these applications from a Windows, macOS or Linux machine as the Visual Studio Code IDE is at home on these operating systems and so will be our FNC components. 
TMS Software Delphi  Components
Opening, compiling & installing the package from the IDE

TMS Software Delphi  Components
List, add & remove component packages in the IDE

TMS Software Delphi  Components
Components on the tool palette and use the FNC components on the designer

* Note that our Miletus technology for creating cross-platform desktop apps that will come in TMS WEB Core for Delphi 1.7, is scheduled for TMS WEB Core for Visual Studio Code v1.4 and will at that point also offer Windows, macOS and Linux support for and from these three operating systems.

Join our upcoming free webinar

TMS Software Delphi  Components
Interested in learning all about the new version v1.3? We have a free webinar coming up for you via our platform TMS Web Academy (built with TMS WEB Core for Visual Studio Code by the way) and we have as host our chief architect José Leon Serna assisted by Bruno Fierens. Register now for this free webinar and be first to learn everything about component creation from TMS WEB Core for Visual Studio Code.





TMS Aurelius academic license

$
0
0

TMS Software Delphi  Components


In February 2020 we announced the TMS Academic Program.

Today we are happy to extend the TMS Academic Program with a new product : TMS Aurelius v5.1.

This license can be used with Delphi 10.4.x Sydney.


With the Delphi Academic edition students already have an extremely powerful tool in their hands and we want to enrich this with offering our most popular products also free to students with the TMS Academic Program.


Getting started :

  1. Register for a free TMS Aurelius Academic license with a school or university email address
  2. Receive your credentials to login on our website via your student email address
  3. Login and download your free TMS Aurelius Academic installer
  4. Install the product in the Delphi 10.4.x edition.
  5. Enjoy being part of the TMS family with full access to our website, TMS support center, product updates for 1 year and develop great Delphi VCL applications

Interesting video’s:


TMS Aurelius video's


Available books:

IntroducingDelphi ORM: Object Relational Mapping Using TMS Aurelius.


Get started with TMS software today and secure your place for the future in the Delphi world!

TMS Aurelius is our new addition to the family and we plan to extend this academic program. We are curious to know how the TMS Academic Program helped you so far in achieving exciting software development challenges and we are eager to learn what next TMS products you would wish to see in the academic program.



Viewing all 1006 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>