Tuesday, October 21, 2014

Speaking at ITDevCon 2014

Next Thursday, October 23rd, I'll be giving a Delphi XE7 keynote at ITDevCon in Milan, Italy.

Next Thursday, October 23rd, I'll be giving a Delphi XE7 keynote at ITDevCon in Milan, Italy. This is one of the Delphi conferences closest to home, given it moved from Verona (where it was help over the last few years -- Delphi Day in Piacenza still beats it, though).

Anyway, I'll be giving a keynote at this conference, that has a high quality group of speakers under the lead of Daniele Teti, including Jeroen Pluimers, Paolo Rossi, Boian Mitov, Stefan Glienke, André Mussche, and quite a few others). ITDevCon is generally quite a nice and technically in-depth conferences, we'll see how the new location will work this year.

For any information, last minute sign ups, or any other detail, head to  http://www.itdevcon.it/en  or the Italian counterpart. BTW, sessions will be both in English and Italian.

 





Monday, October 20, 2014

CodeRage 9 Coming Next Week

Next week Embarcadero technology will host the its 9th free, online developers conference, with parallel tracks covering Delphi XE7 and C++Builder XE7.

Next week Embarcadero technology will host the its 9th CodeRage, a free online developers conference, with parallel tracks covering Delphi XE7 and C++Builder XE7. The CodeRage conference is known for its great content, long hours of sessions, live Q&A with speakers from around the world. Topics cover new products features but also core technologies and foundations, with many MVPs and luminaries presenting along side Embarcadero evangelists, sales consultants, product managers, and members of the RAD Studio R&D team.

All of the sessions times and details are available at www.embarcadero.com/coderage along with the (free) sign up form. Register today, so you won't forget the dates, which are  Tuesday to Thursday  next week (October 28th to 30th). There are over 80 technical sessions not to be missed on a wide variety of topics. My suggestion: reserver the time, join the sessions live, and join the conversation with the speakers and thousands of other fellow developers.

I'll be giving quite a few sessions for CodeRage 9, in both tracks, which reminds me I'll have a busy week preparing them all! Here are my currently planned sessions:

Object Pascal Sessions:

  • Object Pascal Opening Keynote
  • Modernizing VCL Applications
  • What's New in the Object Pascal Language
  • Enterprise Mobility Services: Working with SQL Databases
  • The Life of an Object Pascal Public Store App

C++ Sessions:

  • Modernizing VCL Applications
  • The Life of a Public Store App
  • Enterprise Mobility Services: Working with SQL Databases

Stay tuned for next week, it will be really fun.

 

Delphi XE7 Blogs of the Week #20

Another bi-weekly round of updates, regarding Delphi, applications, third party, and more.

Another bi-weekly round of updates, regarding Delphi, applications, third party, and more.

XE7 Updates and HotFixes

More XE7 Information

General Delphi Information and New Delphi Apps

And More Embarcadero News

 

Friday, October 17, 2014

2014 Conference in Brazil

Yesterday in Sao Paulo myself and Jim McKeeth gave session at the largest Delphi event of the year, a great gathering of passionate developers.

Yesterday in Sao Paulo myself and Jim McKeeth gave session at the largest Delphi event of the year, a great gathering of passionate developers. With over 600 Delphi developers attending this was really a big event, with a perfect organization, and many great speakers, mostly local Delphi MVPs who really know and care about the product. I got "millions" of picture on Facebook and Twitter, but here there are a few more.

Before that, just let me say I had a great reception, my keynote pushed the idea Delphi is alive and kicking around Windows development, single-source multi-device mobile development, and support for the Internet of Things. In two words, "Delphi Everywhere". Enough said. Here are some more pictures taken by Fernando and myself, plus a couple I grabbed form social media. More pictures on twitter.com/marcocantu and www.facebook.com/marcocantu.

 

Monday, October 13, 2014

Open Source "TurboPack" Components for XE7

An important set of open source components has been migrated to XE7 and is now available. These includes some of the former Turbo Power components, plus a few others.

An important set of open source components has been migrated to XE7 and is now available. These includes some of the former Turbo Power components, plus a few others. This is why we are thinking of referring to them as "TurboPack".

The work has been done by Roman Kassebaum (with a little help by us), as you can read on blog.kassebaum.eu/ with the goal of making sure the components work on XE7, and both in Delphi and C++Builder, but also clean their source code of pre-Unicode IFDEFs, taking advantage of new language and RTL features, and migrating some of them to support mobile.

The set of components includes:

  • Orpheus (Win32 and Win64)
  • Abbrevia (Win32, Win64, MacOSX, iOS and Android)
  • Virtual Tree (Win32 and Win64)
  • SynEdit (Win32 and Win64)
  • LockBox (Win32, Win64, MacOSX, iOS and Android)
  • Async Professional (Win32)
  • PowerPDF (Win32 and Win64)

You can also read comments in the forums at https://forums.embarcadero.com/thread.jspa?threadID=109226&tstart=0 (when it works) and on the Google+ Delphi Community at plus.google.com/u/0/+MarcoCantu/posts/YJ3Pc4YaWzg





