Copyright: PJAbout Help - copyright © 1998-2002 PJSoft (P.D.Johnson)


PJAbout unit

This unit contains the implementation of the TPJAboutBoxDlg about box dialog component. It also defines various enumerated types that are related to the component.


 TPJAboutBoxDlg

Heirachy          Properties          Methods          Events

This non-visual component encapsulates a customisable about dialog box.

Unit

PJAbout

Description

This component encapsulates an About Box in a non-visual component. It is displayed by calling its Execute method. The about box appears as below. It has string properties to display five different pieces of information in the about box. They are: Copyright, Notes, ProgramName, Title and Version. The positioning of the string properties is shown in the following picture of the dialog box.

Alternatively, the about box can display information from a VERSIONINFO resource included in a program file. This by setting the VersionInfo property to reference a TPJVersionInfo component which extracts version information from an executbale file.

The application's icon is displayed in the dialog box. This is the icon specified by the Icon property of the TApplication object. If no icon has been specified for the application then default Delphi icon is used.

The position of the about box on the screen is determined by the DlgLeft and DlgTop or the CentreDlg properties.

The about box contains a close button, the appearance of which is governed by the ButtonGlyph, ButtonHeight, ButtonWidth, ButtonKind and AutoDetectGlyphs properties. The position of the button is determined by the ButtonPlacing property.

The HelpContext property allows Windows Help to be displayed for the dialog box when the F1 key is pressed.

This component has no events.


TPJAboutBoxDlg Heirachy
Heirachy

TObject

    |

TPersistent

    |

TComponent


TPJAboutBoxDlg Properties
Properties

AutoDetectGlyphs	ButtonGlyph

ButtonHeight	ButtonKind

ButtonPlacing	ButtonWidth

CentreDlg	Copyright

DlgLeft	DlgTop

HelpContext	Name

Notes	ProgramName

Tag	Title

Version	VersionInfo


TPJAboutBoxDlg.AutoDetectGlyphs

TPJAboutBoxDlg          See also

Determines whether display of glyphs depends on ButtonGlyph property or depends on the default compiler settings.

property AutoDetectGlyphs: Boolean;

Description

The About box contains one button which is used to close the dialog box. This button can display a glyph, which is determined by the ButtonGlyph property. AutoDetectGlyphs determines whether or not the glyph is displayed.

When AutoDetectGlyphs is False glyphs are displayed according to the ButtonGlyph property.

When AutoDetectGlyphs is True the display of glyphs depends on whether the component is being used with 16 or 32 bit Delphi. For 16 bit delphi no glyphs are displayed if the global MsgDlgGlyphs variable is false. Glyphs are displayed according to the ButtonGlyph property if MsgDlgGlyphs is true. With 32 bit Delphi no glyphs are displayed when AutoDetectGlyphs is true.

The default value is True.


TPJAboutBoxDlg.ButtonGlyph

TPJAboutBoxDlg          See also

Determines which, if any, glyph is displayed on the dialog's close button.

property ButtonGlyph: TPJAboutBtnGlyphs;

Description

The About box contains one button which is used to close the dialog box. The button can display a glyph (bitmap) to indicate its use. This property is used to determine which (if any) glyph to display. Valid values for the property and their meaings are as follows:

Value	Meaning

abgOK	A green check mark appears on the button face.

abgCancel	A red cross appears on the button face.

abgIgnore	A green man walking away appears on the button face.

abgClose	A door appears on the button face.

abgNone	No glyph is displayed on the button.

ButtonGlyph defaults to abgOK.

NB: If the AutoDetectGlyphs property is true then th value of the ButtonGlyph property may be ignored. See AutoDetectGlyphs for futher information.


TPJAboutBoxDlg.ButtonHeight

TPJAboutBoxDlg          See also

Determines the height of the About box's close button.

property ButtonHeight: Integer;

Description

The About box displays one button which is used to close the dialog box. The height of this button in pixels is determined by the value of this property. The dialog box's height is adjusted according to the value of this property.

