Copyright: Copyright © 1995, RIchard Hansen


AligmentProperty see also
See also

AlignmentVertical


Alignment Property

See also

Applies to

TrhBitmapButton, TrhButton3D, TrhColoredButton, TrhFramedLabel, TrhLabel3D, TrhFramedLabel3D

Declaration

property Alignment: TAlignment;

Description

The Alignment property specifies how text is aligned horizontally within the component. For buttons the Alignment property has no effect unless the WordWrap property is set to True. These are the possible values:

Value	Meaning
taLeftJustify	Align text to the left side of the control
taCenter	Center text horizontally in the control
taRightJustify	Align text to the right side of the control


AlignmentVertical Property

See also

Applies to

TrhFramedLabel, TrhFramedLabel3d

Declaration

property AlignmentVertical: TVertAlignment;

Description

The AlignmentVertical property specifies how text is aligned vertically within the component. Windows only allows single line text to be vertically aligned. If AlignmentVertical is not set to vaNone, AlignmentVertical overrides any word wrapping and allows only single line captions. If you need word wrapping and vertical centering, you may be able to get the desired effect using the TextOffset property instead.

These are the possible values:

Value	Meaning
vaNone	No vertical alignment
vaTop	Align text to the top edge of the control
vaCenter	Center text vertically in the control
vaBottom	Align text to the bottom edge of the control


AlignmentVertical see also
See also

Alignment


AverageCharWidth Property

See also

Applies to

TrhTabComboBox, TrhTabListBox

Declaration

property AverageCharWidth: Double;

Description

Runtime and Read Only

Returns the average character width for the font assigned to the control.


AverageCharWidth see also
See also

MaxCharWidth


BoldFocus Property

Applies to

TrhBitmapButton, TrhButton3D, TrhColoredButton

Declaration

property BoldFocus: Boolean;

Description

Changes the drawing style of a button that has the focus. A button drawn in the "new style" normally has its caption displayed in a bold font when it has the focus. You may find that a button looks better if the caption is not bolded when it has focus.


ColText Example

This example demonstrates how to retrieve the text in the first column of the current row.

var

  ListBox: TrhTabListBox;

  ColTxt: String;

begin

  if (ListBox.ItemIndex >= 0) then

    ColTxt := ListBox.ColText[0];

  {else error no selected row}

end;

Click here to copy this example topic to the clipboard


ColText Property

Example	See also

Applies to

TrhTabComboBox, TrhTabListBox

Declaration

property ColText[Col: Byte]: String;

Description

Runtime and Read Only.

ColText allows access to the text in each column of the currently selected row. Columns are numbered starting from zero. For a single selection list box and all combo boxes, the selected row number is returned by the ItemIndex property. For a multi-select list box ItemIndex is the currently focused item.

To access the text in any row as a single text item use the Items property.


ColText see also
See also

RowText


ColVisible Property

See also

Applies to

TrhTabComboBox, TrhTabListBox

Declaration

property ColVisible: Boolean;

Description

ColVisible toggles the display of the current column on or off. The current column is set using the Column property. The ColVisible property is used mainly at design time. For runtime changes the ColumnVisible array property is easier to use.


ColVisible see also
See also

Column

Columns

ColumnVisible

ColWidth

ColWidthCalc


ColWidth Example

This example changes column widths at runtime using the ColWidth property.

procedure TForm1.FormCreate(Sender: TObject);

begin

  { set number of columns }

  TabListBox1.Columns := 3;

  { set column units }

  TabListBox1.ColWidthCalc := wcAverageChar;

  { set current column }

  TabListBox1.Column := 0;

  { set column width }

  TabListBox1.ColWidth := 5;

  TabListBox1.Column := 1;

  TabListBox1.ColWidth := 10;

  TabListBox1.Column := 2;

  TabListBox1.ColWidth := 5;

end;

Click here to copy this example topic to the clipboard


ColWidth Property

Example	See also

Applies to

TrhTabComboBox, TrhTabListBox

Declaration

property ColWidth: TColumnWidth;

Description

ColWidth sets the display width of the current column. Display widths can be set in pixels, average character width, or maximum character width. The current column is set using the Column property. The ColWidthCalc property determines how the value in ColWidth is interpreted.

The ColWidth property is used mainly at design time. For runtime changes use the ColumnWidth array property.


ColWidth see also
See also

Column

Columns

ColVisible

ColumnWidth

ColWidthCalc


ColWidthCalc Property

See also

Applies to

TrhTabComboBox, TrhTabListBox

Declaration

property ColWidthCalc: TWidthCalc;

Description

ColWidthCalc determines how the display width of the current column is measured. Each unit of ColWidth will be converted into the specified unit size. If ColWidth for the current Column is 10, and the ColWidthCalc property is set to wcAverageChar, then the column display width will be equal to the width of 10 average characters in the current font assigned to the control. The possible values are :

Value	Meaning
wcPixels	The width value specifies an exact number of pixels
wcAverageChar	The width will be multiplied by the average character width
wcMaxChar	The width will be multiplied by the maximum character width


ColWidthCalc see also
See also

Column

Columns

ColVisible

ColWidth


Color3DShadow Property

See also

Applies to

TrhButton3D, TrhLabel3D, TrhFramedLabel3d

Declaration

property ColorShadow: TColor;

Description

The color used to draw the shadowed parts of 3D text.


Color3DShadow see also
See also

Color3DHighlight


Color3DHilight Property

See also

Applies to

TrhButton3D, TrhLabel3D, TrhFramedLabel3d

Declaration

property ColorHighlight: TColor;

Description

The color used to draw the highlighted parts of 3D text.


Color3dHilight see also
See also

Color3DShadow


ColorBevelHilight Property

See also

Applies to

TrhBitmapButton, TrhButton3D, TrhColoredButton

Declaration

property ColorBevelHilight: TColor;

Description

The color used to draw the highlighted parts of a button's bevel.


ColorBevelHilight see also
See also

ColorButtonFace

ColorBevelShadow


ColorBevelShadow Property

See also

Applies to

TrhBitmapButton, TrhButton3D, TrhColoredButton

Declaration

property ColorBevelShadow: TColor;

Description

The color used to draw the shadowed parts of a button's bevel.


ColorBevelShadow see also
See also

ColorButtonFace

ColorBevelHilight


ColorButtonFace Property

See also

Applies to

TrhBitmapButton, TrhButton3D, TrhColoredButton

Declaration

property ColorButtonFace: TColor;

Description

The color used to draw a button's face.


ColorButtonFace see also
See also

ColorBevelHilight

ColorBevelShadow


Column Editor Columns
Sets the total number of columns in the component.

The maximum number of columns is 255.

Use the up/down spinner buttons or type a number.


Column Editor Form
Column Editor

The Column Editor allows you to edit all the properties for all of the columns of the control. First you should set the properties that apply to all columns in the control.

 Use the Units combo box to select the units used for the column widths.

 Set the total number of columns in the Columns field.

Next, you edit the settings for each column in the control.

 Set the number of the column you wish to edit in the Number field.

 The Width field sets the width of the current column.

 The Visible check box makes the current column visible or invisible.


Column Editor Number
Selects the column to edit.

Columns are numbered starting from zero.

Use the up/down spinner buttons or type a number.


Column Editor Units
Sets the units used to calculate all column widths.

The possible units are pixels, average character width,

or maximum character width.


Column Editor Visible
Toggles the visible property of the current column.


Column Editor Width
Sets the width of the current column.

Use the up/down spinner buttons or type a number.


Column Property

See also

Applies to

TrhTabComboBox, TrhTabListBox

Declaration

property Column: Byte;

Description

The current column in the control. all changes to the ColWidth and ColVisible properties affect the current column only. Primarily used at design time to select a column for editing.

Columns are numbered starting at zero. The last column is equal to Columns - 1.


Column see also
See also

Columns

ColVisible

ColWidth

ColWidthCalc


ColumnVisible Example

This example shows how to make the second column in a combo box non-visible.

var

  ComboBox: TrhTabComboBox;

begin

...

  ComboBox.ColumnVisible[1] := False;

end;

Click here to copy this example topic to the clipboard


ColumnVisible Property

Example	See also

Applies to

TrhTabComboBox, TrhTabListBox

Declaration

property ColumnVisible[Col : Byte]: Boolean;

Description

Runtime Only.

ColumnVisible is an indexed array property that toggles the display of a column on or off.

Columns are numbered starting at zero. The last column is equal to Columns - 1.


ColumnVisible see also
See also

ColVisible


ColumnWidth Example

This example shows how to change column widths at runtime using the ColumnWidth property.

procedure TForm1.FormCreate(Sender: TObject);

begin

  { set number of columns }

  TabListBox1.Columns := 3;

  { set column units }

  TabListBox1.ColWidthCalc := wcMaxChar;

  TabListBox1.ColumnWidth[0] := 5;

  TabListBox1.ColumnWidth[1] := 10;

  TabListBox1.ColumnWidth[2] := 10;

end;

Click here to copy this example topic to the clipboard


ColumnWidth Property

Example	See also

Applies to

TrhTabComboBox, TrhTabListBox

Declaration

property ColumnWidth[Col : Byte]: TColumnWidth;

