Delphi

Learn About Using The Windows Subsystem For Linux (WSL) With Delphi

StoreIn this session, you can how to take advantage of the new Windows Subsystem for Linux (WSL) to develop, debug, and deploy Linux applications from Delphi. What is the Windows Subsystem for Linux (WSL) Windows Subsystem for Linux (WSL) is a compatibility layer for running Linux binary executables natively on Windows 10 and Windows Server 2019 Multiple distributions are available via the Microsoft Store (Ubuntu, Debian, OpenSUSE, Kali, Fedora e.t.c) Mostly focused on the command-line interface with limited support for GUI apps via the external X11 server Less abstraction and better Windows integration than a traditional Virtual Machine Similar to Hyper-V or Windows Sandbox Invoke Linux binaries from Windows and Windows executables from Linux Be sure to watch the whole session to learn: WSL Installation Managing WSL Distros Targeting from Delphi to Linux  Installation of the PAServer Automation All these steps are shown in action with real demos.

Read More

Powerful Chromium Based WebView Component To Host Web Content In Your Delphi/C++ Builder FireMonkey Apps

RAD Studio 10.4 Sydney brings support for working with web content through the Chromium-based Edge WebView2 browser control in VCL applications via the new TEdgeBrowser component. Embarcadero DocWiki But, this is for only the VCL applications currently. So, what if you want to utilize this feature in your FireMonkey application?! Problem solved! We have the WebView for FireMonkey component by WINSOFT which offers you to host web content in your applications. Uses Microsoft WebView2 API Supports Windows 32 and Windows 64 Available for Delphi/C++ Builder 6 – 10.4 Requires Microsoft Edge (Chromium) version 84.0.515.0 or higher After downloading the WebView component you should install the component. Here you can follow the installation video. Moreover, the WebView2Loader dynamic-link library should be with the executable file. You can find that dynamic-link library from the Library folder within the installed component files. Because the WebView2 is the part of the Microsoft WebView2 SDK. After configuring and installing, you can just create a FireMonkey application and drop the TFWebView component from the System category on the Palette. Using the TFWebView is similar to TWebBrowser or TEdgeBrowser.  Let’s start investigating the features of the TFWebView component. You can give the Uniform Resource Identifier (URI) using the Uri property. With the Zoom property, you can control the view. FWebView.Zoom := FWebView.Zoom – 0.1; FWebView.Zoom := FWebView.Zoom + 0.1; You can fetch the web document title by this code: Caption := ‘WebView – ‘ + FWebView.DocumentTitle; CapturePreview procedure takes a screenshot of the TFWebView component to save the screenshot you can just use the TMemoryStream. Here is a use case. procedure TFormMain.SpeedButtonCaptureClick(Sender: TObject); begin if CapturePreviewStream = nil then CapturePreviewStream := TMemoryStream.Create else CapturePreviewStream.Clear; FWebView.CapturePreview(pfPng, CapturePreviewStream, CapturePreviewCompleted); end; procedure TFormMain.CapturePreviewCompleted(Sender: TObject); const FileName = ‘preview.png’; begin CapturePreviewStream.SaveToFile(FileName); FreeAndNil(CapturePreviewStream); Open(FileName); end; procedure TFormMain.SpeedButtonCaptureClick(Sender: TObject); begin   if CapturePreviewStream = nil then     CapturePreviewStream := TMemoryStream.Create   else     CapturePreviewStream.Clear;   FWebView.CapturePreview(pfPng, CapturePreviewStream, CapturePreviewCompleted); end; procedure TFormMain.CapturePreviewCompleted(Sender: TObject); const FileName = ‘preview.png’; begin   CapturePreviewStream.SaveToFile(FileName);   FreeAndNil(CapturePreviewStream);   Open(FileName); end; TFWebView comes with some amazing functionalities like posting a web message to an HTML document.  Or, showing HTML in memory, like you give the HTML/CSS/JS code as a parameter of the ShowHtml procedure that then creates a document to you within the TFWebView.  Moreover, you can manipulate the HTML document by executing JavaScript code, for instance fetching elements by Id and setting a new value. For this, you can utilize the ExecuteScript procedure. Finally, the best feature is playing with the developer tools. For instance, using Browser methods, like executing the getVersion function. To use this option, you can call the CallDevTools procedure. Be sure to check out part two of this post. In the next one, we will go through these given examples with a full explanation. Head over and check out the full WINSOFT WebView for FireMonkey component.

Read More

Learn How To Work With MongoDB Dataset In A Delphi application Quickly Using ListView Sample App

