Marco Cantu

Syndicate content
Techie Italian Blogging on Delphi and More
Updated: 23 hours 39 min ago

Turbo Pack: A Short Video

Fri, 12/12/2014 - 09:38

For a VCL migration session I recorded a short video covering some open source components recently upgraded to XE7 compatibility and collectively called "Turbo Pack". I blogged about these components last October on blog.marcocantu.com/blog/2014-october-turbopack-xe7.html. You can find the projects code direct links in Roman's blog at blog.kassebaum.eu/?p=379.

The video below has a short introduction to the various components and the idea behind their "modernization", followed by the updated version of a classic Virtual Tree minimal demo and a one-minute introduction to a handful (out of the hundreds) of components in the Orpheus package, as you can see below:

These are two two core code snippets of the minimal virtual tree demo you can see in action in the video. The first is for creating the nodes, the second for fetching the information to display for the virtual nodes:

procedure TMainForm.VSTGetText(Sender: TBaseVirtualTree; Node: PVirtualNode; Column: TColumnIndex; TextType: TVSTTextType; var CellText: string); var Data: PMyRec; begin Data := Sender.GetNodeData(Node); if Assigned(Data) then CellText := Data.Caption; end; procedure TMainForm.VSTInitNode(Sender: TBaseVirtualTree; ParentNode, Node: PVirtualNode; var InitialStates: TVirtualNodeInitStates); var Data: PMyRec; begin with Sender do begin Data := GetNodeData(Node); Data.Caption := Format( 'Level %d, Index %d', [GetNodeLevel(Node), Node.Index]); end; end;

This is the demo at runtime, with the design time for in the background. 

 

PS: The code VirtualTree demo in the video has a comment referring to WideString, while the actual code (based on the updated component) simply uses the more performance string (or UnicodeString) data type.

And here, is the real focus of this blog post, the actual video of "Turbo Pack":

 

 

Categories: News, Blogs, and Tips

VCL Features You Might Have Missed

Thu, 12/11/2014 - 10:57

If you are still on older versions of Delphi and C++Builder, there are many features you are missing, including some important VCL features you don't hear much about these days.

Let me focus on those, after recapping some major features.

Great VCL Features Added Recently
  • Improved VCL styling
  • Taskbar and JumpList components
  • Bluetooth
  • AppTethering to mobile (and other VCL) apps
  • Parallel Programming Library
  • Improved REST and BAAS support
  • Improved and new multi-tier architectures (DataSnap, EMS)
  • The whole FireDAC
  • VCL sensor components
  • Visual Live Bindings
  • Gestures recognition

Getting to the specifics of this blog post, There are other relevant features taht you might have missed (even in case you upgraded to a version of RAD Studio that supports them). Here is a short list. I'm pretty sure I'm forgetting many others.

Direct2D Canvas

Beside the classic GDI-based TCanvas, the VCL support the Direct2D-based TDirect2DCanvas painting class. Just create one for your form as a while or during an OnPaint event handler, and you can take advantage of extended graphics. A demo I showed at CodeRage is at code.marcocantu.com/trac/marcocantu_delphi_sessions_demos/browser/coderage9/VCLMigration/04_D2DGradients and its output is below:

WIC support in TImage

Window Imaging Component supports TIFF and other formats, but also a number of transformations (including rotation) on images. And you can keep using the good old TImage component, not a big change in your code. Some (old) code can be found at code.marcocantu.com/trac/marcocantu_marco-delphi-books/browser/delphi2010handbook/05/TiffViewer.

 

VCL Controls Features

Over the years, even basic controls like buttons and edits got enhanced features, from images in the buttons to text hints for edits. Components affected are Buttons, progress bars, edits, list views, headers. Not a very recent change for sure, but one a few developers have missed.  The following application shows some customized edit controls, and it does use the standard VCL TEdit:

Settings are in the following DFM file: code.marcocantu.com/trac/marcocantu_delphi_sessions_demos/browser/coderage9/VCLMigration/06_EditFamilyDemo/EditFamily_MainForm.dfm

