Thursday, December 29, 2005

Built, Designed, Powered - Borland Developer Studio 2006

So far, I have only seen images that display for one of the personalities, like Borland Delphi or Borland C++Builder. The best of those collections/arts can be found at Dragon Soft. However, I wanted to have some icons that can be displayed for the Product as whole, for the Borland Developer Studio 2006. So I created some. I am sure more will come. Download them, distribute them, use them, copy them as you like and help pushing the Borland Developer Studio out into this big world.

Built with Borland Developer Studio 2006 Designed for Borland Developer Studio 2006 Powered by Borland Developer Studio 2006


And do not forget, I like the original ones, it's just that they do not target the whole product yet.

Sunday, December 25, 2005

Code Templates: Define the Cursor Position

Today I was asked how you can define where the cursor will appear after the code template editing was done. Imagine a simple template, which only will add following code.
begin

end;
Now, you would like to position the cursor (shown as "|") as following after invoking the template.
begin
|
end;
The XML template for that task is rather easy, let's say you have not defined any delimiter character, so the IDE will default to the dollar "$" sign. Then you would define the template like the following snippet.
<code
language="Delphi"
context="methodbody">
<![CDATA[begin
$selected$$*$$end$
end;]]>
</code>
If you want to use another delimiter you can simple declare it with a delimiter attribute like the following code snippet will show.
<code
language="Delphi"
context="methodbody"
delimiter="|">
<![CDATA[begin
|selected||*||end|
end;]]>
</code>
I hope that this will help you in your endavours in creating new code templates.

An afterthougt: Why does that work and why do you need to write |selected||*||end|. Well, in my template I have setting surround="true". Why? Simply, you can select some code in your editor and call that template from the Surround -> context menu point.

The editor will now take the selected code and place it into the place designated by |selected||*||end|. If no code is selected, when you invoke the template, the IDE will simply put your cursor there, because it is the selection by itself. ;-)

Saturday, December 24, 2005

Delphi Community Meeting Germany

After this years success, we have planned the next Delphi Days (GE: Delphi Tage). The users of the three largest German speaking Delphi communities, as well as Delphi users from Germany, Switzerland, Netherlands, and Austria are coming to Frankfurt on February 18th 2006.

Directly following the BASTA event, at the same location we will present you well known speakers who will bring you up-to-date on Delphi 2006. Jason Vokes (Borland UK) will come and talk about the future of Delphi, Daniel Magin and Bernd Ua (both Borland Germany) will show you the current version of Delphi 2006 with Together, Luca Giannone (share-it / Element 5) will talk about successful shareware marketing, David I (you know him) will talk via video conference, and Egwin Braganca (Borland Germany) will host a discussion.

A big lunch and coffee breaks will be served in between the sessions, a Q&A session will help you with your problems, and a raffle with many prices (Delphi versions, iPods, Books, ...) will guarantee you much fun.

Come and have fun. More information at the official site Delphi-Tage in German and at Borland EventCentral in English.

I hope to see you there :-)

Happy Holidays

I just want to wish all of you happy holidays and a very successful new year.

Sunday, December 18, 2005

DeskBands with Delphi

Last week, Borland Germany has published my article on Creating DeskBands with Borland Delphi. The source code is available at Borland CodeCentral. Since all, comments in the sources as well as the article is in German I want to give you a few points here. Please forgive me for not translating the article in whole, yet.

What are DeskBands anyway
Well, most of you probably know the quick start bar which comes with Windows XP and/or Internet Explorer 5 to your older versions of Windows. Many of you will even know the way Media Player docks into that very same Windows task bar, or the Google Desktop Bar. All those are built using the same technology: DeskBands.

What do you need
Basically Delphi 4 would help for starting a project. The sample at CodeCentral us built with Delphi 2005. Further I do strongly recommend some virtual environment such as Virtual Machine or MS Virtual PC for testing. This is much faster than doing it on your development machine.

Frist Steps
Start a new ActiveX Project and add a Type Library to it. Now, we need to import the SHDocVw.dll into the project using the ActiveX Import Wizard. Our desk band needs to implement different interfaces, from the imported library as well as from the ActiveX unit.

IDeskBand
This interface is our main candidate. The implemented methods allow us to define our deskband, its title, size, kind, etc.

IPersist, IPersistStream
Those interfaces help us to save the state of the deskband between user sessions. Further does Windows only persist global information (like position, size) of the deskband when tohse interface are declared in our deskband.

IObjectWithSite
A lightweight protocol that allows us to integrate with a host container such as the Windows taskbar.

IContextMenu
I guess the name speaks for itself. It allows us to extend the default context menu.

IInputObject
Some user action, like using the tab key, we want to be handled just as other Windows deskbars do, therefore we need to override some default container behaviuor using the methods of IInputObject.

