Firemonkey from simple to complex. Delphi, FireMonkey, All-Access and other pleasant surprises

In the context of this blog, this project is primarily interesting because it is implemented on FireMonkey and is an amazing demonstration of the capabilities of this platform. And just last week, a public beta of the product was released. This way, blog readers can “feel” something truly complex for themselves. FireMonkey application.

A few words about the program. First of all, it should be noted that the current version of Sphere is positioned a little differently. Yes, sometimes it happens...

New SphereLive This is not just another messenger. First of all, it is a tool that allows you to effectively organize the educational process. It allows for remote lectures, private consultations, individual lessons and other similar activities. At the same time, it is equipped with almost everything necessary for work. Starting with a unique file transfer system and ending with the most powerful billing subsystem.

At this stage, prices for using the product are quite affordable. Subject to a limited number of listeners and a small amount of resources, the product can be used for free.

Naturally, the Sphere uses its main advantage FireMonkey– cross-platform. The application is currently available in Windows and MacOS editions. Android version expected any day now.

However, for me, SphereLive is interesting, first of all, as an innovative product with a whole set of original solutions. Sometimes it’s just at the level of “... wow, how did you do that?” By the way, one of the Sphere developers actively participates in discussions on the forum dedicated to FireMonkey. This in itself may be a reason to download the app and discuss technical issues directly with the author. Believe me, there is something to see and something to learn.

TListView is one of the key components for building a mobile application interface in FireMonkey. This component is not the easiest to use; it often requires a significant amount of code, but it provides the developer with significant freedom of action. Of course, in applications you can also use TListBox, where everything is much simpler. But TListBox may be good for displaying a fixed number of records, for outputting data from data sources, you should definitely use TListView.

The main differences between TListView and TListBox are:

  1. TListBoxItem- control, TListViewItem- No
  2. IN TListBoxItem you can add any controls using Parent. IN TListVIewItem- No.
  3. TListVIewItem stores only data for display
  4. TListVIewItem performs rendering of the stored data itself through the method Render
  5. Due to the actual manual drawing in TListVIewItem, an increase in speed and low memory consumption is achieved (storing only relevant data)
  6. To create your own version TListViewItem, you need to create your own item class, implement the required data in it (for example, time) and create an in-place editor for editing time, register it, etc.

The mere fact of increased performance and reduced memory consumption is a compelling argument in favor of using TListView. But there is something more.

In many Android applications I had to observe the following implementation of lists. When you click on a list element (Item, if you stick to the chosen terminology), a certain action is performed. Typically a new form is called to edit the data. But when you press and hold (Long Tap), a completely different action is performed. And these events do not intersect. In other words, Android applications can clearly distinguish between a “long press” and a “normal” one. Moreover, none of these events fire when scrolling the list. A good example is a list of letters in Yandex Mail.

First of all, I would like to congratulate all blog readers on the past holidays and wish them all the best in the coming year.

Due to obvious circumstances, I did not make a traditional New Year's report, nor did I make any plans for the year. However, life does not stand still, work is going on, and certain events are happening in the world of Delphi. I undertake to publish a selection of missed “news from the world of Delphi” during the Christmas holidays in the near future. In the meantime, I’ll tell you about the new device that I purchased.

You can find the characteristics on the official website. And the subjective impression is very pleasant. Noteworthy is the fact that the device is literally crammed with proprietary software from the manufacturer. And the sellers also received an impressive set of software as a gift. The smartphone is quite fast in operation and fully justifies its cost (about $200). By the way, I bought my previous phone GSmart 1362 for about the same money 2 years ago. But, as you probably guessed, the main interest for me was how they would work FireMonkey applications.

Before continuing the story about the timer, two pieces of news.

Firstly, the first XE7 update was released. By tradition, it is available to registered users. You can find a list of bugs fixed. I wanted to see how the application would behave in the updated environment. Actually, no corrections had to be made, although there was still room for experimentation.

Second news. Embarcadero special offers have been extended until the end of the year:

Well, now directly to the topic of the post. In principle, all that remains for us is to try to launch the already created this application for Android. To do this, we use what I wrote about in previous posts. Namely new. I debugged this application on Nexus 7, accordingly added a representation of Android 7″ Tablet. The design had to be tweaked only a little.

Probably only lazy people didn’t write their own timer. And in the context of supporting development for mobile platforms, the task of writing a timer in Delphi can generally be considered a cult task. So I thought, why not as an example of development FireMonkey The application cannot parse the timer. For Android, of course. Of course, this will be exactly my view of the task, which, although not particularly difficult, still has its own nuances. Perhaps you have any comments or suggestions, it would be great to discuss them in the comments. I'm by no means an expert in writing. mobile applications, so any comment you make will be valuable to me.

We will be developing a timer, in the English understanding of this term. That is, the screen will display a dial and four buttons - “Start”, “Pause”, “Stop” and “Cancel”. The countdown will be in the forward direction (i.e., the time will increase). The option in which the time is set and the countdown is in English terminology is called Stop Watch, maybe I will try to implement it later. The application we are going to work on is closer in functionality to a stopwatch.

