Board index » delphi » Visual Commenting

Visual Commenting

    Sometimes on our main project, some members of development team will
simply work on visual tweaks--changes in fonts, positions and captions
of controls, etc.  Some of these controls have visual properties that
are changed at run-time depending on various conditions, making the
tweaks at best irrevelevant and sometimes damaging.  Obviously, thorough
documentation of what is safe and reasonable to change would be
immensely helpful, but our main project is fairly large and our staff
relatively small; also, documentation separate from the project is
somewhat inconvenient, considering that when a programmer comments
source code, the relevant information is actually at hand.
    My supervisor and I wondered if, somewhere out in that big Delphi
world, there mightn't be a visual equivalent to code comments--something
of a design-time label, which could be used on forms and data modules,
and perhaps their components as well, but which would be ignored when
Delphi produced the executable.  I realize that this probably wouldn't
be an ordinary component, since ordinary components are generally added
to the declarations of their containing forms and data modules, but
would more likely be an enhancement or an extension to the development
environment.  If anyone knows of such an addition to the IDE, we, and
I'm sure others, would be greatly interested in knowing about it.

Marc Benedict
Programmer
Columbus Systems

 

Re:Visual Commenting


Ken, it sounds like Marc wants a little more functionality than that.
No Marc, I don't know of any components that do what you want but I
would look at going along the lines of what Ken suggests - but spend a
little more time thinking about it.

If one-liners (ie labels) are suitable then derive your own label
called TCommentLabel (for example) who's default font colour is
different to the normal labels you use (this allows the developers to
quickly see a comment from a proper label). It's default visibility
would also be false (as Ken suggests). One problem with this is that
the Label has not actually GONE at runtime - it just isn't visible.

You may also want to look at using componentstate to change it's
behaviour at Runtime compared to Design time:

if not (csDesigning in ComponentState)

The best solution may be something more like a TMemo that only shows
up at design-time, stores the comments in a resource file and destroys
itself at run-time.

On Tue, 16 Jun 1998 18:11:38 -0400, Ken White <kwh...@westelcom.com>
wrote:

Quote
>Marc,

>What I usually do in this case is to use a regular TLabel, and
>set it's visible property to false. It still shows in the IDE,
>but is gone at run-time.

>HTH

>Ken
>--
>Ken White
>kwh...@westelcom.com

>Clipper Functions for Delphi
>http://members.aol.com/clipfunc/

>Marc Benedict wrote:

>>     Sometimes on our main project, some members of development team will
>> simply work on visual tweaks--changes in fonts, positions and captions
>> of controls, etc.  Some of these controls have visual properties that
>> are changed at run-time depending on various conditions, making the
>> tweaks at best irrevelevant and sometimes damaging.  Obviously, thorough
>> documentation of what is safe and reasonable to change would be
>> immensely helpful, but our main project is fairly large and our staff
>> relatively small; also, documentation separate from the project is
>> somewhat inconvenient, considering that when a programmer comments
>> source code, the relevant information is actually at hand.
>>     My supervisor and I wondered if, somewhere out in that big Delphi
>> world, there mightn't be a visual equivalent to code comments--something
>> of a design-time label, which could be used on forms and data modules,
>> and perhaps their components as well, but which would be ignored when
>> Delphi produced the executable.  I realize that this probably wouldn't
>> be an ordinary component, since ordinary components are generally added
>> to the declarations of their containing forms and data modules, but
>> would more likely be an enhancement or an extension to the development
>> environment.  If anyone knows of such an addition to the IDE, we, and
>> I'm sure others, would be greatly interested in knowing about it.

>> Marc Benedict
>> Programmer
>> Columbus Systems

Andy Pinkerton, Britannia Software Plc.
apinker...@britsoft.co.uk

Other Threads