The default value depends on the compiler in use: it is 25 pixels for Delphi 2 and later and is 33 pixels when using Delphi 1. This conforms to the default height used for button components.


TPJAboutBoxDlg.ButtonKind

TPJAboutBoxDlg          See also

Determines the text displayed on the dialog's close button.

property ButtonKind: TPJAboutBtnKinds;

Description

The About box contains one button which is used to close the dialog box. The button can display different text to indicate its use. The ButtonKind property is used to determine which text to display. Valid values for the property and their meaings are as follows:

Value	Text

abkOK	'OK'

abkDone	'Done'

abkClose	'Close'

abkCancel	'Cancel'

The default value is abkOK.


TPJAboutBoxDlg.ButtonPlacing

TPJAboutBoxDlg          See also

Determines the horizontal alignment of the dialog's close button.

property ButtonPlacing: TPJAboutBtnPlacing;

Description

The About box contains one button which is used to close the dialog box. The button is positioned at the bottom of the dialog box, but can be aligned left, centre or right. The ButtonPlacing property is used to determine which position the button occupies. Valid values for the property and their meaings are as follows:

Value	Meaning

abpLeft	Display the button at the bottom left of the dialog box

abpCentre	Display the button at the bottom centre  of the dialog box

abpRight	Display the button at the bottom right of the dialog box

The default value is abpCentre.


TPJAboutBoxDlg.ButtonWidth

TPJAboutBoxDlg          See also

Determines the width of the About box's close button..

property ButtonWidth: Integer;

Description

The About box displays one button which is used to close the dialog box. The width of this button in pixels is determined by the value of this property.

The default value depends on the compiler in use: it is 75 pixels for Delphi 2 and later and is 85 pixels when using Delphi 1. This conforms to the default width used for button components.


TPJAboutBoxDlg.CentreDlg

TPJAboutBoxDlg          See also

Determines whether the about box is display in the centre of the screen or not.

property CentreDlg: Boolean;

Description

This property determines whether the About dialog box appears in the centre of the screen or with its top left corner in the position given by the values of the DlgLeft and DlgTop properties.

When CentreDlg is set to True then the DlgLeft and DlgTop properties are ignored and the about box appears in the centre of the screen. When CentreDlg is set to False the DlgLeft and DlgTop properties determine the position of the dialog box on screen.

The default value of CentreDlg is True.


TPJAboutBoxDlg.Copyright

TPJAboutBoxDlg          See also

Contains the copyright message displayed in the about box.

property Copyright: string;

Description

The Copyright property provides the copyright message that is displayed on the third line of the about box.

The default value of this property is an empty string, which displays nothing.

Note: If the VersionInfo property is not nil then this property is ignored.


TPJAboutBoxDlg.DlgLeft

TPJAboutBoxDlg          See also

Determines the location of the left hand side of the about box on screen.

property DlgLeft: Integer;

Description

The DlgLeft property determines the position of the left hand side of the about dialog box on the screen, in pixels. If the value of DlgLeft is so large that all or part of the about box would be displayed off screen then the right hand edge of the about box is displayed aligned with the right hand edge of the screen.

If the CentreDlg property is true then DlgLeft is ignored and the dialog is centred on screen.

The default value of DlgLeft is 0.


TPJAboutBoxDlg.DlgTop

TPJAboutBoxDlg          See also

Determines the location of the top of the about box on screen.

property DlgTop: Integer;

Description

The DlgTop property determines the position of the top of the about dialog box on the screen, in pixels. If the value of DlgTop is so large that all or part of the about box would be displayed off screen then the bottom of the about box is displayed aligned with the bottom of the screen.

If the CentreDlg property is true then DlgTop is ignored and the dialog is centred on screen.

The default value of DlgTop is 0.


TPJAboutBoxDlg.HelpContext

TPJAboutBoxDlg

Stores the help topic number accessed when F1 is pressed.

type THelpContext = -MaxLongInt..MaxLongInt;

property HelpContext: THelpContext;

Description

HelpContext stores the number of the help topic in the application's help file that is displayed when the F1 key is pressed while the about box is displayed. If HelpContext is 0 then no help topic is displayed.