Delphi XE7 allows us to significantly simplify the development process due to the fact that we can now create and debug real application for Win32, and then simply add form views for the required mobile devices and, with a little tweaking, get a working mobile application. Sounds too good to be true? Maybe. But I want to test this statement by implementing the task.

The more frequently I’m asked my colleagues in private conversations if it’s possible to develop mobile applications in FireMonkey or is it a prototype rather than a production solution?

I think, now I can ensure even the out-and-out skeptics.

My bosom friend and colleague Tagir Yumaguzin told me about the project he took part a long time ago. Now, when this project is in pre-release state, we decided that this description will be interesting for the Delphi community. In the essence, this is a really large project implemented in FM. We are talking about Sphere Live project. A little article devoted to that project was recently published in Habrahabr.ru Alexey Glyzin, chief of ‘ ‘ development department agreed to tell more about the project taking into consideration the audience of my blog.

A.B.– Alexey, in general, what is your project?

A.G.: – The idea has not appeared at once and instantly. Before the ‘Sphere’ project our team had been working on the project where stream audio/video technologies were implemented. Later we created our own software that was able to deliver multimedia streams to an unlimited amount of users including the feedback. But we needed to have a billing feature included.
The application had to comply with the several requirements. First, the maximally simplified organization of conferences or transmission to the participants which amount we cannot predict. Second, the most important, is to give to our clients an opportunity to earn with our application and to reduce the complexity of the system, amount of instruments needed to use to reach the goal. The ease of organization of courses, webinar or just a consultation.

A small note for memory concerning FireDAC V current versionDelphi XE6. But first, a few words about where to look for answers to questions regarding FireMonkey. Russian-speaking users are in a privileged position here.

While preparing for the Kharkov event as part of the RAD Studio XE5 World Tour, I encountered a small problem in working with SQLite by using FireDAC. If filled in Windows application transfer the database along with the application to Android, Cyrillic strings in the database are no longer readable (question marks are displayed instead of letters). However, if you fill out the database directly on a mobile device, Russian characters are read quite correctly. Data from the database filled in third party application, or in Delphi applications using other data access components were also displayed normally. The meeting failed to find a solution, and I had to quote a famous Ukrainian football specialist: “We’ll figure it out!”

Unlike the last one, I managed to deal with the described problem. By default when connecting to SQLite V FireDAC ANSI string format is used.

If you force Unicode to be installed, then everything will work as it should. But there is also an unpleasant moment. By changing the string format, you will have to recreate the list of fields in all data sets, as well as reconnect the components responsible for displaying and entering data. Therefore, it is better to take care of the encoding right away.

In the previous parts of this mini-series, we dealt with creating a database, its structure and connecting to it from Delphi. In this part, I propose to understand the display of data from tables, starting with the simplest case.

A simple table data editor, usually part of a complex application. I usually use a separate form to edit tables. Let's start with the grocery list. First of all, we need to create a DataSet to access the table data. In our case, it is quite possible to use the component TADTable. Let's place it in the DataModule and specify the property value Connection. In the property editor TableName a list of tables will appear from which we select a table Products. If you did everything correctly, you can assign the property Active value True. It is better to immediately rename the component (for example, ADTProduct). After this, I usually create a set of fields for the DataSet. Call the field editor ( double tap mouse on the component) and in context menu select the Add All Fields item.

For those who are not in the know, I will explain the essence of this operation. Here we create a predefined set of DataSet fields. If we don’t do this manually in design mode, then, in principle, nothing bad will happen. In RunTime this set will be created automatically. But I still prefer to create it manually. There are several reasons for this. Firstly, it’s more convenient to manage a set of fields, because we can create additional (calculated or lookUp) fields ourselves in design mode. We can also change the properties of the fields themselves. And in addition, we get the opportunity to access fields in code by the name of the TField component, which, in my opinion, greatly simplifies writing code.

As in the case of the VCL application, we will connect the component to the data set TDataSource. This component will provide the connection between the data set and the visual controls. The component's DataSet property must reference our data set (ADTProduct). Below I provide a fragment of the DFM file

object ADTProduct: TADTable IndexFieldNames = "ID" Connection = ADConnection UpdateOptions. UpdateTableName = "Product" TableName = "Product" Left = 64 Top = 192 object ADTProductID: TADAutoIncField FieldName = "ID" Origin = "ID" ProviderFlags = [ pfInWhere, pfInKey] ReadOnly = True end object ADTProductTitle: TStringField FieldName = "Title" Origin = "Title" Size = 50 end object dsProduct: TDataSource DataSet = ADTProduct Left = 120 Top = 192 end

Please note one interesting feature: the DataModule form file is saved not in FMX format, like a regular FireMonkey form, but in DFM format, like in VCL.

The next step is to create a procedure for opening a data set, which we will need to call in RunTime when the program starts. Let's create it in the same DataModule. The procedure code is extremely simple:

