TMS Component Pack v8.5 released with wave of new components

Wednesday, January 18, 2017

We have given up thinking that the TMS Component Pack will ever be complete. It is simple: It will never be complete! On a daily basis, we're in conversation with developers around the planet with interesting, useful and cool new ideas. Between waking up and going to sleep, we ponder all the time how to improve components, how to make developers write less code and do more, to design new controls for bringing functionalities that don't exist out of the box in Delphi & C++Builder. And yes, some nights while sleeping, we also dream about new cool stuff to do.
As we've now just released and reached a new milestone with TMS Component Pack v8.5, it's good to take a moment and bring to the attention all the new goodies that are packed in the new release, so, sit back, hold tight, here we go with the list:

New: TDBAdvSearchList
DB-aware version of the TAdvSearchList component
The TDBAdvSearchList is a DB-aware of TAdvSearchList. This means that the data in the list in the different columns can be automatically filled from a connected dataset via a datasource. Set TDBAdvSearchList.DataSource and DBAdvSearchList.Columns[x].DataField to specify binding of values in the columns of the list. When the DB field bound to a column is of the type TBlobFiled, the list control will try load the blob data as a picture.


New: TDBAdvSearchEdit
DB-aware version of the TAdvSearchEdit component
The TDBAdvSearchEdit is DB-aware version of the TAdvSearchEdit with respect to the value as well as with respect to the list of values. Set TDBAdvSearchEdit.DataSource and TDBAdvSearchEdit.DataField to define the DB-awareness of the value and use TDBAdvSearchEdit.ListSource in combination with TDBAdvSearchEdit.Columns[x].DataField to specify binding of values in the columns of the list.


