Adam’s Nov 2021 Meeting Summary
- FireMonkey Drag and Drop – Simon Hooper
- Using Alexander Sviridenkov’s HTML components to create responsive UI in Delphi cross-platform applications – Adam Brett
- An intro to using the TMS FNC map component – Ian Hamilton
- Delphi 11 – member participation – Jason Chapman
There were around 20 attendees. Jason lead off. He pointed out that Blaise Pascal Magazine, has reached its 100th Issue and is offering this “double issue” free as a taster for those who want to check out the content. I didn’t manage to note down the link for this, hopefully Jason will add it in the comments.
Windows 11 was discussed Martin showing “Start11” an add-on to Windows from StarDock which replaces the Windows Start menu with one that gives the user more control, and is similar to the Windows 7 Start menu.
General responses about installation and use of Windows 11 were positive. The loss of right-click on the task-bar was complained about. Jason pointed out we all still have the [ctrl] [shift] [esc] shortcut which can open Task Manager.
DelphiCon (which starts on 16th November) was also discussed in detail. Members will sign up to sessions and share comments about good ones in the Group Slack.
FireMonkey Drag and Drop – Simon Hooper
Simon Hooper then opened the discussions with a good talk on Drag and Drop mechanisms in FireMonkey.
The Architecture mimics and extends that used in VCL, with some significant changes. The concept of Source, Target, and Data all still exist, and the Events for StartDrag, DragOver, DragDrop, and DragExit are all implemented. The DragMode property is also replicated from VCL with values of dmManual and dmAutomatic.
Note that in different Operating Systems the actual mechanisms for Dragging are substantially different. In the light of this, Delphi FMX has chosen to simplify the “Data” object that is passed in the Drag methods so you really only have access to string values, rather than any underlaying data. This is an annoying, but understandable simplification.
Simon notes that all drags in FMX are universal, you cannot restrict them to “your app”, so if you make your control a DragTarget it will respond to ANY drag event. Developers therefore have to add protective code.
The FMX Drag/Drop methods are more usefully verbose than in VCL which only has parameters like Sender, Source and X, Y co-ordinates. In FMX the drag drop includes a TRect parameter, which allows you to figure out where an item has been dropped.
So implementation of Dragging in FMX is decent, but not outstanding, and Developers still have to add a fair amount of their own code for it to really be usable.
Simon then reviewed the FMXTreeview and its management of dragging, which is frankly pretty dreadful. An “AllowDrag” property has been added to the class, which on first sight allows the developer easy access to a tree with “built in” dragging. However, the functionality of the AllowDrag process is so poor that it is fundamentally useless. Indeed Simon has actually sub-classed his own TFMXTreeview to totally rewrite the dragging functionality!
For example: When you drag a node in a tree you need to be able to drag it “above”, “below” or “make child” of any node. You need to be able to drag it to any level in the tree, including dragging it to the start or end. Of these essential functions, the Delphi TFMXTreeview only implements “make child” automatically, which is about as useful as an umbrella made of soap.
These issues made a good number of members point out quite rightly that much of the FMX framework suffers from this type of failing. Simon did add that “it is getting better”.
Simon gave a really good demonstration of the extensions he added to the TFMXTreeview to implement his own dragging functionality. While it was good to see this was possible, it does make me sad to think about all the developers having to write this code individually when it really should have been implemented centrally by Embarcadero.
Simon also discussed his excellent looking WiseEyes Smart Reporting software. Group-members can get a free license.
It offers a very wide range of reporting processes, coupled with Excel-file generation, and an automated portal for display of reports on-line. It connects to a wide range of data-sources, including an enterprise’s internal SQL database and data-sources such as Google, the Twitter-API, etc..
Using Alexander Sviridenkov’s HTML components to create responsive UI in Delphi cross-platform applications – Adam Brett
I spoke about Alexander Sviridenkov’s HTML components, which are a fantastic set of cross-platform Delphi components for presentation of HTML. I showed the components, a sample project loading and displaying HTML files, and showed how CSS can be used to generate nice, friendly and modern looking UI. Built in management of scaling, fonts and display properties make it a very easy way of developing for Applications that may have to present data on multiple platforms. I have recently had quite a bit of difficulty with High DPI displays and Delphi. Using these components takes those issues away completely.
The components include an htEditor, htPanel and numerous “additional” components. The htEditor allows users to write text “live” giving an “in-App” rich-text-like component, including the ability to add toolbars for formatting which you control as a developer.
The components’ “OnURLClick” and “OnGetImage” methods are well thought out and fully featured, giving access to the clicked object, and allowing simple or complicated ways of using the component, as per the developers needs. For example the htPanel has an Images/TImageList property. If the Images property is assigned, html in the panel in the form: will display the Image at position 10 in the image-list. You can also set zoom and scale properties for these images in the CSS, as well as adding animations if you wish. If you want to return data yourself, you can just add code to the OnGetImage to return the image in Byte-form, which can be implemented in 3 or 4 lines of code.
An intro to using the TMS FNC map component – Ian Hamilton
Ian Hamilton then showed a nugget about: TMS Webmaps: which is an interface to many map-technologies including Google, Tomtom and others. He is building it in an Application with FNC, which makes it fully multi-platform.
Ian showed that it is a very clean all-platforms interface to deliver Google (or other) maps. There is an excellent, decently long manual with good worked examples for most operations a developer might want to do. Ian is using it to develop an application which allows users to click on a map of their farm or nursery and be given an update about the particular items planted there. This has not been hard to implement. The components add straightforward methods for actions like “Move to Co-ordinate” and “Add Marker at Co-ordinate.”
If you are going to use the Google component you have to input a Google API key. Ian showed how to get one of these. It is important to note that these components are free to use in an on-going way within your Applications only while the number of map-queries remain within certain (quite generous) limits. Above this level Google would start to charge for use of the API.
Delphi 11 – member participation – Jason Chapman
Jason then hosted a discussion of Delphi 11, which gradually blended into a chat session with beer. Jason has installed a recent patch to D11, and has “messed about with it”, i.e. coded, but not “in anger”, about 3 members have used it.
High DPI is still a real issue, but is also pretty bad in 10.4, members seemed to think it might be better, but some thing may be worse. It is often a question of exactly which third party components you use. Jason reported that absent members Patrick/Dave Capps at Savoy Systems have had real issues. Jason feels that beta testers have not really done the job they are supposed to do, as a lot of basic issues are present in something which should be a finished product.
Conrad pointed out that his naming convention for types (he uses a lot of dots, with types called things like “TFunction.Process.Printer”) results in LSP crashing really badly. While it is clearly good to be able to write code in different ways, it is clear that this type of naming does put a lot of strain on the compiler, figuring out where a name ends and functionality begins.