MongoDB is a document database, which means it stores data in JSON-like documents, the most natural way to think about data, and is much more expressive and powerful than the traditional row/column model. How about connecting with MongoDB using FireDAC components in your Application and access the dataset to show in a list view? Don’t know where to start? This post will guide you to do that. MongoDB.ListView Sample App shows how to work with a sample MongoDB Database and show the data in the Listview. You can find Delphi and C++ code samples in GitHub Repositories. Search by name into the samples repositories according to your RAD Studio version. Components used in MangoDB.ListView App: TFDPhysMongoDriverLink: To link the MongoDB driver to an application and set it up. In general, it is enough to only include the FireDAC.Phys.MongoDB unit into your application uses a clause. The TFDPhysMongoDriverLink component can be used to specify: The VendorHome – the MongoDB installation root folder. The VendorLib – the name and the optional path to the MongoDB client library. TFDConnection: To establish a connection to a DBMS and to manage associated datasets. TListView: FireMonkey component that you can use to hold and present various types of items. Implementation Details: Before implementing this, as a preliminary step, we need to have a MongoDB Server is running and accessible from your host. For Details, See Connect to MongoDB Database. The “restaurants” collection of the “test” database is provisioned with test data. To provision this collection, run the MongoDB Restaurants Demo, and click the Load Data button: You can find the MongoDB Restaurants Demo sample project at: Object PascalDatabaseFireDACSamplesDBMS SpecificMongoDBRestaurants This sample application illustrates how to connect to a MongoDB server, select specific documents from a sample collection “restaurants” using a select query, parse the selected document elements (JSON items), and then display the results using the TListView component. Create a select query to retrieve specific documents from the sample MongoDB collection “restaurants” using the TMongoCollection.Find method. Parse elements of the selected documents in one of the following ways: using the TJSONIterator.Find method. using the TJSONIterator.Next, TJSONIterator.Recurse, and TJSONIterator.Return methods. using the TJSONIterator.Iterate method. Display the retrieved data using the TListView component. Check out the full article in the DocWiki about the MongoDB.ListView Sample. MongoDB ListView Sample App Check out the full source code for the MongoDB.ListView projects for Delphi and C++Builder over on GitHub.

Read More

Blastoff Game Created With Open Source DirectX Engine Built In Delphi

Quad Engine is an open source DirectX game engine built in Delphi which also offers bindings for C++ and C#. Blast-off is a showcase game built in the quad Engine and available on Stream. It is described as “Blast-off is a hardcore jumper/runner/shmup, where your alter ego will be a ball of anti-matter seeking to leave our Universe. Anti-matter is extremely difficult to exist in our universe, because when it contact with matter it annihilates. This forces the hero to reach super-fast speed to break through the space-time and break through the limit, where he will find peace in the void.” The game engine itself has 10 different demos showing how to use various features in the engine. Additionally, there is a showcase section with 12 different games plus full source code built with the quad Engine. Quite an impressive feat of engineering in a small package. Game Engine http://quad-engine.com/ (on GitHub) Ready to get started with the latest RAD Studio version? Start Free Trial or Learn More About Upgrading On Steam https://store.steampowered.com/app/391140/Blastoff/ Screenshot Gallery Reduce development time and get to market faster with RAD Studio, Delphi, or C++Builder. Design. Code. Compile. Deploy.Start Free Trial   Learn More About Upgrading

Read More

Learn To Add Custom Text Rendering And Formatting Capabilities To Your Delphi FMX Controls Quickly

Most applications demand high-quality text rendering, resolution-independent outline fonts, and full Unicode text and layout support. Looking for a device-independent text layout system that improves text readability in documents and in UI for Your Delphi/C++ applications? How to build such Text Rendering Capabilities to your FireMonkey controls? This post will guide you. (e.g) Let’s see how to enhance the TLabel control with Rendering and formatting capabilities for the Text in HTML Tags. How to create:1. Create a descendant of TLabel that supports a limited selection of HTML tags. Parse the label for HTML tags every time the text changes.2. Override its Dochanged method to parse the text for HTML tags3. Use Firemonkey’s TTextLayout class to apply formatting attributes to parts of the text. Note: No need to use HTML for formatting instead we can use TTextlayout. TTextLayout is an abstract class that provides mechanisms to render text quickly. Such rendering systems are supported by DirectWrite API (Windows) and Core Text framework (OS X). Also used to calculate glyph positions, measure text, draw text, and covert to curves for path effects and 3D extrusion. To create this class, use TTextLayoutManager – In charge of choosing the appropriate layout class type for the current running platform. Use AddAttribute to assign text block properties like TTextRange (starting position and length) and TTextAttribute (font and color). When changing several properties of the layout, you should use the BeginUpdate and EndUpdate procedures. Use RenderLayout to render the text on a canvas. The PositionAtPoint method returns the position in the text by the position’s coordinates. The RegionForRange method returns the array of the rectangles surrounding the range of the text specified in ARange. Another feature is the ability to convert text to a TPathData object by calling the ConvertToPath procedure. Check out the full Video of creating a Simple FMX HTML control below.

Read More

Powerful Native Windows Open Source And Free Python IDE Built In Delphi

Embarcadero’s users understand the scalability and stability of C++ and Delphi, and depend on the decades of innovation those languages bring to development. Ninety of the Fortune 100 and an active community of more than three million users worldwide have relied on Embarcadero’s award-winning products over the past 30 years. Icons by Icons8.com. © 2020 EMBARCADERO INC. ALL RIGHTS RESERVED Legal

