Friday 14 December 2012

Resources/Links

We’ve just come to the end of the latest run of Developer Direct webinars on Delphi and C++Builder that I posted about when they started. The closing slide had a bundle of collated links on, so I thought I would copy (and, where necessary, correct) them into a post and make them searchable/locatable just in case that ever happened to be vaguely helpful for anyone.

Conference season has (for me) departed

It’s been a busy 6 weeks for me in terms of conferences. I used to be a regular speaker on Delphi and C++Builder topics at international conferences in the late 1990s and early to mid-2000s, but haven’t really been doing much in that area in the last semi-decade for various reasons that have no mileage in verbalising. However this autumn/fall I’ve thrown myself back into it as much as was feasible.

Embarcadero’s C++ stories

There’s been some chatter over recent months (and maybe even years) over the pending 64-bit C++ compiler for Windows from Borl^H^H^H^H Embarcadero. And now it’s here – the press release can be found at this link! Released days ago it’s a free update for users of C++Builder XE3 or RAD Studio XE3 and is now included in the install for new customers and in the trial version.

So C++Builder can now generates 32-bit Windows and OS X applications and 64-bit Windows applications. The beta program for the mobile support (for iOS and Android) is under way and expected to be done by the end of the first half of 2013. XE3 customers have priority access to the beta program.

David I posted up a great a potted history of Borland/CodeGear/Embarcadero’s C and C++ technology in this post, which charts the course from Turbo C on DOS through Turbo C++ on DOS and protected mode DOS, Borland C++ on DOS, Windows 3 and 3.1, then OS/2, Turbo C++ for Windows 3.1, then C++Builder for Win32 and (briefly) C++Builder X for enterprise and mobile platforms. Interestingly the post skips over the C++ compilers present in Kylix 2 and 3 (November 2001 and July 2002 respectively), which targeted ELF executables that run on Linux.

The new 64-bit release is based on the CLANG compiler front end and the LLVM optimising compiler back end, with Borland/Embarcadero extensions added in to work on VCL/FMX applications. It’s the first commercial CLANG implementation that targets Windows, so a lot of work was required to get this project to this point of being released.

The focus of this release is language conformance and support for C++11, which comes from the work already done by the CLANG project and now available to C++Builder customers. There are some blog posts on the new C++11 features in the list below. You can see what’s new in this release in the online docwiki.

I write this post not long after the C++ version of the free online CodeRage 7 conference has finished. The Win64 C++ compiler was announced at the start of the conference, and the conference sessions should become available online real soon, as the sessions from the Delphi CodeRage 7 have done. One of the first sessions on the first day of the C++ conference was a chat between David I and Bjarne Stroustrup (work page and home page), the designer and original implementer of C++. It was great to hear his views and opinions on all things C++. There’s a write-up of that session in this blog post.

To celebrate C++Builder’s move into the 64-bit world David I is spending much of December blogging about C++ in what he calls The 25 Days of C++mas. Current posts are as follows. I’ll try and add to this list a the days go by.

  1. C++Builder XE3 64-bit compiler
  2. Some of my favorite C++11 links
  3. Survey of favorite C+11 features
  4. The path to C++11 and the future
  5. Stricter C++Builder Win64 compiler
  6. Get a C++Builder 64-bit Boost!
  7. Pre-compiled Header Files
  8. A/V Capture Devices and Sensors
  9. C++Builder 64-bit Debugging
  10. C++Builder XE3 64-bit compiler is released
  11. A recap of my conversation with Bjarne Stroustrup
  12. Checking 12/12/12 12:12:12.12 with C++Builder
  13. Migrating C++ Code to 64-bit

RAD Studio XE3 new features

Delphi XE3, C++Builder XE3 and RAD Studio XE3 have been out a few months now. Back in October, David I released a video per day of the month to highlight new features in some of the various products that make up RAD Studio XE3: Delphi XE3, C++Builder XE3 and HTML5 Builder (I didn’t immediately notice anything relating to Embarcadero Prism XE3).

These 31 videos have been grouped together in an October calendar page entitled the Oct 2012 International RAD Studio Film Festival. If you have XE3 or are looking at upgrading to it you should take a look through some of these videos to see some of the newer features.

International RAD Studio Film Festival

Tuesday 6 November 2012

New Delphi Product Manager announced

Congratulations to Marco Cantù who has just been announced as the new Delphi Product Manager.

Let’s hope his years of Delphi experience and expertise are a great positive input into the team and that the general outlook for Delphi continues to bounce back.

Good luck Marco in your new rôle!

CodeRage is on!

As I type, Bob Swart has just finished running through the first CodeRage 7 session. The full session list for CodeRage 7 is here and the registration form is here.

You can keep an eye on what’s going on using the #coderage Twitter tag.

If you are outside the PST timezone you may be interested in this timezone-adjusted conference schedule for CodeRage 7 from HREF.

Enjoy!

Monday 5 November 2012

Conference season has arrived!

The Delphi conference season has definitely arrived. Starting tomorrow (November 6-8 2012) we have Embo’s CodeRage 7 – this is the first of the 2 free online CodeRage 7 conferences, this one being the Delphi conference. You can register using this link. These three days are packed with great Delphi information, so try and catch as many sessions as you can.

I’m in the schedule as session 3 on the first day (7am PST on Tuesday 6th November) giving a 40 minute run-through of my favourite productivity tips in the RAD Studio IDE. I hope you pick up a shortcut tip or two in the session :o)

Straight after my session, at 8am PST, John Thomas will give the Delphi Product Address, including a special announcement and a live ‘mystery’ guest (according to DavidI).

Next up for me, well it’s not a conference, but I’m presenting a session on RemObjects’ Project “Nougat” (a native iOS and OS X compiler, which uses the same Pascal-based Oxygene compiler as Embarcadero Prism) at a UK Developer’s Group meeting on Monday 19th November.

Then, on Thursday 22nd November I’m off to Antwerp in Belgium to show Project “Nougat” to a room full of Delphi developers at the second annual Be Delphi conference. This is set to be a great two-track conference with speakers including Marco Cantu, Bob Swart and Bruno Fierens.

On Monday 3rd December in Arnhem, the Netherlands a special SDE+ event is being run by the SDN with Delphi speakers including Cary Jensen and Marco Cantu. I’ll be delivering a full length version of the IDE productivity tips session and also doing an evening session where I’ll introduce more developers to Project “Nougat”.

Finally this year for me the C++ version of CodeRage 7 is running December 10-12. A repeat broadcast of my 40 minute RAD Studio productivity tips session is the 23rd session and opens up the last day at 6am PST on Wednesday 12th December.

It’s a busy conference season for me, and I hope to bump into some blog readers at the conferences over the coming months.

Help Update for XE3

In the vein of catching up on last week’s news, I notice that there is a replacement for the Delphi XE3 and C++Builder XE3 (and RAD Studio XE3) help system available. It’s marked as Help Update 1, but the instructions require you to remove the original help before installing this whopping 908MB download.

