Home

Tools API

Messages

Open Tools API

Introduction
Services
Wizards
Messages
Notifiers
Creators
Editors
Debugger
Examples
Custom Forms

Home

The message interface in Delphi 4 is entirely new. It has no Delphi 3 equivalent.

Using the message services to display messages in Delphi's message view or to clear messages from the message view. You can display a message as a string or take complete control over drawing the message. You can also tie a message to a particular location in a source file, so when the user double-clicks the message, Delphi shows a file in the source editor, with the cursor positioned at a specific line and column.

IOTAMessageServices

AddCustomMessage
Display a custom message. You must define a class that implements IOTACustomMessage, and possibly IOTACustomDrawMessage.
AddTitleMessage
Display a simple text message in bold face.
AddToolMessage
Display a text message that is tied to a source file. Delphi displays the message with the form
[Prefix] File(Line): Message
ClearAllMessages
This also frees any custom message objects you added.
ClearCompilerMessages
You figure this out.
ClearSearchMessages
You figure this out.
ClearToolMessages
This clears your custom messages, but not messages you added by calling AddToolMessage. You must call ClearToolMessages or ClearAllMessages when your wizard is freed if you added any custom messages. Otherwise, Delphi's message view is left with dangling pointers.

IOTACustomMessage

Implement this interface to define a custom message. You can figure out how it works by reading ToolsAPI.pas. Note that Delphi does not format the file name and line number in the message, the way it does for tool messages. If you want to use Delphi's convention, you must add the prefix, file name, and line number to LineText.

IOTACustomDrawMessage

Your wizard can take complete control over how Delphi displays a message by implementing IOTACustomDrawMessage.

Draw
Delphi calls this message whenever it needs to draw the message. If this is computationally expensive, buffer the display in a bitmap and draw the bitmap to the canvas. I don't know what Inprise intends to do with the Wrap parameter. The Rect argument is the width of the message view and the height of one line of text.
CalcRect
Delphi calls this method at irregular intervals, and then ignores the rectangle it returns. MaxWidth is the screen width.

Copyright © 1998 Tempest Software, Inc. All rights reserved.