Cygnes' Weblog

Friday, April 27, 2007

Editing HTML with TWebBrowser

Coltrui asked me if I knew any good HTML editors that can be used in a delphi application. I don't know any free components for Delphi for WYSIWYG editing. But I know the TWebBrowser has an edit mode.

So now it's time to get started on html editing with TWebBrowser. A few steps to get started:

1) add a TWebBrowser control to your application

2) open a webpage or an empty page.

ie. WebBrowser1.navigate('http://zinloos.be/wordpress');
WebBrowser1.navigate('about:blank');


3) Put TWebBrowser in edit mode.

(WebBrowser1.Document as IHTMLDocument2).DesignMode := 'On';

4) Start editing!

5) Save HTML to file

var
persist: IPersistFile;
begin
Persist := (WebBrowser1.Document as IPersistFile);
Persist.Save(StringToOleStr(ExtractFilePath(application.exename) +
'test.html'), True);
end;


These are some basics without special features. But you can select a part of the html text and press CTRL+B for BOLD, CTRL+I for ITALIC, CTRL+U for UNDERLINE.

Even creating a link with CTRL+K works great.

Labels: , , , ,

Thursday, April 19, 2007

Continuous Integration with CruiseControl.NET

Steve Trefethen recently posted two blog articles about "continuous integration". These posts get you on track setting up your own environment.

The links are:

CCNetConfig to help you create and maintain your CruiseControl.NET server

Video: Setting up a continuous integration environment

I was curious so I tried to setup an CI-environment. It was much easier than excepected. Now running 4 projects using CruiseControl.NET. There's one Delphi5 project and 3 Delphi7 projects. In a few weeks I will also try a Delphi2007 project with MSBuild.

I managed to synchronize the executables version information with the published label. For this I use my own command line tool that uses a template to generate a
version.rc, which can be build by brcc32.exe (resource compiler) and linked into the projects.

I bet there must be an easier way to do this, so if you have info about doing this just let me know.


I'm still having problems publishing the latest build to a network drive since I get an "access is denied" error. But I'm not logged on to the domain and that's probably the reason why it doesn't work.

[update]
Changing the service login account to my user account fixed the problem.
[/update]

Here you can find an article about continuous integration by Martin Fowler

Labels: , , , , ,

Thursday, April 12, 2007

Open Tools Api

Jeremy North wrote an article about extending the project manager context menu. It's great to see more attention to the open tools. He hopes to write more than one article. So I sure have to keep an eye on his articles. Very interesting indeed.

Labels: , , ,

Wednesday, April 11, 2007

Execute Delphi code from javascript using TWebbrowser

I just bumped into some really neat code. This code allows you to integrate your delphi application with the TWebBrowser component. You just hook in your application as the host of the TWebBrowser component. This will allow javascript to use your Delphi functions. It's like the welcome page in the Delphi IDE.

Just check out this link on www.delphidabbler.com

Labels: , , , , , , , ,

A little bit about me

I was born in 1977 in The Netherlands and currently living in Belgium. I started to do some programming in Basic somewhere back in the late 80s on a GoldStar MSX. But finally got a pc in early 90s. I started doing pascal coding using Turbo Pascal v5.5. While at school we learned pascal programming in version 3! I was glad to move on to Borland Pascal 7.0. Together with a friend we started coding packet radio software for Citizen Band (27Mhz). Which was used by several hundreds of people world wide. In 1998 it was time to learn delphi. I've used several delphi versions: 3, 4, 5 and 7 and Turbo Explorer. We are still using Delphi 5 and 7 at work, but they have purchased Delphi 2007, so I can't wait to start using that one.

I've downloaded the trial of 2007 and I really enjoy working with it so far.

Labels: , , , , , , , ,

Tuesday, April 10, 2007

The Delphi Hour

Stay tuned for the Delphi Hour. A live broadcast from ScottsValley, California by Nick Hodges.

Get the latest news about CodeGear and Delphi. This all during live broadcast.

Delphi Hour page

Also check out Audio & Video at the CodeGear Developer network.

Labels: , ,

Let's get started

Okay,

The weblog will be focussed on Object Pascal (also known as Delphi), but CodeGear is now refering back to Object Pascal as a language and Delphi as the tool to build the applications.

My current environments are:

at home - Turbo Delphi Explorer
at work - Delphi 5, Delphi 7 and soon Turbo Delphi Pro and Delphi 2007.

So far my first post, more information about myself will soon be online..but I have to get started somewhere.

Labels: , , , , , ,