Installation and Removal
Deskbands are installed using the MS Windows regsvr32-Tool.
regsvr32.exe {Path to DLL}\DemoDeskBar.dll
Uninstalling goes similar using the /u switch.
regsvr32.exe /u {Path to DLL}\DemoDeskBar.dll

Usually you will have to reboot after uninstalling the DLL before you can delete/replace it.

Well, as said above, this will be a short overview only, but most of you will do fine looking at the sources ;-) So have fun and drop me a line if you feel like it.

Saturday, December 17, 2005

RAVE for the Programmer

Yesterday was great! Thomas Pfister, member of the Team Nevrona and one of the greatest experts on RAVE gave a lecture yesterday in Frankfurt. Planning, as I was told, took three years to get four people together (and two more, as it turned out in the end) for some technical meeting somewhere. Well, as mentioned above, it turned out to be in Frankfurt (as location) and on RAVE (as topic). While I have toyed with RAVE in the past and done some things with it, I was (okay, still am) far away from really understanding how RAVE worked. As I wrote before, once you start to understand what RAVE con give you, you will start to phathom the power off it.

Yesterday was "just another" of those experiences. I was, once again, baffeled by the power of it, and if you are going to believe Thomas, there is so much more you can do with RAVE... don't start dreaming, imagination wont last (in most cases anyway).

Now, as I am into web server programming often for intranet and extranet, I can hardly wait for RAVE for ASP.NET (best would be .NET 2.0 right now) to arrive. Giving the user the report he wants in all different formats (HTML, XML, PDF, ...) he could possibly need is just so easy. Cool!

Now, if I would be able to start working with RAVE... there you have a tool with a steep learning curve. So, if you need reporting, please try out RAVE, the time you invest to get started will repay with the first reports you are going to deploy and all those formats you can extract. And do not forget, there are many places where you get add-ons for RAVE to expand the power within it to yet another level.

Thursday, December 15, 2005

Welcome Page Feature: Favo(u)rite Projects

Hi, first off, the Welcome Page calls the "Favorites" as the American English does, not "Favourites" as in the British English. So let's see. I prepared four screen shots for you. The first shows the normal recent project detail page. Each project there has a link called Make me a Favorite.
Make me a Favorite

Sorry, it will not boost your sales among your client base, but the link will disappear once you click. At least something ;-)
I seem to be your Favorite

Well, the project detail page, I decided, will not be configurable, and therefore allways display the full information. However, since you usually know your favorite projects pretty well, the Favorite Page will not show all those details, but simply a list with each project and their last change date/time.
Two Favorites so far.

And, you can kick each favorites butt, by clicking on that [x] besides its name and it will not be a favorite any longer :-(
I am your only Favorite

The length of your favorite list is limited by your computers power only (and yours in scrolling through it). I am still thinking about some auto-ordering, either by names, or last access. We'll see.

And, did you notice Athene in the back, yes she made it into the page. :)

Sunday, December 11, 2005

A Video on Class Operators

Today, Daniel R. Wolf has published a second video on Borland Developer Studio 2006. This version is about the new class operators, introduced to the Delphi Language. Usually examples for class operators are shown on complex numbers, but Daniel took an example much easier to follow without in-depth math knowledge: times.

The videos are in German available at the Delphi-PRAXiS Video Page.

Thursday, December 08, 2005

FastMM, DLLs, and strings

Funny, I just asked myself yesterday what I should do when creating a DLL which will share strings and/or dynamic arrays with the main application exe-file. Today, before I even had time to investigate that setting, look at the help, or even ask Pierre the same question came up in the Borland public non-tech news group.

The solution is simple (Pierre le Riche):
All you need to do is add SimpleShareMem.pas as the first unit in the .dpr
file of the exe as well as the dll (as you would have done with the old
sharemem.pas) and you can then safely share strings and dynamic arrays
between them. You don't need the borlndmm.dll if you use the SimpleShareMem
unit.


Good to know, thanks Pierre for answering before I have even asked you ;-)

Wednesday, December 07, 2005

Nothing is perfect, though we are getting close

Today, I came back to my office computer running Borland Developer Studio 2006. Currently, I am working on a VCL application for Win32, since BMW still has not even allowed .NET 1.1 projects for deployment. Who is crying for .NET 2.0 needs to be here already? Well, I would like that too, but anyway, back to the topic.

When I started up Delphi 2006 this morning and loaded my current project into the IDE it automatically loaded one of the forms. Okay, good so far, but where did all those non-visual components go?
Components missing


on the verge of panic, it is the RTM release I have installed, I clicked with my mouse into the form and "hey!" there they were.
Components are back


I have heard of this problem before, but never have seen it myself. So here I am, even being able to reproduce it with my project. So, I'll pack it up and will be going to QC it in the coming days.