procedure TDM. ConnectToDB ; beginADConnection. Open(); ADTProduct. Open(); end ;

We will place the procedure call in the OnCreate event handler for the DataModule.

Released in September last year, Delphi XE2 contains a record number of innovations.
Brief overviews of the capabilities of Delphi XE2 have already been published on Habré. But, obviously, the most striking innovation is the FireMonkey platform, and here I would like to pay a little attention to it.
I have made a small selection of links to materials that, I hope, will help you get a more or less adequate idea of ​​this platform. But first, for those who are not in the know, I will briefly tell you what FireMonkey is.
Embarcadero Technologies positions FireMonkey as a platform for creating rich business applications for Windows, Mac and iOS. Moreover, this platform is native to each OS, i.e. When running an application created using FireMonkey, no additional add-ons are used.
FireMonkey links directly to a native (from an OS perspective) graphics library such as OpenGL or DirectX. Thus, the best solution from a GPU point of view is proposed.
The core of the FireMonkey architecture is a powerful library of classes (including visual components).
The target platform is selected during the compilation process.
The first version of FireMonkey only supported Win32, Win64, MacOSX and iOS, but Embarcadero plans to port it to several other platforms in the future.

What should you consider?

Although the FireMonkey platform provides extensive tools for developing 3D applications, it should not be considered a game engine. FireMonkey is positioned specifically as a platform for developing business applications.
The product is currently in the early stages of its evolution. And many functionality FireMonkey is undergoing changes, both qualitative and quantitative.

I hope the links below will help you understand the main features of the new platform.
Official product page on the Embarcadero website (Russian)

Among the English-language material I would like to highlight the series (English)

What to see?

Regarding latest version Delphi, there is more video material dedicated to the capabilities of the product and how to work with it than ever before. Both official, from Embarcadero, and from independent developers. There are a lot of videos about FireMonkey on YouTube, you can just use the search. Among this abundance of material, I will highlight a series of three videos from Marco Cantu - RAD in Action landing page, thus giving my research a vector of usefulness.

What is FireMonkey?


FireMonkey (FMX) is a framework for cross-platform development for both desktop systems (Windows, Mac OS + server support on Linux is planned in the near future) and mobile (iOS and Android) using the Delphi/C++ language.

Peculiarities:

  • single code base for all platforms;

  • any control (visual component) can be a container (parent) for other components;

  • the presence of a very advanced relative arrangement (20 types) of components on the form;

  • LiveBinding allows you to connect any type of data or information to any user interface or graphical objects;

  • presence of form/component styles;

  • Multi-Device Preview allows you to customize the visual presentation for each platform;

  • FireUI Live Preview - displays the appearance of the application on real devices in real time.

Possibilities:

  • use of the native API of each platform, as well as the ability to call third-party native libraries;

  • interaction with all sensors (GPS, Accelerometer, Compass, Bluetooth (including LE) and others);

  • support for push notifications, IoT;

  • support for asynchronous HTTP requests;

  • support for most databases (MsSQL, MySql, Oracle, PostgreSQL, MongoDB, etc.);

  • working with Cloud Service (Amazon, Azure);

  • Android Service support.

Cons (currently):

  • lack of support for customizing native classes;

  • implementation of specific things is either impossible (widgets, extensions (iOS), etc.) or a dance with a tambourine is required (background service, broadcast message, etc.);

  • Customization of the Splash screen (initial screen) is, to put it mildly, lacking;

  • FMX controls use their own rendering (visualization, drawing), which is purely visually similar to the native one;

  • the use of native controls involves large body movements;

  • when there is a lot of nesting of components, incredible things happen: the application crashes in various places, loses focus, freezes, etc.;

  • the information content of debugging an application on mobile platforms is zero;

  • descriptions of errors on mobile platforms are reduced to the useless “Error 0x00000X”;

  • compilation time wants to be the best for medium and large projects;

  • the need to use a file to polish mobile applications for each platform;

  • no support for Intel Atom architecture;

  • inadequate price compared to competitors.

Pros:

  • very active development of both the product and the community lately, support for more and more new technologies;

  • the presence of a huge number of free and commercial components;

  • The speed of the application is very close to native;

  • very advanced visual editor and environment in general, the presence of styles;

  • the ability to test an application on Win, and only then deploy it on devices, which greatly speeds up development;

  • change mode/platform with a flick of the wrist;

  • PAServer provides easy interaction with MacOs when developing for Apple OS;

  • 3D graphics support out of the box.

In conclusion, I want to say that over the past couple of years FireMonkey has grown into a professional tool for cross-platform development of business applications and more. Many shortcomings are gradually being resolved and with each release the product becomes more modern and self-sufficient, and the existing skepticism towards the Delphi language itself, associated with many years of stagnation, also disappears. Writing new projects in FireMonkey is “safe” and promising.

