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.
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.
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.
Sometimes we may need to share the functionalities as DLL and we know, creating a DLL in Delphi is a simple task. We learned how to create Python Module and add methods to it in Delphi. How about making a python module as DLL using Python4Delphi and import this python module in another application? This post will guide you to do that. You can also use Python4Delphi with C++Builder. Python4Delphi Demo9 Sample App shows how to create a Module, add a routine to that module, Import the module in a python script, and access the added routine. You can find the Demo9 source on GitHub. Prerequisites: Download and install the latest Python for your platform. Follow the Python4Delphi installation instructions mentioned here. Alternatively, you can check out this video Getting started with Python4Delphi. Components used in Python4Delphi Demo9 App: No visual components were added to the library however the following class were instantiated by using PythonEngine.pas TPythonEngine: A collection of relatively low-level routines for communicating with Python, creating Python types in Delphi, etc. It’s a singleton class. TPythonModule: It’s inherited from TMethodsContainer class allows creating modules by providing a name. You can use routines AddMethod, AddMethodWithKW to add a method of type PyCFunction. You can create events using the Events property. TMemo: A multiline text editing control, providing text scrolling. The text in the memo control can be edited as a whole or line by line. You can find the Python4Delphi Demo9 sample project from the extracted GitHub repository ..Python4DelphiDemosDemo09.dproj. Open this project in RAD Studio 10.4.1 and run the application. Implementation Details: This Sample contains one library project(demodll) and a VCL application project(Demo09). Demodll contains a procedure PyInit_demodll which will create an instance of TPythonEngine and TPythonModule. PythonEngine loads the python DLL using the LoadDll procedure. PythonModule named ‘demodll’ will have a method to add 2 integers. See the code below. When building this project, demodll.pyd is created. function PyInit_demodll : PPyObject; begin Result := nil; try gEngine := TPythonEngine.Create(nil); gEngine.AutoFinalize := False; gEngine.UseLastKnownVersion := False; gEngine.RegVersion := ‘3.9’; //
Beyond Compare is a data management utility that allows users to compare and reconcile documents, files, folders, and even whole system drives quickly and easily. It’s a deeply useful resource, and it is built and powered by Delphi. According to the Beyond Compare website “You can compare entire drives and folders at high speed, checking just sizes and modified times. Or, thoroughly verify every file with byte-by-byte comparisons. FTP sites, cloud storage, and zip files are integrated seamlessly, and powerful filters allow you to limit what you see to only what you’re interested in.” Additionally, it offers three way merge which is explained as “Beyond Compare’s merge view allows you to combine changes from two versions of a file or folder into a single output. Its intelligent approach allows you to quickly accept most changes while carefully examining conflicts.” And it offers syncing folders which is described as “Beyond Compare’s intuitive Folder Sync interface lets you reconcile differences in your data automatically.” Website https://www.scootersoftware.com/ Screenshot Gallery
In this webinar, learn how to access all the APIs on Windows 10 from RAD Studio, Delphi, and C++Builder. Overview Traditional Core APIs Shell Integration WinRT and more Windows API Evolution Over Time Classic API 1985 (Win1) Win16 -> Win32 -> Win32(w/Unicode) -> Win64 COM, OLE Automation, Shell, etc WinRT Classic Windows API Kernel, User, GDI Delphi bindings for the Windows API (C language API) Load time linking vs. dynamic invocation vs. delay loading Message handling TWinControl Delphi TWinControl Wraps Windows handles, CreateWindows, API calls Used for platform controls and custom controls Used for form The entire VCL library wraps Windows APIs, plus some native concepts Component inheritance, actions, visual form inheritance, frames, styling, component messages, delayed creation, handle re-creation Be sure to check out the whole session to learn about COM, Interfaces, Shell integration concepts, and modern WinRT. Moreover, TaskBar and JumpList components in action. Learn more about the Delphi VCL and Windows development in the Embarcadero DocWiki.
import spam p = spam.CreatePoint(2, 5) print (p) p.OffsetBy( 3, 3 ) print (p.x, p.y) print (dir(spam)) print (spam.Point) print (“p = “, p, ” –> “,) if type(p) is spam.Point: print (“p is a Point”) else: print (“p is not a point”) p = 2 print (“p = “, p, ” –> “,) if type(p) is spam.Point: print (“p is a Point”) else: print (“p is not a point”) p = spam.CreatePoint(2, 5) try: print (“raising an error of class EBadPoint”) p.RaiseError() # it will raise spam.EBadPoint except spam.PointError as what: #it shows you that you can intercept a parent class print (“Caught an error derived from PointError”) print (“Error class = “, what.__class__, ” a =”, what.a, ” b =”, what.b, ” c =”, what.c) # You can raise errors from a Python script too! print (“——————————————————————“) print (“Errors in a Python script”) try: raise spam.EBadPoint(“this is a test !”) except: pass try: err = spam.EBadPoint() err.a = 1 err.b = 2 err.c = 3 raise err except spam.PointError as what: #it shows you that you can intercept a parent class print (“Caught an error derived from PointError”) print (“Error class = “, what.__class__, ” a =”, what.a, ” b =”, what.b, ” c =”, what.c) if p == spam.CreatePoint(2, 5): print (“Equal”) else: print (“Not equal”)
Developer Ivan Polyacov from Apus Software created Astral Heroes in Delphi. According to the site it is a collectible card game that’s simple to learn, exciting to play, and deep enough to challenge even the greatest strategists. It uses a truly fair Free-to-Play model that never hides the best content behind “pay walls” according to the developer. Some of the features of this beautiful game include: Fast-paced and simple core gameplay, 3 different game modes, Custom Decks: Construct and play a deck of your own personal design, Random Decks, Draft Tournament, a deep library of well balanced creatures and spells, A global Online League, Sophisticated and merciless AI opponents that will test your mettle, and a rich single player campaign. If you want to find out more about why Ivan selected Delphi and more about this development process check out this YouTube code review video. Website http://astralheroes.com/ Download https://store.steampowered.com/app/488910/Astral_Heroes/ Open Source Game Engine https://github.com/Cooler2/ApusGameEngine Screenshot Gallery
Are you a teacher, educator, or parent of a child interested in programming? Are you looking for a simple but powerful language and student-friendly integrated development environment? With it’s combination of full-language features, simple syntax, and visual drag-and-drop development, Delphi rocks its competition. Still unsure? Let Victory Fernandes, a former mathematics and computer science professor at Brazil’s Unifacs University, walk you through the benefits of Delphi in education in his talk Delphi at the University – Insights for Students and Teachers. This presentation and Q&A session is free of charge and bundled with nine other talks and four panels by industry professionals. Sign up now by clicking the “Save my seat” button at delphicon.embarcadero.com.
We have learned how to create a Python Module in Delphi and added some methods to it. It’s time to learn how to create a Python Type(Class) in Delphi. Creating a new class creates a new type of object, allowing new instances of that type to be made. Each class instance can have attributes attached to it for maintaining its state. Class instances can also have methods (defined by its class) for modifying its state. You can also use Python4Delphi with C++Builder. This post will guide you to create a Python Type in Delphi using Python4Delphi components. Prerequisites: Download and install the latest Python for your platform. Follow the Python4Delphi installation instructions mentioned here. Alternatively, you can check out this video Getting started with Python4Delphi. Components used in Python4Delphi Demo6 Sample App: TPythonEngine: A collection of relatively low-level routines for communicating with Python, creating Python types in Delphi, etc. It’s a singleton class. TPythonGUIInputOutput: Inherited from TPythonInputOutput (which works as a console for python outputs) Using this component Output property you can associate the Memo component to show the Output. TPythonDelphiVar: Inherited from TEngineClient, used to convert the python variable to the Delphi variable and vice versa. It has methods to set and get value as variant or PyObject. It contains property like Module(TPythonModule internally created by default) where the python variable(TPyVar) is created and later converted to and from the Delphi variant or PyObject. TPythonModule: It’s inherited from TMethodsContainer class allows creating modules by providing a name. You can use routines AddMethod, AddMethodWithKW, AddDelphiMethod, AddDelphiMethodWithKeywords to add a method which should be type compatible with this routine parameter. You can create events using the Events property. TPythonType: This component helps to create a new python type in Delphi which is inherited from the hierarchy of classes (set of APIs to create, manage methods, and members). TMemo: A multiline text editing control, providing text scrolling. The text in the memo control can be edited as a whole or line by line. You can find the Python4Delphi Demo6 sample project from the extracted repository ..Python4DelphiDemosDemo06.dproj. Open this project in RAD Studio 10.4.1 and run the application. Implementation Details: PythonEngine1 provides the connection to Python or rather the Python API. This project uses Python3.9 which can be seen in TPythonEngine DllName property. It Is assigned with InitScript which import sys module and prints the Python.Dll version, copyright information to Memo2. import sys print(“Python Dll: “, sys.version) print(sys.copyright) print() PythonGUIInputOutput1 provides a conduit for routing input and output between the Graphical User Interface (GUI) and the currentlyexecuting Python script. PythonDelphiVar1 component is intended for demonstrating how to assign value between Delphi(Edit1.Text)->Python Delphi variable(test.Value) and back from (test.Value) -> Edit1.Text using event PythonDelphiVar1GetData and PythonDelphiVar1SetData respectively. The data is passed as variant type here. PythonModule1 with Module name spam is created. During PythonModule1Initialization a method spam_foo,spam_CreatePoint,spam_getdouble is added to the Module. and the definition of these methods was included in the same unit file. In the method definition, we can use the python engine to manipulate between python and Delphi. In this sample, created a new Python Type(Point) which is a Delphi record that holds attributes Ob_refcount, X, Y positions, and a Pointer to TPyTypeObject. This Python type point is instantiated using the spam_CreatePoint routine. To get and set the attribute value for the created point instance, procedure PyPoint_getattr, PyPoint_setattrfunc is used. To represent the Point object procedure PyPoint_repr is used. To destroy the Point […]
Invormațiile pe cale Dvs le introduceți în prezentul formular nu se păstrează online, dar se vor transmite direct la destinație. Mai multe informații găsiți în Politica Noastră de Confidentialitate
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.