Monthly Archives: May 2007

Mashup of Google Maps and VCL


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:

Microsoft Surface looks very impressive

Dan Miser’s has already mentioned it but Microsoft Surface was announced today and looks very, very interesting. I can envision lots of applications of this technology though I’ve read a $10K price point obviously putting it well out of reach for the average Joe at least for the time being even though the videos portray it being used in a home setting.

I’d like to see this kind of technology applied to software development and can imagine a bunch of developers sitting around the table and actually sketching out UML, designing forms or Popfly mashups. I’ll be interested in reading a Tom’s Hardware type of review of the device.

Community Blogs featured on CodeGear.com

I see Marco is now featured on CodeGear.com along with Mike Pence and Hallvard Vassbotn. I think it a nice gesture for CodeGear to reach out to the blogging community and highlight some great blogs. I was one of the people contacted when they were looking for recommendations so it’s good to see this finally happen. My blog used to be listed there along with Joe, Allen and Nick’s but that’s no longer the case. Ah, the price to be paid for getting my own domain.

That’s ok, today marks my highest RSS subscriber count to date (775) so thanks to all of you who have subscribed even though my blog isn’t hosted on the CodeGear blog server. Btw, if you haven’t subscribed now’s your chance. 🙂

My list of Podcasts

There are a few podcasts I listen to either at work or occasionally in my car with the less than stellar MP3 player of my $g(Motorola KRZR) though my commute is short enough to negate that effort most days, btw I’m still shopping for a bike so that may change soon. I own a $g(4G iPod) though I’ve lost control of it to my three year old and it now permanently resides in a JBL On Stage cradle on her bookshelf.

Anyway, here’s my list in no particular order:

For non-tech podcasts really the only one I listen to regularly is:

What, if any, podcasts do you listen to? Is there anything good I’m missing? Also, what download software do you use? I’m using iTunes but I’d readily give it up for something better.

Hi, I'm VCL and I'm WinForms

 
VCL: Hey, WinForms how’s it going?

WinForms: Oh, being here on Vista is great. VCL, what’s up with your Form?

VCL: Yeah, that. That’s my new SheetOfGlass property, part of my native support for Windows Vista UI in Delphi 2007.

WinForms: Ah, so you’re specific to Windows Vista. Well, not me.

VCL: Well, no. With just one Delphi executable you’re good to go on Win98/ME, 2000, XP, 2003 and Vista.

WinForms: Just one file?

VCL: Ah yeah, what about you?

WinForms: Uh, well…, I need the .NET framework 2.0. And that needs IE 5.01. Oh, and Windows Installer 3.0 (except for Windows 98/ME, which requires Windows Installer 2.0 or later). Though Windows Installer 3.1 or later is recommended. Oh, whatever, here‘s the rest.

VCL: Yowza.

Hey, it’s Friday afternoon before a long weekend and with all the “I’m a…” ripoffs I just couldn’t resist. 🙂

Ruby IDE public beta test available from CodeGear

The JBuilder team is hard at work on building an IDE for Ruby which is now available for beta testing. You’ll need to create a CodeGear Developer Network account to join though it’s pretty easy as those things go. Joe McGlynn is the Product Manager and he’s got a lot of good content on his blog related to Ruby so be sure to check it out. The official press release is available here.

Here is a list of key features:

  • A complete IDE with full support
    for Ruby and Rails, enabling advanced development features such as Code
    Completion, Refactoring, type browsing and navigation
  • Innovative new “Commanders” that uniquely merge the power of
    the command line with the ease of use and productivity of the IDE,
    Wizards and Code Insights
  • Dependency visualization and navigation to seamlessly work
    with all resources regardless of their relationship, location or format
  • A full set of development and deployment modules including Ruby, Rails, Gems and Database

[Updated: May 23, 2007] Change CodeCentral -> Developer Network. I used the wrong name.

Automatically expand listview columns to the size of their content

Windows File Open dialog
Click for larger view.
Arrow indicates where you need to double click.

This should probably be filed under “Did you know?” Over lunch I was talking to Mark Edington about various UI-isms and he mentioned how the listview column header on Vista has no visual indicator for the splitter between columns. Specifically, he wanted to use the mouse to resize the column headers to so he could see all of the text from the items contained within that column. I mentioned the fact you can double click the splitter to automatically expand the column to the width of the content and he was like “Huh?! Is that just on the File dialog?” Nope, you can double click the splitter on any column header on any standard listview in windows and it will size to the width of the content. He said, “dude, that’s something to blog”. 🙂

[Update May 22, 2007] This is too good not to add to this post. Via Eric van der Gaag pressing Ctrl-+ (Plus key from the keypad) will adjust the size of all the columns in the listview at once! Thanks Eric.

Note to RSS feed readers of my blog regarding temporary items, their from Windows Live Writer

I use Windows Live Writer to post to my blog and it has a nice feature which allows my to write entries in the style of my blog so I can see what they look like immediately. When I change my site’s stylesheets I can select View|Update Weblog Style… and it will download my styles automatically to match my blog. Well, if you read my blog via RSS as does www.delphifeeds.com you may occasionally see entries from my blog which look:

Temporary Post Used For Style Detection (812027f7-29d4-4be6-9114-84b79a5a090d)

With text indicating the item is just temporary and should be deleted. This occurs as a result of updating my blog style in Windows Live writer and this temporary items exists for a very brief period of time. The upside is that this isn’t something that happens all that often though my apologies if you wind up seeing these entries even briefly.

Disabling Windows built-in zip file support on XP and Vista

In this post, I discussed a problem with the built-in ZIP file support included with Windows Explorer. A comment from that post mentioned simply disabling this native support and thus I thought it might be a good idea to mention how go about doing just that. Under Windows XP you can use the following command line from a Command Prompt:

regsvr32 /u %windir%\system32\zipfldr.dll

Of course, you can always re-register support by executing the above command without the “/u”. While that may work under XP it fails under Windows Vista, go figure. If you run regedit and open up HKEY_CLASSES_ROOT there is a long list of file extensions with information about the various associations and such used by Windows. If you locate “.zip” you can see that the default value is “CompressedFolder” from there you can search for a CLSID that has the same default value and you’ll find:

HKEY_CLASSES_ROOT\CLSID\{E88DCCE0-B7B3-11d1-A9F0-00AA0060FA31}

WARNING: The following discusses steps for editing your Windows Registry. If something should go wrong you’re on your own. You’ve been warned!

First, export the above key before touching it at all so you have a backup. Next, if you delete this key you will effectively disable the built-in ZIP file support for Windows Explorer.

Code to help generate MSBuild compatible output

MSBuild console output

When the Delphi team switched it’s build process to MSBuild and started running Zombie under a Continuous Integration Environment the test automation framework also had to be updated to output MSBuild style errors. MSBuild recognizes errors which follow a specific format allowing it to colorize them as well as report them back to the calling process. Without proper error formatting MSBuild will simply continue merrily along without the slightest clue something might have failed.

Here is a zip file that contains a small Delphi unit which implements an MSBuildStr function with multiple overloads to help you create MSBuild compatible output. The zip also contains a simple console application which illustrates calling the MSBuildStr functions and a MSBuild .proj file that allows you to test the output. This unit doesn’t cover every single form of MSBuild style output but it does cover some of the most common uses. To test the sample console app:

  1. Extract the contents of the zip file to a directory if your choice
  2. Build OutputTest.dpr
  3. From a command prompt CD to the above directory and execute:

    %SystemRoot%\Microsoft.NET\Framework\v2.0.50727\MSBuild.exe make.proj

You should see output similar to the above picture. Feel free to use/change/improve/tweak this code however you like.