Task Dialogs

The support include migration of old MessageDlg calls and the specific TTaskDialog component. A sample project with a progress bar in a task dialog can be found at code.marcocantu.com/trac/marcocantu_delphi_sessions_demos/browser/coderage9/VCLMigration/05_ProgressTask. The output is below:

New Common Dialogs

These include the TFileOpenDialog and TFileSaveDialog, which fully replace the old TOpenDialog and TSaveDialog components. A screenshot of the post-XP file open dialog, in action at design time (it has an Execute local menu for testing) is below:

 

Conclusion

That's all. Far from an exhaustive list, but I'm sure that some of you might have missed existing VCL features. Did I miss some other nice additional feature? Feel free to comment about them below or in your own blogs...

Of course, if you are still on old versions of Delphi, there is no better time to upgrade (even from very old versions, but only until the end of December) taking advantage of the current offers at  www.embarcadero.com/radoffer.

 

Categories: News, Blogs, and Tips

Delphi Blogs of the Week #23

Wed, 12/10/2014 - 14:52

Another round of activities... over the past two weeks. News, technical blogs, and more.

Parallel Library and More Technical Blog Posts

A great series of Parallel Library blogs posts by Malcolm Groves:

Other technical blog post:

Third Party Tools Built with Delphi And Announcements
Categories: News, Blogs, and Tips

Special Object Pascal Online Training (Dec 17th)

Tue, 12/09/2014 - 03:43

Next week I'll give a special and exclusive online training  class on the Object Pascal language. I've been doing a lot of Delphi and Object Pascal training for companies before joining Embarcadero, and while I've been doing a lot of webinars, talked to conferences, and given CodeRage sessions, we are trying to setup something different:

  • Special because it is really a new experiment in terms of format with a single longer-than-average session (a 3 hours online class, with a short break, rather than the standard one hour webinar). If it goes well, this format might be repeated in the future.
  • Exclusive because this online event is reserved to developers who have bought XE7 or registered a trial, rather than open to anyone. The idea is to deliver extra value (a class on the language will cost you several hundred dollars) to our most loyal customers.

You an sign up at http://forms.embarcadero.com/DelphiObjectPascalTraining for one of the two sessions (given the length, it was hard to squeeze 3 sessions into a single day) which are at:

  • 6am Pacific - 9am Eastern - 2pm London - 3pm Central Europe - 5pm Moscow - 19:30 New Delhi
  • 2pm Pacific - 5pm Eastern - 10pm London - 7am Tokyo (Dec 18th) - 9am Sydney (Dec 18th)

The online training class is titled "The Ins and Outs of Delphi’s Object Pascal" and its focus is on Delphi's language, with specific focus on features added in recent years. It is not specifically for beginners, but rather for developers who have been using Object Pascal in the past and might not be up-to-date with the recent language features. Even developers who've been staying current with the Embarcadero tools and have occasionally used some of the new features should find a lot of value in the class, which (given the length) goes well beyond the basics.