More than three years have passed since the CodeGear division, responsible for the creation of world-famous tools such as Delphi, C++Builder and JBuilder, as well as the Interbase database management system, became part of Embarcadero Technologies, known for its tools for database design and administration , and two years since we discussed on the pages of our magazine what to expect in the development of tools that are so popular among Russian developers. We asked David Intersimone, vice president of developer relations and chief evangelist at Embarcadero Technologies, and Kirill Rannev, head of the Embarcadero Technologies representative office, to talk about what new has been done in this area over the past two years and what to expect in the near future. Russia. For our youngest readers, we will inform you that this is not the first interview that David and Kirill give to ComputerPress - our cooperation has been going on for the second decade. And for about the same number of years, we have periodically published reviews of database management tools, in which much attention is paid to Embarcadero products.

ComputerPress: David, your division has been part of Embarcadero for three years. Two years ago, you were enthusiastic about it becoming part of a company close to your goals and spirit. Has anything changed during this time? Do you and your colleagues still have the same enthusiasm?

Yes, I'm still very enthusiastic. The main change that has occurred since we became part of the Embarcadero company is that a lot of investment has been made in the development of Delphi. The number of people working on development tools has increased, and the number of technologies that we can develop or, if necessary, acquire, has increased.

The release of RAD Studio XE 2, which we plan to demonstrate in Moscow, is the largest release of this product with enormous capabilities and a large number supported platforms since the first version of Delphi, created for 16-bit Windows and an innovative product that combined the component approach and compilation into machine code. Now we support development not only for Windows, but also for Macintosh, not to mention web development and creation of applications for mobile devices, and these applications for different platforms can have a single code.

The new development platform, FireMonkey, is a collaboration between Embarcadero and the recently acquired Russian company KSDev from UlanUde, a manufacturer of components for vector graphics, DirectX and OpenGL, technologies for creating graphic effects and Delphi components using a GPU with PixelShader 2.0. We acquired the company KSDev (see ksdev.ru) a year ago and began working together to create a multi-platform development tool, including a platform for developing FireMonkey applications with components for Delphi and C++Buider for creating application user interfaces, database integration , graphics processing using the GPU and integration with the operating system.

Using FireMonkey, you can create an application that runs on the CPU and GPU together, and then use different compilers and Run-time Libraries (RTLs) to compile it for Windows, Mac OS, or iOS. Instead of learning programming using various graphics libraries, study the APIs of different platforms that have various systems coordinates and different capabilities, developers using Delphi and C++Builder can use the same component-based approach, visually editing forms and connecting to databases by moving the component with the mouse. This is fundamental new way creating applications that run on different platforms is the future. If you want to add support for other operating systems and platforms to your application, you don't need to design and develop it again - you just need to recompile it.

We create new compilers that generate native code. Today there are Delphi compilers for 32- and 64-bit Windows versions, 32-bit Mac versions OS 10. And we're working on the next generation of Delphi and C++Builder compilers that will allow you to create high-performance native code for both these and other platforms like Android or Linux, and keep the same design, the same components , the same code by using different compilers and runtime libraries.

As you can see, I have enough reasons for enthusiasm. And the developers I meet around the world know that Embarcadero is investing heavily in Delphi and C++Builder, as well as PHP development tools.

KP: What successes have you achieved in integrating the tools of the two companies over the past two years? What are Embarcadero's plans for the future in this area?

DI.: At the time CodeGear became part of Embarcadero, the company had development teams in Toronto, Monterrey and Romania, we were and are still located in Scotts Valley and in Russia, in St. Petersburg. Embarcadero had tools for developers and database administrators, CodeGear had tools for application development, but the latter also use databases. The merger of companies is a combination of expertise, knowledge in the field of databases, code optimization, including server code. The combination of companies also led to the creation of a new product, AppWave, a special technology for turning a regular Windows application into something very easy to use (like applications for the iPhone or other devices). AppWave allows you not to install an application, but simply select it and launch it from the prepared application storage server (app), and it will be executed on the user’s computer without making changes to its registry and system area file system. By the way, the AppWave application browser is written in Delphi. Embarcadero uses Dephi for its own development and our expertise in application development.

iPhone (iOS) application created by
using the FireMonkey platform

You can also use the integration of our development tools and DB Optimizer to optimize SQL queries when creating applications. By passing SQL code directly into DB Optimizer, you can profile it, test it, and return an optimized version back to your development environment. Embarcadero's database expertise has also improved DataSnap technology. Thanks to the developers from Toronto, we gained a lot of knowledge about the architecture of multi-tier systems and databases. We now have joint expertise in creating server code and stored procedures in both companies. We have tools like RapidSQL and DB Change Manager, as well as development environments that simplify the creation of server code - for example, Code Insight and Code Completion technologies enabled the creation of SQL insight and SQL Completion technologies. Our common approaches to creating client and server code, our common philosophy, allow us to give common features to database management tools and application development tools.

Kirill Rannev: I want to add something important. From a commercial point of view, how we deliver our tools is very important. For example, the new RAD Studio XE 2 Ultimate release includes the full DB Power Studio toolset. This is a very powerful set of tools, including the RapidSQL query development environment, the DB Change Manager change management tool, and the DB Optimizer query optimization tool, allowing you to carry out an important part of the development and deployment process by managing changes to the data model, database, code, and so on. This is a very good and correct combination of technologies.