Read More

Structured Programming in Delphi – DelphiCon 2020

Have you heard of functional programming but are vague on the details?  Are you ready to expand beyond the object-oriented mindset?  Tomorrow, Nick Hodges, author of Coding in Delphi, will teach us how to harness functional programming techniques to craft beautiful programs in Delphi.  Just one day away, Functional Programming with Delphi is a knowledge-broadening talk you don’t want to miss! DelphiCon 2020 offers ten talks and four expert panels by Embarcadero tech partners and Most Valuable Professionals spanning the range of software from education to industrial database access. Come for the functional programming and leave with a greater understanding of how to maximize performance with Delphi. The conference is free and open to the public. Sign up now by clicking the “Save my seat” button at delphicon.embarcadero.com!

Read More

Learn To Build Modern Enterprise-Grade Native Applications For Windows With RAD Studio

In this webinar, one of the Embarcadero MVP Serge Pilko shows off the RAD Studio against Electron and other JavaScript frameworks for desktop application development. Overview Native desktop development for Windows JavaScript framework-based solutions vs. RAD Studio for Windows Development Electron & Node.js .NET WinForms & WPS vs. Delphi & C++ Builder VCL or FMX JavaScript for Desktop Many JavaScript libraries let you create desktop GUI applications with web technologies like JavaScript, HTML, and CSS. And it is connected to the web easily. With JavaScript desktop development libraries you can’t get the native performance, no native user interface.  Consumes more memory because your JavaScript application needs an engine Source code protection issue Not all enterprise developers are ready to rely on open-source solutions  Delphi & C++ Builder for Desktop A proven tool for Windows desktop development Small executable file size and low memory usage Native application The best performance you can get Thousands of use cases are ready to explore Native look and feel Easy to design and bring the best user experience Be sure to check out the whole session to learn about the benchmarks in action and more about modernizing your applications! Learn more about enhancing your productivity with RAD Studio.

Read More

Learn How To Build Decoupled Delphi Applications Quickly With Delphi Event Bus Framework

Modularity is very important in software architecture so that applications built can be easily extendable and maintainable. Consider your building an application with multiple components in it. If we decide to remove a component and replace it with another component it should not affect the application. This can be done by decoupling software architecture. Do you want to build such decoupled applications in Delphi? This post guide you to build using Delphi Event Bus Framework. EventBus: An event bus allows publish/subscribe-style communication between components without requiring the components to explicitly be aware of each other. Looks like Observer Pattern? No, there is a difference. In the observer pattern, the broadcast is performed directly from the observable to the observers, so they “know” each other. But when using a publish/subscribe pattern, there is a third component, called event bus, which is known by both the publisher and subscriber. It is Decoupled between Publisher and Subscriber. Delphi Event Bus allows you to decouple components that asynchronously receive and process events and or emit events. Consumers can subscribe to this event bus and declaratively specify which events they wish to consume. The event consumer a publisher is completely decoupled. Simplifies the communication between components. Delphi Event Bus Features: Easy and clean: DelphiEventBus is super easy to learn and use because it respects KISS and “Convention over configuration” design principles. By using default TEventBus instance, you can start immediately to delivery and receive events Designed to decouple different parts/layers of your application Event-Driven, Thread Safe, Unit Tested Attributes based API: Simply put the Subscribe attribute on your subscriber method you are able to receive a specific event Support different delivery modes: Specifying the TThreadMode in Subscribe attribute, you can choose to deliver the event in the Main Thread or in a Background one, regardless of where an event was posted. The EventBus will manage Thread synchronization. How it works : TEvent = class(TObject) // additional information here end; TEvent = class(TObject) // additional information here end; Prepare subscribers: Declaring your subscribing method: [Subscribe] procedure OnEvent(AEvent: TAnyTypeOfEvent); begin // manage the event end; [Subscribe] procedure OnEvent(AEvent: TAnyTypeOfEvent); begin   // manage the event end; Prepare subscribers: Register your subscriber: GlobalEventBus.RegisterSubscriber(self); GlobalEventBus.RegisterSubscriber(self); GlobalEventBus.post(LEvent); GlobalEventBus.post(LEvent); Check this below video for Demonstration of How the Delphi Event Bus Framework(DEB) works. Delphi Event Bus Demonstration Checkout the full source code for Delphi Event framework here.

Read More

Awesome Pascal Is A Curated List Of Awesome Open Source Delphi Pascal Frameworks, Libraries, Resources, And More

Developer Anton Frost has a curated listed of Awesome Delphi projects available over on GitHub. It offers a wide variety of projects across multimedia, game development, GUI, scripting, database, reporting, utilities, serial ports, memory management, and much more. Take A Look According to the project “only open-source projects are considered. Dead projects (not updated for 3 years or more) must be really awesome or unique to be included.“ You can submit your own projects to the list by creating a pull request to get projects included. This awesome collection is formatted and available on Delphi.ZEEF.com as well.

Read More