This is the official class agenda, with some extended comments:

  • The Status of Object Pascal (the overall scenario of the language, the available compilers, OP and other programming languages)
  • Classic Features: Interfaces and Class Operations (a very short roundup of core features that are not as commonly used or significantly different from other languages to be worth underlining; also some "minor" language features added in recent years)
  • Records on Steroids with Methods and Operators (a roundup of records enhancements, how they are different from objects, where they make sense, and some very special purpose records in the RTL)
  • Generics and Anonymous Methods (from generic collections to generic methods and generic types; why anonymous methods are different, how they work internally, and some usage scenarios)
  • 30-minute Break (with a short Q&A session, so the actual break might be shorter -- but we'll deserve it)
  • Reflection and Attributes (from extended RTTI to attributes, and the opportunities opened up by these features in practical terms)
  • Class and Record Helpers, including Intrinsic Type Helpers (how to use them, what should be avoided, and how intrinsic type helpers really change the language perception)
  • Memory Management and ARC (the various models you can use to manage memory with all targets, plus the specifics of ARC and weak references for mobile) 
  • Q&A

Don't miss this unique online class, let me know if you like the idea, and (after attending) if you feel it was worth, how it can be improved, and which other Delphi and C++Builder topics could see similar "extended online classes". Sign up now to reserve your "virtual seat" for next week.

Categories: News, Blogs, and Tips

InterBase XE7 has Been Released

Thu, 12/04/2014 - 04:05

A new version of the InterBase server, XE7, has been released yesterday. Details of the announcement and core features are described in details by Stephen Ball in his blog at delphiaball.co.uk/2014/12/03/interbase-xe7/.

The most notable feature to me is Change Views, a whole new and extremely efficient way to track changes to a table since you previously queried it, asking for custom delta of the data. No other database has a feature exactly like that!

For more information head to the What's New product page or, even better, sign up for today's first look webinar at forms.embarcadero.com/InterBaseXE7FirstLookWebinar

 

Categories: News, Blogs, and Tips

Hotfix for FireMonkey Controls Resize Issue

Wed, 12/03/2014 - 07:48

There is a hotfix for Delphi and C++Builder XE7 Update 1, related with a resizing bug in FireMonkey controls. The hotfix is available at cc.embarcadero.com/item/30070 and must be applied on the Update 1 version of XE7, not the original release (which didn't have the issue, by the way). The problem is due to the fact that in some scenarios, the controls fail to issue a repaint request.

The hotfix resolves a few "apparently" unrelated issues, from TViewport3D problems (quality.embarcadero.com/browse/RSP-9732) to a repainting issue in the new Radiant Shapes components (www.raize.com/DevTools/RadiantShapes/Default.asp). If you are using FireMonkey, on any platform, applying the fix is recommended.

Categories: News, Blogs, and Tips

Castalia for Delphi XE7 Users, Now with Show Debug Variables

Fri, 11/28/2014 - 14:32

The latest version of Castalia, 2014.11, adds a very interesting feature, "Show Debug Variables". As you step in the code while debugging, you get to see the values where the variables are used. Truly in this case, a picture is much better than a description:

Now even better for Delphi XE7 and RAD Studio XE7 customers, this feature is available for free with the updated version of Castalia, free for registered users, at cc.embarcadero.com/item/29995.

So if you own Delphi XE7 and haven't downloaded Castalia, it is time to do it. If you have already downloaded it... it is time to get the new, updated version. For more information, head to twodesk.com/castalia/.

 

Categories: News, Blogs, and Tips

Delphi Blogs of the Week #22

Fri, 11/21/2014 - 08:15

A week with Delphi, from comets to 4K monitors, passing through an update and some expiring offers. A nicely dis-organized list:

I told you this was really a bit random, but all links are relevant. Finally, even if not strictly Delphi, Embarcadero is about to launch a new version of InterBase. Live and online previews early December. Read all at delphiaball.co.uk/2014/11/12/interbase-xe7-first-look-events/. This is the last blog post of this week, and quite a relevant one. From comets to InterBase, nice week.

PS. I spoke at BE-Delphi yesterday, nice event as usual -- see my twitter account for images and information -- and I'll be at SDC in Papendal (Netherlands) on December 1st and 2nd.

 

Categories: News, Blogs, and Tips

XE7 Update 1 is Available

Fri, 11/14/2014 - 10:03

The Update 1 for RAD Studio XE7, Delphi XE, and C++Builder XE7 is available to download for registered users (and trial users as well). The update has been available since yesterday, but this morning CodeCentral was having some hiccups, so I waited before posting this.

Update Links
  • Download and installation instructions are available in the Release notes in the docwiki at docwiki.embarcadero.com/RADStudio/XE7/en/Release_Notes_for_XE7_Update_1
  • There is an ISO for registered and non-registered users, and different web installers for RAD and individual products, and the trial versions. Best is to download from the specific product registered users download pages following the links in the release notes above (that is, if you have a RAD Studio license, you cannot get the installer from the Delphi product page).
  • The list of fixed issue that were logged by customers (on QC or the new quality portal) is on EDN at edn.embarcadero.com/article/44156. This is NOT the complete list of bugs fixed, as there are many issues our internal QA found and were also fixed in the update.
Why is the Update a Re-Install?

Given this is a common question, let me explain a couple of issues. Ultimately this is our current process, and we are looking for improvements, but there are reasons it is like this, and it might not change despite our efforts.

The most important element is that even if this is a uninstall/reinstall you can preserve all of your IDE settings and installed third party component. If you let the installer uninstall for you, that is done automAtically. If you manually uninstall first, there is a check box in the uninstaller to keep your registry settings. This is very important and makes a big difference.

Now the reasons. First is that patching under MSI (Microsoft Installer) is extremely time consuming. A patch of this size takes much more time than a full install (we have tried internally!). Some users reported a half hour process after the download. Not ideal but not too bad. Second, most large applications (and even small ones) regularly ask to reinstall for every minor release, patch or security update. Examples: Skype, OpenOffice, any Mac application from the store, any mobile application, Windows 8.1 (from Windows 8), most open source projects, Java runtime and most other runtimes. So RAD is not really as much of an exception. Now I  know this doesn't make things easier, and we'll keep investigating for ways to simplify the update process. Including moving to "native install" and using a different installer engine.

 

Categories: News, Blogs, and Tips

My Delphi CodeRage Session Replays

Thu, 11/13/2014 - 04:05

Replays for the CodeRage sessions are available on YouTube. Here are mine from the Object Pascal / Delphi track, along with further information and source code links when applicable.

Delphi Keynote This is the video for the CoreRage 9 Delphi / Object Pascal opening keynote, which offers an overview of the status of the product. There is no source code for this session.

.

 

What's New in the Object Pascal Language

This session focuses on recent features of the Object Pascal language, offering a roundup of dynamic arrays enhancements, record helpers for intrinsic types, and ARC, but also going back to generics, anonymous methods, and attributes. The source code can be browses online (or downloaded via subversion) at:

(Browsing) code.marcocantu.com/trac/marcocantu_delphi_sessions_demos/browser/coderage9/ObjectPascalLanguage

(SVN via HTTP) code.marcocantu.com/svn_public/marcocantu_delphi_sessions_demos/coderage9/ObjectPascalLanguage/

Here is the video:

.

 

Modernizing Object Pascal VCL Applications

This session focuses on bringing new life to VCL applications by embracing features added or enhanced over the last few years, from styles to task bar buttons support, from Direct2D to controls updates, touching on REST client library and parallel library... and a few more topics.

(Browsing) code.marcocantu.com/trac/marcocantu_delphi_sessions_demos/browser/coderage9/VCLMigration

(SVN via HTTP) code.marcocantu.com/svn_public/marcocantu_delphi_sessions_demos/coderage9/VCLMigration/

Here is the video:

.

 

Enterprise Mobility Services: Working with SQL Databases using Object Pascal

The focus of this session is the FireDAC database access in the new EMS architecture. In this case there is only one demo (as the other ships with the product), available for browsing at code.marcocantu.com/trac/marcocantu_delphi_sessions_demos/browser/EMS/EmsData1. The video is below:

.

 

The Life of an Object Pascal Public Store App

Finally, this is s presentation offering my personal experience in building and publishing a public store app written in Delphi, and you can find the actual app at play.google.com/store/apps/details

The video is below:

.

 

More from Fellow Speakers

Of course, there are many more sessions from other great internal speakers (including R&D sessions) and external speakers (including MVPs and Partners). The complete Object pascal track collection is a YouTube playlist. It was a great CodeRage, hope you can further enjoy the great content by looking to the session replays.

 

Categories: News, Blogs, and Tips