DI.: But if needed, developers can use Subversion for source code versioning and DB Change Manager for metadata versioning. You can use code profiling and DB Optimizer to optimize server code, RapidSQL to build and debug server code, and our development environments to build and debug applications. This combination of technologies in RAD Studio XE Ultimate Edition demonstrates the parallels between database and application development models. Most developers building business applications with Delphi and C++Builder work with databases and need these tools, and RAD Studio XE Ultimate Edition is a great combination for such developers.

KP: The modern user is no longer a user of the Windows platform alone. We apply mobile devices, iPhone, iPad, devices based on the Android platform. This means that developers must begin to target different platforms without significantly increasing investment in training - that is, universal tools are needed. Obviously, it is unrealistic to expect the emergence of universal tools from platform manufacturers, and in this matter we can only count on independent tool manufacturers. How can we count on Embarcadero?

DI.: We still have a lot to do in terms of platform support. Today we are introducing support for iOS platforms for iPhone and iPad, then smartphones based on the Android platform, Windows 7 and Blackberry will receive our support. In RAD Studio XE 2, we started by building the FireMonkey platform for iOS and will then bring FireMonkey to other platforms.

At the same time, there are a large number of operating systems that support touch screens(touch screen), for phones, tablet computers and devices, desktop computers, and we will continue to add support for them. In addition, there are voice, motion, biometric systems, accelerometers, so we must continue to expand FireMonkey so that all developers can take advantage of new platforms. For example, the Microsoft Kinect device was designed for the Xbox 360, and now there is a corresponding SDK (Software Development Kit) for Windows. And we already have examples where we use motion to control an application in much the same way that a mouse or keyboard would normally be used.

When you create applications with a lot of complex graphics, you generate a whole world of new user interfaces. If we are dealing with an operating room Windows system, we encapsulate its application software interface Windows API in the VCL library (Visual Component Library - a library of visual components, which is integral part Delphi and C++Builder development tools. - Note ed.), which, by the way, can be used further. And in FireMonkey we encapsulate the API operating system. But today we manipulate shapes and graphics much more widely. You can also add physical properties to the space for animation and special effects. In addition, there is huge amount other additional features to create user interfaces that we are going to implement in the next few years for different platforms, mobile and tablet devices.

Microsoft recently announced detailed information about Windows 8, which is due out in a year. We will support these innovations in the VCL library and the FireMonkey platform. But Delphi is a development tool designed not only for Windows, but also for Macintosh, iPhone and iPad. We also develop our PHP products, support jQuery Mobile, use the iOS API to develop mobile client applications, and create server-side PHP applications using wizards and tools to generate client-side JavaScript, HTML, and cascading style sheets. We can create packages from PHP applications and client applications with native code for iPhone iOS, and such a client will communicate with PHP server. And he, in turn, will communicate with the database server and with web services - with everything that is needed for business.

RadPHP XE2 development environment. Creating a mobile web application
using jQuery Mobile components for iPhone 3G

In other words, we plan to expand the capabilities of FireMonkey and VCL, including support for mobile platforms.

KP: Could you tell us more about the FireMonkey platform?

DI.: As I already noted, the VCL library created for Windows will continue to develop and improve. But today, if you want real business application development, you have to create them for different platforms. This is what the FireMonkey platform is designed for. It supports the creation of high-resolution user interfaces, high-performance 3D graphics, high speed frame changes and, importantly, uses the graphics processor for this.

You can use such capabilities when creating scientific, engineering and business applications. Such applications can connect to databases using dbExpress technology, still using non-visual components familiar to developers, such as ClientDataSet or DataSource, use DataSnap technology, connect to any database, SOAP and REST servers. You can create attractive controls, buttons with boxes, unusual tables and other interface elements, both in two and three dimensions. You can load a finished 3D model into the app and connect it to a 2D shape in which you can rotate it and view it from different angles. You can create a data cube or a 3D business chart and rotate it using your mouse, keyboard, or even a Kinect device, or you can step inside the cube and look at its different surfaces from the inside. And all this can be done using a high-speed GPU. The same application can then be compiled for another platform, such as Mac OS.

An application containing a rotating data cube,
placed on its edges

Or you can create a 3D shape from scratch and use cameras and lights to light and rotate parts of the user interface. The form designer already has a built-in environment to support a 3D user interface during design.

On Windows, you can use Direct2D libraries to work with high-resolution 2D graphics, and Direct3D for 3D graphics. On Mac OS, the Quartz and OpenGL libraries are used for the same purposes. For iOS, the Quartz and OpenGL ES libraries are used. But all this is hidden from the developer - he uses the FireMonkey platform, its coordinate system and application programming interface, without thinking about these libraries, and can compile the same application for different platforms.

Let's remember what VCL is. VCL is a component wrapper around the Windows API. We deal with resources, menus, dialog boxes, colors, styles, Windows messages. Being a multi-platform wrapper, unlike VCL, FireMonkey retains the same event and component models, allowing you to think in terms of events (for example, OnClick, OnHasFocus, onMouseDown, and onKeyDown events), but handles Macintosh or iPhone events.