New: TDBAdvResponsiveList
DB-aware version of the TAdvResponsiveList component
The TDBAdvResponsiveList is a DB-aware version of the TAdvResponsiveList. Header, content and footer of responsive list items can be loaded automatically from a dataset connected via a datasource. Set the datasource via TDBAdvResponsiveList.DataSource. The binding of values to items is done via item templates. The template placeholders are defined as (#FIELDNAME) and are dynamically rendered when the dataset is activated. Memo fields can be used as well as picture blob fields. For picture blob fields, specify the template value to render as picture as:

<IMG src="(#BLOBFIELDNAME)">




New: TAdvPDFLib
Standalone PDF library to generate PDF files easily on-the-fly.
Library that features PDF file generation with text, formatted text, rectangles, lines, polygons, images, ... header, footer access and custom drawing.



There is a new developers guide specifically covering the new PDF generation library.
This is also the library that is used under the hood to do out of the box PDF generation from our grids, richeditor, planner, memo!

New: TAdvPDFImageBook
Class that can on-the-fly generate PDF files from a list of images

TAdvResponsiveList
- New: HeaderTemplate capability added
Now also for the item header, a template can be specified. The template placeholders are just like for the content specified as (#VALUENAME). The template is rendered by using the TResponsiveListItem.Values['VALUENAME'] value and have specifiers like (#VALUENAME) replaced by these values.
- New: FooterTemplate capability added
Same as the header template but for the optional footer of the item
- New: Appearance.ItemContentMargin added
New property to specify the margin from left/right and top/bottom of the content with respect to the outline of the item.
- New: Filter capability
Items in the TAdvResponsiveList can now be easily filtered. The filter condition is set via TAdvResponsiveList.FilterCondition. Following properties are available:
FilterCondition.CaseSensitive: Boolean : when true, a case-sensitive match is performed

FilterCondition.FilterData: TResponsiveListItemFilterDataSet : defines on what data to filter : the header, the content or the footer.

TResponsiveListItemFilterData = (fdContent, fdHeader, fdFooter);
TResponsiveListItemFilterDataSet = set of TResponsiveListItemFilterData;

FilterCondition.FilterType: TResponsiveListItemFilterType : defines what match method to use:

TResponsiveListItemFilterType = (mText, mEntireWord, mStartWord, mEndWord);

mText: match of any part of the text
mEntireWord: match of text respecting word boundaries
mStartWord: match must be at start of a word
mEndWord: match must be at end of a word
FilterCondition.Text : string : holds the text to perform a match against
The filter operation is started by setting the filter condition and then call:
TAdvResponsiveList.UpdateFilter;

The filter operation is cancelled by calling:

TAdvResponsiveList.ClearFilter;

In addition to the filter condition, an event OnItemFilter() is also triggered for each item's filter match check and as such, via this event also custom filtering can be implemented. When this event is triggered, set the var parameter Retain to TRUE if the item needs to remain in the list after filtering.


TAdvDirectoryTreeView
- New: SortOrder: TAdvDirectoryTreeViewSortOrder to set sorting order to files first, folders first
TAdvDirectoryTreeViewSortOrder = (tvsoNone, tvsoFilesFirst, tvsoDirectoriesFirst);
Defines whether to display first files in the treeview, first directories or use the default order of returned files and directories by the shell.
- New: SystemContextMenu: Boolean;
When this property is true, the property shell context menu will be shown on right-click of a file/folder in the treeview.



TAdvGauge
- New: ExtraNeedles: TNeedleItems
This is an extra collection to add as many needles as desired to the gauge. The collection consists of TNeedleItem objects via which the needle color, position and width can be set.

Example:

var
  it: TNeedleItem;
  I: Integer;
begin
  for I := 0 to 10 do
  begin
    it := AdvGauge1.ExtraNeedles.Add;
    it.Position := i * 10;
    if odd(i) then
      it.Color := clLime
    else
      it.Color := clAqua;
  end;
end;


These are the bigger items that are new in TMS Component Pack v8.5, there are numerous smaller items and bug fixes that you can find in the full version history.
Enjoy the amazing array of functionality that is in the TMS Component Pack v8.5 now but moreover, don't hesitate to keep the conversation alive. Our team is eager to learn what you want in v8.6, we're impatiently waiting to hear your thoughts where we can improve components, what new functionality to add and what cool new components can make your job as developer of great Windows applications with Delphi or C++Builder even more enjoyable and exciting. Use your communication channel of preference and get in touch:

                




Bruno Fierens


Bookmarks: 

This blog post has not received any comments yet. Add a comment.



My Top 10 Aurelius Features - #6 Legacy Databases

Thursday, January 12, 2017

The video series "My Top 10 Aurelius Features" continues. The #6 feature is the support for Legacy Databases, and the following video shows it in action. English and Portuguese subtitles available!



In my opinion, TMS Aurelius will be very limited if it required a very strict database schema/structure. It would be great for creating prototypes and new applications from scratch, but a no-no for existing applications and databases - and we all know that in Delphi world, what we have most is existing and legacy applications!

That's why Aurelius provides an extensive list of mapping attributes that makes it compatible with virtually any existing database structure you might have. Attributes like

Id
Allows you to use databases with different primary key, like GUID, String, UUID, or even Composite Id's

Column and JoinColumn
Allows you to specify how one table relates to another (foreign keys) even if it doesn't reference a primary key in parent table (an unique index might be used).

Those are just small examples. And the best part is that you don't need to map it yourself. You can use the TMS Data Modeler tool to import an existing database structure and generate all the mapping for you!

Please watch the video for more details and to see TMS Data Modeler source code generation in action.

As usual, don't forget to subscribe to our YouTube channel and receive notifications about upcoming videos!

Wagner R. Landgraf


Bookmarks: 

This blog post has received 4 comments. Add a comment.



TMS Cryptography Pack 2016 Bug List and Feature Requests

Tuesday, January 03, 2017

To begin 2017, here is an update on TMS Cryptography Pack, that has now been available for six months. We received several bug reports and requests for new features that are listed in the Excel spreadsheet in the link.

The good news is that no bug related to one of the cryptographic engines was reported and that we only found a single pure cryptographic bug. This bug was identified in the SPECK 24 bit mode and escaped our detection because the test program returned " true " independently from the test result of this mode. Hopefully no user was impacted.

There is one critical bug left for users who don't want to use or ship VCRuntime140.dll required for Windows 64 bit applications. This requirement is due to the use of Visual Studio C++ to generate the object files for Windows 64 as Embarcadero doesn't provide the required object format to interoperate with Pascal Object code. A bug report has been sent to Embarcadero.

There are 4 feature requests that we will address in the upcoming releases of TMS CP. They are:
- ASN.1 (BER, DER, CER, OER encodings)
- XADES/CADES/PADES signatures
- Unicode support for file names
- Stream operations support

We are always open to new suggestions.

Bernard Roussely


Bookmarks: 

This blog post has received 1 comment. Add a comment.



My Top 10 Aurelius Features - #7 Schema Update

When creating a database-based application, one of the tasks I always considered boring was to create the database structure, table, fields, foreign keys. Even using a tool to generate a SQL would require me to create a table, add columns, column types, foreign keys, etc.

That's why I consider the ability to automatically create and update the database schema to be the #7 feature of My Top 10 Aurelius Features. It's simply something I don't need to care about anymore.



Updating the database is as easy as doing this:
TDatabaseManager.Update(Connection);
That simple command will check the existing schema in the database and create the missing objects needed to persist all the objects you are dealing with: new tables, columns, foreign keys.

Note that I'm talking about updating, not creating the database. That makes application prototyping and development really fast. Create the database, change your application, add a new table, update the database, and it goes on.

Even though updating the database is as simple as using one line of code, Aurelius provides advanced features for the database update process, like validation. With a code like the following, you can check the differences between the schema of the existing database, and what is needed in the schema to hold the current entity model you have. It shows you the differences without requiring you to actually execute the SQL statements:
procedure TForm1.ValidateMyDatabaseSchema;
var
  DBManager: TDatabaseManager;
  Action: TSchemaAction;
  Warning: TSchemaWarning;
  Error: TSchemaError;
begin
  DBManager := TDatabaseManager.Create(Connection);
  try
    DBManager.ValidateDatabase;

    { Show SQL statements }
    mmStatements.Clear;
    for Statement in DBManager.SQLStatements do
    begin
      mmStatements.Lines.Add(Statement);
      mmStatements.Lines.Add('');
    end;

    { Show validation results }
    mmValidation.Clear;

    mmValidation.Lines.Add('----- Actions -----');
    for Action in DBManager.Actions do
      mmValidation.Lines.Add(Format('%s -> %s', [Action.ClassName, Action.Text]));
    mmValidation.Lines.Add('');

    mmValidation.Lines.Add('----- Warnings -----');
    for Warning in DBManager.Warnings do
      mmValidation.Lines.Add(Format('%s: %s', [Warning.ClassName, Warning.Text]));
    mmValidation.Lines.Add('');

    mmValidation.Lines.Add('----- Errors -----');
    for Error in DBManager.Errors do
      mmValidation.Lines.Add(Format('%s: %s', [Error.ClassName, Error.Text]));
  finally
    DBManager.Free;
  end;
end;
Please watch the video (closed captions available!) to see how schema update and validate in action. As usual, don't forget to subscribe to our YouTube channel and receive notifications about upcoming videos!

Wagner R. Landgraf


Bookmarks: 

This blog post has received 2 comments. Add a comment.



Generating PDF files cross-platform with ease

Thursday, December 22, 2016

With the new 1.7 release of the TMS FNC UI Pack we've added a completely new PDF library built from the ground up, that is capable of generating PDF files on all supported frameworks (FMX, VCL, LCL). Via all supported frameworks, you can easily target minimum 5 different operating systems: Windows, macOS, iOS, Android, Linux (&Raspbian),.. To introduce this new PDF library I've written a small tutorial to start generating your own PDF files.

Getting Started

To get started with the PDF library, add the FMX.TMSFNCPDFLib, VCL.TMSFNCPDFLib or LCLTMSFNCPDFLib depending on the chosen framework. The PDF library class is called TTMSFNCPDFLib, and the code is shareable between the three supported frameworks.

Starting a new document

Starting a new document can be file-based, or TMemoryStream-based. To start a new document, call the BeginDocument function. The BeginDocument always needs to be paired with EndDocument, which is responsible for writing the contents to a file or TMemoryStream. When the AFileName parameter in the BeginDocument call is empty, the contents will be written to a TMemoryStream, returned by the EndDocument call. The EndDocument call also has an additional parameter to allow opening the generated PDF file in the default PDF reader application.

procedure TForm1.GeneratePDF(AFileName: string);
var
  p: TTMSFNCPDFLib;
begin
  p := TTMSFNCPDFLib.Create;
  try
    p.BeginDocument(AFileName);
    p.EndDocument;
  finally
    p.Free;
  end;
end;

Adding pages

Adding pages can be done by calling the NewPage function. The NewPage is responsible for starting a new page content stream on which the graphics / text can be written. Each NewPage call will clear the content buffer and allow you to start with new text and graphics. Please note though that all appearance settings such as fill, stroke and font are stored for the entire document, so starting a new page will allow you to continue in the same appearance settings as the previous page.

procedure TForm1.GeneratePDF(AFileName: string);
var
  p: TTMSFNCPDFLib;
begin
  p := TTMSFNCPDFLib.Create;
  try
    p.BeginDocument(AFileName);
    p.NewPage;
    p.EndDocument;
  finally
    p.Free;
  end;
end;

Drawing content on a page

After adding a new page, the page can be filled with content such as HTML formatted text, plain text as well as some basic drawing primitives such as rectangles, circles and lines. To starting drawing content, the pdf library has a Graphics property that provides access to the drawing functionality. The following sample uses the Fill and Stroke properties to generate a PDF with a gradient rectangle and a dotted border.

procedure TForm1.GeneratePDF(AFileName: string);
var
  p: TTMSFNCPDFLib;
begin
  p := TTMSFNCPDFLib.Create;
  try
    p.BeginDocument(AFileName);
    p.NewPage;
    p.Graphics.Stroke.Color := gcRed;
    p.Graphics.Stroke.Width := 3;
    p.Graphics.Stroke.Kind := gskDashDotDot;
    p.Graphics.Fill.Kind := gfkGradient;
    p.Graphics.Fill.Color := gcBlue;
    p.Graphics.Fill.ColorTo := gcOrange;
    p.Graphics.DrawRectangle(RectF(10, 50, 100, 150));
    p.EndDocument(True);
  finally
    p.Free;
  end;
end;

Drawing Text

Drawing text on a PDF page is done via the DrawText function. The DrawText has a set of parameters to allow drawing wordwrapped text in a rectangle, or simply as-is at a specific position. The DrawText function has a set of overloads that also supports column drawing. Each call to DrawText returns a value that can either contain the calculated text rectangle or the amount of left-over characters after an overflow is detected when drawing text in a column. The font that is used when drawing text can be controlled separately via the Font property. With this property, the font name, size, color and style can be set.

procedure TForm1.GeneratePDF(AFileName: string);
var
    p: TTMSFNCPDFLib;
begin
    p := TTMSFNCPDFLib.Create;
  try
    p.BeginDocument(AFileName);
    p.NewPage;
    p.Graphics.Font.Name := 'Segoe UI';
    p.Graphics.Font.Size := 16;
    p.Graphics.Font.Color := gcRed;
    p.Graphics.Font.Style := [TFontStyle.fsBold];
    p.Graphics.DrawText('Hello World !', PointF(10, 50));
    p.EndDocument(True);
  finally
    p.Free;
  end;
end;

HTML formatted text

HTML formatted text is also supported by using the DrawHTMLText call. When passing a TMSFNCBitmapContainer reference it can even draw images referenced by the <IMG> tag. HTML support is based on the miniHTML reference.

procedure TForm1.GeneratePDF(AFileName: string);
var
  p: TTMSFNCPDFLib;
  s: string;
  r: TRectF;
begin
  p := TTMSFNCPDFLib.Create;
  try
    s := 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum     has been the industry''s standard dummy'+
'text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. '+
'It has survived not only five centuries, but also the leap into electronic typeset'+
'ting, 
remaining essentially unchanged. It'+ ' was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with des'+ 'ktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.'; p.BitmapContainer := TMSFNCBitmapContainer1; p.BeginDocument(AFileName); p.NewPage; p.Graphics.Font.Name := 'Arial'; p.Graphics.Font.Size := 10; p.Graphics.Fill.Color := gcNull; r := RectF(10, 50, 300, 400); p.Graphics.DrawHTMLText(s, r); p.EndDocument(True); finally p.Free; end; end;

The PDF library supports more than simple text and graphics. More information on the PDF library and the features can be found at the following page http://www.tmssoftware.com/site/tmsfncuipack.asp?s=fncpdf#features.

The PDF library is also available in the TMS FMX UI Pack and is coming to the TMS Component Pack at the beginning of 2017!

Pieter Scheldeman


Bookmarks: 

This blog post has not received any comments yet. Add a comment.




Previous  |  Next  |  Index