Description

Runtime Only.

ColumnWidth is an indexed array property used to get or set the width of a column at runtime.

Columns are numbered starting at zero. The last column is equal to Columns - 1.


ColumnWidth see also
See also

ColWidth


Columns Property

Applies to

TrhTabComboBox, TrhTabListBox

Declaration

property Columns: Byte;

Description

Sets the total number of columns in the control. There can be up to 255 columns per control.

Columns are numbered starting at zero. The last column is equal to Columns - 1.


Contact Information

Please send any comments, suggestions, problems, bugs, or questions to:

Blue House Software

PO Box 18571

Saint Paul, MN  55118-0571  USA

FAX	: (612) 552-0498

CompuServe	: 70242,3367

Internet	: 70242.3367@compuserve.com


Contents
Enhanced Controls for Delphi

Blue House Software

Copyright © 1995,96 Richard Hansen, All Rights Reserved.

Contents

General Information

Contact Information

Ordering Information

TrhBitmapButton

TrhButton3D

TrhCheckListBox

TrhColoredButton

TrhCustomComboBox

TrhFramedLabel

TrhFramedLabel3D

TrhGraphicButton

TrhLabel3D

TrhTabComboBox

TrhTabListBox

TrhTabListHeader


Create Method

Applies to

All components

Declaration

constructor Create(AOwner: TComponent);

Description

The Create method allocates memory to create the component and initializes its data as needed. Each object can have a Create method customized to create that particular kind of object. The owner of the created component is passed in the AOwner parameter.

Usually you don't need to create objects manually. Objects you design in Delphi are automatically created for you when you run the application and destroyed when you close the application. If you construct a component by calling Create, and give it an owner, the owner disposes of the component when the owner is destroyed. If you don't want another component to own the created component, pass Self in the AOwner parameter.


Destroy Method

Applies to

All components

Declaration

destructor Destroy;

Description

The Destroy method destroys the object, component, or control and releases the memory allocated to it. You seldom need to call Destroy. Objects designed with Delphi create and destroy themselves as needed, so you don't have to worry about it. If you construct an object by calling the Create method, you should call Free to release memory and dispose of the object.


Disclaimer

Enhanced Controls for Delphi" is distributed as Shareware, IT IS NOT FREE. If you use "Enhanced Controls", please register it. Your registration will allow for the creation future versions of this product. What happens with future versions is up to you.

DEFINITION OF SHAREWARE

Shareware distribution gives users a chance to try software before buying it. If you try a Shareware program and continue using it, you are expected to register.

Copyright laws apply to both Shareware and commercial software, and the copyright holder retains all rights, with a few specific exceptions as stated below. Shareware authors are accomplished programmers, just like commercial authors, and the programs are of comparable quality. (In both cases, there are good programs and bad ones!) The main difference is in the method of distribution. The author specifically grants the right to copy and distribute the software, either to all and sundry or to a specific group. For example, some authors require written permission before a commercial disk vendor may copy their Shareware.

Shareware is a distribution method, not a type of software. You should find software that suits your needs and pocketbook, whether it's commercial or Shareware. The Shareware system makes fitting your needs easier, because you can try before you buy. And because the overhead is low, prices are low also. Shareware has the ultimate money-back guarantee -- if you don't use the product, you don't pay for it.

DISCLAIMER

Users of "Enhanced Controls" must accept this disclaimer of warranty:

"Enhanced Controls" is supplied as is. The author disclaims all warranties, expressed or implied, including, without limitation, the warranties of merchantability and of fitness for any purpose. The author assumes no liability for damages, direct or consequential, which may result from the use of "Enhanced Controls."

LICENSE AGREEMENT

"Enhanced Controls" is a "Shareware package" and is provided at no charge to the user for evaluation. Feel free to share, but please do not give it away altered or as part of another package. If you find this program useful and find that you are using "Enhanced Controls" and continue to use "Enhanced Controls" after a reasonable trial period, you must make a registration payment to Blue House Software. The registration fee will license one copy for use on any one computer at any one time, site licenses are available by contacting Blue House Software. You must treat this software just like a book. Each licensed copy may be used by only one person at a time, just as a book cannot be read by two different persons at the same time.

Anyone distributing "Enhanced Controls" for any kind of remuneration must first contact Blue House Software for authorization.


DropDownWidth Property

Applies to

TrhCustomComboBox

TrhTabComboBox

Declaration

property DropDownWidth: Word

Description

Specifies the width in pixels of the drop down list portion of the combo box.


FrameColor Property

Applies to

TrhFramedLabel

Declaration

property FrameColor: TColor;

Description

Specifies the color used to draw the frame around the label.


GlyphChecked Property

See also

Applies to

TrhCheckListBox

Declaration

property GlyphChecked: TBitmap;

Description

The bitmap displayed to the left of the selected (checked) items in the list box.

The color of the lower left pixel in the bitmap is the color used as the transparent color when displaying the bitmap. The color of the list box will show through all pixels that are the transparent color.


GlyphChecked see also
See also

GlyphLeftMargin

GlyphTopMargin

GlyphUnchecked


GlyphDisabled Property

See also

Applies to

TrhBitmapButton

Declaration

property GlyphDisabled: TBitmap;

Description

The bitmap displayed when the button is disabled. If there is no bitmap assigned to GlyphDisabled, the GlyphUp bitmap will be used to draw the disabled button.

Depending on the setting of the Stretch property (ssButton or ssBitmap), the button may be resized to fit the bitmap or the bitmap may be resized to fit the button. If Stretch equals ssNone, then the glyph is displayed either to the left or right side of the button as determined by the Layout property.

If Stretch is ssNone the color of the lower left pixel in the bitmap is the color used as the transparent color when displaying the glyph. The color of the button face will show through all pixels that are the transparent color.


GlyphDisabled see also
See also

GlyphUp

GlyphDown

Stretch


GlyphDown Property

See also

Applies to

TrhBitmapButton

Declaration

property GlyphDown: TBitmap;

Description

The bitmap displayed when the button is pressed. If there is no bitmap assigned to GlyphDown, the GlyphUp bitmap will be used to draw the pressed button.

Depending on the setting of the Stretch property (ssButton or ssBitmap), the button may be resized to fit the bitmap or the bitmap may be resized to fit the button. If Stretch is ssNone, then the glyph is displayed either to the left or right side of the button as determined by the Layout property.

If Stretch is ssNone the color of the lower left pixel in the bitmap is the color used as the transparent color when displaying the glyph. The color of the button face will show through all pixels that are the transparent color.


GlyphDown see also
See also

GlyphDisabled

GlyphUp

Stretch


GlyphLeftMargin Property

See also

Applies to

TrhCheckListBox

Declaration

property GlyphLeftMargin: Integer;

Description

Number of pixels spacing between the glyph and the left edge of the list box.


GlyphLeftMargin see also
See also

GlyphTopMargin

GlyphChecked

GlyphUnchecked


GlyphTopMargin Property

See also

Applies to

TrhCheckListBox

Declaration

property GlyphTopMargin: Integer;

Description

Number of pixels spacing between the glyph and the top edge of display area when each item is drawn. The height of display area is determined by the ItemHeight property. You can use ItemHeight and and GlyphTopMargin to center the glyph in the display rectangle for a row in the list box.


GlyphTopMargin see also
See also

GlyphChecked

GlyphLeftMargin

GlyphUnchecked

ItemHeight


GlyphUnchecked Property

See also

Applies to

TrhCheckListBox

Declaration

property GlyphUnchecked: TBitmap;

Description

The bitmap displayed to the left of the unselected (not checked) items in the list box.

The color of the lower left pixel in the bitmap is the color used as the transparent color when displaying the bitmap. The color of the list box will show through all pixels that are the transparent color.


GlyphUnchecked see also
See also

GlyphChecked

GlyphLeftMargin

GlyphTopMargin


GlyphUp Property

See also

Applies to

TrhBitmapButton

Declaration

property GlyphUp: TBitmap;

Description

The bitmap displayed when the button is enabled and not pressed. If the GlyphDown or GlyphDisabled properties are not set, the GlyphUp bitmap will also be displayed for those states. Depending on the setting of the Stretch property (ssBitmap or ssButton), the button may be resized to fit the bitmap or the bitmap may be resized to fit the button. If Stretch is ssNone, then the glyph is displayed either to the left or right side of the button as determined by the Layout property.

If Stretch is ssNone the color of the lower left pixel in the bitmap is the color used as the transparent color when displaying the glyph. The color of the button face will show through all pixels that are the transparent color.


GlyphUp see also
See also

GlyphDisabled

GlyphDown

Stretch


ItemHeight Property

Applies to

TrhTabListBox, TrhTabComboBox, TrhCheckListBox

Declaration

property ItemHeight: Integer;

Description

The ItemHeight property is the height of an item in the list box or combo box in pixels. You can control the height of the rows by changing the value of ItemHeight.

For TrhTabListBoxes and TrhTabComboBoxes, ItemHeight is based on the size of the current font. For TrhCheckListBoxes, ItemHeight is based on the height of the tallest glyph or the size of the current font whichever is larger.


Layout property

See also

Applies to

