Rx Speed Bar

RX Library

Control Name Unit Class
RX Speed Bar Speedbar TSpeedbar

Description:
TSpeedBar manages speed buttons, arranging them in rows and automatically adjusting their sizes and positions.

TSpeedBar is a container for speed buttons (TSpeedItem). It provides an easy way to arrange and manage TSpeedButton controls.

• All speed buttons on a speed bar maintain a uniform width, height and style.

• The Options property allows the background to show through the speed buttons and gives pop-up borders to the speed buttons.

• Spaces and dividers (which are in fact specially configured speed buttons) can group buttons on the TSpeedBar both visually and functionally.

Typically, the speed buttons correspond to items in an application’s menu and give the user more direct access to the application’s commands.

Speedbar design-time component editor provides a method to create and edit your speedbar and buttons. TSpeedbar has a methods to bring up Customize Dialog at run-time and user can customize the speed bar in run-time using drag-and-drop operation, similar to Delphi speedbar.

TSpeedbar has also methods to store and load layout using ini-file or Win'95 system registry.


Property BoundLines
Declaration: BoundLines: TBoundLines;

Use this property to specify which sides of the Speedbar component will be framed with a recessed (lowered) line.


Property BtnHeight
Declaration: BtnHeight: Integer;

BtnHeight represents the height, in pixels, of the buttons in the TSpeedBar. During upgrading your application, don't remember to increase value of Version property if the BtnHeight or BtnWidth property has been changed.


Property BtnOffsetHorz
Declaration: BtnOffsetHorz: Integer;

Determines the minimum available horizontal offset (left coordinate) for the left-most buttons in Speedbar.


Property BtnOffsetVert
Declaration: BtnOffsetVert: Integer;

Determines the minimum available vertical offset (top coordinate) for the top-most buttons in Speedbar.


Property BtnWidth
Declaration: BtnWidth: Integer;

BtnWidth represents the width, in pixels, of the buttons in the TSpeedBar. During upgrading your application, don't remember to increase value of Version property if the BtnHeight or BtnWidth property has been changed.


Property IniStorage
Declaration: IniStorage: TFormPlacement;

IniStorage property is the IniStorage component that this component saves and restores all the component state information from.


Property Options
Declaration: Options: TSpeedbarOptions;

TSpeedbarOption = (sbAllowDrag, sbAllowResize, sbFlatBtns, sbGrayedBtns, sbTransparentBtns, sbStretchBitmap);

  • sbAllowDrag - allow the speed bar to be dragged to a new position.
  • sbAllowResize - allows the speed bar to be resized.
  • sbFlatBtns - subclasses the RxSpeedButtons so that they appear to be flat.
  • sbGrayedBtns - subclasses the RxSpeedButtons so that they appear grayed.
  • sbTransparentBtns - subclasses the RxSpeedButtons so that they appear transparent.
  • sbStretchBitmap - stretches the wallpaper if necessary.

Property Position
Declaration: Position: TBarPosition;

TBarPosition = (bpAuto, bpCustom);

Positition subclasses the position so that it appears to be either automatically located (bpAuto) or customised to some certain configuration (bpCustom).


Property Sections
Declaration: Sections: TList;

Sections are sections of speedbar so Speedbuttons can be added in a systematic manner.


Property Version
Declaration: Version: Integer;

Apparently does nothing.


Property Wallpaper
Declaration: Wallpaper: TPicture;

WallPaper property contains the picture that is used to "wallpaper" or cover the speedbar.


Event OnApplyAlign
Declaration: OnApplyAlign: TApplyAlignEvent;

OnApplyAlign sets the alignment to a particular part of the form [top, bottom, left and right]. OnApplyAlign is useful for setting some settings that are form specific, e.g., the position of the speedbuttons (from Left-right to Top bottom).

Event OnApplyAlign example

procedure TMainForm.SpeedBarApplyAlign(Sender: TObject; Align: TAlign; var Apply: Boolean);
begin
__Apply := Align in [alTop, alBottom];
end;


Event OnCustomize
Declaration: OnCustomize: TNotifyEvent;

OnCustomize occurs when the speedbar's Customize Dialog closes. Write an OnCustomize event handler to perform special processing when the customize dialog closes.


Event OnPosChanged
Declaration: OnPosChanged: TNotifyEvent;

OnPosChange event is triggered when the position of the speedbar has changed.


Event OnVisibleChanged
Declaration: OnVisibleChanged: TNotifyEvent;