This full help replacement has a bunch of corrections and updated pages as well as new tutorial sections.

I’ll doubtless install this update, but to be honest I usually forget to use the installed help these days, after being so frequently disappointed by it during the Delphi 8/2005/2006 era. Generally I tend to go straight to the online documentation site if I have an Internet connection, which I get on pretty well with these days.

Free issue of Blaise Pascal magazine to registered users

I must have missed this one being announced, but registered users of XE, XE2 and XE3 products can pull down a free copy of Blaise Pascal, the magazine for all things Pascal-based.

Details are on this edn post by Tim DelChiaro and you can pull down the PDF magazine from Code Central.

The free issue, Issue 24, runs to 120 pages and has a number of articles from notable authors (such as Cary Jensen, Bob Swart and Bruno Fierens) on a variety of subjects including FireMonkey 2, Smart Mobile Studio, HTML 5, Delphi XE3 Styles, Delphi XE3 helper types, and interviews with various industry luminaries, including Marco Cantu, Mike Rozlog, marc hoffman and David I.

Also in the issue is my second article on Oxygene for Java: Supporting new android features in old android versions with Oxygene.

Download the magazine – I hope you like the contents!

Tuesday 16 October 2012

CodeRage 7 C++ Conference date change

Just a heads-up for Borland C++ users: the C++ CodeRage 7 conference has had to be changed. It now runs from 10th to 12th December 2012.

Friday 12 October 2012

CodeRage 7 registration open

CodeRage 7Embo’s CodeRage 7 multi-day multi-product online conference is now open for registration! Follow this link to sign up for the Delphi and/or the C++ event – it’s totally free!

You can browse the sessions in the agenda for the Delphi event here and for the C++ event here and the list of speakers is also up online.

There’s oodles of good content there for Delphi and C++Builder developers and I’ll be giving an IDE productivity tips & techniques session to be screened in both the Delphi conference and the C++ conference.

I hope to “see you there”!

Wednesday 10 October 2012

Embarcadero Developer Direct webinars return

After a good run of Developer Direct webinars over the summer, the Embo guys return with another ten 2 hour online sessions each Friday starting this coming Friday 12th October, 2012. The running times for the sessions are:

  • 10:00-12:00 London
  • 11:00-13:00 Frankfurt/Paris
  • 13:00-15:00 Moscow
  • 14:30-15:30 Mumbai/Bangalore

You can sign up to the series by using this link and that gets you access to any or all of the following sessions:

Episode Date Topic
1 12 October 2012 RAD Studio XE3 - The Story So Far!
2 19 October 2012 Be Agile Today! - Developer Workflow
3 26 October 2012 FM2 - FireMonkey in Action
4 02 November 2012 Language Focus (Object development, RTTI, 64 Bit)
5 09 November 2012 Mac Development for Windows Developers
6 16 November 2012 From Data to Business Information with RAD Studio XE3
7 23 November 2012 Web and Mobile apps using HTML5 and CSS3
8 30 November 2012 Multi-tier, Scalable Development and Deployment
9 07 December 2012 Windows 8 - Opportunities and Considerations for Developers
10 14 December 2012 Season Summary Session

Tuesday 2 October 2012

Windows tips

I like to consider myself reasonably competent in using Windows having picked up a whole bunch of tips, techniques and shortcuts over the many years (approximately 21) I’ve been using and programming against various versions of it.

For example, I’m one of a shrinking number of people who know that in a multi-selection list box with extended selection enabled (as opposed to a list view, just to be clear) you can press Shift+F8 to enter keyboard-driven multiple selection mode where Space toggles the selection of the current item and Shift+F8 or Esc leaves this selection mode. And I’ve know this since the days of Windows 3, before Raymond Chen made it more widely known in a 2006 post. Whilst on the subject of list boxes it’s also no longer well known that Ctrl+/ and Ctrl+\ perform select all items and select current item respectively.

However I’m always happy to pick up new tricks. I’ve bumped into a few recently and would like to share them with you.

A bounty of new XE3 videos coming

DavidI has kicked off a month of daily XE3 videos (that’ll be 31, then, what with this being October), all planned to be quick tips/demos less than 10 minutes long, more likely 5 minutes-ish.

The first one out yesterday was showing the Windows 8 styles that can be applied to VCL and FireMonkey applications in Delphi and C++Builder. There are form designer wizards that do this for VCL apps and for FireMonkey apps.

I’ll look forward to seeing more as the moth rolls on.

New compiler directives in Delphi XE3

There are a few changes/additions to the compiler in Delphi XE3. One of them is record helpers, much the same as class helpers but for records [UPDATE: actually the new thing about record helpers is mentioned a little further below]. This has been discussed and demonstrated on a few sites, such as Zarko Gajic’s delphi.about.com, Marco Cantù’s blog and Alister Christie’s LearnDelphi.tv.

These look quite interesting, but primarily from what Embo’s R&D will use them for rather than what you can use them for. I say this because the primary drawback of class or record helpers is that only one can be active on a class or record at a time, and it’s the last one found in scope.

Record helpers are poorly named really, as they can be used to add methods to primitive types [UPDATE: this is what is new in XE3 in relation to record helpers]. This is what TStringHelper does – it adds in a bunch of functions and properties to the basic string type, which incidentally are all 0-based in their behaviour, as opposed to regular string routines, which are all 1-based.

If you check in System.SysUtils.pas you will see that the way that these record helper methods manage to work zero-based is not by a lot of manual index offsetting in the code, but by a new and undocumented compiler directive that’s used around the implementation: {$ZEROBASEDSTRINGS ON}. [Edit: You can read more on this in Mark Edington’s October blog post].

Browsing through more of the XE3 source I noticed that the rules for $if have changed. All the cases of $if I bumped into are terminated by $endif, rather than $ifend as has previously been the case since its introduction in Delphi 6. A quick check shows that $if can now be closed with either $ifend or $endif. At the time of writing the documentation for $IF does not indicate this new flexibility so some investigation was required.

It turns out that there is another new (and currently undocumented) compiler directive that I was informed about, and then found had already cropped up in a discussion on the Embo fora. The directive is $LEGACYIFEND and the default state of this conditional is {$LEGACYIFEND OFF}. Using {$LEGACYIFEND ON} will take things back to how they were, forcing $IF to be closed by $IFEND and $IFDEF to be closed by $ENDIF.

If using the command-line compiler the --legacy-ifend command-line switch will also bring back the compiler behaviour of Delphi XE2 with regard to closing a $IF conditional compilation block.

So, to recap, this works in Delphi XE3 but does not compile in Delphi XE2 or earlier:

{$if defined(VER240)}
procedure foo;
begin
//blah blah
end;
{$endif}

but this throws up the same error in Delphi XE3 as it does in XE2:

{$ifdef CONDITIONALEXPRESSIONS}
  {$if CompilerVersion >= 24.0}
    {$LEGACYIFEND ON}
  {$ifend}
{$endif}

{$if defined(VER240)}
procedure foo;
begin
//blah blah
end;
{$endif}

Oh, but talking of compiler directives something else cropped up. As is implied in the snippet just above Delphi XE3 adds in the new VER240 conditional define (there’s a list of these tucked away on this blog). This is present and correct in the compiler version table in Embo’s doc wiki, but hasn’t yet made it into the conditional defines page, though I’m sure that’s just a matter of time. However, the point I was getting round to is to emphasise something that can be found in a comment in the RTL’s System unit source code:

CompilerVersion is assigned a value by the compiler when the system unit is compiled.  It indicates the revision level of the compiler features / language syntax, which may advance independently of the RTLVersionCompilerVersion can be tested in $IF expressions and should be used instead of testing for the VERxxx conditional define. Always test for greater than or less than a known revision level. It's a bad idea to test for a specific revision level.

The code above therefore shows the approved way of checking for Delphi XE3 or higher, using CompilerVersion (see here for a list of these values), as well as the wrong way to check for Delphi XE3, using VER240.

Back to $IF/$ENDIF, it should be noted that ErrorInsight has not been updated to be aware of this new flexibility for $IF, so if you use the new pairing to set up a conditional compilation block it will flag up an error in ErrorInsight and give a red squiggle in the source editor. This has already been reported as a bug.

Monday 1 October 2012

Embarcadero MVP Program officially up and running

Embarcadero MVP


After some weeks of being set up and readied the Embarcadero MVP program is now all official and public and the logos are done. You can visit the MVP landing page here to find out more about the program and see the full list of MVPs on the directory page here.


If you know of a helpful community member that does a lot for Delphi and isn’t in the MVP list then you can nominate them – for more info see the information page here.

I’m very pleased to be in the list from the beginning of the program.

Tuesday 25 September 2012

Native iOS development for Delphi programmers: Project ‘Nougat’

If you’ve kept up to date with developments in the world of Delphi, you’ll be aware that Embarcadero have teased us with a multi-step way of targeting iOS devices using the cross-platform FireMonkey framework and then just recently taken it away again (for now…).

It seems almost prescient, then, that RemObjects have just announced Project ‘Nougat’, which is the next incarnation of their Delphi-like Object Pascal based Oxygene compiler.

Oxygene will soon be natively targeting three platforms:

  • .NET: Oxygene for .NET (aka Delphi Prism aka Embarcadero Prism) is the longstanding .NET compiler that took over from Delphi for .NET in Borland/CodeGear/Embarcadero’s RAD Studio suite. It was released in 2005 and supports all the platform features such as LINQ and the Parallel Framework and targets regular .NET, Silverlight, Windows Store (aka Metro), Mono, in other words anything .NET can be targeted from Oxygene for .NET.
  • Java & Android: Oxygene for Java (previously Project ‘Cooper’) was released in 2011 and supports the targeting the Java Virtual Machine and also fully supports the Android toolchain. This means you can target regular Java apps, Java servlets, Java applets, and also build apps for Android phones and tablets. I’ve posted quite a bit already on Android development using Oxygene for Java.
  • OS X and iOS: this is what Project ‘Nougat’ is all about. It is in development, and the beta is expected to start in early October 2012, with release in the first half of 2013. ‘Nougat’ will target:
    • 64-bit OS X apps
    • 32-bit ARM v7 iOS apps
    • 32-bit Intel iOS Simulator apps
    There will be no wrappers involved in the generated apps, so nothing like Mono will be necessary. You will get native apps out of Project ‘Nougat’, coded in Pascal but as native as if you’d used Objective-C.

This is a great move forwards to fill in the gaps in what Oxygene can target and now gives a full spread over the major desktop and mobile platforms in one permutation or another.

If interested in native iOS and OS X targeting using all the regular native APIs as nature intended then be sure to read the series (in progress) of posts by RemObjectsmarc hoffman:

Additionally (and perhaps importantly), if you buy an Oxygene subscription for $499 (that’s the price for a new subscription – it’s $349 for a renewal) you get all three platforms: Oxygene for .NET and Oxygene for Java (and Android) and Project ‘Nougat’ (you’ll get access to the beta and also the shipping product when it comes out in the first half of 2013).

Monday 24 September 2012

Delphi actions

I’ve got a bunch of Delphi articles on my web site, mostly from the halcyon days of international Delphi conferences and printed Delphi magazines. One of the old articles that still gets quite a few regular hits is the one on actions from the early part of this century. Given it was around a decade old and actions have recently been added into the FireMonkey framework in Delphi XE3 I thought it might be an idea to dust it down and update it a bit.

So I present my slightly shinier actions article: Actions, Action Lists and Action Managers for your delectation. I’ve tried to be reasonably thorough and certainly found a bunch of places where methods have moved from one class to another. And I’ve covered the FireMonkey action support, meagre as it may be.

By ‘meagre’ that I mean that we have action lists but not managers nor action bands. Also, FireMonkey actions are not equipped to find arbitrary action targets, which is why the collection of standard actions is rather underwhelming. Still, it’s a first pass, and when Delphi 4 introduced actions, things were pretty thin on the ground there too, so hopefully matters will improve in that regard.

Oh, in the process of updating the article I bumped into what certainly appear to be a bundle of bugs in certain aspects of the VCL action bands – they’re highlighted in the text.

If it looks like I’ve overlooked anything key or made a hash of understanding something in the current implementation, do be a good sport and let me know, won’t you? That way there’s a more than average chance of me getting it fixed.

Thursday 20 September 2012

Windows 8 Boot Manager – Goodbye

I’ve split my hard disk into a couple of partitions and am dual booting Windows 7 and Windows 8. Consequently I have the Windows boot manager pop up to give me a choice of OS to boot into for 30 seconds, before the default OS (Windows 8) is launched. One rather annoying thing I’ve discovered about Windows 8 is its new boot manager and the amount of time it takes to show up on power up or system restart.

Windows 8 boot manager

To be fair, the new boot manager looks much more appealing to the eye than the last one, which was old school text mode. It’s had quite some work done to it to ensure that it will be usable and appealing even on a keyboard-less Windows RT ARM device. You can read about the boot manager’s evolution on the Windows Team‘s blog post.

Windows 7 boot manager