TrhBitmapButton

Declaration

property Layout: TBtnLayout;

Description

The Layout property determines where the image appears on the button. These are the possible values:

Value	Meaning
blGlyphLeft	The image appears near the left side of the button.
blGlyphRight	The image appears near the right side of the button.


Layout see also
See also

Margin

Spacing


License Agreement

Enhanced Controls for Delphi" is distributed as Shareware, IT IS NOT FREE. If you use "Enhanced Controls", please register it. Your registration will allow for the creation future versions of this product.

LICENSE AGREEMENT

"Enhanced Controls" is a "Shareware package" and is provided at no charge to the user for evaluation. Feel free to share, but please do not give it away altered or as part of another package. If you find this program useful and find that you are using "Enhanced Controls" and continue to use "Enhanced Controls" after a reasonable trial period, you must make a registration payment to Blue House Software. The registration fee will license one copy for use on any one computer at any one time, site licenses are available by contacting Blue House Software. You must treat this software just like a book. Each licensed copy may be used by only one person at a time, just as a book cannot be read by two different persons at the same time.

Anyone distributing "Enhanced Controls" for any kind of remuneration must first contact Blue House Software for authorization.

More Information


ListBox Property

Applies to

TrhTabListHeader

Declaration

property ListBox: TrhTabListBox;

Description

Links a TrhTabListHeader to a TrhTabListBox. When the header is moved or resized, the associated list box will also be moved or resized. When a header column is resized the same column in the list box will be resized.


Margin property

See also

Applies

TrhBitmapButton

Declaration

property Margin: Integer;

Description

The Margin property determines the number of pixels between the edge of the image (specified in one of the Glyph properties) and the edge of the button. The edges that the margin separates depends on the layout of the image and text (specified in the Layout property). For example, if Layout is blGlyphLeft, the margin appears between the left edge of the image and the left edge of the button. If Margin is 3, three pixels separates the image and the button edges. If Margin is 0, no distance in pixels separates the image and the button edges.

If Margin is -1 (the default), then the image and text are centered. The number of pixels between the image and button edge is equal to the number of pixels between the opposite edge of the button and the text.


Margin see also
See also

Layout

Spacing


MaxCharWidth Property

See also

Applies to

TrhTabComboBox, TrhTabListBox

Declaration

property MaxCharWidth: Integer;

Description

Runtime and Read Only

The width of the widest character in the font assigned to the control.


MaxCharWidth see also
See also

AverageCharWidth


OnDrawFace Event

Example

Applies to

TrhBitmapButton, TrhButton3D, TrhColoredButton, TrhGraphicButton

Declaration

property OnDrawFace: TBtnDrawEvent;

Description

The OnDrawFace event is called when the face of a TrhGraphicButton needs to be repainted. If you assign a handler to this event, you can draw the button face.

You draw on the canvas and inside the drawing rectangle passed to OnDrawFace in the Canvas and Rect parameters. The parameters IsDown, IsDefault, IsFocused, IsNewStyle supply the information needed for displaying the current state of the button correctly. All drawing must be confined to the rectangle passed in the Rect parameter.


OnDrawFace Example

This example of draws an "X" on  the face of a TrhGraphicButton in different colors depending on the button state.

procedure TForm1.Button1OnDrawFace(Sender: TObject; IsDown, IsDefault, IsFocused, IsNewStyle : Boolean;Canvas : TCanvas; Rect : TRect);

begin

  {When pressed draw Red X}

  if IsDown then

    Canvas.Pen.Color := clRed

  {When focussed draw Yellow X}

  else if IsFocused then

    Canvas.Pen.Color := clYellow

  {Else draw White X}

  else

    Canvas.Pen.Color := clWhite;

  { draw the X }

  Canvas.MoveTo(0,0);

  Canvas.LineTo(Rect.Right, Rect.Bottom);

  Canvas.MoveTo(Rect.Right, Rect.Top);

  Canvas.LineTo(Rect.Left, Rect.Bottom);

end;

Click here to copy this example topic to the clipboard


Order Form

Enhanced Controls for Delphi

If paying in U.S. dollars, the check must be drawn on a U.S. bank.

Make all funds payable to :

  Richard Hansen

Mail to :

  Richard Hansen

  Blue House Software

  PO Box 18571

  Saint Paul, MN  55118-0571  USA

Name __________________________________________________________________

Address ________________________________________________________________

_______________________________________________________________________

City ___________________________________________________________________

State/Province _________________________ Country ___________________________

Zip/Postal Code ________________________ Date _____________________________

Email ______________________

Number of copies with source code	 _______  X $79.00 =	$ _______.00

Number of copies without source code	 _______  X $39.00 =	$ _______.00

Shipping fee	$5.00	$               5.00

Total Enclosed	$ _______.00


Ordering Information
How to Order

You may order by check, money order, credit card, or online on the CompuServe information service.

Site licenses and multiple copy discounts are available directly from Blue House Software. A registered copy is required for each copy of Delphi that has the "Enhanced Controls" installed.

Direct mail registrations by check or money order are preferred, as this saves the third party processing fees. If paying in U.S. dollars, the check must be drawn on a U.S. bank. To order direct by mail make all funds payable to Richard Hansen. Mail your order to :

  Richard Hansen

  Blue House Software

  PO Box 18571

  Saint Paul, MN  55118-0571  USA

Pricing 	(all prices in U.S. Dollars)

Controls (DCUs only)	$39.00

Controls with source	$79.00

Shipping and Handling	$  5.00

Order Form

You can also register online on CompuServe. Type GO SWREG, and follow the prompts. The registration number for CompuServe is 8385 (with source code).

You may place an order by Master Card, VISA, American Express, or Discover by contacting Public Software Library at (800) 242-4PSL (from overseas (713) 524-6394), by FAX at (713) 524-6398, or on CompuServe at 71355,470. These numbers are for credit card orders only! Please, do not call these numbers for any type of technical assistance. The registration number for PSL is 14302.

Enhanced Controls for Delphi can also be ordered from:

ZAC Catalogs

106 Access Rd

Norwood, Ma 02062

Telephone: 	(800)-GO-DELPHI (1-800-463-3574)

(617)-551-0860

Fax: 	(617)-551-0857

EMail: 	sales@zaccatalog.com


RowText Example

Gets the text for the second column at row 10 in the list box.

var

  ListBox : TrhTabListBox;

  TheText : String;

begin

...

  TheText := ListBox.RowText[10, 1];

end;

Click here to copy this example topic to the clipboard


RowText Property

Example	See also

Applies to

TrhTabComboBox, TrhTabListBox

Declaration

property RowText[Row : Integer; Col : Byte]: String;

Description

Runtime and Read Only.

RowText provides a convenient way to retrieve the text from any row and column in the control. Rows and Columns are numbered starting at zero.


RowText see also
See also

ColText


Sections Property

See also

Applies to

TrhTabListHeader

Declaration

property Sections: TStrings;

Description

The Sections property is a list of strings that contain the text for the sections of a header. The number of lines of the string list determines the number of sections of the header. If the string list is empty, the header will have one blank section. If this string list contains one or more lines, the text of each line will be in its own section. The first line will be in the leftmost section, the second line will be in the next section to the right, and so on.

If the header is attached to a TrhTabListBox, the number of sections and section widths will default to match the columns in the list box. Whenever the header sections are resized the list box columns will also be resized.


Sections see also
See also

TrhTabListBox


ShadowOffset Property

Applies to

TrhButton3D, TrhLabel3D, TrhFramedLabel3d

Declaration

property ShadowOffset: TShadowOffset;

Description

ShadowOffset is the distance in pixels that the 3D shadow text is offset to the right and down form the caption.


ShowFocusColor Property

Applies to

TrhCheckListBox

Declaration

property ShowFocusColor: Boolean;

Description

Toggles highlighting of the focused item on and off in the list box. When set to True the text in the focused row will be displayed in the highlight colors as defined by the current Windows setup.


ShowFrame Property

Applies to

TrhFramedLabel, TrhFramedLabel3d

Declaration

property ShowFrame: Boolean;

Description

Toggles display of the label frame on or off.


Spacing Property

See also

Applies to

TrhBitmapButton

Declaration

property Spacing: Word;

Description

The Spacing property determines where the image and text appear on the button. Spacing determines the number of pixels between the image (specified in one of the Glyph properties) and the Caption. The default value is 4 pixels. If Spacing is 0, there will be no space between the image and text.


Spacing see also
See also

Layout

Margin


Stretch Property

See also

Applies to

TrhBitmapButton

Declaration

property Stretch: TStretchStyle;

Description

Determines how the bitmap is drawn on the button.

When Stretch is set to ssBitmap or ssButton, the button or bitmap is resized when drawing the bitmap on the button. If set to ssBitmap then each bitmap is resized to fit on the button face. If Stretch is ssButton the button is resized to hold the largest bitmap, any smaller bitmaps will be resized to fit the button.

If Stretch is ssNone, the bitmap is draw as an icon to the right or left of the caption. The exact layout is determined by the Spacing, Margin, and Layout properties.


Stretch see also
See also

GlyphDisabled

GlyphDown

GlyphUp


Style Property

Applies to