Thursday, October 9, 2014

RAD Studio Hotfixes for BMP Buffer Overflow and PAServer

There are two new hotfixes for Delphi and C++Builder XE7, XE6, and one also for XE5.

There are two hotfixes for different versions of RAD Studio that have been released over the last few days. All of these fixes are listed in the registered users download page at cc.embarcadero.com/myreg (notice they are sorted by version first, and date next).

Bitmap Buffer Overflow

This issue was already fixed about a month ago, but the new fix is more comprehensive and covers other corner cases. This is an important fix as it makes VCL applications vulnerable to attacks:

The fix will also be included in a future XE7 update 1, of course. For older versions, manual steps are available in the support site at support.embarcadero.com/article/44015.

PAServer Issues with Simulator

This fix relates with issues with the new iOS 8 simulator, and allows you (as a temporary work around) to use the iOS 7.1 simulator:

The readme with some information is available at www.fmxexpress.com/xcode-6-ios-7-1-simulator-hotfix-for-delphi-xe6-firemonkey-paserver/

A Subtle Delphi TRegEx Change

A subtle change in the TRegEx class defaults can cause some incompatibilities with pre-XE6 versions of Delphi (and C++Builder) code.

Last month I was approached by a customer who was migrating code from XE2 and saw some incompatibilities (or actually some bugs) in the way regular expressions are processed in the TRegEx class. He pointed out that using:

  RegEx := TRegEx.Create(sPattern);
  Match := RegEx.Match(sInput);

would work properly, while forcing the expressions to compile (for extra performance, if the same expressions is applied multiple times), like in the following code will basically break the regular expressions engine:

  RegEx := TRegEx.Create(sPattern, [roCompiled]);
  Match := RegEx.Match(sInput);

This looked really a bug and I noticed the difference was that with the compiled expression there was an extra match (and skipping it with the NextMatch call things would work). I asked to the R&D team and it turns out this change was done specifically to fix a real limitation (qc.embarcadero.com/wc/qcmain.aspx -- submitted by Jan Goyvaerts, who originally wrote the library and fixed in XE6).

What happens is that older version of TRegEx didn't support "empty matches", while now they do. To preserve the behavior, the structure is created with the roNotEmpty flag tunred on:

constructor Create(const Pattern: string; Options: TRegExOptions = [roNotEmpty]);

So you can now disable the option PCRE_NOTEMPTY (or roNotEmpty) using:

RegEx := TRegEx.Create(sPattern, []);

However, if you pass a different value to the constructor, the "not empty" is not applied. Once you know about this change, the workaround is add this option explicitly, so the "compiled" code above should read:

RegEx := TRegEx.Create(sPattern, [roNotEmpty, roCompiled]);”

By the way, TRegEx support has also been enhanced in XE7 to use a newer version of the library (PCRE 8.35) on Windows and mobile, while on Mac and for iOS simulator the TRegEx code binds to the version of the library available on the system. You can read this at docwiki.embarcadero.com/RADStudio/XE7/en/What%27s_New_in_Delphi_and_C%2B%2BBuilder_XE7#PCRE_8.35_for_Windows_and_Mobile_Platforms.

Now it is debatable if this is optimal (as there might be subtle differences, while using system libraries helps reduce the application footprint), but that's not the real point of this blog post.

Monday, October 6, 2014

Embarcadero Conference Brazil, Next Week

Next week I'll speak for the first time at the Embarcadero Conference in Brazil, a large gathering of local, mostly Delphi developers in Sao Paulo.

On Thursday next week, October 16th, I'll speak for the first time at the Embarcadero Conference in Brazil, a large gathering of local, mostly Delphi developers in Sao Paulo. While I was invited few times in the past, this is the first time I'll be attending... and I know a lot of Brazilian developers who read my Delphi books in the past are going to be there... But the conference will have much more content and a long list of great speakers. There will be Jim McKeeth joining from the US and showing his spectacular device interaction demos. Most of the 24 technical sessions (in 4 parallel tracks) will be given by local experts in Portoguese and I'll do a keynote (and a technical session) in English.

This is going to be a great event for all  Brazilian developers (likely the best developer conference of the year for Delphi developers and possibly one of the largest world wide) and I'm really looking forward to be there. Feel free to come and have a chat with me, stop by for a selfie, ask for a feature you'd like to see in the product, or get a book signed!

See all of the information, the complete agenda, and the sign up form at  www.embarcaderoconference.com.br/evento.html . If you live in Brazil, don't miss the "5 edição da Embarcadero Conference".

Thursday, October 2, 2014

Delphi XE7 Blogs of the Week #19

As usual, more than a week went by, and this is why this list of blogs is quite long. Lots of nice content from the Delphi world and beyond.

As usual, more than a week went by, and this is why this list of blogs is quite long. Lots of nice content from the Delphi world and beyond.

Delphi XE7 Technical Information and Additional Packages

General Delphi Blog Posts

Written in Delphi

And We Have Books!

And Third Party Tools

That's all for this couple of past weeks...

 





Friday, September 26, 2014

VCL in XE7: Styles

