Steve Trefethen
Contact me Send mail to the author(s)
About Me
View my LinkedIn profile


Powered by discountASP.NET
referal ID: sdtref
Why recommend discountASP.NET?

Archives
Tags
Disclaimer
The posts on this weblog are provided �AS IS� with no warranties, and confer no rights. The opinions expressed herein are my own personal opinions and do not represent my employer�s view in any way.
# Thursday, May 31, 2007

Mashup of Google Maps and VCL

Posted @ 12:53AM

Categories: VCL

Tags:

In light of Google Developer Day, which I'll be attending tomorrow, I thought I'd be fun to post a teaser about a little VCL mashup I've been working on where I've created a descendant of TWebBrowser to render a Google map with two-way interaction between Javascript  and the VCL. The "trick", at least in this case, is using IDocHostUIHandler.GetExternal and connecting the ppDispatch parameter to a Pascal object from the VCL application which exposes application functionality to the Javascript running in the browser control. The screenshot is a standard VCL TForm application with two TButton's, one places a marker on the map at a particular longitude/latitude and the other pans the map to a specific lat/long. Once placed, clicking the marker causes the form's caption to update with text passed from the original button click. The Pascal code is particularly interesting to me because the concepts are very similar to code developed for the Zombie Test Automation framework used back in D3 days. Similar code is used in the IDE's welcome page to handle opening of projects from the browser control.

If there is interest I'll look to blog about this in more detail so let me know what you think.

Have you done any interesting VCL/web mashups?

Nitpicker's corner (with apologies to Raymond Chen for borrowing the name):
I understand this may not fit the classic definition of a "mashup" but it seemed fitting to me.

[UPDATE: April 2, 2008] Related links:

# Monday, April 02, 2007

VCL and RTL enhancements since Delphi 7 (D7)

Posted @ 11:47AM

Categories: Delphi | RTL | VCL

Tags:  |  | 

Nick Hodges put together a list of changes to the VCL since D7 and I thought I'd pitch in and help expand since it only includes a few of the high level items. I'll try and avoid duplicating items Nick's list (no guarantees). This is by no means an exhausive list and does not include bug fixes nor does it mention cases where we've made numerous methods virtual/protected to better enable descendant classes.
  • New TDragObject properties AlwaysShowDragImages and RightClickCancels
  • New TDragDockObject properties EraseDockRect and EraseWhenMoving
  • New classes TCustomControlAction, TControlAction, TCustomTransparentControl, TColorListBox, TTrayIcon
  • Many new methods on TControlActionLink for binding to additional properties on TControls
  • New Control States: csDesignerHide, csPanning, csRecreating, csAligning
  • New Control Styles: csPannable (mousewheel support), csAlignWithMargins
  • New events published throughout VCL: OnMouseActivate, OnMouseEnter and OnMouseLeave now with reliable enter/leave detection
  • New events on TWinControl OnAlignInsertBefore and OnAlignPosition for use with alCustom alignment style
  • New TWinControl property MouseInClient
  • New TDragImageList property DragHotSpot
  • New TDockZone property ChildControl
  • TDockTree has many new methods for better mouse support
  • Improved double buffered painting performance
  • Updated appearance with gradient painting support for TControlBar
  • New events on TControlBar BeginBandMove/EndBandMove
  • New properties on TControlBar CornerEdge, DrawingStyle, GradientDirection, GradientStartColor and GradientEndColor
  • New property on TColorBox: OnGetColors
  • New properties on TCustomForm: PopupMode, PopupParent
  • New properties on TScreen: CursorCount, FocusedForm, SaveFocusedList, PrimaryMonitor
  • New properties on TApplication: ActionUpdateDelay, ActiveFormHandle, MainFormHandle, MainFormOnTaskbar, ModalLevel, ModalPopupMode, PopupControlWnd
  • New events on TApplication: OnGetActiveFormHandle, OnGetMainFormHandle
  • Improved drawing support meaning less flicker for many controls throughout VCL
  • Constants for standard web colors added to Graphics.pas
  • RGB conversion routines for working with web colors/color names
  • New Pen Styles: psUserStyle, psAlternate
  • New property on TFont: Orientation
  • Enumerator support on numerous classes throughout VCL for use with "for...in"
  • New property on TOleControl: ServiceQuery
  • New action: TBrowseForFolder
  • New property on TLabel: EllispsisPosition
  • New property on TComboBox: AutoCompleteDelay
  • New property on TListBox: AutoCompleteDelay
  • New properties/events on TTabSet: Images, ShrinkToFit, TabPosition, OnGetImageIndex
  • Numerous ActionBand menu enhancements