TrhBitmapButton, TrhButton3D, TrhColoredButton, TrhGraphicButton

Declaration

property Style: TButtonStyle;

Description

The Style property of a button determines the appearance of the button. These are the possible values:

Value	Meaning
bsAutoDetect	When you are using Windows 3.x, the bitmap button uses the standard Windows 3.x look. When you are using a later version of Windows, the bitmap button uses a newer look.
bsWin31	Uses the standard Windows 3.1 look, regardless of which version of Windows you are running.
bsNew	Uses a new bitmap button look, regardless of which version of Windows you are running.


Style3D Property

Applies to

TrhButton3D, TrhLabel3D, TrhFramedLabel3d

Declaration

property Style3D : T3dStyle;

Description

The Style3D property determines what 3D effect is used to draw the caption text. The possible values are:

Value	Meaning
tsNone	No 3D effect, caption displays normally.
tsRaised	Caption is displayed with a raised 3D effect.
tsRecessed	Caption is displayed with a lowered 3D effect.
tsShadowed	Caption is displayed with a shadow.


T3dStyle Type

Unit

RHCtrl3D

Declaration

T3dStyle = (tsNone, tsRaised, tsRecessed, tsShadowed);

Description

Defines the values for the Style3D property.


TBtnDrawEvent see also
See also

OnDrawFace


TBtnDrawEvent Type

See also

Unit

RHGrhBtn

Declaration

TBtnDrawEvent = procedure(Sender: TObject; IsDown, IsDefault, IsFocused, IsNewStyle: Boolean; Canvas: TCanvas; Rect: TRect) of object;

Description

TBtnDrawEvent is the procedural type for the OnDrawFace event for TrhGraphicButton and its descendants. You can create an OnDrawFace event handler to do the drawing of the button face. In your OnDrawFace event handler you can display a bitmap, or use any of the standard canvas drawing routines.

Four of the parameters passed to your OnDrawFace procedure, IsDown, IsDefault, IsFocused, IsNewStyle, provide information on the state and type of the button. The Canvas parameter is a canvas for drawing on. All drawing should be confined to the rectangle passed in the Rect parameter.


TColumnWidth Type

Unit

RHTabBox

Declaration

TColumnWidth = Word;

Description

TColumnWidth is the type of the ColWidth and ColumnWidth properties.


TShadowOffset Type

Unit

RHCtrl3D

Declaration

TShadowOffset = 1..10;

Description

TShadowOffset defines range of the ShadowOffset property.


TStretchStyle Type

Unit

RHBmpBtn

Declaration

TStretchStyle = (ssButton, ssBitmap, ssNone);

Description

TStretchStyle defines the values for the Stretch property.


TTextOffset Type

Unit

RHLblFrm

Declaration

TTextOffset = 1..16;

Description

TTextOffset defines the range of the TextOffset property.


TVertAlignment Type

Unit

RHCtlDef

Declaration

TVertAlignment = (vaNone, vaTop, vaBottom, vaCenter);

Description

TVertAlignment defines the possible values for the AlignmentVertical property.


TWidthCalc Type

Unit

RHTabBox

Declaration

TWidthCalc = (wcPixels, wcAverageChar, wcMaxChar);

Description

TWidthCalc defines the possible values of the ColWidthCalc property.


TextLeftMargin Property

Applies to

TrhCheckListBox

Declaration

property TextLeftMargin: Integer;

Description

TextLeftMargin sets the spacing (in pixels) between the check box glyph and item text in a TrhCheckListBox. The default value is one pixel.


TextOffset Property

Applies to

TrhFramedLabel, TrhFramedLabel3d

Declaration

property TextOffset: TTextOffset;

Description

The TextOffset property sets the spacing between the caption text and the frame of a TrhFramedLabel and TrhFramedLabel3d. TextOffset is the number of pixels the caption is offset from the top left corner of the control. If the AutoSize property is True, TextOffset also determines the number of extra pixels added to the width and height when the caption text is changed.


TrhBitmapButton Component

Properties	Methods	Events	See also	 Tasks

Unit

RHBmpBtn

Description

TrhBitmapButton is a push button that can displays a bitmap image over its entire face. TrhBitmapButton can also display bitmap as an icon like the standard TBitBtn. How the bitmap is displayed is determined by the setting of the Stretch property.

Since TrhBitmapButton is descended from TrhColoredButton, it supports all the features of a TrhColoredButton including user defined colors and multi-line captions.

Interface

  TrhBitmapButton = class(TrhColoredButton)

  protected

    function  CalcTextSize(AWidth: Integer; ACanvas: TCanvas): TPoint; override;

    function  CalcGlyphBounds(const ARect: TRect; ACanvas: TCanvas): TRect; virtual;

    function  CalcTextBounds(const ARect: TRect; ACanvas: TCanvas): TRect; override;

    procedure DrawGlyph(ABitmap: TBitmap; ARect: TRect; ACanvas: TCanvas); virtual;

    procedure DrawFace(IsDown, IsDefault, IsFocused, IsNewStyle: Boolean; const ARect: TRect; ACanvas: TCanvas); override;

  public

    constructor Create(AOwner: TComponent); override;

  published

    property GlyphDown: TBitmap index IDX_DOWN read GetGlyph write SetGlyph;

    property GlyphDisabled: TBitmap index IDX_DISABLED read GetGlyph write SetGlyph;

    property GlyphUp: TBitmap index IDX_UP read GetGlyph write SetGlyph;

    property Layout: TBtnLayout read FLayout write SetLayout default blGlyphLeft;

    property Margin: Integer read FMargin write SetMargin default -1;

    property Spacing: Word read FSpacing write SetSpacing default 4;

    property Stretch: TStretchStyle read FStretch write SetStretch default ssBitmap;

    property Style: TButtonStyle read GetStyle write SetStyle default bsAutoDetect;

  end;


TrhBitmapButton events
Events

OnDrawFace


TrhBitmapButton methods
Methods

Create	Destroy


TrhBitmapButton properties
Properties

Alignment	BoldFocus	ColorButtonFace

ColorBevelHilight	ColorBevelShadow	GlyphDisabled

GlyphDown	GlyphUp	Layout

Margin	Spacing	Stretch

Style	WordWrap


TrhBitmapButton see also
See also

TBitBtn

TButton

TrhColoredButton

TrhGraphicButton


TrhBitmapButton tasks
Using the TrhBitmapButton Component

TrhBitmapButton Reference

The tasks associated with using a TrhBitmapButton are generally the same as the standard TButton or TBitBtn components. To display a bitmap image you must assign a bitmap to the button's GlyphUp property. You may also assign separate bitmaps to GlyphDown, for the display when the button is pressed, and GlyphDisabled, for display when the button is disabled. If no bitmaps are assigned to GlyphDown or GlyphDisabled, the GlyphUp bitmap will be used as needed.

The Stretch property determines how the bitmaps are resized. If Stretch is set to ssBitmap each bitmap is resized to fit on the button face. If Stretch is set to ssButton the button is resized to hold the largest bitmap, smaller bitmaps will be resized to fit the button. If Stretch is ssNone the the glyph will be displayed as an icon, much like the TBitBtn component.

When the Stretch property equals ssNone, use the Layout, Margin, and Spacing properties to alter how the glyph is displayed. Layout determines if the button is displayed to the left or right of the caption. Spacing is the number of pixels between the caption text and the glyph. Margin is the distance in pixels between the glyph and the edge of the button.

You may assign your own colors for the button bevels. Use ColorBevelHilight to set the color for the highlighted areas of the bevel. The ColorBevelShadow property sets the color for the shadowed portion of the bevel.

If you enter a caption and Stretch is not ssNone, the text will displayed on the image, but in most cases will be difficult to read. For multi-line captions set the WordWrap property to True. When the caption extends across multiple lines, the text can be aligned horizontally using the Alignment property. Multi-line captions work particularly well when the glyphs are displayed as icons.


TrhButton3D Component

Properties	Methods	Events	See also	Tasks

Unit

RHCtrl3D

Description

TrhButton3D is a button with a caption drawn with a 3D effect. TrhButton3D descends from TrhColoredButton and supports all the features of a TrhColoredButton including multi-line captions and user defined colors. Captions can be displayed recessed, raised, shadowed, or normal by setting the Style3D property. The colors used to display the 3D effect are fully customizable with the Color3DShadow and Color3DHilight properties.

Caption text can be left justified, right justified or centered. The button can be drawn with either the Windows 3.1 or "new" style bevels.

Interface

  TrhButton3D = class(TrhColoredButton)

  protected

    function  DrawCaption(const ARect : TRect): TRect; override;

  public

    constructor Create(AOwner : TComponent); override;

  published

    property Style3D: T3dStyle read F3dStyle write SetStyle default tsRaised;

    property ShadowOffset: TShadowOffset read FOffset write SetOffset default 1;

    property Color3DShadow: TColor read FShadowColor write SetShadowColor default clBtnShadow;

    property Color3DHilight: TColor read FHiliteColor write SetHiliteColor default clBtnHighlight;

  end;


TrhButton3D events
Events

OnDrawFace


TrhButton3D methods
Methods

Create	Destroy