The use of styles is a great way to modernize Delphi VCL applications. Here is a short guide to styles in VCL.

Even if they have been in the product for a few versions, styles have seen several improvements (like the recent addition of menu styling in XE6). But what is a VCL Style? Here is a tentative definition:

A style is a collection of painting rules you can dynamically apply to an entire Windows application, changing the size and appearance of various elements, the fonts, and the color scheme used by VCL controls for painting.

Styles extend the concept of themes, in which the styling was provided at the operating system level. Styles in a VCL application can be set (and changed) both at design time and at run time.

Adding Styles to an Application

You can embed a style inside an application using resources, or you can refer to an external file with the style information. By default, you pick the design-time style(s) in the Appearance page of the Project Options:

 

In this page you can pick a few styles (either by Embarcadero or some you've added) to be embedded as resources in your applications. You can also select one of the styles to be the default one, activated as the program starts. Below you can see a trivial application at design time and the same application running with the “Auric” style selected in the dialog shown above:

 

As you can see, the program hasn't got the standard Windows look and feel. Notice that most elements will be styled, but not all of them. Notable exclusions the OS dialogs (there are some external tools to style them but they do have issues in Win64).
In general styles work with both TWinControl and TGraphicsControl descendants and any third party tool that supports theming, which is most of the recent or recently updated components. In general, if a control supports themes, it should also work or when styled.

Dynamically Changing Styles

To work on styles at run-time you use the TStyleManager class, defined in the Vcl.Themes unit. You generally use class methods and properties, rather than creating an instance. For example, you can get a list of styles using the StyleNames property, as in the following code fragment:

procedure TStylesForm.btnListStylesClick(Sender: TObject);
var
  str1: string;
begin
  for str1 in TStyleManager.StyleNames do
    ListBox1.ITems.Add(str1);
end;

You can load new styles from external files using the LoadFromFile and LoadFromResource methods of the TStyleManager. The selection of the current style takes place using the SetStyle method, which takes a string with the style name as parameter, so we can apply it to the list box elements after a double-click:

procedure TStylesForm.ListBox1DblClick(Sender: TObject);
begin
  TStyleManager.SetStyle(
    Listbox1.Items[ListBox1.ItemIndex]);
end;

So we can change the user interface of the application in many different ways, as visible in the next image, where I've picked two completely different styles, Ruby Graphite and Smokey Quartz.

 

Notice that the product ships with many styles and a few more are generally sold, but can be downloaded for free as part of promotions.

Creating or Customizing a Style

How can we modify an existing style or create a brand new one? Delphi includes a specific “Bitmap Style Designer” application (linked from the IDE Tools menu), which can also be freely distributed to external graphical designers. The designer is displayed below:

For each style, the Style Designer has five sections:

  • The Objects section includes a set of “properties” for the various elements of the user interface like forms, buttons, panel borders, and so on. There are hundreds of settings you can customize, which are saved like in a DMF file. In the first image above, for example, I’ve selected the “face” of a button.
  • The Images section has a single large image comprising all graphical elements of the style, as shown below:

  • The Fonts section has the fonts used by the various controls.
  • The Colors section has the various control's colors like en edit or a button.
  • The SysColors section has the color for standard windows elements, like the commonly used clBtnFace

Armed with this information you can design your custom styles or adapt the existing ones, and make your program more modern looking and a bit more colorful.

Menu Styling in XE6

The most relevant, recent addition to styling was done in XE6. That version included a significant number of fixes and improvements and new technology to support styling of the main menu, pull down menus, popup menus and the Windows system menu. In other words, all menu elements of your VCL application will now match the selected style.

Here is an example of a styled menu:

 

The best thing is there is nothing you have to do to enable this, as it just works. However, in case of problems, you can disable it by configuring the system hooks:

TStyleManager.SystemHooks := TStyleManager.SystemHooks - [shMenus];

Styling and the Windows Modern UI

Another interesting element of styling is that the VCL supports special styles that will make your traditional Win32 and Win64 applications adopt the so-called Modern UI (originally known as “Metro”) and look very much like the WinRT applications supported by Windows 8:

 

Notice there is a specific option in the IDE that allows you to convert an existing VCL application to what Embarcadero calls “Metropolis UI”, plus 4 specific styles based on the standard Modern UI chromes (Blue, Green, Gray, Dark). If you create a “Metropolis” VCL application, its main form will also be a full screen borderless form, but you can tweak that part as you prefer.

While Microsoft originally kept a distinction between the desktop applications (like those you built in Delphi) and their “traditional” UI and the new breed of WinRT application and the Modern UI, that distinction has been blurring since Windows 8 was introduced.

In Windows 8.1, for example, there are already some of the traditional UI elements (like a close button showing up within a “fake” application title bar) mixed into Modern UI applications. According to some leaked information (so nothing official there) it is expected that Windows 9 will allow WinRT/Modern UI applications running within a window – something you can achieve today with Delphi XE7, given these two types of applications will become basically undistinguishable.

In other words, with proper styling your VCL applications are ready for Windows 8, and most likely also for Windows 9, with no major rewrite but simply by properly modernizing the UI using styles.