The FireMonkey platform also comes with a complete animation system for user interface elements. It's certainly not a comprehensive Pixar-type animation system, but it does allow for effects such as animation raster images, highlighting the focus of a user interface element and working with vector graphics. More than 50 are available to the developer visual effects: blur, turning the image into black and white, dissolving, transitions, reflection, creating shadows - all types of effects available in modern graphics processors, which are now found in almost any computer. An application built using the FireMonkey platform sends commands to the GPU, which does all the work of displaying graphics and creating the user interface. At the same time CPU free for calculations and calls to the operating system. The developer can only place the components correctly.

The most fundamental thing about the FireMonkey platform is the way it builds the user interface. There are means of placing raster graphics on interface elements such as menus, buttons, and scroll bars. At FireMonkey, we use GPU-powered vector graphics for this purpose. From a programming perspective, these are still the same controls, but all the work of displaying them is carried out by the graphics processor. We can apply styles to controls, make the application look like an application for Mac OS or Windows, create our own style, apply our own styles to interface elements (for example, make a button rectangular or round by changing its style in the form editor) - for this There is a style editor in the development environment. You can create your own style, or you can change the style of an already finished application.

FireMonkey Platform - Development Tools
and supported platforms

If you remember, the VCL library had a limited number of controls - containers (that is, allowing you to place other elements in them), and in FireMonkey each control is a container. This means that each control can contain any other control. For example, dropdown list items may contain images, buttons, edit fields, and other controls. You can also place components in layers.

The FireMonkey rendering system is quite flexible - it can use the Direct2D, Direct3D and OpenGL libraries, sending commands to the GPU. To achieve the same thing in VCL, you had to generate a separate off-screen buffer, create an image in it by calling the appropriate graphics library functions, and then display it on the form.

Examples of graphic effects supported by FireMonkey

If you don't have a GPU, you can still apply 2D or 3D shapes and use FireMonkey controls. In this case, the FireMonkey platform will use the GDI+ or other similar libraries and perform the same effects and animations or manipulation of 3D objects.

Another feature of FireMonkey is new system linking interface elements with data, open and flexible. There are two types of interface elements in the VCL: data-bound and non-data-bound (for example, TDBEdit and TEdit). In FireMonkey, every control can be associated with data of any type. This could be a simple expression, a field from a data set, data from developer-created objects, or the results of method calls.

In addition, when creating an application, you can load a ready-made 3D model into it and use it - such capabilities are often required in both business and engineering applications. We have a client who creates applications for logistics. They had an information system built using Delphi, and in it an application that drew a plan and displayed information from data sources. They recently did something interesting - they drew a fully automated 3D warehouse in AutoCAD, and their application allows you to see how the automatic forklift moves around the warehouse and places goods on the shelves. And they put data from the sources on the corresponding image.

Examples of changing application styles

KP: What 3D model formats are currently supported?

DI.: In this release we support loading models from AutoCAD, Collada (3D modeling tool with open source. - Note edit.), Maya, an OBJ format that is supported by many 3D graphics vendors.

KP: What other formats are you planning to add?

DI.: We plan to add 3DS (3D Studio MAX), SVG (usually this format is used for 2D vector graphics, but sometimes for 3D), Google SketchUp. Perhaps we will support other formats.

KP: Does using 3D models in applications built with FireMonkey require a license for the appropriate 3D modeling tool?

DI.: No, it doesn't require it. All we do is read the model file. We're importing the model, but not exporting it (although, of course, you could write an application that saves the model in your own format). We do not pretend to be a manufacturer of 3D modeling tools - for this you can use AutoCAD, 3D Studio Max, Maya or any other 3D modeling tool, and import the created models into our applications.

KP: How performant are applications built with FireMonkey on modern hardware platforms?

DI.: Productivity is quite high. For example, rendering a 3D shape with three spheres and three lights on a MacBook Pro can be rendered at 100 frames per second. Or it can reach 600 - it depends on what exactly we are doing. Again, it all depends on the power of the GPU.

KP: Does this mean that you can create modern games using FireMonkey?

DI.: We do not position our development tools as tools for games. However, using high performance modern graphics processors, you can create games using FireMonkey - after all, they are created using Direct3D or OpenGL.

KP: What kind of work are you currently doing in the area of ​​supporting gesture recognition and other newfangled things? Is such support available?

DI.: We don't have gesture support in this release yet. Gesture controls will be added in a future release of FireMonkey, but in the meantime you can use the gesture support built into the operating system.

Mikhail Filippenko, director of Fast Reports, Inc.

K.R.: We have already said that FireMonkey technology has Russian roots - its foundations were created in our country, and then both the technology itself and its developers joined Embarcadero. In general, it is gratifying to see the growth of the Russian component in RAD Studio and Delphi. This includes the activities of our development center in St. Petersburg and the contribution of independent Russian developers. For example, Rad Studio XE2 includes the FastReport report generator - known all over the world and very popular in our country. He is originally from Rostov-on-Don.