The property's default value is 0.


TPJAboutBoxDlg.Notes

TPJAboutBoxDlg          See also

Contains the notes text displayed in the dialog box.

property Notes: string;

Description

The Notes property is used to store the notes to be displayed in the about box. The notes appear at the bottom of the text area of the dialog box. The text will word-wrap up to three lines. When setting the property at run time end of line characters (#13) can be included in the string to force line breaks. Forcing line breaks is not possible at design time.

The default value for the Notes property is an empty string, which displays nothing.

Note: If the VersionInfo property is not nil then this property is ignored.


TPJAboutBoxDlg.ProgramName

TPJAboutBoxDlg          See also

Determines the name of the program displayed in the about box.

property ProgramName: string;

Description

The ProgramName property defines the program name to be displayed on the first line of the about box.

If ProgramName is set to the empty string then the title of the application as specified by the Title property of the Application object  is displayed. If you have not specified an application title then the name of the project (without the .dpr extension) is used. If ProgramName is set to any non-empty string then that string is displayed.

ProgramName defaults to the empty string.

Note: If the VersionInfo property is not nil then this property is ignored.


TPJAboutBoxDlg.Title

TPJAboutBoxDlg

Determines the title bar text of the about dialog box.

property Title: string;

Description

The Title property stores the string that is displayed in the title bar of the about dialog box. The default value of this property is 'About'.


TPJAboutBoxDlg.Version

TPJAboutBoxDlg          See also

Determines the version number information to be displayed in the about box.

property Version: string;

Description

The Version property defines the version number (or other text)  to appear on the second line of the about box.

The default value of this property is an empty string, which displays nothing.

Note: If the VersionInfo property is not nil then this property is ignored.


TPJAboutBoxDlg.VersionInfo

TPJAboutBoxDlg          See also

References a TPJVersionInfo component that provides the text displayed in the about box.

property VersionInfo: TPJVersionInfo;

Description

This property allows information from a string information block in a program file's VERSIONINFO resource to be displayed in the dialog box.

To enable this to happen a TPJVersionInfo component must be placed on the form and this property must reference it. The TPJVersionInfo component's FileName property must be set to the name of the executable file from which version information is to be extracted.

The following table shows which version information string values are used, along with the properties whose values they replace:

VERSIONINFO string	Replaces property

ProductName	ProgramName

ProductVersion	Version

LegalCopyright	Copyright

Comments	Notes

When any of these string values are not present in the version information nothing is displayed in their place.

If the VersionInfo property is set to nil then the information displayed in the dialog box is taken from the string properties listed in the table above.

This property has no effect on the usage of the Title property.


TPJAboutBoxDlg Methods
Methods

TPJAboutBox adds just one method, Execute, to the methods inherited from TComponent.


TPJAboutBoxDlg.Execute

TPJAboutBoxDlg

Displays the about box.

procedure Execute;

Description

This method displays the About box and returns when the user closes the About box.


TPJAboutBoxDlg Events
Events

TPJAboutBoxDlg has no events.


TPJAboutBtnGlyphs

Unit

PJAbout

Description

This enumerated type provides all the valid values for the ButtonGlyph property of a TPJAboutBoxDlg component. The record is declared as follows:

type TPJAboutBtnGlyphs = (abgOK, abgCancel,

  abgIgnore, abgClose, abgNone);

See the ButtonGlyph property topic for details of the meaning of these values.


TPJAboutBtnKinds

Unit

PJAbout

Description

This enumerated type provides all the valid values for ButtonKind property of a TPJAboutBoxDlg component.

type TPJAboutBtnKinds = (abkOK, abkDone,

  abkClose, abkCancel);

See the ButtonKind topic for details of the meaning of the values.


TPJAboutBtnPlacing

Unit

PJAbout

Description

This enumerated type provides all the valid values for ButtonPlacing property of a TPJAboutBoxDlg component.

type TPJAboutBtnPlacing = (abpLeft, abpCentre, abpRight);

See the ButtonPlacing topic for details of the meaning of the values.