The new one supports touch and sports the modern "Windows Store app" appearance(y'know, the "Metro" style...). It does certainly look pretty swish and makes the previous version look rather archaic. Additionally, when you choose Windows 8 from the boot menu, Windows 8 appears very quickly afterwards.

All good points for the Windows 8 boot manager, right? Right.

However, the boot manager itself takes a really long time to wind itself up and display the options. That's because it requires a good chunk of Windows 8 to be loaded up in order to do so, which of course then explains why Windows 8 can start so quickly after being chosen from its boot manager.

If I want to boot to Windows 7 then I have to wait for a good chunk of Windows 8 to load in order to be presented with the option of booting to Windows 7, which then results in the machine restarting, and popping out of the BIOS screen into the Windows 7 startup sequence.

So the question is: can I get my old, simple, text mode boot manager back?
The answer is: yes.

There's two approaches to sorting this. One is simply switching which the default boot OS is. When Windows 8 is the default OS to boot to you get the Windows 8 boot manager, when Windows 7 is the default OS to boot to you get the old Windows 7 boot manager. The other is to tell Windows 8 to use the 'legacy' boot manager instead of the 'standard' one, which then means the text mode boot manager appears regardless of which OS has been set to be the default.

Let's take a look at these two options.

RAD Studio mobile support

With the removal of the support (admittedly placeholder support) for iOS in RAD Studio XE3 there has been an unsurprising volume of wailing and gnashing of teeth. To answer questions such as what, when, how etc. the RAD Studio Mobile Roadmap has now been made public.

From this we see that native ARM compilers for Delphi and C++Builder are in the works targeting native iOS and native Android along with a FireMonkey Mobile Framework (with sensor support and native UX) and associated mobile designers (with form factor and orientation awareness).

The planned timeframes for all this are as follows:

  • Mobile Beta Program, available to XE3 customers, opening late 2012
  • iOS Edition, planned for release in first half of 2013
  • Android Edition, planned for release in mid-2013

Delphi XE3 Professional and C++Builder XE3 Professional customers should be able to get the iOS and Android add-ons at low cost. Customers with the Enterprise Editions of the products or any version of RAD Studio XE3 will either get the mobile packs through Software Assurance or as low-cost upgrades. [ Updated to have the stated facts be, er, factual ]

CodeRage 7

Following on from the success of CodeRage 6 and CodeRage 5 before that, it makes sense that the next iteration of Embarcadero’s free online multi-day technical conference is to be called CodeRage 7 and will be here in a matter of weeks!

This year there is a Delphi CodeRage held November 6th to 8th (that’s a Tuesday, Wednesday and Thursday) and then a separate C++ CodeRage will run through November 13th to 15th (again a Tue-Thu).

There’s sure to be some great sessions through these CodeRage conferences. If you’re in the VCL or FireMonkey worlds then good technical content is yours for the taking by attending CodeRage.

If you’re a deft exponent of some aspect of the VCL or FireMonkey libraries, or can pass on Delphi or C++Builder tips, tricks and techniques, then submit a paper.

Registration for CodeRage 7 opens in October.

Wednesday 19 September 2012

Windows 8 ‘Camp In A Box’

For the last few months Microsoft has been running Windows 8 free developer events around the world (Dev Camps) called 'Windows 8 Camps'. They are still going on so do check the ongoing schedule on the Microsoft site.

If you've been along to one of them you'll have picked up a lot of information about Windows 8, its capabilities and how you take advantage of them in code. The hands-on labs from the Windows 8 Camp have been made available to anyone interested, but until recently the resources were still specific to pre-release versions.

As of a couple of days back the Windows 8 Camp In A Box is now available updated to the RTM version of Windows 8. You can either pull down a version for C# and XAML, or a version for JavaScript and HTML. Both are available at this download link and both come in at approximately 143MB.

This is definitely worth pulling down. It's an entirely self-contained training lab that takes you through all the steps of building up a nice, functional Windows 8 app. Enjoy!

[ UPDATE: this Camp-in-a-Box runs through the development of a Windows 8 cookbook application called the Contoso Cookbook, along with application. The installable also adds in a variety of useful presentations and resources.

It seems there is also a cut down version of the same kit without the presentations and additional resources at this download link, where the downloads are a little over 60 MB.

Finally, there is a mass of pre-fabricated Windows 8 sample apps set up to run with the RTM version of Visual Studio 2012, which can be pulled down for either C++, C#, JavaScript or VB.NET. Those are available from this link. ]

Monday 17 September 2012

Visual Studio 2012 and those... CAPS

Anyone who’s glimpsed Visual Studio 2012 has seen it shouting at them and wondered why, given the luxury of having both lower and upper case available, Microsoft has chosen to go for all upper case in the menu bar. Well, if you really want to know, read the post on The Visual Studio Blog as that explains their reasoning.

I read it. To be honest it didn’t seem very convincing. There is mention of All Caps being a strong signature element of styling for navigation in Microsoft UIs. They do point at some upper case in a web site and on the Zune, but given the main UI thrust at the moment is Metro^H^H^H^H^H the Modern UI in Windows 8 and on Windows Phone and those don’t appear to focus on upper case I remain dubious.

I am aware that Office 2013 will also be using the upper case motif (you can see it here). This to me and to many who share a certain sensitivity of eyesight is somewhat regrettable.

Fortunately, with Visual Studio at least, you can instruct it to forget all about the upper case fad and just ‘be normal.’ This involves a little registry hackery. Run regedit.exe and in the HKEY_LOCAL_MACHINE hive navigate to the Software\Microsoft\VisualStudio\11.0\General subkey. Add in the DWORD SuppressUppercaseConversion and give it a value of 1. As you might expect, a value of 0 reverts to the short-sighted choice of upper case again.

This trick is getting reasonably well known around the Arpanet, but I’m posting it to help ensure the message is spread as far and as wide as feasible. I’ll cross my fingers that Office 2013 also offers up a trick available to turn off its SHOUTY MENUS.

Getting an Android app’s version number

A while back I was preparing an app to upload to the Android Market Google Play. One of the requirements of uploading is that the app must contain version information. As of the August update of Oxygene for Java 5.2, the default Android application template does not contain version information so you need to insert this manually, and then update it as and when your code is updated.

You add version information to your Android application by editing the manifest file. In the outermost element, the manifest element, you add in a couple of attributes: versionCode and versionName.

versionCode is an integer that can be anything you like, as long as each new version code is higher than the last – clearly an incrementing number is the simplest option here. versionName is the string that is shown to the user – it’s not used by the system so can be any test you like.

So, for example, you could open the manifest element like this on your first app version:

<manifest
    xmlns:android="
http://schemas.android.com/apk/res/android"
    package="com.acme.app"
    android:versionCode="1" android:versionName="1.00">

Each time you want to issue a new application you simply update the two version-related attributes, maybe like this:

<manifest
    xmlns:android="
http://schemas.android.com/apk/res/android"
    package="com.acme.app"
    android:versionCode="2" android:versionName="1.01">

With that done, what’s involved in displaying some version information to the user, say in an About screen in the app? Well that’s what I wanted to do with the app mentioned above – it was my Plasma app (a free graphics plasma effect demo written in Oxygene for Java).

To get version info we must access a PackageInfo class for the app as that can give us information about the Android package gleaned from the application manifest file – specifically the class exposes versionCode and versionName members that return the values from the manifest discussed above.

How do we get a PackageInfo class? That can be arranged by a PackagManager object that offers a getPackageInfo() method (that we can access as a PackageInfo property). Pass it the package name and it will return the goods for us.

The Context class is what Activity inherits from, and it defines two useful methods: getPackageManager() and getPackageName() – hopefully it will be patently clear these will finish the job off.

In the case of my plasma app I have layout resource containing a TextView called aboutText. I also have two string resources that define formatted strings waiting to have a version string (the version name from the manifest file) plugged in. For example, one of them is used to set up the About activity’s title and is defined thus:

<string name="plasma_about_title">About Plasma %s</string>

The code to access the TextView control and give it a formatted string containing the version information looks like this:

var aboutTextView: TextView :=
 
TextView(findViewById(R.id.aboutText));
var versionName :=
  PackageManager.PackageInfo[PackageName, 0].versionName;
aboutTextView.Text :=
  String[R.string.plasma_about_text, versionName];
Title := String[R.string.plasma_about_title, versionName];

If you want to use the original method names as defined in the Google Android documentation, as opposed to the equivalent implied properties, it would look like this instead:

var aboutTextView: TextView :=
  TextView(findViewById(R.id.aboutText));
var versionName :=
  getPackageManager().getPackageInfo(
    getPackageName(), 0).versionName;
aboutTextView.setText(getString(
  R.string.plasma_about_text, versionName));
setTitle(getString(R.string.plasma_about_title, versionName));

Notice we are making use of the overload of getString() that takes a string resource id and a list of format string arguments to use when building the formatted string.

Windows 8 keystrokes

If you’re an old school computer user then whilst getting the hang of Windows 8 you’ll bump into a whole heap of keystrokes that will help make it dance to your tune. Here’s the list of useful keystrokes I’ve found that work in Windows 8, for when you get around to upgrading from Windows 7 (the shortcut keys for that are listed here).

Note that this table uses the Windows key (or WinKey) character (ÿ). Since Unicode has no character for this image I’m explicitly referencing Microsoft’s WingDings font character 255 so it probably looks all yucky a Mac, given Macs don’t have the WingDings font available by default.

Some of the shortcut keystrokes have been redefined since Windows 7. For example the desktop peek keystroke was ÿ+Space but has now been re-mapped as ÿ+, and ÿ+Space now means something else. Also, ÿ+Space no longer invokes the Windows Mobility Centre but displays the Quick Link menu instead.

Also, some keystrokes have gone, such as ÿ+G, which is no longer required thanks to Windows Gadgets not being supported by Windows 8.

Shortcut    aka Meaning
Ctrl+Shift+Esc   Invoke Task Manager or whatever replacement you might have installed, such as Process Explorer from SysInternals
Alt+Tab   Cycle through "Metro" (Windows 8) and desktop apps
Alt+Shift+Tab   Cycle through "Metro" (Windows 8) and desktop apps in reverse order
Alt+Esc   Switch to next desktop app in Alt+Tab list
Alt+Shift+Esc   Switch to previous desktop app in Alt+Tab list
ÿ+B WinKey+b Give focus to Task Bar’s notification area so arrow keys can move between notification icons, Enter can select them (like clicking them with the mouse), Shift+F10 can show context menu, Shift+Tab can move focus to notification area etc.
ÿ+C WinKey+c Display the Charms bar. Equivalent to moving the mouse to the right edge of the screen or swiping in from the right edge of the screen.
ÿ+D WinKey+d Toggle show desktop
ÿ+E WinKey+e Windows Explorer
ÿ+F WinKey+f Open Search Charm and do a search on Files
ÿ+H WinKey+h Open Share Charm
ÿ+I WinKey+i Open Settings Charm
ÿ+J WinKey+j Switch the main app and snapped app
ÿ+K WinKey+k Open Devices Charm
ÿ+L WinKey+l Lock workstation
ÿ+M WinKey+m Minimise all desktop app windows
ÿ+Shift+M WinKey+Shift+m Restore all desktop app windows
ÿ+O WinKey+o Lock device orientation
ÿ+P WinKey+p Invoke the presentation menu to allow options of displaying on computer only, duplicating to external display, extending to external display or displaying on external display only
ÿ+Q WinKey+q Open Search Charm and do a search on Apps
ÿ+R WinKey+r Run a command
ÿ+T WinKey+t Give focus to Task Bar so arrow keys can move between Task Bar items, Enter can select them (like clicking them with the mouse), Shift+F10 can show context menu, Tab can move focus to notification area etc. Repeated presses of the keystroke cycles through the buttons on the Task Bar
ÿ+U WinKey+u Windows Ease of Access Centre
ÿ+V WinKey+v Cycle through notifications
ÿ+Shift+V WinKey+Shift+v Cycle through notifications in reverse order
ÿ+W WinKey+w Open Search Charm and do a search on Settings
ÿ+X WinKey+x Opens Quick Link menu
ÿ+Z WinKey+z Show app commands. Equivalent to right-clicking a general area of the application.
ÿ+Break WinKey+Break Windows System properties
ÿ+F1 WinKey+F1 Windows help
Prt Sc Print Screen Copy a screenshot to the clipboard
Alt+Prt Sc Alt+Print Screen Copy a screenshot of just the focused window to the clipboard
ÿ+Prt Sc WinKey+Print Screen Save a screenshot as a PNG in logged on user’s My Pictures folder
ÿ+Tab WinKey+Tab Cycle through "Metro" (Windows 8) apps
ÿ+Shift+Tab WinKey+Shift+Tab Cycle through "Metro" (Windows 8) apps in reverse order
ÿ++ WinKey+Plus Zoom in (via Magnifier, which autostarts)
ÿ+- WinKey+Minus Zoom out (via Magnifier)
ÿ+Esc WinKey+Escape Cancel zoom, if enabled
ÿ+. WinKey+Period Cycle through snapping an app to the right, to the left and unsnapping it
ÿ+Shift+. WinKey+Shift+Period Cycle through snapping an app to the left, to the right and unsnapping it
Alt+↑ Alt+Up Arrow In Windows Explorer navigate one folder up in the folder hierarchy
Ctrl+Shift+N   In Windows Explorer this creates a new folder
Alt+Enter   Equivalent of right-clicking an item in Windows Explorer and choosing Properties
Shift+right-click on an item in Windows Explorer Enables extended Send To menu (has many more items in it). Also adds Copy as Path to the context menu.
Shift+right-click on a folder Adds in context menu command: Open command window here. This starts cmd.exe with the current directory being the folder in question.
Ctrl+Shift+Enter   In Start screen's Apps search results launches app as Administrator
Shift+Alt+Prt Sc left Shift+left Alt+Print Screen Toggle High Contrast mode
Ctrl+Alt+↑ Ctrl+Alt+Up Arrow Rotate screen to default orientation default
Ctrl+Alt+→ Ctrl+Alt+Right Arrow Rotate screen orientation 90 degrees from default
Ctrl+Alt+↓ Ctrl+Alt+Down Arrow Rotate screen orientation 180 degrees from default
Ctrl+Alt+← Ctrl+Alt+Left Arrow Rotate screen orientation 270 degrees from default
ÿ+, WinKey+Comma Makes all windows transparent so you can see the desktop until you release the keys. Equivalent to (invisible) desktop peek button to right of Task Bar’s notification area. This was done by ÿ+Space in Windows 7
ÿ+↑ WinKey+Up Arrow Maximise window. Same as dragging window’s title bar to top of screen.
ÿ+↓ WinKey+Down Arrow Restore maximised window, or minimise restored window
ÿ+← WinKey+Left Arrow Alternately expand windows to fill left half of screen, expand to fill right half of screen or restore to previous size. Dragging window’s title bar to left edge of screen also expands window to fill left half of screen.
ÿ+→ WinKey+Right Arrow Alternately expand windows to fill right half of screen, expand to fill left half of screen or restore to previous size. Dragging window’s title bar to right edge of screen also expands window to fill right half of screen.
ÿ+Home WinKey+Home Minimise all but the active window. You can get the same effect by clicking on a window’s title bar and shaking it about (known as Aero Shake)
ÿ+Shift+↑ WinKey+Shift+Up Arrow Maximise window vertically (leave width unchanged). This is the same as double-clicking the window’s top or bottom resize border
ÿ+Shift+← WinKey+Shift+Left Arrow Move window to the monitor on the left
ÿ+Shift+→ WinKey+Shift+Right Arrow Move window to the monitor on the right
ÿ+PgUp WinKey+Page Up Move Start screen and "Metro" (Windows 8) apps to the monitor on the left
ÿ+PgDn WinKey+Page Down Move Start screen and "Metro" (Windows 8) apps to the monitor on the right
ÿ+<digit> WinKey+<a number> Start app pinned on the Task Bar at the position corresponding to the number pressed, or switch to it if already open
ÿ+Shift+<digit> WinKey+Shift+<a number> Start new instance of app pinned on the Task Bar at the position corresponding to the number pressed. Shift-clicking the item does the same.
Shift+click a Task Bar button   Same as ÿ+Shift+<digit>
ÿ+Ctrl+Shift+<digit> WinKey+Ctrl+Shift+<a number> Start new instance of app pinned on the Task Bar at the position corresponding to the number pressed running as administrator. Ctrl+Shift-clicking the item does the same.
Ctrl+Shift+click a Task Bar button   Same as ÿ+Ctrl+Shift+<digit>
ÿ+Ctrl+<digit> WinKey+Ctrl+<a number> Cycle through open windows of app pinned on the Task Bar at the position corresponding to the number pressed
ÿ+Alt+<digit> WinKey+Alt+<a number> Show the Jump List for the item on the Task Bar at the position corresponding to the number pressed
Shift+right-click a Task Bar button   Show XP-style Window menu
Ctrl+click a grouped Task Bar button   Cycle through the windows of the group
ÿ+Space WinKey+Space Switch input language and keyboard layout
ÿ+Ctrl+Space WinKey+Ctrl+Space Switch to previous input language and keyboard layout

Windows 7 keystrokes

Having recently settled into regularly using Windows 8 I’ve also just bumped into a new Windows 7 keystroke that I hadn’t previously been aware of. It seems that the enhanced Task Bar, which you can pin application shortcuts to, has shortcut keystrokes related to those pinned items: Windows key + a digit, where the digit represents the pinned item’s position on the Task Bar. For a pinned item that is not running, the shortcut launches that app. If the pinned item is already running the shortcut switches to that item.

For example, if you have Google Chrome pinned as the third item on your Task Bar, then Win+3 will either switch to Chrome, or launch it if it’s not already running. Simple.

Inspired by this I did some digging to check out what other keystrokes were introduced by Windows 7 (granted some of them may have come from Vista, but I’m not sufficiently interested to work out which – let’s just say they are new when compared to Windows XP). It seems there are quite a few. I’d encountered most of them before, but some of them were definitely new to me. You can see what I’ve found below – I’ve also added them all to my Commands and Keyboard Shortcuts page. I’ll look at the new Windows 8 keystrokes in a separate post.

Note that this table uses the Windows key (or WinKey) character (ÿ). Since Unicode has no character for this image I’m explicitly referencing Microsoft’s WingDings font character 255 so it probably looks all yucky a Mac, given Macs don’t have the WingDings font available by default.

Shortcut    aka Meaning
ÿ+Tab WinKey+Tab Glitzier version of Alt+Tab
ÿ+Shift+Tab WinKey+Shift+Tab Glitzier version of Alt+Shift+Tab
ÿ++ WinKey+Plus Zoom in (via Magnifier)
ÿ+- WinKey+Minus Zoom out (via Magnifier)
ÿ+Esc WinKey+Esc Turn off zoom, if active
ÿ+G WinKey+g Cycle between the Windows Gadgets on the desktop
Alt+↑ Alt+Up Arrow In Windows Explorer navigate one folder up in the folder hierarchy
Ctrl+Shift+N   In Windows Explorer this creates a new folder
Shift+right-click on an item Enables extended Send To menu (has many more items in it). Also adds Copy as Path to the context menu.
Shift+right-click on a folder Adds in context menu command: Open command window here. This starts cmd.exe with the current directory being the folder in question.
Ctrl+Shift+Enter   In Start menu's search box launches as Administrator
Prt Sc Print Screen Copy a screenshot to the clipboard
Alt+Prt Sc Alt+Print Screen Copy a screenshot of just the focused window to the clipboard
Shift+Alt+Prt Sc left Shift+left Alt+Print Screen Toggle High Contrast mode
Ctrl+Alt+↑ Ctrl+Alt+Up Arrow Rotate screen to default orientation default
Ctrl+Alt+→ Ctrl+Alt+Right Arrow Rotate screen orientation 90 degrees from default
Ctrl+Alt+↓ Ctrl+Alt+Down Arrow Rotate screen orientation 180 degrees from default
Ctrl+Alt+← Ctrl+Alt+Left Arrow Rotate screen orientation 270 degrees from default
ÿ+Space WinKey+Space Makes all windows transparent so you can see the desktop until you release the keys. Equivalent to desktop peek button to right of Task Bar’s notification area. This is known as Aero Peek.
ÿ+↑ WinKey+Up Arrow Maximise window. Same as dragging window’s title bar to top of screen.
ÿ+↓ WinKey+Down Arrow Restore maximised window, or minimise restored window
ÿ+← WinKey+Left Arrow Alternately expand windows to fill left half of screen, expand to fill right half of screen or restore to previous size. Dragging window’s title bar to left edge of screen also expands window to fill left half of screen.
ÿ+→ WinKey+Right Arrow Alternately expand windows to fill right half of screen, expand to fill left half of screen or restore to previous size. Dragging window’s title bar to right edge of screen also expands window to fill right half of screen.
ÿ+Home WinKey+Home Minimise all but the active window. You can get the same effect by clicking on a window’s title bar and shaking it about (known as Aero Shake)
ÿ+Shift+↑ WinKey+Shift+Up Arrow Maximise window vertically (leave width unchanged). This is the same as double-clicking the window’s top or bottom resize border
ÿ+Shift+← WinKey+Shift+Left Arrow Move window to the monitor on the left
ÿ+Shift+→ WinKey+Shift+Right Arrow Move window to the monitor on the right
ÿ+T WinKey+t Give focus to Task Bar so arrow keys can move between Task Bar items, Enter can select them (like clicking them with the mouse), Shift+F10 can show context menu, Tab can move focus to notification area etc.
ÿ+B WinKey+b Give focus to Task Bar’s notification area so arrow keys can move between notification icons, Enter can select them (like clicking them with the mouse), Shift+F10 can show context menu, Shift+Tab can move focus to notification area etc.
ÿ+P WinKey+p Invoke the presentation menu to allow options of displaying on computer only, duplicating to external display, extending to external display or displaying on external display only
ÿ+<digit> WinKey+<a number> Start app pinned on the Task Bar at the position corresponding to the number pressed, or switch to it if already open
ÿ+Shift+<digit> WinKey+Shift+<a number> Start new instance of app pinned on the Task Bar at the position corresponding to the number pressed. Shift-clicking the item does the same.
Shift+click a Task Bar button   Same as ÿ+Shift+<digit>
Ctrl+Shift+click a Task Bar button   Open program as administrator
ÿ+Ctrl+<digit> WinKey+Ctrl+<a number> Cycle through open windows of app pinned on the Task Bar at the position corresponding to the number pressed
ÿ+Alt+<digit> WinKey+Alt+<a number> Show the Jump List for the item on the Task Bar at the position corresponding to the number pressed
Shift+right-click a Task Bar button   Show XP-style Window menu
Ctrl+click a grouped Task Bar button   Cycle through the windows of the group

Friday 14 September 2012

Delphi happenings

Well, I turn my back for a mere month and when I turn round again all sorts of occurrences and shenanigans have happened in the world of Delphi and RAD Studio! Here’s a summary for anyone who has also been distracted with other matters over recent weeks:

  • RAD Studio XE3 is released and available
  • RAD Studio XE3 world launch tour in progress
  • Delphi XE3 and C++Builder XE3 have Windows 8 support, but not necessarily in the form you might expect
  • Delphi compiler maintainer leaves Embo
  • Now you can’t do client/server apps in Delphi Professional. Oh, but now you can
  • RAD Studio XE3 drops mobile support (for a bit)
  • No 64-bit C++ just yet
  • Embo announces an MVP program

Let’s take a look at each of these…..

Thursday 13 September 2012

Windows 8 and me

As the more observant among you will doubtless be aware, Windows 8 is here. Of course it’s only actually here for developers and similar types who can download it from Microsoft’s Developer Network or TechNet. Normal punters will have to wait a little while before they can either get their hands on it or fervently spurn it.

It was released to manufacturing right at the start of August 2012, made officially available to developer types on 15th August and will be made available to the populace at large towards the end of October (the 26th).

I’d originally installed the Developer Preview from September 2011 and largely ignored it. Then I installed February’s Consumer Preview and had a little dabble with it, to see what was new and different, though it didn’t get much of my attention. Then in June the Release Preview replaced the Consumer Preview and I focused a bit more time on it on the occasions when that the VM in question booted up. And now I’ve got the shipping build of Windows 8 Enterprise 64-bit installed on a new laptop (dual-booting with Windows 7 Ultimate 64-bit).

So now I’ve had a chance to get a small flavour of this new release, which Microsoft seems to be hoping will get a reasonable foothold in the market, but which has generated quite a lot of negative press from a variety of cynical pundits.

Oh, and before we get started, I should point out that since the introduction of Windows Phone and then all through the Windows 8 development cycle, the new minimalist style of applications that run on the new WinRT subsystem have been consistently labelled as Metro apps, the UI style being called the Metro style. This is no longer the case, as reported on ZDNet in early August. Apparently a German company called Metro has decided to take its name back.

At the time of this story on The Register and this one on ZDNet, the suggestion was that Metro apps were to be called Windows 8 apps, but that was just speculation. Another new name for the Metro style is Windows 8 Style UI, which seems to be the one featured the marketing materials. But developers are being targeted with the term Modern UI – they will be building Modern UI-style apps. That said, a quick check in Visual Studio 2012 reveals the various project templates using the phrase Windows Store in place of Metro.

Visual Studio 2012 refers to Windows 8 Modern UI apps as Windows Store apps

It’s all far from clear to be sure.

Sunday 22 July 2012

Delphi IDE productivity keystrokes

The other day I posted about a talk I gave at a User Group meeting that focused on Delphi IDE keystroke shortcuts (mostly code editor features and shortcuts). After processing my simple notes list and adding in comments and links to the documentation where appropriate I’ve come up with what we see in this post.

This represents the list of my favourite keyboard shortcuts (and related features), some of which have been available since Delphi1, some added in the most recent versions and many more added at various points in between. I hope you can find some useful additions to your Delphi coding arsenal in this collection. Note that the list is mostly keystrokes, but the mouse is mentioned here and there. I do find having a wealth of keystrokes available to call upon helps me be efficient in use of the Delphi IDE.

Without further ado, here’s the list:

Code Insight, mostly added in Delphi 3. Some of these can be enabled or disabled as you choose in the Code Insight page of the Tools, Options dialog:

Code Completion. The (resizable) popup list we often see automatically, but which can be forced up when required. Ctrl+Space
Code Parameters. The tooltip that shows the names and types of the parameters required in a parameter list, with the current parameter shown in bold. Again, this often comes up as required but can be forced up when the cursor is in a parameter list using this keystroke. Ctrl+Shift+Space
Code Templates (now called Live Templates). Very under-used mechanism for auto-entering a block of often-entered text. The IDE ships with a bunch of predefined Code Templates and you can define your own also (which is where the real benefit comes in). Originally the Code Template definition was quite trivial, but since the introduction of Live Templates in Delphi 2006, the definition is now in XML and a little cumbersome, but is covered in the documentation. Ctrl+J
Tooltip Help Insight. This pops up when you hover over a symbol giving you information on it. If that symbol has XML documentation comments (XMLDOC comments) defined for the item, or its parameters, these will be included in the help popup. XMLDOC comments can be readily entered in Delphi XE2 by the included product Documentation Insight Express. Ctrl+Shift+H
Tooltip Symbol Insight. This is enabled by default, but so is Tooltip Help Insight, which takes precedence. Disabling Help Insight allows this to work – it shows some declaration and type information for the symbol under the mouse cursor hover mouse over a symbol
Tooltip Expression Evaluation. In debug mode, hovering the mouse over an identifier or a selected expression will evaluate it. If the expression yields an object then the tooltip will allow you to drill down into its constituent members. hover mouse over a symbol or highlighted expression in debug mode
Class Completion. If a class has a method declaration, this will enter the implementation if pressed with the cursor within the class. If there is a method implementation this will enter a corresponding declaration. Given a minimal property declaration (e.g. property Foo: Integer;) this will declare a private backing variable and a setter that assigns its passed value to it and extend the property declaration accordingly. Ctrl+Shift+C
Block Completion. This typing saver finishes code blocks for you. Enter
Error Insight. This is the name for the squiggly red lines in the code editor indicating where a background compilation has detected errors in the source. The errors are also listed in the Structure window in recent Delphi versions. As we have all seen over many recent versions, after a few compilations, Error Insight leaves various perfectly valid and compilable expressions marked with red squigglies and most people get quite irked by it, essentially paying no attention because of its lack of reliability. The tip here is to go to the Code Insight options and turn Error Insight off.  
Code Browsing. When you hold the Ctrl key down and move your mouse around the code editor, any item whose declaration can be located turns into a hyperlink and the mouse cursor indicates clicking it will take you somewhere. In short, Ctrl+click will take you to a symbol’s declaration or definition. However that involves the mouse, so there is another keystroke that is less commonly mentioned for this. Alt+Up
Browsing History. Once you start code browsing, these keystrokes allow you to go back and forth in the browsing history. Alt+Left and Alt+Right

Method hopping, i.e. jumping from one method to another within a source file:

Scroll through methods Ctrl+Alt+mouse scroll wheel
Toggle class lock. Normally method hopping goes through all methods in a file. This toggles a lock on just hopping through the methods of just the current class. Ctrl+Q, L
Move to top of current method or to previous method (unless your graphics driver software takes the keystroke to orient your monitor display to the natural orientation) Ctrl+Alt+Up
Move to next method (unless your graphics driver software takes the keystroke to orient your monitor display upside down) Ctrl+Alt+Down
Move to first method in file Ctrl+Alt+Home
Move to last method in file Ctrl+Alt+End

Regions and code folding. Regions are great for hiding away code sections that you don’t want to see when scrolling around in your code. They are a special case of compiler directives that each adds in a new code folding area.

Collapse current foldable code block or region Ctrl+Shift+K, Ctrl+Shift+E
Expand current foldable code block or region Ctrl+Shift+K, Ctrl+Shift+U
Toggle code block collapsed state Ctrl+Shift+K, Ctrl+Shift+T
Collapse all regions Ctrl+Shift+K, Ctrl+Shift+R
Collapse all nested procedures Ctrl+Shift+K, Ctrl+Shift+P
Collapse all methods Ctrl+Shift+K, Ctrl+Shift+M
Collapse all classes Ctrl+Shift+K, Ctrl+Shift+C
Expand all code Ctrl+Shift+K, Ctrl+Shift+A
Toggle code folding support Ctrl+Shift+K, Ctrl+Shift+O

Miscellaneous editor keystrokes:

Drop (or remove) bookmark – seems to be a bug that one keystroke option doesn’t handle bookmark 0 Ctrl+Shift+1-9 or Ctrl+K, 0-9
Go to bookmark Ctrl+0-9 or Ctrl+Q, 0-9
Module navigation (a name which appears to have been dropped from the documentation over recent releases). The keystrokes take you from a method declaration to a method implementation or vice versa (either keystroke does both jobs) Ctrl+Shift+Up or Ctrl+Shift+Down
Code formatting Ctrl+D
Indent marked block Tab or Ctrl+Shift+I or Ctrl+K, I
Unindent marked block Shift+Tab or Ctrl+Shift+U or Ctrl+K, U
Insert new GUID Ctrl+Shift+G
Go to line number Alt+G
SyncEdit. This is an awesome mechanism for intelligently updating an identifier name in a marked block. Also available via an icon in the editor gutter that looks like 2 pencils joined together. Ctrl+Shift+J
Open unit under cursor. Handy for looking at the VCL source when in a uses clause. Ctrl+Enter
Find references Ctrl+Shift+Enter
Insert compiler options at top of current file Ctrl+O, O
Delimiter match – pretty redundant in recent versions as the highlighting does this for you Alt+[ or Alt+]
Toggle case of marked block. For those of us who aren’t touch typists it’s very common to accidentally type quite a bit of text while Caps Lock is on. When you notice this just mark the block and use this keystroke. Ctrl+O, U
Delete word to left of cursor Ctrl+BackSpace
Delete word to right of cursor Ctrl+T
Delete current line Ctrl+Y
Start and stop recording keystroke macro Ctrl+Shift+R
Play back keystroke macro Ctrl+Shift+P
Comment current line or marked block Ctrl+/
Show list of open files Ctrl+Alt+F12
Incremental search. General search is no longer modal in recent IDEs Ctrl+E
Add to do item. I find this keystroke often gets mis-interpreted for some unknown reason, so I have to resort to a right-click in the editor followed by pressing E. To do list items (and the to do list itself) can be a handy way of keeping on top of notes regarding code you are building up. Ctrl+Shift+T
Move marked block mouse drag
Copy marked block Ctrl+mouse drag
Set focus to Tool Palette Ctrl+Alt+P
IDE Insight. The mother of all searching keystrokes – offers an incremental search through a whole bunch of parts of the IDE. Ctrl+. or F6

Form designer:

Select selected control’s parent Esc
Move selected component(s) 1 grid unit Ctrl+Shift+cursors or mouse drag
Move selected component(s) 1 pixel Ctrl+cursors or Alt+mouse drag
Resize selected component(s) by 1 pixel Shift+cursors
Lasso controls on a container (e.g. a TPanel) Ctrl+mouse drag

Object Inspector. Note that it’s quite possible to set a given property on a bunch of neighbouring components with very little mouse use. Select the first of the components (let’s say a bunch of buttons), click the target property (say the Caption property) and then click the first component on the form designer. If you simply type you will enter a value for the selected button’s Caption. Pressing Enter after having entered the value should take you back to the button on the form designer. You can use the cursor keys to then select the next button whose caption you want to set, then you can rinse and repeat as required. Additionally you can select the initial property by selecting the Object Inspector (F11), selecting the property name column (Tab) and then start typing the property name – it uses an incremental search. Tab then switches back to the property value column.

Select Object Inspector or go back to form designer or code editor F11
Switch columns Tab
Drop down component list Ctrl+Down
Switch between Properties and Events tabs Ctrl+Tab or Ctrl+Shift+Tab