KP: I would like to talk about compilers. What kind of compiler is used when creating applications for iOS?

DI.: We don't have our own Delphi compiler for iPhone or iPad - we haven't yet developed compilers for ARM processors used in these devices. For iOS, we temporarily use the Free Pascal compiler and runtime library. But we are working on the next generation of compilers, including for AWP processors. But there are compilers for Windows and Mac OS, since both hardware platforms are based on Intel processors.

KP: What has been done in the field of creating compilers in the last two years?

DI.: We have 32- and 64-bit Delphi compilers for Windows and Mac OS. And we are working on a new generation of Delphi and C++ compilers. These are still a work in progress, but when they are completed we will have Delphi compilers for ARM processors, Android platforms, Linux and anything else. And we will have 64-bit C++ compilers for Windows and other platforms, compatible with the latest C++ language standard just adopted by the ISO.

KP: What's going on with cloud computing support in Embarcadero development tools today?

DI.: In RAD Studio XE 2, we support moving applications to the Microsoft Azure or Amazon EC2 cloud using the Platform Assistant. And we have server components for Cloud Storage for Azure and Amazon S3 for storing tables, binary data, message queues. In the previous version of RAD Studio XE, we also supported application deployment to Amazon EC2, but it did not support storage.

Cloud computing support in RAD Studio XE 2

KP: Two years ago you talked about the new All-Access solution. How popular was it? What are its benefits for system integrators and developers?

DI.: The All-Access solution and the AppWave cloud tool are widely used around the world. They are designed to make it easier to use our own and other manufacturers' applications. In fact, it is a solution for managing licenses and application usage, and it is convenient for large companies. Smaller firms that don't have dedicated teams of people responsible for managing applications can put an application into a repository, select usernames from a database, and make those applications available without having to remember where. license key and how many licenses are available. All-Access and the AppWave browser are designed to manage both versioning and access control.

K.R.: The market is so diverse and the users are so different that it is impossible to cover all needs with one solution. That's why we strive for diverse packaging solutions. We've done great job to unify methods of licensing, license management and installation of products. This line of solutions includes license and provisioning management tools not only for Embarcadero products, but also for any other product, including internal company developments.

Work on packaging development tools into effective kits for users is still ongoing. We have All-Access - a superset that combines all Embarcadero products. If a customer purchases All-Access Platinum, they receive all the tools found in Embarcadero. But sometimes this set turns out to be redundant; for example, for database specialists, we have made two other sets - DB Power Studio Developer Edition and DB Power Studio DBA Edition. The difference between them is that for the developer we offer RapidSQL - a tool for developing server code, and for the administrator there is built-in DBArtizan - a database administration tool, a broader product than RapidSQL. For professionals, we have the following All-Access suites: a suite that includes all products, DB Power Studio for developers, DB Power Studio for administrators, ER Studio Enterprise Edition for architects and anyone involved in modeling. There are combinations for application development and for administrators. Delphi is a developer's tool, and it makes a lot of sense to add SQL development and optimization tools to it. Finally, DB Change Manager is a logical tool for managing the complexity of changes that occur to databases during their life cycle.

Thus, All-Access is the head of a large family different sets products.

KP: If it's not a secret, who in Russia uses All-Access?

K.R.: We have customers who bought All-Access based on Delphi. Many of them build complex client-server systems with SQL Server and Oracle, and they immediately liked our cross-platform database tools. We have a client company that has been using Delphi since the first version, and a year ago they switched from using Delphi to the All-Access suite. Two tools that all developers at this company are guaranteed to use are Delphi and DBArtisan. And there are customers who came to All-Access from the database side. Their main task is to administer databases, but they also sometimes develop applications. Clients using All-Access include media companies, engineering companies and other industries.

Separately, I would like to focus on small companies. Very often in small teams the developer does everything, and such a company sometimes buys large All-Access product sets for one or two developers. In large teams, it is not encouraged for a developer to also perform, for example, the role of a database administrator, so small product sets are usually popular there, but in small companies such a combination of responsibilities is quite acceptable.

Delphi Architect is a heavily marketed product that includes modeling and programming tools. The number of copies sold is, however, less than the Delphi Enterprise version, but it is also large. I would like to note that in 2010 we turned out to be the best country in terms of sales volume, despite the fact that all countries experienced a crisis. This growth was associated not so much with economic factors, but with the fact that the version of RAD Studio XE, released at the end of 2009, turned out to be very popular. And for now we expect further sales growth.

We have taken another reasonable step, which is extremely popular in Russia. Degree of legalization different versions our products are different: the higher the version, the more legalized it is, because earlier software not so actively bought. Starting with RAD Studio XE, the license covers versions 2010, 2009, 2007, and even Delphi 7, a widely used product.