TrhButton3D properties
Properties

Alignment	BoldFocus	ColorButtonFace

ColorBevelHilight	ColorBevelShadow	Color3DHilight

Color3DShadow	ShadowOffset	Style

Style3D	WordWrap


TrhButton3D see also
See also

TButton

TrhColoredButton

TrhGraphicButton


TrhButton3D tasks
Using the TrhButton3D Component

TrhButton3D Reference

The tasks associated with using a TrhBitmapButton are generally the same as the standard TButton component. By default, text displays with a raised 3D effect, you change the 3D style by setting the Style3D property. To change the colors used to draw the 3D effects, set the Color3DHilight and Color3DShadow properties.

Change the color of the text by modifying the standard Font property. Most fonts display best in 3D when they are bolded.

You may assign your own colors to the button bevels and the button face. Use ColorBevelHilight to set the color for the highlighted areas of the bevel. The ColorBevelShadow property sets the color for the shadowed portion of the bevel. The ColorButtonFace property determines the color of the button face.

For multi-line captions set the WordWrap property to True. When the caption extends across multiple lines, the text can be aligned horizontally using the Alignment property.


TrhCheckListBox Component

Properties	Methods	See also	Tasks

Unit

RHLBoxCk

Description

The TrhCheckListBox is a list box that displays bitmaps next to each item indicating its selected state. The default bitmaps are a check mark and a rectangle. TrhCheckListBox provides an easy to understand method for selecting multiple items. You may supply your own bitmap for both the selected and unselected states.

Interface

  TrhCheckListBox = class(TCustomListBox)

  protected

    procedure DrawCurItem(Canvas: TCanvas; Index: Integer; ARect: TRect; IsFocused: Boolean; IsSelected: Boolean); virtual;

    procedure DrawFocusState(Canvas: TCanvas; Index: Integer; ARect: TRect; IsFocused: Boolean); virtual;

    procedure DrawSelectState(Canvas: TCanvas; Index: Integer; ARect: TRect; IsSelected: Boolean); virtual;

    function  GetPicture(IsSelected: Boolean): TBitmap; virtual;

  public

    constructor Create(AOwner: TComponent); override;

    destructor  Destroy; override;

  published

    property Align;

    property BorderStyle;

    property Color;

    property Columns;

    property Ctl3D;

    property DragCursor;

    property DragMode;

    property Enabled;

    property ExtendedSelect default False;

    property Font;

    property IntegralHeight;

    property ItemHeight;

    property Items;

    property MultiSelect default True;

    property ParentColor;

    property ParentCtl3D;

    property ParentFont;

    property ParentShowHint;

    property PopupMenu;

    property ShowHint;

    property Sorted;

    property TabOrder;

    property TabStop;

    property Visible;

    property OnClick;

    property OnDblClick;

    property OnDragDrop;

    property OnDragOver;

    property OnEndDrag;

    property OnEnter;

    property OnExit;

    property OnKeyDown;

    property OnKeyPress;

    property OnKeyUp;

    property OnMouseDown;

    property OnMouseMove;

    property OnMouseUp;

    {$IFDEF WIN32}

    property OnStartDrag;

    {$ENDIF}

    property GlyphChecked: TBitmap index IDX_CHECKED read GetGlyph write SetGlyph;

    property GlyphUnchecked: TBitmap index IDX_UNCHECKED read GetGlyph write SetGlyph;

    property GlyphLeftMargin: Integer index IDX_MLEFT read GetOffset write SetOffset default 1;

    property GlyphTopMargin: Integer index IDX_MTOP  read GetOffset write SetOffset default 1;

    property ShowFocusColor: Boolean read FUseFocus write FUseFocus default False;

    property TextLeftMargin: Integer index IDX_MTEXTLEFT read GetOffset write SetOffset default 4;

  end;


TrhCheckListBox Example

This example code demonstrates how to get and set the checked state of items in a list box. The form has one TrhCheckListBox, one TSpinEdit, and one TCheckBox component. The spin edit control can be used to select a list box item, checking or unchecking the check box will change the list box item's selected state.

procedure TForm1.GetItemState;

begin

  { set the check box based on the current value in the spin edit }

  CheckBox1.Caption := CheckListBox1.Items[SpinEdit1.Value];

  CheckBox1.Checked := CheckListBox1.Selected[SpinEdit1.Value];

end;

procedure TForm1.FormCreate(Sender: TObject);

begin

  { set the spin edit max to the number of items in the list box }

  SpinEdit1.MaxValue := CheckListBox1.Items.Count - 1;

  { init the check box }

  GetItemState;

end;

procedure TForm1.CheckBox1Click(Sender: TObject);

begin

  { set list box item the the same state as check box }

  CheckListBox1.Selected[SpinEdit1.Value] := CheckBox1.Checked;

end;

procedure TForm1.SpinEdit1Change(Sender: TObject);

begin

  { spin edit changed update check box for new item }

  GetItemState;

end;

procedure TForm1.CheckListBox1Click(Sender: TObject);

begin

  { list box changed update check box }

  if (CheckListBox1.ItemIndex >= 0) then begin

    GetItemState;

    SpinEdit1.Value := CheckListBox1.ItemIndex;

  end;

end;

Click here to copy this example topic to the clipboard


TrhCheckListBox methods
Methods

Create	Destroy


TrhCheckListBox properties
Properties

GlyphChecked	GlyphLeftMargin	GlyphTopMargin

GlyphUnchecked	ShowFocusColor	TextLeftMargin


TrhCheckListBox see also
See also

TListBox


TrhCheckListBox tasks
Using the TrhCheckListBox Component

TrhCheckListBox Reference	Example

The TrhCheckListBox behaves just like a standard TListBox, except that the selected state of its items are indicated by bitmap images. The default bitmaps are an empty rectangle and a check mark inside a rectangle. You may supply other bitmaps, such as an X in a box, by changing the GlyphChecked and GlyphUnchecked properties. If you supply a new bitmap, remember that the bottom left pixel in the bitmap is the transparent color used when the bitmap is displayed.

Use the GlyphLeftMargin and GlyphTopMargin properties to set the margin, in pixels, around the bitmap. The height of each line in the list box is determined by the ItemHeight property. ItemHeight defaults to the height of the tallest bitmap plus twice the value of GlyphTopMargin. If you change the size of the font and the height of the new font is greater than ItemHeight, ItemHeight will be changed to the the font height plus twice the GlyphTopMargin value

The glyph is always drawn to the left of the text for on a line. You can adjust the spacing between the glyph and the text with the TextLeftMargin property

ItemIndex indicates the currently selected item in a single selection list box. For a list box with the MultiSelect property set to True, the ItemIndex property does not indicate whether an item is selected. With a multi-select box you must use the Selected property to determine which items are selected. Selected is an array of boolean values, with one entry for each item in the list box. SelCount is the total number of selected items in the list box.


TrhColoredButton Component

Properties	Methods	See also	Tasks

Unit

RHClrBtn

Description

TrhColoredButton is a button that supports multi-line captions and user defined colors for the bevels and face. Caption text can be left justified, right justified, or centered. The button can be drawn with either the Windows 3.1 or the "new" style bevels.

Interface

  TrhColoredButton = class(TrhGraphicButton)

  protected

    function  CalcTextBounds(const ARect: TRect): TRect; virtual;

    function  CalcTextSize(AWidth: Integer; ACanvas: TCanvas): TPoint; virtual;

    function  CalcTextBounds(const ARect: TRect; ACanvas: TCanvas): TRect; virtual;

    procedure DrawFace(IsDown, IsDefault, IsFocused, IsNewStyle: Boolean; const ARect : TRect; ACanvas: TCanvas); override;

    function  DrawCaption(const ARect: TRect; ACanvas: TCanvas): TRect; virtual;

    procedure DrawTextFocus(IsDown, IsDefault, IsNewStyle: Boolean; const ARect: TRect; const ATextRect: TRect; ACanvas: TCanvas);

    procedure SetTextFont(IsDefault, IsFocused, IsNewStyle: Boolean; ACanvas: TCanvas);

  public

    constructor Create(AOwner : TComponent); override;

  published

    property Alignment: TAlignment read FAlignment write SetAlignment default taCenter;

    property BoldFocus: Boolean read FBoldText write FBoldText default True;

    property ColorButtonFace;

    property ColorBevelHilight;

    property ColorBevelShadow;

    property WordWrap: Boolean read FWordWrap write SetWordWrap default False;

  end;


TrhColoredButton methods
Methods

Create	Destroy


TrhColoredButton properties
Properties

Alignment	BoldFocus	ColorButtonFace

ColorBevelHilight	ColorBevelShadow	Style

WordWrap


TrhColoredButton see also
See also

TButton

TrhBitmapButton

TrhGraphicButton


TrhColoredButton tasks
Using the TrhColoredButton Component

TrhColoredButton Reference

The tasks associated with using a TrhColoredButton are the same as the standard TButton component. In addition to the standard features you can customize all colors of a TrhColoredButton button. The TrhColoredButton can serve as a substitute for the Delphi TBitBtn if you want to to italicize or bold the fonts on buttons with the bsNew style.

