What’s New in Delphi?

Someone didn’t plan very well. There were people standing in the aisles, because there weren’t enough chairs in the room. Heck, there wasn’t enough space in the room. Several people I’ve talked to have wondered why they didn’t have it in the same big room where we had the opening keynote, since the majority of conference attendees are going to be interested in the new version of Delphi.

 

But anyway. Here’s Allen Bauer‘s session, “What’s New in Delphi?”

What’s New in Delphi?

  • C++Builder & Delphi support for C++
  • VCL Designer & HTML Designer
  • Block completion
  • Live templates
  • Editor enhancements (gutter, change bars, line numbers, etc.)
  • New debugging functionality
  • Together design-only projects (no code behind them) – you can just create diagrams to visualize stuff
  • New refactorings

RTL

  • Memory manager (both Delphi and C++, thread-aware, minimizes contention, helps with fragmentation, significant performance boost – replacing memory manager in IDE reduced startup time, at the time, from 20 seconds to 12 seconds)
  • RTL functions from FastCode project
  • Inlined RTL functions, like Length(string) — “incredible” increase in performance

VCL

  • New components (TGridPanel, TFlowPanel)
  • Margins & Padding
  • Align with margins
  • Intellimouse / Mouse wheel (click-and-scroll for pretty much anything with a scrollbar, just by including one unit)
  • Tray Icon component (in the VCL, not just a sample – and they fixed it)
  • Gradient support in TToolBar and TControlBar
  • Mouse Enter/Exit events (that are reliable πŸ˜‰
  • New PopupMode property on TApplication, to deal with TForm.PopupMode issues from Delphi 2005. Default is Delphi-7-and-before behavior, so you have to be explicit when you want to fix stacking stuff.
  • Fixes and more fixes… (QC)

IDE – Delphi support for C++Builder

  • C++ devs used to have to do various magical incantations to generate all the support files (HPP, LIB, BPI) they need from a component package. Now one compiler option (-jl) that generates all that stuff.
  • Component palette now filters components: C++ Only, Delphi Only, Delphi & C++. No, C++ components won’t work in Delphi (right now), so it won’t actually let you drop them on a design surface (since your app wouldn’t compile). Also, Delphi components that aren’t built with C++ support files won’t be available when you’re designing a C++ app.
  • VCL designer guidelines!
    • New Padding and Margins properties control the distances
    • Top, bottom, & baseline alignment
    • Extensible – component devs can define their own guidelines (e.g., if you have multiple text baselines, or other alignment points)
  • HTML designer
    • Markup preservation: leave my HTML alone! (now does a “pretty good job” of that)
    • Error Insight inside the tag editor
  • Block Completion and LiveTemplates
    • type “TMyClass = class” and hit Enter. It adds the “end;” for you. (Also for record. Presumably for interface as well?)
    • type “var” inside a method body, hit some magic keystroke (Tab?); a variable declaration appears right there on that line. Fill in the name and type, do something else magic, and that declaration jumps up into the “var” section of the current method.
    • “Surrounds” template: wrap selection in a region. Template is itself a LiveTemplate, so you can tab to the different fields.
    • Templates pane in IDE – select code, double-click “(*” in the list.
    • Space for autocompletion, Tab for manually handled; some have to be manually invoked (like Surrounds).
    • Templates are also part of Code Completion. Hit Ctrl+Space, and you’ll see “(*” in the list.
    • File > New > Other > Code Template. Give it a name and description, author, specify the language (“Delphi“), put the code in the CDATA, save it to the right magic location, and it should just work. Define jump points (how?). Open existing templates and see how they work.
    • Templates know where you are in your code – context-aware.
  • Editor enhancements
    • Uncluttered look
    • Gutter is smaller than before; icons try to stay out of each other’s way, but will overlap a bit when they have to
    • Change bars. Yellow = changed since last save; green = saved, but changed since last open.
    • Line number shows on every tenth line, as well as current line. (Configurable)
  • Intellimouse clicking works in IDE editor (as well as in apps you write, if you want it)
  • Debugging features
    • Treeview-type drilldown/expansion inside tooltip expression hints
    • Treeview drilldown in Locals view, Watch view
    • Enable and disable watches
    • In-place editing in Watches window
    • Remote Debugging will be back
    • When a file is opened because you stepped into it during debugging, that file’s tab shows a different icon so you can see it was implicitly opened. Then when you stop debugging, they go away! (Won’t close the currently active file.)
  • CodeGuard (C++ only) completely rewritten and revamped
  • Demand-loading of things like Together support (so, faster startup time)
  • New refactorings: Delphi
    • Change parameters (add, remove, change type; will try to modify callers, or flag them as needing manual attention). Add: specify default value.
    • Push Up / Down Method
    • Extract Superclass for a group of classes
    • Introduce Field / Variable
    • Safe Delete (makes sure nobody is using it)
    • Extract Interface
  • C#Builder refactorings gets all the same refactorings
  • C++Builder just gets Rename refactoring in this release; more to come later
  • RTL – what’s new?
    • High-performance, thread-safe/aware Memory Manager
    • Win32 only
    • Based on FastMM4 by Pierre le Riche
    • Intelligent thread locking. Old memory manager was designed for interactive UI on a single processor, and got contention on multithreaded server apps. New guy is better.
    • Fragmentation resistant
    • Replaces old Borland memory manager
    • Just recompile to get new memory manager
    • Can use external memory manager to get diagnostics, etc.
      • May be able to detect when you access memory that’s already been freed??
  • New RTL functions from FastCode project
    • Move, Pos, PosEx
    • CompareMem
    • StrCopy, StrComp, UpperCase, LowerCase
    • Power, ArcCos, ArcSin
  • Length() is now inlined
    • Eliminates the call overhead for checking string lengths
    • Does this apply to Length(dynamic array) too?

VCL – new properties

  • Margins
    • Defines a “no fly” zone *outside* the control
    • Used for designer guidelines
    • Defaults to 3 pixels
  • AlignWithMargins
    • As the name implies – uses Margins for alignment (alTop, etc.)
    • Margins never violate other margin space
  • Padding
    • Defines a “no fly” zone *inside* container (the inside of the padded cell)
    • Only on containers (TForm, TFrame, TPanel, etc.)
    • Defaults to 0 pixels, so there’s no need for an AlignWithPadding
    • Guides see that it’s 0 and fake it up to 5 when you’re dragging in design mode.
  • Guidelines do go outside the parent – can drag-align buttons on two different panels.
  • You can install a design-time package and redefine how you want guidelines to work. So if you want to use the larger of two margins, instead of adding them, then you can write a package to do it.
  • GridPanel
    • Select it, double-click a control in the Palette, it puts it into the top-left cell. Double-click in the Palette again, the control goes into the next cell in the grid panel.
    • Flickers a lot at design time because it’s got to draw the grid lines. Better at runtime.
  • Can copy/paste between VCL and VCL.NET design surfaces.
  • FlowPanel
    • Works well in combination with child controls’ AlignWithMargins
    • Can change flow direction
    • No hard returns

Leave a Reply

Your email address will not be published. Required fields are marked *