To elaborate on Nick's FastCode mention there is the following on the RTL side:
  • New high performance memory manager
  • FastCode routines:
    • Move
    • _FillChar
    • _LStrCmp
    • Pos
    • __lldiv
    • UpperCase
    • LowerCase
    • CompareStr
    • CompareMem
    • CompareText
    • StrLen
    • StrCopy
    • StrComp

  • Numerous inlined routines throughout the RTL
[Update: Mar 2, 2007] Fixed typo.
# Monday, March 19, 2007

Delphi 2007 VCL Designer Theme Support

Posted @ 7:38AM

Categories: Delphi | VCL

Tags:  | 

In the Delphi 2007 IDE, we enabled Windows theming which serves to upgrade the appearance of the entire IDE leaving behind the more classic Windows style. In fact, all new VCL applications in Delphi 2007 have themes enabled by using the new "Enabled runtime themes" checkbox on the Applications page of the Project Options dialog. This means you no longer have to add either the XPMan unit to your uses clause nor drop a TXPManifest component to theme a VCL applications.

Unfortunately, theming your application isn't always a trivial task because not all 3rd party or custom controls behave properly when themed not to mention it can potentially really slow your application down if it wasn't written with themes in mind. We recognize this and have built the Delphi 2007 VCL designer so that it will properly displays your controls depending whether "Enable runtime themes" is checked for your project.

For example, here is a screenshot with a "Enabled runtime themes" checked:

And the same application with themes disabled:

In addition, we've made numerous improvements to VCL to help reduce flicker and improve performance particularly when DoubleBuffered is enabled. Since this release is interface compatible with BDS 2006 there are additional changes which have to that will have to wait for the next major release.

[UPDATE: March 19, 2007] The IDE caption says "Highlander" because this is my developer build which includes all personalities and HL related bits.

# Tuesday, March 13, 2007

Writing native Win32 applications for the Windows Vista Aero UI

Posted @ 4:56PM

Categories: CodeGear | Delphi | VCL | Vista

Tags:  |  |  | 

If you're a Windows developer and your looking to write native Win32 applications that support Microsoft Vista's new Aero UI you're sort of on your own right now. If you're a Visual Basic 6.0 developer you'll need to "roll your own" solution since Microsoft has moved to .NET. If you're an MFC developer, based on a few Microsoft blog posts, it appears you'll have to wait for the Orcas release of Visual Studio which Scott Guthrie has said will be shipping sometime in the second half of 2007 though it's unclear, at least to me, what level of support is actually planned and I've Googled all over looking.

In Delphi 2007, which CodeGear has announced to be available in Q1, you will not only be able to develop new Win32 applications that support Aero but you'll be able to update exising VCL applications as well. There has been a lot of work on the VCL to support Vista including the Aero UI, the common dialogs, the TaskDialog API. Allen has a nice write-up on how we implemented some of these changes without breaking existing unit compatibility with BDS 2006

Here is a screenshot of Delphi 2007 VCL application I threw together illustrating the new Aero support:

VCL application with Windows Vista Aero UI support

Of note in this screenshot is the Glass UI which extends into the client region of the form, the new style listview/treeview controls, the gradient toolbar style and the combobox style.

# Friday, December 15, 2006

Do you have issues running Delphi or VCL applications on Windows Vista?

Posted @ 2:50PM

Categories: Delphi | VCL | Vista

Tags:  |  | 

As we continue work on our next release I thought it would be worthwhile to mention that if you're encountering issues related to running either the Delphi IDE or your VCL applications on Windows Vista that now is definitely the time to let us know. Please post any issues to QualityCentral. You're more than welcome to leave comments here but if you want the issue fixed you definitely need to submit it to QC.

[Update: Feb 12, 2008] I'm no longer employed by CodeGear so I'd refer you to this post for how to get your Delphi questions resolved.