Tuesday, December 06, 2005

Huw Collingbourne on Delphi 2006 and .NET

Today, Ryan McGinty uploaded a link an interesting article on a debate on .NET in the public Borland Delphi news groups. Huw Collingbourne said the following about the new release of the Borland Developer Studio 2006.
I agree with you to a large extent - the editing and debugging environment of Visual Studio is excellent. The debugging tools in particular are much better even than those in my beloved Delphi. However, speaking of Delphi… I wonder if Borland now has a realistic opportunity to offer competition to Microsoft? With the new release of the Borland Developer Studio, you’ll have the option of coding in C++ for Win32, C# for .NET and Delphi for .NET (Win Forms). Moreover, Borland has a powerful class library (VCL) that works pretty well on both Win32 and .NET. That’s why some VB developers are looking to Delphi as a serious alternative. Unlike VB, which commits you either to Win32 (VB6 and its predecessors) or .NET (VB .NET), a Delphi Win32 VCL application can be recompiled for .NET with few (or if you are careful, with no) modifications to the source code. In principle it seems to me that Borland’s .NET solution is essentially better than Microsoft’s.
Now, that let's one hope for great times to come, doesn't it?

Monday, December 05, 2005

Videos on Borland Developer Studio

Daniel R. Wolf has started publishing Flash Videos on Borland Developer Studio 2006. He will probably concentrate on the Borland Delphi 2006 personalities. His first video is a 10 minute introduction to some of the new features awaiting you.

Watch them at the Delphi-PRAXiS (German narrations though).

Good stuff, check back in the next weeks for more videos to come.

More on creating Live-Coding Templates

This time I will not show you a fancy Live-Coding Template, but want to let you in on what types you can use for them and how to do that.

Actually, it is rather simple to create new templates. In the View menu of Borland Delphi 2006, chose the Template entry. Right click in that window and select New from the context menu. Now note that you got a new XML file, itself controlled by a Live-Coding Template. Nice touch ;-)

First you need to enter a name for the template, which needs to be unique within the language you want that template working for. Using [tab] you come to the description node, the author node, and the language attribute. For a list of all languages supported, see below. You should add an attribute "delimiter" and set its value to "|", or any delimiter you want to use.

In the CDATA node, you add the code, which you want to be inserted when invoking this template. All synchronization points should be surrounded using that6 defined delimiter. For each synchronization point (note: you can use the same multiple times in the code, thus synchronizing them automatically as the user types) you must add a node which should contain a node with the default value and a node with a hint shown to the user.

A sample for CSS nodes can be downloaded from here, helping you to automatically insert the CSS attributes for scrollbar-manipulation in IE-based browsers. Save that into your local application folder of your profile -> Borland\BDS\4.0\code_templates. (Just a simple sample, but you can come up with much better ones for yourself, I am sure.)

The list of Live-Coding Templates supported can be found in the CodeTemplateAPI.pas file of your Borland Developer Studio 2006 installation.
  • CSharp
  • VB
  • Jsharp
  • HTML
  • XML
  • Delphi
  • C
  • IDE
  • SQL
  • IDL
  • JavaScript
  • CSS
  • INI
  • PHP


Have fun and put your Live-Coding Templates online at Borlands CodeCentral for everyone.

Sunday, December 04, 2005

Video Preview for the Community Welcome Page

As promised, with the launch of the Borland Developer Studio 2006 I am going to launch a second Welcome Page, as Community Release. Sadly, as the time of the Quality Assurance Team was very limited for the Welcome Page. That is why we are preparing a Welcome Page as Community Release.

It will take a little longer until you can actually download it, however, here I want to present the current features to you. This way you may actually have some more ideas on what you would like to see.

The video shows you the following areas:
  • Project view with detailed information about each recently opened project / project group
  • Newsfeed selection
  • Newsfeed summary view of all cached feeds
  • Integration of the BDN BabelCode service, which translates C# source code to Delphi.NET source code

Get a first look with this Camtasia Flash Video.

Saturday, December 03, 2005

Creating a Script Template Engine for the Borland Developer Studio 2006

As you might already know, the new version of the Borland Developer Studio has "live templates," that allow you to get many coding tasks easily done. The react either automatically or manually at special keywords and fill in the gaps for you. Further, those live templates are completely done in XML and thus can be changed rather easily. Further, you can add scripts to those templates allowing you to invoke code completion, refactoring among many other feature of the IDE.

However, you can even write your very own template scripting engine, allowing you to further expand the power of those code templates. Thanks to Adam "Sparky" Markowitz, I have just done that. The source code can be downloaded at CodeCentral ID 23866. I will not indulge to much on the how-to here, as the source code comes with a readme and is fully commented.

Let's first take a look at what I have done. When the user enters "search" in the code editor and presses [Tab] or [Ctrl+J], the live template will be invoked automatically and tell him to enter the keywords to search for.
user input
enter keywords


