
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:
e4506bec-269f-4932-8ad3-fa01e3e64901|0|.0
Tags: VCL
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.
f3d62d6a-a9d4-418c-9dd3-491df3806e99|0|.0
Tags: Delphi, RTL, VCL
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.
13c8522e-7f00-426a-bffb-6602c0358b07|0|.0
Tags: Delphi, VCL
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:
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.
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.
I was just reading
this article over on
delphi.about.com about getting forms to snap to the edges of the screen. Since at least Delphi 7 this functionality has been built into the VCL and is available through two properties on TCustomForm called ScreenSnap and SnapBuffer.
- ScreenSnap is a boolean and toggles the feature on/off.
- SnapBuffer is the distance in pixels from the edge of the screen that you want snapping to occur, the default is 10 pixels.
3f5ca9bf-b90c-43cd-befa-33e6a1c30197|0|.0
Tags: Delphi, VCL
If you're a developer who uses the TWebBrowser
component I'd highly recommend you download and install
IE7 RC1 and put your
application through it's paces. We've been testing our shipping products namely,
C#B 1.0,
Delphi 8, BDS 2005
and BDS2006 which use the IE rendering engine for the HTML/ASP.NET designers and
have run into problems ranging from minor to very serious and I imagine any
applications that leverage the
MSHTML
control share similar risks.
Quoted:"...and have run into problems ranging from minor to very
serious and I imagine any applications that leverage the MSHTML control share
similar risks." - regarding the IE7
update
I've read that IE7 will be
distributed as a high priority update via Windows Update meaning for many it
will be installed automatically though I'm not sure if that decision is set in
stone. One thing that is clear is that MS is still in the beta test period of
the development cycle so there is potentially time left to get problems
addressed although they've reached a Release Candidate milestone (RC1) and I'd
guess the window is closing rapidly.
Look here for IE
support information.
If you've either already done testing or used our products which have been
impacted by this latest release I'd certainly be interested in hearing from you.
Also, please be sure to communicate your problems to Microsoft, we're currently
in the process of doing just that.
Updated: Sept. 1, 2006
I've been working with a very helpful Program Manager at Microsoft to try and
resolve some of our IE7 issues and they gave me the following information
regarding an Access Denied issue in BDS after installing IE7.
I received more information on the Access Denied Error. After
further investigation, it looks like this is an issue with the object caching
feature, which was enabled by default for all applications in IE7.
To
resolve the issue, we recommend turning off this feature for your applications
with the FeatureControl keys. Information on how to do this is available in the
MSDN article:
Security
and Compatibility in Internet Explorer 7.
Tags: borlanddelphiIE7Internet ExplorerMSHTML
9218b2f3-a41e-4ab3-b06d-c2811005a28b|0|.0
Tags: VCL