OnVisibleChanged occurs when the control is shown or hide (that is, when the control’s Visible property changes).


Method AddItem
Declaration: procedure AddItem(Section: Integer; Item: TSpeedItem);

AddItem procedure adds an item speedbar item to a particular section.


Method AddSection
Declaration: function AddSection(const ACaption: string): Integer;

AddSection adds a particular section to the toolbar.


Method Customize
Declaration: procedure Customize(HelpCtx: Longint);

Customize sets the helpc context number.


Method FindItem
Declaration: function FindItem(Item: TSpeedItem; var Section, Index: Integer): Boolean;

FindItem tries to find item. If the function returns true, the Section and Index would be filled with the appropriate IDs where exactly the item is.


Method Items
Declaration: function Items(Section, Index: Integer): TSpeedItem;

Items function returns the speeditem based on the section id and the index of the speeditem.


Method ItemsCount
Declaration: function ItemsCount(Section: Integer): Integer;

ItemsCount function counts the number of items on a speedbar's section.


Method RemoveItem
Declaration: procedure RemoveItem(Item: TSpeedItem);

RemoveItem procedure removes the item from the speedbar.


Method RemoveSection
Declaration: procedure RemoveSection(Section: Integer);

RemoveSection procedure removes the section based on the section number.


Method SearchSection
Declaration: function SearchSection(const ACaption: string): Integer;

SearchSection function searches for a particular caption on the speedbar.


Method SetFontDefault
Declaration: procedure SetFontDefault;

SetFontDefault sets the font to the default font.


Class TSpeedItem

TSpeedItem is a wrapper component for the button control (TRxSpeedButton) in a TSpeedBar object. To place speed buttons on a speed bar at design time, select the speed bar, double-click, and choose Add. All buttons in the speed bar can be grouped by the sections. You can rearange the buttons in a speed bar at design time and at runtime by using drag-and-drop operations while the Speedbar Designer is shown.


Property BtnCaption
Declaration: BtnCaption: TCaption;

BtnCaption specifies a text string that will be shown as a caption of button control (TRxSpeedButton) in the speed bar.


Property Button
Declaration: Button: TRxSpeedButton;

Run-time and read-only property to direct access to the button in a speed-item component as to the TRxSpeedButton control.


Property Stored
Declaration: Stored: Boolean;

This property determines whether or not button's position and visibility will be stored in an INI-file (or in a system registry) when application calls TSpeedbar.SaveLayout (or SaveLayourReg) method.


Method ButtonClick
Declaration: procedure ButtonClick;

ButtonClick simulates a mouse click, as if the user had clicked the button of TSpeedItem.


Type TApplyAlignEvent
Declaration: TApplyAlignEvent = procedure (Sender: TObject; Align: TAlign; var Apply: Boolean) of object;

TApplyAlignEvent is the type of the OnApplyAlign event of the TSpeedBar component.


Type TBarOrientation
Declaration: TBarOrientation = (boHorizontal, boVertical);

TBarOrientation is a set of values for the Orientation property of the TSpeedbar component.


Type TBarPosition
Declaration: TBarPosition = (bpAuto, bpCustom);

TBarPosition is a set of values for the Position property of the TSpeedbar component.


Type TBoundLine
Declaration: TBoundLine = (blTop, blBottom, blLeft, blRight);

TBoundLines is a set of values for the BoundLines property of the TSpeedbar component.


Type TBoundLines
Declaration: TBoundLines = set of TBoundLine;

TBoundLines is a set of values for the BoundLines property of the TSpeedbar component.


Type TSpeedbarOption
Declaration: TSpeedbarOption = (sbAllowDrag, sbAllowResize, sbFlatBtns, sbGrayedBtns, sbTransparentBtns, sbStretchBitmap);

TSpeedbarOptions is a set of values for the Options property of the TSpeedbar component.


Type TSpeedbarOptions
Declaration: TSpeedbarOptions = set of TSpeedbarOption;

TSpeedbarOptions is a set of values for the Options property of the TSpeedbar component.


Routine FindSpeedBar
Declaration: function FindSpeedBar(const Pos: TPoint): TSpeedBar;

FindSpeedBar attempts to find if the speedbar is at position X and Y.

FindSpeedBar example:
__Bar := FindSpeedBar(Point(X, Y));
__if Bar <> nil then
__begin
____{...}
__end;


Index Page | About | Download
Creation Date: 4 Feb 1998 | Last Update: 16 Mar 2000