TrhColoredButtons can be displayed with Windows 3.1 style bevels or "new" style bevels. To change the bevel style use the Style property.

Use the ColorBevelHilight property to set the color for the highlighted areas of the bevel. The ColorBevelShadow property sets the color for the shadowed portion of the bevel. You can set the color of the button face using the ColorButtonFace property.

For multi-line captions set the WordWrap property to True. When the caption extends across multiple lines, the text can be aligned horizontally using the Alignment property.


TrhCustomComboBox Component

Properties	Methods	See also	Tasks

Unit

RHCombo

Description

TrhCustomComboBox is a TComboBox that allows the width of the drop down portion of the component to be changed. If you have a combo box with items that are wider than the edit portion of the a standard combo you can use the DropDownWidth property to set a new width for the drop down list.

Interface

  TrhCustomComboBox = class(TCustomComboBox)

  protected

    procedure WndProc(var Message: TMessage); override;

    procedure SetBounds(ALeft, ATop, AWidth, AHeight: Integer); override;

  public

    constructor Create(AOwner: TComponent); override;

  published

    property Style: TComboBoxStyle read GetStyle write SetStyle default csDropDown;

    property Color;

    property Ctl3D;

    property DragMode;

    property DragCursor;

    property DropDownCount;

    property Enabled;

    property Font;

    property ItemHeight;

    property Items;

    property MaxLength;

    property ParentColor;

    property ParentCtl3D;

    property ParentFont;

    property ParentShowHint;

    property PopupMenu;

    property ShowHint;

    property Sorted;

    property TabOrder;

    property TabStop;

    property Text;

    property Visible;

    property Width: Integer read GetWidth write SetWidth;

    property OnChange;

    property OnClick;

    property OnDblClick;

    property OnDragDrop;

    property OnDragOver;

    property OnDrawItem;

    property OnDropDown;

    property OnEndDrag;

    property OnEnter;

    property OnExit;

    property OnKeyDown;

    property OnKeyPress;

    property OnKeyUp;

    property OnMeasureItem;

    {$IFDEF WIN32}

    property OnStartDrag;

    {$ENDIF}

    property DropDownWidth: Word read FDropDownWidth write SetDropDownWidth;

  end;


TrhCustomComboBox methods
Methods

Create	SetBounds


TrhCustomComboBox properties
Properties

DropDownWidth


TrhCustomComboBox see also
See also

TComboBox

TrhTabComboBox


TrhCustomComboBox tasks
Using the TrhCustomComboBox Component

TrhCustomComboBox Reference

You use a TrhCustomComboBox just like a standard TComboBox component. The only difference is that for all styles except csSimple, you can set the width of the drop down portion of the control.

The DropDownWidth property is used to set the width of the drop down list in pixels. DropDownWidth changes with the width of the control until the first time it is changed. Once you change the DropDownWidth property, it will no longer change as you resize the control. DropDownWidth does not affect the size of the edit portion of the combo box.


TrhCustomFramedLabel Class

Unit

RHLblFrm

Description

TrhCustomedFramedLabel is a TLabel component with a frame drawn around its caption. It is the parent class for the TrhFramedLabel and the TrhFramedLabel3D components.

Interface

  TrhCustomFramedLabel = class(TCustomLabel)

  protected

    procedure DrawCaption(ACanvas: TCanvas); virtual;

    procedure DrawFrame(ACanvas: TCanvas); virtual;

    procedure Paint; override;

    property AlignmentVertical: TVertAlignment read FVAlignment write SetVAlignment default vaNone;

    property AutoSize: Boolean read GetAutoSize write SetAutoSize default True;

    property FrameColor: TColor read FFrameColor write SetFrameColor default clBlack;

    property ShowFrame: Boolean read FShowFrame write SetShowFrame default True;

    property TextOffset: TTextOffset read FTextOffset write SetTextOffset default 1;

    property WordWrap: Boolean read GetWordWrap write SetWordWrap default False;

  public

    constructor Create(Aowner : TComponent); override;

  published

    property Align;

    property Alignment;

    property Caption;

    property Color;

    property DragCursor;

    property DragMode;

    property Enabled;

    property FocusControl;

    property Font;

    property ParentColor;

    property ParentFont;

    property ParentShowHint;

    property PopupMenu;

    property ShowAccelChar;

    property ShowHint;

    property Transparent;

    property Visible;

    property OnClick;

    property OnDblClick;

    property OnDragDrop;

    property OnDragOver;

    property OnEndDrag;

    property OnMouseDown;

    property OnMouseMove;

    property OnMouseUp;

    {$IFDEF WIN32}

    property OnStartDrag;

    {$ENDIF}

  end;


TrhFramedLabel Component

Properties	Methods	See also 	Tasks

Unit

RHLblFrm

Description

TrhFramedLabel is a label component with a frame drawn around its caption. It is descended form the TrhCustomFramedLabel  which is the base class for TrhFramedLabel and TrhFramedLabel3D.

Interface

  TrhFramedLabel = class(TrhCustomFramedLabel)

  public

    constructor Create(Aowner: TComponent); override;

  published

    property AlignmentVertical: TVertAlignment read FVAlignment write SetVAlignment default vaNone;

    property AutoSize: Boolean read GetAutoSize write SetAutoSize default True;

    property FrameColor: TColor read FFrameColor write SetFrameColor default clBlack;

    property ShowFrame: Boolean read FShowFrame write SetShowFrame default True;

    property TextOffset: TTextOffset read FOffset write SetTextOffset default 1;

    property WordWrap: Boolean read GetWordWrap write SetWordWrap default False;

  end;


TrhFramedLabel methods
Methods

Create


TrhFramedLabel properties
Properties

Alignment	AlignmentVertical	FrameColor

ShowFrame	TextOffset	WordWrap


TrhFramedLabel see also
See also

TLabel

TrhCustomFramedLabel


TrhFramedLabel tasks
Using the TrhFramedLabel Component

TrhFramedLabel Reference

A TrhFramedLabel behaves much like a standard TLabel component.

When the ShowFrame property is True, the caption will be displayed inside a border drawn in the current FrameColor. When AutoSize is True, the value of TextOffset is the number of pixels spacing between the border and the caption text on all sides.

You can use the standard Alignment property to left justify, right justify, or center the caption horizontally in the frame. The AlignmentVertical property will draw the caption at the top, bottom or center of the frame vertically.


TrhFramedLabel3D Component

Properties	Methods	See also	Tasks

Unit

RHCtrl3D

Description

TrhFramedLabel is a TrhCustomFramedLabel component with a 3D frame drawn around its caption. The frame and label caption can be drawn with a raised, lowered or shadowed 3D effect.  The 3D effect is changed by setting the Style3D property. The colors used to display the 3D effect are fully customizable with the Color3DShadow and Color3DHilight properties.

Interface

TrhFramedLabel3D = class(TrhCustomFramedLabel)

protected

    procedure DrawCaption(ACanvas: TCanvas); override;

    procedure DrawFrame(ACanvas: TCanvas); override;

  public

    constructor Create(AOwner: TComponent); override;

  published

    property AlignmentVertical;

    property AutoSize;

    property ShowFrame;

    property TextOffset;

    property WordWrap;

    property Style3D: T3dStyle read F3dStyle write SetStyle default tsRaised;

    property ShadowOffset: TShadowOffset read FShadowOffset write SetOffset default 1;

    property Color3DShadow: TColor read FShadowColor write SetShadowColor default clBtnShadow;

    property Color3DHilight: TColor read FHiliteColor write SetHiliteColor default clBtnHighlight;

end;


TrhFramedLabel3D methods
Methods

Create


TrhFramedLabel3D see also
See also

TLabel

TrhCustomFramedLabel


TrhFramedLabel3d tasks
Using the TrhFramedLabel3d Component

TrhFramedLabel3D reference

A TrhFramedLabel3D behaves much like a standard TLabel component.

To display the caption text with a 3D effect, set the Style3D property to tsRaised, tsRecessed, or tsShadowed. If Style3D is tsShadowed then the value of ShadowOffset is used to set the distance between the caption and its shadow.

Change the color of the text by modifying the standard Font property. Most fonts display best in 3D if they are bolded.

You can change the 3D shadow and highlight colors by editing the Color3DShadow and Color3DHilight properties. If you set both colors to the same value, the text will displayed with an outline instead of a 3D effect.

When the ShowFrame property is True, the caption will be displayed inside a border drawn in the current FrameColor. When AutoSize is True, the value of TextOffset is the number of pixels spacing between the border and the caption text on all sides. You will probably need to make the text offset slightly larger than for the TrhFramedLabel component, because of the extra space needed to draw the 3D border.

You can use the standard Alignment property to left justify, right justify, or center the caption horizontally in the frame. The AlignmentVertical property will draw the caption at the top, bottom or center of the frame vertically.


TrhFramedlabel3d properties
Properties

Alignment	AlignmentVertical	Color3DShadow

Color3DHilight	ShadowOffset	ShowFrame

Style3D	TextOffset	WordWrap


TrhGraphicButton Component

Properties	Methods	Events	See also	Tasks

Unit

RHGrhBtn

Description