Today, developers are faced with the fact that they have both new projects and projects in support. A large number of projects have been migrated from early versions of Delphi to version 7 and remain within this version, continuing to run on relatively small resources. No one is moving them to newer versions, but they are maintained in a viable state. And now we allow you to get both RAD Studio XE and Delphi 7 for little money (less than the price of a Delphi 7 license) - that is, we legalize the developer both for the implementation of new projects and for support projects.

KP: How do you assess the current state of the Embarcadero community?

DI.: This community is large and very demanding. They need everything immediately - they are developers. But sometimes it takes a long time to do something right.

A few years ago, we took the Windows component architecture and put it on Linux desktops. Now we see that this was not the right decision. The right solution is to create an application platform. Applications even across platforms have menus, windows, graphics, network access, and device access. Different platforms may have different models for managing threads or handling exceptions, but we see the same try blocks in the application code. Our job is to make it easier for developers to create business applications and compile them for the platforms on which they are intended to be used, regardless of how the instruction set of the corresponding processors is structured and what other features of these platforms are. And FireMonkey is exactly what you need to solve this problem.

KP: If a company creates a new device and wants it to be supported in FireMonkey, will it be possible?

DI.: With the new generation of compilers, which will have a platform-independent front-end and a platform-dependent back-end, this will be quite possible. In the meantime, for each operating system, we create a compiler and runtime library from scratch.

Any modern new device usually has a graphical user interface (many of them have dual core processor and GPU) and standard SDKs for developers. This makes it easier to create device support in FireMonkey. If the new device only has libraries for two-dimensional graphics like Quartz, we will be able to support such a device in FireMonkey, but this will take approximately several months. However, a lot depends on the platform: not all platforms support all features, for example, iOS does not have menus and dialog boxes and you will not be able to place the corresponding components on the forms of such applications.

KP: Has anything changed in the policy of working with partners? What is being done to increase the share of users of your products? What is being done in Russia?

DI.: Our partner ecosystem is broad - there are hundreds of manufacturers of tools and components not found in our products, and we have a technology partnership program. Therefore, a wide range of components, technologies and tools are available to developers. And the solutions they create for their clients are better than if they used only our products. And for sales we have offices in many countries, resellers and distributors.

K.R.: What is important to us is not the number of partners, but the quality of work of each specific partner. For now, we want to focus on working closely with existing partners, although the pool of partners remains open. We have many partners, and we must help them in terms of technology. We work with developers, and they know what they want, and they know what is available on the market, and the capabilities of partners must match this.

We have business partners who have seriously invested in Embarcadero as a business line - they have trained specialists, marketing our products, dedicated employees responsible for this line and monitoring what is happening with our products, price list, marketing. Naturally, they are more successful in terms of sales of our products than companies that sell our products occasionally.

KP: David, Kirill, thank you very much for the interesting interview. Let me, on behalf of our publication and our readers, wish your company further success in creating your amazing tools that developers need so much!

Questions asked by Natalia Elmanova

TRippleEffect class for creating an effect that applies wave ripples to the texture of visual objects.

The center of the ripple is specified in the property Center. Other aspects of the ripple can be customized using properties Amplitude(Amplitude), AspectRatio, And Phase(Phase). The number of ripple waves is determined by the property Frequency(Frequency).

The following table shows the results of the influence TRippleEffect on PNG photo placed on the form (using the ). The center of the ripple is in the middle of the image. Other properties TRippleEffect are used with their default values ​​( Amplitude = 0,1, AspectRatio = 1,5, Frequency = 70, Phase = 0).

In this tutorial you will use some basic image effects in the FireMonkey application.

Step 1: Apply the effect to the image.

In FireMonkey, applying an image effect to an image is a simple process. Simply create a component that can contain an image and then apply one of the image effects.

    Create a new FireMonkey application ( File> New> FireMonkey Desktop Application> HD FireMonkey Application).

    Place the component on the form.

Select the component in the toolbar.

Place the TImage on the form in the designer.

    You can see that the component does not fit in the center of the form designer. As shown in the figure, you want the size of the image area to be as large as possible. To do this, select the component on the design form, then change the properties Align V alClient in the Object Inspector so that the size of the component becomes the same as the client size of the form area.

    Select the image you want to apply the effect to. The component stores the picture in the property Bitmap. Select property Bitmap in the object inspector, and using Edit... to select an image.

  1. Now you can choose an effect for the image. From the Tools palette, select TRippleEffect.

Now RippleEffect displayed in in the window Structure.

To apply an effect, it must be defined as a child of another component. In this case, RippleEffect1 must be defined as a child Image1. To do this, drag RippleEffect1 and place it on Image1 in the structure panel.

  1. Now you can see that RippleEffect already works on Form Designer.

  1. Change the property Frequency on 20 .

Step 2: Apply animation effect to RippleEffect.

    Highlight RippleEffect on the panel Structure.

    Select a property Phase in Object Inspector and run the command Create New TFloatAnimation from the drop down menu.

Make sure FloatAnimation1 defined as a child element RippleEffect1.

    Change properties FloatAnimation1 as below:

And finally, let’s add an event procedure OnMouseMove To .

Share