Now, the user can enter his search keywords. Once he (or she) presses tab to leave the syncronization point, a script will be called which invokes my new template scripting engine and it will start an online search in the users default browser.
user search keywords
search results online


The template scripting engine can be accessed through the new IOTACodeTemplateScriptEngine interface, defined in the CodeTemplateAPI.pas file, which is in your sources folder of your Delphi 2006 installation. The whole source is online at Borlands CodeCentral (see link above). Below you can see the XML template (click for a larger view).
online search xml template

Closing the Editor Tabs in BDS 2006

Developers who have used Borland Delphi 2005 will remember that little [x] on each tab, which allowed you to close each tab rather easily using the mouse. Some will be wondering where that has gone in the Borland Developer Studio 2006. Well, simply it's gone, however, you have another way, imo better way, to close them. Just as you know it from FireFox and other tabbed browser, click with your middle mouse button, or the mouse whell, on any editor tab you want to close, and it will be closed.

On the right of your tab row, you can see up to four square buttons. The scroll left and the scroll right button allow you to scroll horizontally through the list of the tabs opened. The drop list button will open a list of all opened tabs. Select any item, which you want to see and the code editor will focus on it. The last button close current will close the currently shown editor window.
The Editor Tabs Row

Friday, December 02, 2005

The BDS 2006 Splash Screen

Well, finally I got it registered, so here you see the splash screen of the Borland Developer Studio 2006, or as I still like to say Delphi 10 - the first even Delphi version you really must have because it is better than any odd one before ;-)

Borland Developer Studio 2006 / Delphi 2006 Splash Screen

First Delphi 2006 book is out

I just read on Nicks blog, that the first Delphi 2006 book is already available. It is called Inside Delphi 2006 and written by Ivan Hladni.

I have not seen the book myself yet, nor heard anything about it, but that it exists. So I cannot let you know how it is. However, it is on Delphi 2006, so I hope that it will be "just the first" in a long line of books.

The "Floating Designer" - for "Die Hards"

Yesterday evening I have been at the Munich Delphi User Group meeting, and we had a look at the new Borland Developer Studio 2006. One question came up asking me, whether one could have back that old floating designer, as it has been in Delphi 7 and prior versions. Knowing the person asking is using Borland Delphi 2005 I was a little surprised, since it has been officially supported there too. Anyway, here you go, if you want to have that old style as well.
BDS 2006 looking almost like Delphi 7


Now, if you really want to use that view, you need to go to the Tools menu and go to your options dialog. Within the environment options go to VCL-Designer and uncheck that "embedded designer" option. (Note that the screen shot is form the German version.)
BDS 2006 looking almost like Delphi 7


Note: this option works for VCL applications only, not for WinForms and ASP.NET applications. But hey, if you want to stick to that layout, you are probably ignoring .NET anyway.

BDS 2006: Laser Guide Lines

With Borland Developer Studio 2006 arriving in stores near you and hopefully on your desk I'll start blogging about some of the new features coming with it. In this first blog entry I'll introduce the laser guide lines to you. When creating VCL applications those will help you to properly align components to each other, either getting spaces between them right, or aligning edges to each other.

First I dropped a label on the form and aligned that to the border of the form. Notice the black lines, that appear when you have just the right distance to the form border.
aligning with the form border


Next I have dropped an edit component to the form. The following screen shot shows two designer laser guide lines. The pink one will inform you that the bases of the text of the components are aligned with each other, the white one lets you know, that the compontents have just the right distance to each other.
baseline alignment


After adding a button to the form, you see the pink and white lines appearing again. While the pink line informs me, that all three compontents are aligned along their baselines, the white one again tells me that the button has just the right distance to the edit component.
baseline alginment across three compontents


Now, I have added a panel to the form, and we see four laser guide lines at once. There is the black one again, showing the distance to the form border. Then there is the white one, showing the distance between the panel and the buttom. And new, there are two gray lines, letting us know, that the left edge of the panel aligns with the label and the right one with the button. Cool, eyh?
Aligning with multiple components at once


Not really a new line, but take a look. Label2 is placed inside the panel, while Label1 is outside. And still, the laser guide lines work across container boundaries. Now, that is at least as cool as the last one ;-)
aligning across container boundaries


And again, aligning those two edit components to each other. Hey, I am having fun here.
aligning more components


This last screen shot shows a new situation. Did you notice that white laser guide line cross between Label2 and Label3? We are setting Label3 in a way, the horizontally and vertically the space to Label2 is identical (8 pixels in my setup).
aligning two ways at once


I hope you like that small introduction and you'll be checking back for more on the new DeXter stuff coming soon to a PC near you.
Google
Search WWW Search delphi-notes.blogspot.com