TrhGraphicButton is the base class for TrhColoredButton, TrhBitmapButton, and TrhButton3D. You can use TrhGraphicButton to display anything you want on the button face. As implemented, TrhGraphicButton displays nothing, not even a caption. However; TrhGraphicButton calls an event handler, that you assign, whenever the button face needs to be repainted.

Interface

  TrhGraphicButton = class(TButton)

  protected

    procedure CreateParams(var Params: TCreateParams); override;

    procedure DoDrawFace(IsDown, IsDefault, IsFocused, IsNewStyle: Boolean; const ARect: TRect; ACanvas: TCanvas);

    procedure DrawItem(const DrawItemStruct: TDrawItemStruct); virtual;

    procedure DrawFace(IsDown, IsDefault, IsFocused, IsNewStyle: Boolean; const ARect: TRect; ACanvas: TCanvas); virtual;

    procedure SetButtonStyle(ADefault: Boolean); override;

    property Canvas: TCanvas read FCanvas; {do not publish}

    property ColorButtonFace: TColor index IDX_BTNFACE read GetColor write SetColor default clBtnFace;

    property ColorBevelShadow: TColor index IDX_BTNSHADOW read GetColor write SetColor default clBtnShadow;

    property ColorBevelHilight: TColor index IDX_BTNHILIGHT read GetColor write SetColor default clBtnHighlight;

    property FillRectFlag: Boolean read FFillFlag write FFillFlag;

  public

    constructor Create(AOwner: TComponent); override;

    destructor Destroy; override;

  published

    property OnDrawFace: TBtnDrawEvent read FOnDrawFace write FOnDrawFace;

    property Style: TButtonStyle read FStyle write SetStyle default bsAutoDetect;

  end;


TrhGraphicButton events
Events

OnDrawFace


TrhGraphicButton methods
Methods

Create	Destroy


TrhGraphicButton properties
Properties

Style


TrhGraphicButton see also
See also

TButton


TrhGraphicButton tasks
Using the TrhGraphicButton Component

TrhGraphicButton Reference

The main task associated with a TrhGraphicButton is to add an event handler for the OnDrawFace event. The default behavior of a TrhGraphicButton is to display a blank button face. If you assign an event handler you can draw the button face yourself, using any of the normal canvas drawing routines. You can display a bitmap, draw lines or shapes, and respond to the current button state in any manner you see fit.

TrhGraphicButton can be displayed with Windows 3.1 style bevels or "new" style bevels. To change the bevel style use the Style property.


TrhLabel3D Component

Properties	Methods	See also 	Tasks

Unit

RHCtrl3D

Description

TrhLabel3D is a label with a caption that can be drawn with a raised, lowered or shadowed 3D effect. The 3D effect is changed by setting the Style3D property. The colors used to display the 3D effect are fully customizable with the Color3DShadow and Color3DHilight properties.

Interface

  TrhLabel3D = class(TCustomLabel)

  protected

    procedure Paint; override;

  public

    constructor Create(AOwner: TComponent); override;

  published

    property Align;

    property Alignment;

    property AutoSize;

    property Caption;

    property Color;

    property DragCursor;

    property DragMode;

    property Enabled;

    property FocusControl;

    property Font;

    property ParentColor;

    property ParentFont;

    property ParentShowHint;

    property PopupMenu;

    property ShowAccelChar;

    property ShowHint;

    property Transparent;

    property Visible;

    property WordWrap;

    property OnClick;

    property OnDblClick;

    property OnDragDrop;

    property OnDragOver;

    property OnEndDrag;

    property OnMouseDown;

    property OnMouseMove;

    property OnMouseUp;

    {$IFDEF WIN32}

    property OnStartDrag;

    {$ENDIF}

    property Style3D: T3dStyle read F3dStyle write SetStyle default tsRaised;

    property ShadowOffset: TShadowOffset read FShadowOffset write SetOffset default 1;

    property Color3DShadow: TColor read FShadowColor write SetShadowColor default clBtnShadow;

    property Color3DHilight: TColor read FHiliteColor write SetHiliteColor default clBtnHighlight;

  end;


TrhLabel3D methods
Methods

Create


TrhLabel3D properties
Properties

Color3DHighlight	Style3D

Color3DShadow	ShadowOffset


TrhLabel3D see also
See also

TLabel

TrhFramedLabel3D


TrhLabel3D tasks
Using the TrhLabel3D Component

TrhLabel3D Reference

To display the caption text with a 3D effect, set the Style3D property to tsRaised, tsRecessed, or tsShadowed. If Style3D is tsShadowed then the value of ShadowOffset is used to set the distance between the caption and its shadow.

Change the color of the text by modifying the standard Font property. Most fonts display best in 3D when they are bolded.

You can change the 3D shadow and highlight colors by editing the Color3DShadow and Color3DHilight properties. If you set both colors to the same value, the text will displayed with an outline instead of a 3D effect.


TrhTabComboBox Component

Properties	Methods	See also	Tasks

Unit

RHTabBox

Description

TrhTabComboBox is a TrhCustomComboBox that can display multiple columns of text. To add column aligned text just insert a tab character between each column of text before adding it to the combo box. Column widths can be set in pixel, average or maximum character width.

Columns can be made invisible to store hidden data for easy retrieval. Text from any row and column in the list box can be retrieved at run time with the RowText or ColText properties.

Interface

  TrhTabComboBox = class(TrhCustomComboBox)

  protected

    procedure DrawItem(Index: Integer; Rect: TRect; State: TOwnerDrawState); override;

    procedure DefineProperties(Filer: TFiler); override;

    procedure Loaded; override;

  public

    constructor Create(AOwner: TComponent); override;

    destructor  Destroy; virtual;

    property AverageCharWidth: Double read GetAverageCharWidth;

    property MaxCharWidth: Integer read GetMaxCharWidth;

    property ColText[Col : Byte]: String read GetColText;

    property RowText[Row : Integer; Col : Byte]: String read GetRowText;

    property ColumnWidth[Col : Byte]: TColumnWidth read GetColumnWidth write SetColumnWidth;

    property ColumnVisible[Col : Byte]: Boolean read GetColumnVisible write SetColumnVisible;

  published

    property Column: Byte read FCol write SetCol stored False;

    property Columns: Byte read FColumns write SetColumns default MIN_COL;

    property ColVisible: Boolean read GetColVisible write SetColVisible stored False;

    property ColWidth: TColumnWidth read GetColWidth write SetColWidth stored False;

    property ColWidthCalc: TWidthCalc read FWidthCalc write SetWidthCalc;

    property ItemHeight: Integer read GetItemHeight write SetItemHeight;

  end;


TrhTabComboBox Example

This example shows how to change column settings at runtime. There is one TrhTabComboBox, one TEdit, and one TCheckBox on the form.

procedure TForm1.CheckBox1Click(Sender: TObject);

var

  Col : Integer;

begin

  Col := StrToInt(Edit1.Text);

  { toggle column visible or invisible }

  TabComboBox1.ColumnVisible[Col] := CheckBox1.Checked;

  { change the column width }

  if TabComboBox1.ColumnVisible[Col] then

    TabComboBox1.ColumnWidth[Col] := 5

  else

    TabComboBox1.ColumnWidth[Col] := 0;

end;

Click here to copy this example topic to the clipboard


TrhTabComboBox methods
Methods

Create	Destroy


TrhTabComboBox properties
Properties

AverageCharWidth	Column	Columns

ColText	ColumnVisible	ColVisible

ColWidth	ColumnWidth	ColWidthCalc

DropDownWidth	MaxCharWidth	RowText


TrhTabComboBox see also
See also

TComboBox

TrhCustomComboBox

TrhTabListBox


TrhTabComboBox tasks
Using the TrhTabComboBox Component

TrhTabComboBox Reference	Example

The TrhTabComboBox displays multiple columns of text, up to 255 columns total. The width of the columns can be based on pixels, or the average or maximum character width of the current font. All columns use the same measurement units from the ColWidthCalc property.

To display column aligned text, you must place a tab character between each column of data in each line that you add to the combo box. You can add a tab character (ASCII nine) at run time using the Chr function or the #9 notation. There is also a constant named TAB defined for the use as a Tab character delimiter. You can add tabs to the text in the Items property at design time by pressing Ctrl-Tab in the Items string list editor.

In the Object Inspector, you edit the settings for each column by first setting the current column number in the Column property. Columns are numbered starting from zero. After the current column is set, you can set the column width with the ColWidth property and the column visibility with the ColVisible property. At runtime you can use the array properties ColumnWidth and ColumnVisible to set the width and visibility of a column.

There is a custom property editor which allows you to more easily edit column properties. In the Object Inspector, if you double click or press the ellipsis in the ColWidth property field, the Column Editor dialog will be displayed.

Click on the parts of the box below where [image] appears for explanations of features.

You can retrieve the text from any column and row in the combo box at runtime using the the ColText and the RowText properties. The ColText and RowText properties can be used to get the text from both visible and non-visible columns. ColText will return the text from any column in the currently selected row. The current row is returned by the standard ItemIndex property. The RowText property takes a row and column number and will return text from any column in any row of the combo box


TrhTabListBox Component

Properties	Methods	See also	Tasks

Unit

RHTabBox

