TMS Software. All-Access

GraphQL, workflow engine, multitenancy and more: what you will do with Delphi in 2021

Here at TMS, we are working on so much new exciting frameworks and features that I decided to share with you what we expect to bring to you in 2021! Photo by Rhett Wesley on Unsplash First, a disclaimer: this is not an official commitment. Some of the things listed here might be delayed or not be released at all. But of course, that’s not our intention, since we are listing it here. We want to (and probably will) release all of this in 2021. But, since unexpected things might happen, we can never guarantee what will happen in future. One second thing: thislist only covers what is coming around TMS Business line of products. There is much more to come from TMS in 2021! I was going to title this post as “TMS Business Roadmap for 2021”. But I thought that the current title brings more attention and curiosity. And it looks like it worked, thanks for coming! ?? Ok, jokes aside, another reason is that we still don’t know if all of the libraries, features and technologies listed here will be part of the TMS Business bundle, and the original title could be misleading. But regardless, everything listed here will for sure be smoothly integrated with TMS Business – either using ORM (TMS Aurelius) or REST/JSON framework (TMS XData), or any other core product, what is for sure is that everything listed here makes up a huge ecosystem around TMS Business technologies. An exciting year is coming ahead! So, without further ado, this is what we expect to bring to Delphi world this year, with TMS Business. GraphQL TMS is bringing GraphQL to Delphi! We have it already in a beta state, the core is complete, all is going fine. We still need to document everything, and add a few more features here and there, but it’s in a very advanced stage. This teaser video shows GraphQL server in action, written in Delphi! The frontend is GraphQL Playground JS framework, but still being served via a Delphi server. The relevant parts of the code used to build the server in the video are the following. First, the GraphQL schema is built: SchemaDocument := TGraphQLDocumentParser.ParseSchema( ‘type Query { hello(name: String!): String }’); Schema := TGraphQLSchemaBuilder.Build(SchemaDocument); Schema.SetResolver(‘Query’, ‘hello’, function(Args: TFieldResolverArgs): TValue begin Result := ‘Hello, ‘ + Args.GetArgument(‘name’).AsString; end ); Then, the endpoints for the GraphQL API and the GraphQL Playground are created: ADispatcher.AddModule( TGraphQLServerModule.Create(‘http://+:2001/tms/graphql’, FSchema)); ADispatcher.AddModule( TGraphQLPlaygroundModule.Create(‘http://+:2001/tms/playground’, ‘/tms/graphql’)); And that’s it for the “Hello, world” demo! TMS Auth A complete framework for adding authentication to your application, with user, roles and permissions management and providing features like login, registration, e-mail confirmation and more. Relying on Aurelius ORM and XData REST framework, with a few lines of code you will get all your database setup and have an authentication API server running, with lots of features. Well, it’s said one picture is worth a thousand words, so here is an example of the available API out of box: And these are screenshots of an existing app built with TMS Web Core which is already using TMS Auth for user registration and login: It will never been as easy to add user and permissions management and login system to your Delphi application and server! BPM Workflow A full workflow engine is […]

Read More

Freebie Friday: Windows version info

Coincidence or not, but 26 years ago, in 1995, not only Delphi 1 was released by Borland but Microsoft also released Windows 95 that from that moment on skyrocketed in popularity and went for world domination as operating system.Who would have thought in 1995 that 26 years later, detecting on what Windows operating system your software is running would be more complex than ever?Over the years, Microsoft released not only new major versions almost every 2 to 3 years but also all sorts of editions like the Windows NT operating system for example. In 2015 Microsoft released Windows 10 and decided it would continue to release incremental updates all under the Windows 10 moniker but also here Microsoft went on to make it available in different editions (Education, Home, Pro, Enterprise) and at the same time continued to release major updates to its server operating system Windows 2016 Server and Windows 2019 Server. Needless to say that proper Windows operating system version detection became non-trivial over the years. Added to this complexity is the fact that Microsoft decided to create a mechanism to return Windows version information to applications through its APIs different from the real Windows version and this depending on the application manifest. The reason for this approach was obviously for ensuring old applications would continue to work thinking they were running on older Windows operating systems, but it doesn’t make things easier.  So, forget about all this history, forget about all this complexity as after all, it is Friday today and we are heading to the weekend to celebrate the 26th anniversary of Delphi. This #FreebieFriday brings you one routine GetOperatingSystem() that returns the Windows version and also the version number as string: procedure GetOperatingSystem(var AName: string; var AVersion: string); const SM_SERVERR2 = 89; VER_NT_WORKSTATION = $0000001; type pfnRtlGetVersion = function(var RTL_OSVERSIONINFOEXW): DWORD; stdcall; var osVerInfo: TOSVersionInfoEx; majorVer, minorVer, spmajorVer, spminorVer, buildVer, edition: Cardinal; ver: RTL_OSVERSIONINFOEXW; RtlGetVersion: pfnRtlGetVersion; procedure GetUnmanistedVersion(var majv,minv,buildv: cardinal); begin @RtlGetVersion := GetProcAddress(GetModuleHandle(‘ntdll.dll’), ‘RtlGetVersion’); if Assigned(RtlGetVersion) then begin ZeroMemory(@ver, SizeOf(ver)); ver.dwOSVersionInfoSize := SizeOf(ver); if RtlGetVersion(ver) = 0 then begin majv := ver.dwMajorVersion; minv := ver.dwMinorVersion; buildv := ver.dwBuildNumber; end; end; end; function GetWindows10Edition: string; begin Result := ‘Windows 10’; GetProductInfo(majorVer, minorVer, spmajorVer, spminorVer, edition); case edition and $FF of $62..$65: Result := ‘Windows 10 Home’; $79..$7A: Result := ‘Windows 10 Education’; $46,$04,$48,$1B,$54,$7D,$7E,$81,$82: Result := ‘Windows 10 Enterprise’; $30,$31,$A1,$A2: Result := ‘Windows 10 Pro’; end; end; begin AName := ‘Unknown’; AVersion := ‘0’; // set operating system type flag osVerInfo.dwOSVersionInfoSize := SizeOf(TOSVersionInfoEx); if GetVersionEx(POSVersionInfo(@osVerInfo)^) then begin majorVer := osVerInfo.dwMajorVersion; minorVer := osVerInfo.dwMinorVersion; buildVer := osVerInfo.dwBuildNumber; AVersion := majorVer.ToString + ‘.’ + minorVer.ToString + ‘.’ + buildVer.ToString; case osVerInfo.dwPlatformId of VER_PLATFORM_WIN32_NT: // Windows NT/2000 begin if majorVer = 17763 then AName := ‘Windows Server 2019’ else AName := ‘Windows Server 2016’; end; end; end else if (majorVer = 6) and (minorVer = 3) then begin if osVerInfo.wProductType = VER_NT_WORKSTATION then AName := ‘Windows 8.1’ else AName := ‘Windows Server 2012R2’ end else if (majorVer = 6) and (minorVer = 4) then begin if osVerInfo.wProductType = VER_NT_WORKSTATION then begin AName := GetWindows10Edition; end else begin if osVerInfo.dwBuildNumber >= 17763 then AName := ‘Windows Server 2019’ else AName := ‘Windows Server 2016’ end; end else if (majorVer = 10) and (minorVer = 0) then begin if osVerInfo.wProductType = VER_NT_WORKSTATION […]

Read More

Planning / Scheduling in FMX

Intro 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 TTMSFNCPlanner component, a highly configurable planning/scheduling component. Features Below is a list of the most important features the TTMSNCPlanner 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 view and edit appointments / tasks in FireMonkey. Built-in and customizable inplace and dialog editing Moveable and sizeable items with HTML formatted text and hyperlink detection High performance virtual mode Various display modes: day, month, day period, half day period, multi day, multi month, multi day resource, multi resource day and custom displays Multiple events for all kinds of interactions such as editing, item inserting, updating, moving and sizing Multiple events for custom drawing and customization of default drawing Item hints and time indication helpers Optional overlapping items Touch scrolling and selection Optimized for mobile devices Recurrency support Databinding support via the TTMSFNCPlannerDatabaseAdapter Separate ToolBar Popup PDF Export capabilities Learn More! Want to learn more about what the TTMSFNCPlanner can do? Here is a video that highlights some of the above features through a demo application. Download & Explore! The TTMSFNCPlanner 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 TTMSFNCPlanner component. Coming up The TTMSFNCPlanner is the second 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. Next up will be the TTMSFNCTreeView component, a highly configurable, high performance tree view with virtual and collection-based modes able to deal with millions of nodes so stay tuned for more!.

Read More

TMS FNC Maps 1.3 released!

What’s new? The first TMS FNC Maps update of 2021 includes 2 often requested features: programmatically toggle StreetView mode in TTMSFNCGoogleMaps and the ability to avoid toll roads with TTMSFNCDirections. Toggle StreetView mode in TTMSFNCGoogleMaps With just one line of code it is now possible to switch to StreetView mode on the map’s current center position. This feature is available exclusively for the TTMSFNCGoolgeMaps component.   TMSFNCGoogleMaps1.Options.StreetView.Enabled := not TMSFNCGoogleMaps1.Options.StreetView.Enabled; Avoid toll roads with TTMSFNCDirections Adjust your routing with just a single parameter to avoid toll roads. This feature is available for the following directions services: Google, Here, Bing, Azure and MapBox. Avoid toll roads:     TMSFNCDirections1.GetDirections(StartCoordinate, EndCoordinate, nil, ”, nil, False, tmDriving, nil, False, ”, mlmDefault, True); Include toll roads (default):     TMSFNCDirections1.GetDirections(StartCoordinate, EndCoordinate, nil, ”, nil, False, tmDriving, nil, False, ”, mlmDefault, False); What’s next? Although we are already working on a future update, it’s a little early to reveal what we have planned for now.I hope you enjoy the new features and I’m looking forward to share more exciting new additions to TMS FNC Maps throughout the new year! 

Read More

SVG quality improvements

Intro A while back, we introduced SVG in TMS VCL UI Pack. The first version focused on smaller icon sets. We have meanwhile tweaked and improved the engine and although there is still a lot of work to be done, the next update of TMS VCL UI Pack will offer 2 quality of life improvements: Gradients (GDI+) Rendering quality (GDI+) Disabled drawing (TVirtualImageList) Gradients Gradients were left out of the first version because of shortcomings on other platforms, as we also have SVG rendering engine support for FNC targeting not only VCL, but also FMX, LCL and WEB. The underlying native graphics can be quite complex and have various differences between frameworks. Therefore we decided to take the initial step of offering linear & radial gradients support in VCL only using GDI+. Please note that we are still targeting smaller less complex icons, but we’ll add improvements over time. Rendering quality The initial version did not use the full quality that GDI+ had to offer. When working with SVG, we focused on adding features instead of quality and therefore the rendering quality was not optimal. We have now changed this so it has a smoother appearance independant of the size. v1.0                       v1.1        Disabled drawing In v1.0 we also added support for TVirtualImageList, which converts SVG files into bitmaps on the correct size without losing quality. You can add a TAdvSVGImageCollection attached to a TVirtualImageList and specify only one SVG suitable for any size you want. The TVirtualImageList also has the ability of automatically adding disabled state versions of the converted bitmaps. Initially, this was not working due to the way the bitmap alpha channel was configured and the SVG quality drawing on the bitmap before returning it to the TVirtualImageList. In this update, we have added correct alpha channel to the bitmap conversion routine. What’s next? The above applies to VCL only and will be part of the next update of TMS VCL UI Pack. The engine is a port from FNC, support for other operating systems (macOS, iOS, Android) is still ongoing. As soon as things get shape, we’ll post an update.

Read More

Webinar: A Cross-Platform Development Deep Dive with the TMS FNC Suite of Components

We look forward to connect with you at the upcoming webinar “A Cross-Platform Development Deep Dive with the TMS FNC Suite of Components” organized by Embarcadero.   Webinar content: Starting a new project? Are you going to use FireMonkey or VCL? What about targeting the Web with TMS WEB Core? Luckily the Framework Neutral Components (FNC) from TMS Software works with all those frameworks and more.  Join this live deep-dive session with Dr. Holger Flick, Bruno Fierens and Pieter Scheldeman of TMS Software where the content will focus on your questions with live demos, real-time debugging, and a level of interaction like never before. You won’t want to wait for the replay, mark your calendar today! The TMS FNC Suite gives developers a single UI controls set, a single learning-curve and a single license to have the freedom of choice to develop Delphi or C++Builder, using VCL for Windows, FireMonkey cross-platform applications for Windows, macOS, Android, iOS, Web applications with TMS WEB Core, or even Lazarus LCL applications for Windows, macOS, or Linux. There is so much to tell about TMS FNC components so we kindly invite you to visit our landing page, where more information is provided, including online demos, video tutorials and more. Extras videos can be found on the following page: FNC videos Register today!

Read More

#WEBWONDERS : The world of web audio

A new year and yet another new theme for blog articles. After #GRIDGOODIES and #FREEBIEFRIDAY, this is a new theme we introduce with #WEBWONDERS. In these blogs, we explore the wonderful world of the browser operating system and uncover hidden or not so hidden treasures, tips and tricks. So, let’s kick of this new series with exploring the world of web audio. Modern browsers make the web audio API available. The goals of the web audio API are mixing sound, generating sound and applying effects to sound from web applications.  TMS WEB Core includes the Pascal import unit for using the web audio API from our beloved language. This unit is in the RTL subfolder that contains all units for several different browser APIs. So, in this blog, we let you explore the web audio API with a small code snippet that shows how you can create your own audio wave and have it played through the speakers of the device. The most straightforward is to create a sound through a sine wave with variable frequency. While technically, the web audio API comes with oscillator objects that could generate this, in this sample, we will use Pascal code for creating the buffer that will hold the sine wave. It is this buffer of floats (TJSFloat32Array) that will be played. The only part of the code where we need to use JavaScript is for the creation of the audio context. This is because there is a subtle difference between the creation on Chromium based browsers and webkit based browsers. So, basically the JavaScript code tries the webkit based creation if the Chromium based creation failed. So, the Pascal function to do this is: procedure playfreq(freq, volume: double); var   ctx: TJSAudioContext;   buf: TJSAudioBuffer;   wave: TJSFloat32Array;   i,len: integer;   src: TJSAudioBufferSourceNode;   sampleFreq: double; begin   // connect to the browser window Audio Context.    asm     ctx = new (window.AudioContext || window.webkitAudioContext)();   end;   // get the sample frequency the audio context can use    len := round(ctx.sampleRate);   // create a new buffer of floating point values   wave := TJSFloat32Array.new(len);   // determine the sine wave frequency in relation to the audio context sample frequency   sampleFreq := ctx.sampleRate / freq;   // create a buffer on the audio context   buf := ctx.createBuffer(1, len, ctx.sampleRate);   wave := buf.getChannelData(0);   // fill the float array with the sine wave data taking frequency & volume in account   for i := 0 to len – 1 do     wave[i] := (volume /100) * sin(i/(samplefreq/(2*PI)));   // create a buffer source object for the audio contect   src := ctx.createBufferSource();   // assign the buffer holding the wave to the audio buffer source object   src.buffer := buf;   // connect the audio buffer source object to the audio context output   src.connect(ctx.destination);   // play the sample from position 0   src.start(0.0); end; With this Pascal routine, it becomes simple to put two TWebTrackBar components on the form that allow to select the frequency and the volume and add a button to play the sound. With a frequency selectable between 20Hz en 20000Hz and volume between 0% and 100%, you have a little web application to test your ears frequency range or speaker […]

Read More

web & mobile developer magazine article on TMS WEB Core

It’s been over a year now since the first release of TMS WEB Core. Meanwhile many developers have started first experimenting and then building new web technology based applications with the standalone version of TMS WEB Core and additional tools like TMS XData that are all included in TMS ALL-ACCESS. Some developers combined this with our FNC cross-platform components and have created extraordinary projects! We were especially pleased to see this month that the well-known and respected German magazine on web development: “web & mobile developer” features an article on TMS WEB Core.This is especially encouraging as it spreads the word about TMS WEB Core and more importantly the Delphi IDE to a wide community of software developers. Let’s hope it gets noticed and might convince developers to explore RAD component based web development in the Delphi world! Here is a short summery of the article: TMS WEB Core v1.6.1.0 for Delphi/Lazarus is available standalone now and is also part of TMS ALL-ACCESS. Do you have already one or more TMS product licenses and are interested to get on board for TMS ALL-ACCESS, our no-nonsense formula for access to our full current and future toolset, priority support and access to betas, contact our sales: sales@tmssoftware.com for a best possible upgrade offer.

Read More

Async keyword in TMS WEB Core (Leon Kassebaum)

Async? What’s that? Maybe you have already heard about the two concepts of synchronous and asynchronous processing of code statements. I give you an example. Let’s have a look at a “normal” Delphi application and the following lines of code: procedure MyProc(); var lResponse : string; begin lResponse := ExecuteServerRequest; lResponse := ‘Response: ‘ + lResponse; Writeln(lResponse); end; I think you know this type of application (maybe a VCL or FMX app) and of course line 6 is executed after receiving the servers response. This behavior is called synchronous because the computer performs the written code line by line. If you write the same type of code in JavaScript things are working differently. Let me explain why. First of all pure JavaScript is single-threaded. Due to that fact it only has the possibility to perform your code line by line, so to say JS code is executed synchronously. But this only applies to JS and not for browser api calls. Imagine, if you perform an http request as I did in the example above, you call functions from the browser api. At this point the JS engine can continue with the next statement (next line of code) and the browser performs his task in the background. As soon as he is ready he gives you a callback. This is due to the fact that a website always has to react e.g. for resizing. If this would not be possible you would see an hourglass when connecting to a webserver (which lasts a bit) and your whole web app would be frozen. I think you know the well known Blue circle of death from windows. The reason in JS style So what to do if you want to connect to a webserver? The thing is that you have to wait for the response until you can continue your code. In JS the answer is splitted to three statements: async, await and promises. The concept behind this is that the promise which executes your code (e.g. pulling a webserver), has two callback functions. One is called if everything was successful and the other handles possible errors. Maybe it is better to give you a tiny example in JS: … let lPromise = new Promise( function(ASuccess, AFailed){ setTimeout ( function(){ ASuccess(“Waited 2 seconds”) ; }, 2000); }); … I created a promises which performs setTimeout() to wait for 2 seconds and then he calls the success function. The next step is that you can mark a function as async so that it returns a promise and no longer maybe a string. This … async function MyAsyncFunction(){ return “Hello World!” ; } … is the same as … async function MyAsyncFunction(){ return new Promise( function(ASuccess, AFailed){ ASuccess(“Hello World!”); }); } … I know this is hard to understand but please keep in mind that this is just another way to return a promise but it is much more legible. Calling this function with the await keyword makes sure that your code waits for the success callback function of the returned promise and calculates the result of this function which can be the response of the server. Think of the lPromise from above which simply waits 2 seconds. If I would run the following lines of code console.log(“Before calling”); let lPromise = new … console.log(await […]

Read More

VCL Grid goodies

Our VCL component TAdvStringGrid is one of our components with the longest history. It served thousand and thousands of software developers on planet Earth and we are incredibly thankful for an not oversee-able amount of ideas from users that went into the grid during all these years. There is so much power packed into TAdvStringGrid that it becomes a challenge to know and unlock all its power. Hence this new series “Grid Goodies“. And that is not all, our colleague & chief evangelist Holger Flick has some more things up in his sleeves to help you getting the most out of our VCL grids. But I don’t want to reveal more about this upcoming surprise at this time. Let’s bring two extremely easy to use yet powerful features of TAdvStringGrid. Smart clipboard The grid has numerous settings to fine-tune the exact behavior for clipboard handling you want to have. One lesser known feature is the built-in smart clipboard handling. This is enabled by setting grid.Navigation.AllowSmartClipboard = true. What this means is that when you copy a range of cells values to the clipboard with grid.CopySelectionToClipboard and you paste this range into a cell range with a different size, it will try to perform in a smart way what you expect on the different range of cells where you paste, like for example automatic number or date increments. This isn’t limited to performing copy & paste, it can also be enabled for when you select a range of cells and resize it with the mouse. This is enabled with grid.SelectionResizer = true. Of course, for this to work, the grid must be enabled for editing and cell range selection. We decided to make it ultra easy to enable all this functionality by setting one public property instead of going over all different properties involved here, and that is: grid.SpreadSheet := true; When this is enabled, this becomes possible without any code except the button OnClick handlers calling grid.CopySelectionToClipboard / grid.PasteSelectionFromClipboard: Easy highlighting The second goodie we want to reveal is highlighting matching text in the grid. Although the grid has built-in filtering, various built-in search functionality, on the fly highlighting of matching values can be that convenient feature you are looking for. And it cannot be easier to use. All you need to do is call: grid.Hilight(FixedCells, CaseSensitive, YourText); So, for this example, all we did was attach an OnChange event handler for the edit control and call from there: procedure TForm1.Edit1Change(Sender: TObject); begin AdvStringGrid1.HilightInGrid(false,false,Edit1.Text); end; Oh, one small extra setting was done! We changed the highlight color from the standard blue to yellow background and red text with: AdvStringGrid1.HighlightColor := clYellow; AdvStringGrid1.HighlightTextColor := clRed; Let us know what your favorite grid feature is or what other interesting little goodie you discovered recently and we will be happy to share it here in a follow up #GRIDGOODIES.

Read More