Description

TrhTabListBox is a TListBox that can display multiple columns of text. To add column aligned text just insert a tab character between each column of text before adding it to the list box. Column widths can be set in pixel, average or maximum character width.

A TrhTabListBox can be linked to a TrhTabListHeader for run time resizing of the list box columns.

Columns can be made invisible to store hidden data for easy retrieval. Text from any row and column in the list box can be retrieved at run time with the RowText or ColText properties.

Interface

  TrhTabListBox = Class(TCustomListBox)

  protected

    procedure CreateParams(var Params : TCreateParams); override;

    procedure DrawItem(Index: Integer; Rect: TRect; State: TOwnerDrawState); override;

    procedure DefineProperties(Filer: TFiler); override;

    procedure Loaded; override;

  public

    constructor Create(AOwner : TComponent); override;

    destructor  Destroy; virtual;

    property AverageCharWidth: Double read GetAverageCharWidth;

    property MaxCharWidth: Integer read GetMaxCharWidth;

    property ColText[Col : Byte]: String read GetColText;

    property RowText[Row : Integer; Col : Byte]: String read GetRowText;

    property ColumnWidth[Col : Byte]: TColumnWidth read GetColumnWidth write SetColumnWidth;

    property ColumnVisible[Col : Byte]: Boolean read GetColumnVisible write SetColumnVisible;

  published

    property Align;

    property BorderStyle;

    property Color;

    property Ctl3D;

    property DragCursor;

    property DragMode;

    property Enabled;

    property ExtendedSelect;

    property Font;

    property IntegralHeight;

    property ItemHeight;

    property Items;

    property MultiSelect;

    property ParentColor;

    property ParentCtl3D;

    property ParentFont;

    property ParentShowHint;

    property PopupMenu;

    property ShowHint;

    property Sorted;

    property TabOrder;

    property TabStop;

    property Visible;

    property OnClick;

    property OnDblClick;

    property OnDragDrop;

    property OnDragOver;

    property OnEndDrag;

    property OnEnter;

    property OnExit;

    property OnKeyDown;

    property OnKeyPress;

    property OnKeyUp;

    property OnMeasureItem;

    property OnMouseDown;

    property OnMouseMove;

    property OnMouseUp;

    {$IFDEF WIN32}

    property OnStartDrag;

    {$ENDIF}

    property Column: Byte read FCol write SetCol stored False;

    property Columns: Byte read FColumns write SetColumns default 1

    property ColVisible: Boolean read GetColVisible write SetColVisible stored False;

    property ColWidth: TColumnWidth read GetColWidth write SetColWidth stored False;

    property ColWidthCalc: TWidthCalc read FWidthCalc write SetWidthCalc;

  end;


TrhTabListBox Example

This example shows how to add multiple columns text to the list box at run time.

procedure TForm1.FormCreate(Sender: TObject);

var

  ch : Char;

  s  : String;

begin

  { add text for three columns }

  for ch := 'A' to 'Z' do begin

    { the are several was to add a TAB (ASCII character nine) characters }

    s := ch + #9 + ch + ch + Chr(9) + ch + ch + ch;

    TabListBox1.Items.Add(s);

  end;

end;

Click here to copy this example topic to the clipboard


TrhTabListBox methods
Methods

Create	Destroy


TrhTabListBox properties
Properties

AverageCharWidth	Column	Columns

ColText	ColumnVisible	ColVisible

ColWidth	ColumnWidth	ColWidthCalc

MaxCharWidth	RowText


TrhTabListBox see also
See also

TListBox

TrhTabComboBox

TrhTabListHeader


TrhTabListBox tasks
Using the TrhTabListBox Component

TrhTabListBox Reference	Example

TrhTabListBox displays multiple columns of text, up to 255 columns total. The width of the columns can be based on pixels, or the average or maximum character width of the current list box font. All columns use the same measurement units from the ColWidthCalc property.

To display column aligned text, you must place a tab character between each column of data in each line that you add to the list box. You can add a tab character (ASCII nine) at run time using the Chr function or the #9 notation. You can add tabs to the text in the Items property at design time by pressing Ctrl-Tab in the string list editor. The text will display at design time aligned correctly for the current column settings.

In the Object Inspector, you edit the setting for each column by first setting the current column in the Column property. Columns are numbered starting from zero. You set the column width with the ColWidth property and the column visibility with the ColVisible property. At runtime you can use the array properties ColumnWidth and ColumnVisible to set the width and visibility of a column.

There is a custom property editor which allows you to more easily edit column properties. In the Object Inspector, if you double click or press the ellipsis in the ColWidth property field, the Column Editor dialog will be displayed.

Click on the parts of the box below where [image] appears for explanations of features.

You can retrieve the text from any column and row in the list box at runtime using the the ColText and the RowText properties. The ColText and RowText properties can be used to get the text from both visible and non-visible columns. ColText will return the text from any column in the currently selected row. For single select list boxes, the current row is returned by the ItemIndex property. The RowText property takes a row and column index and will return text from any column in any row of the list box


TrhTabListHeader Component

Properties	Methods	See also	Tasks

Unit

RHLstHdr

Description

TrhTabListHeader is a THeader that allows user defined color and can be linked with a TrhTabListBox. If a TrhTabListHeader is linked with a TrhTabListBox, resizing the header sections also resizes the list box columns.

Interface

  TrhTabListHeader = class(THeader)

  protected

    procedure CopySectionWidths;

    procedure Notification(AComponent: TComponent; Operation: TOperation); override;

    procedure Paint; override;

    function  GetSections: TStrings;

    procedure SetSections(Strings: TStrings);

    procedure Sized(ASection, AWidth: Integer); override;

    procedure UpdateListBox;

  public

    constructor Create(AOwner : TComponent); override;

    destructor  Destroy; override;

    procedure SetBounds(ALeft, ATop, AWidth, AHeight: Integer); override;

  published

    property Color: TColor read FColor write SetColor default clBtnFace;

    property ListBox: TrhTabListBox read FListBox write SetListBox;

    property Sections: TStrings read GetSections write SetSections;

    property BorderStyle default bsNone;

  end;


TrhTabListHeader methods
Methods

Create	Destroy	SetBounds


TrhTabListHeader properties
Properties

Color	ListBox	Sections


TrhTabListHeader see also
See also

THeader

TrhTabListBox


TrhTabListHeader tasks
Using the TrhTabListHeader Component

TrhTabListHeader Reference

The TrhTabListHeader is used mainly to provide a way to resize the columns of a TrhTabListBox at run time. However, if you need a header that allows custom colors, it can also be used as a replacement for the standard THeader. To change the color of the TrhTabListHeader edit the Color property.

To link a TrhTabListHeader to a TrhTabListBox, select the ListBox property and choose a TrhTabListBox from the list of all TrhTabListBox components on the form. You can add the list box before or after you define the header sections. If you have not added any sections to the header, one section will be added for each column in the list box. At design time and run time the list box columns will be resized whenever the header sections are resized. For best results when using a header, set the ColWidthCalc property of the linked list box to wcPixels.

The header will adjust the list box width when its overall width is changed. When the header is moved the listbox will also be repositioned.

Use the right mouse button to size header sections at design time. Use the left mouse button to size header sections at run time.


Unit RHBmpBtn
RHBmpBtn Unit

The following items are declared in the RHBmpBtn unit:

Components

TrhBitmapButton

Types

TStretchStyle


Unit RHClrBtn
RHClrBtn Unit

The following items are declared in the RHClrBtn unit:

Components

TrhColoredButton


Unit RHCombo
RHCombo Unit

The following items are declared in the RHCombo unit:

Components

TrhCustomComboBox


Unit RHCtlDef
RHCtlDef Unit

The following items are declared in the RHCtlDef unit:

Types

TVertAlignment


Unit RHCtrl3D
RHCtrl3D Unit

The following items are declared in the RHCtrl3D unit:

Components

TrhLabel3D

TrhButton3D

TrhFramedLabel3D

Types

T3dStyle

TShadowOffset


Unit RHGrhBtn
RHGrhBtn Unit

The following items are declared in the RHGrhBtn unit:

Components

TrhGraphicButton

Types

TBtnDrawEvent


Unit RHLBoxCk
RHLBoxCk Unit

The following items are declared in the RHLBoxCk unit:

Components

TrhCheckListBox


Unit RHLblFrm
RHLblFrm Unit

The following items are declared in the RHLblFrm unit:

Components

TrhFramedLabel

Types

TrhCustomFramedLabel

TTextOffset


Unit RHListHdr
RHLstHdr Unit

The following items are declared in the RHLstHdr unit:

Components

TrhTabListHeader


Unit RHTabBox
RHTabBox Unit

The following items are declared in the RHTabBox unit:

Components

TrhTabComboBox

TrhTabListBox

Constants

TAB = #9;

Types

TColumnWidth

TWidthCalc


WordWrap Property

Applies to

TrhLabel3D, TrhButton3D, TrhBitmapButton, TrhColoredButton, TrhFramedLabel, TrhFramedLabel3D

Declaration

property WordWrap: Boolean;

Description

The WordWrap property determines if text in a label or button control wraps at the right margin so that it fits in the control.