THYBaseToolbar

Overview

The THYBaseToolbar is a base class for toolbars in the Hydra framework. This class implements the IHYVCLToolbar interface and provides basic functionality for toolbars manipulation.

You will not deal with this class directly, for toolbar manipulation, you can use the IHYVCLToolbar interface.

Note: You can read about menu and toolbar usage in the Hydra framework in this article. Please also take a look at the Actions sample shipped with Hydra to see menu and toolbar merging in action.

Location


 

constructor Create (TObject, THYBaseToolbarController)  reintroduce virtual

Creates a new instance of the class.

constructor Create(anObject: TObject; aController: THYBaseToolbarController)

Parameters:

  • anObject: Object that is wrapped by this class, if anObject is nil, an EHYException is raised.
  • aController: References to a controller that is used to manage this control.

constructor Create (TObject, Boolean)  reintroduce virtual    (declared in THYObjectReference)

Creates a new instance of the class.

constructor Create(anObject: TObject; OwnsObject: Boolean)

Parameters:

  • anObject: Object that is wrapped by this class, if anObject is nil, an EHYException is raised.
  • OwnsObject: If set to true, the referenced object will be freed when this class is destroyed.

Add  protected

Adds a new item and fills it with information from the action object.

function Add(anAction: TBasicAction): IHYVCLToolbarItem

Parameters:

  • anAction: Reference to an action.

AddSeparator  protected

Adds a separator line.

procedure AddSeparator

BeginModify  protected dynamic

The BeginModify method must be called before starting to add to or remove buttons from the toolbar.

Component sets like Developer Express require that the developer calls certain utility methods before starting to customize toolbars or menus. In order to provide a consistent access to different component sets, Hydra follows this approach and makes it mandatory for every wrapped component set.

A call to BeginModify must be followed by one to EndModify.

procedure BeginModify

Controller

References to a controller that is used to manage this control.

property Controller: THYBaseToolbarController read

DestroyObject  protected    (declared in THYObjectReference)

Destroys the referenced object.

procedure DestroyObject

DoGetCount  protected virtual abstract

Gets number of toolbar items from the underlying toolbar class.

function DoGetCount: Integer

DoGetItems  protected virtual abstract

Gets a toolbar item with specified index from the underlying toolbar class.

function DoGetItems(Index: Integer): IHYVCLToolbarItem

Parameters:

  • Index: Index of the item.

DoInsert  protected virtual abstract

Inserts a new item into the underlying toolbar class.

function DoInsert(anIndex: Integer; anAction: TBasicAction): IHYVCLToolbarItem

Parameters:

  • anIndex: Index of the item.
  • anAction: Reference to an action.

DoInsertSeparator  protected virtual abstract

Inserts a separator line into the underlying toolbar class.

procedure DoInsertSeparator(anIndex: Integer)

Parameters:

  • anIndex: Index of the item.

EndModify  protected dynamic

The EndModify method must be called after adding/removing toolbar buttons.

Component sets like Developer Express require that the developer calls certain utility methods before starting to customize toolbars or menus. In order to provide a consistent access to different component sets, Hydra follows this approach and makes it mandatory for every wrapped component set.

A call to BeginModify must be followed by one to EndModify.

procedure EndModify

GetCount  protected

Gets number of toolbar items.

function GetCount: Integer

GetDockable  protected dynamic

Used to get the Dockable property of the toolbar. Returns true by default.

function GetDockable: Boolean

GetIsModifying  protected dynamic

Returns a value indicating whether the control is currently being updated.

function GetIsModifying: Boolean

GetItems  protected

Gets a toolbar item with specified index.

function GetItems(Index: Integer): IHYVCLToolbarItem

Parameters:

  • Index: Index of the item.

GetLeft  protected virtual abstract

Gets the Left position of the underlying toolbar.

function GetLeft: Integer

GetProperty  protected    (declared in THYObjectReference)

Retrieves the value of the published property of the referenced object.

function GetProperty(const aName: string): variant

Parameters:

  • aName: Name of the property.

GetRefObject  protected    (declared in THYObjectReference)

Gets referenced object.

function GetRefObject: TObject

GetRow  protected virtual abstract

Gets the Row position of the underlying toolbar.

function GetRow: Integer

GetShowHint  protected dynamic abstract

Gets the ShowHint property of the underlying toolbar.

function GetShowHint: Boolean

GetTop  protected virtual abstract

Gets the Top position of the underlying toolbar.

function GetTop: Integer

Insert  protected

Inserts a new item into the position specified by the anIndex parameter and fills it with information from the given action object.

function Insert(anIndex: Integer; anAction: TBasicAction): IHYVCLToolbarItem

Parameters:

  • anIndex: Index of the item.
  • anAction: Reference to an action.

InsertSeparator  protected

Inserts a separator line into the position specified by the anIndex parameter.

procedure InsertSeparator(anIndex: Integer)

Parameters:

  • anIndex: Index of the item.

SetLeft  protected virtual abstract

Sets the Left position of the underlying toolbar.

procedure SetLeft(Value: Integer)

Parameters:

  • Value: New value of the property.

SetProperty  protected    (declared in THYObjectReference)

Sets the value of the published property of the referenced object.

procedure SetProperty(const aName: string; const aPropertyValue: variant)

Parameters:

  • aName: Name of the property.
  • aPropertyValue: Value of the property.

SetRow  protected virtual abstract

Sets the Row position of the underlying toolbar.

procedure SetRow(Value: Integer)

Parameters:

  • Value: New value of the property.

SetShowHint  protected dynamic abstract

Sets the ShowHint property of the underlying toolbar.

procedure SetShowHint(Value: Boolean)

Parameters:

  • Value: New value of the property.

SetTop  protected virtual abstract

Sets the Top position of the underlying toolbar.

procedure SetTop(Value: Integer)

Parameters:

  • Value: New value of the property.

 

Controller

References to a controller that is used to manage this control.

property Controller: THYBaseToolbarController read

 

constructor Create (TObject, THYBaseToolbarController)  reintroduce virtual

Creates a new instance of the class.

constructor Create(anObject: TObject; aController: THYBaseToolbarController)

Parameters:

  • anObject: Object that is wrapped by this class, if anObject is nil, an EHYException is raised.
  • aController: References to a controller that is used to manage this control.

constructor Create (TObject, Boolean)  reintroduce virtual    (declared in THYObjectReference)

Creates a new instance of the class.

constructor Create(anObject: TObject; OwnsObject: Boolean)

Parameters:

  • anObject: Object that is wrapped by this class, if anObject is nil, an EHYException is raised.
  • OwnsObject: If set to true, the referenced object will be freed when this class is destroyed.

Add  protected

Adds a new item and fills it with information from the action object.

function Add(anAction: TBasicAction): IHYVCLToolbarItem

Parameters:

  • anAction: Reference to an action.

AddSeparator  protected

Adds a separator line.

procedure AddSeparator

BeginModify  protected dynamic

The BeginModify method must be called before starting to add to or remove buttons from the toolbar.

Component sets like Developer Express require that the developer calls certain utility methods before starting to customize toolbars or menus. In order to provide a consistent access to different component sets, Hydra follows this approach and makes it mandatory for every wrapped component set.

A call to BeginModify must be followed by one to EndModify.

procedure BeginModify

DestroyObject  protected    (declared in THYObjectReference)

Destroys the referenced object.

procedure DestroyObject

DoGetCount  protected virtual abstract

Gets number of toolbar items from the underlying toolbar class.

function DoGetCount: Integer

DoGetItems  protected virtual abstract

Gets a toolbar item with specified index from the underlying toolbar class.

function DoGetItems(Index: Integer): IHYVCLToolbarItem

Parameters:

  • Index: Index of the item.

DoInsert  protected virtual abstract

Inserts a new item into the underlying toolbar class.

function DoInsert(anIndex: Integer; anAction: TBasicAction): IHYVCLToolbarItem

Parameters:

  • anIndex: Index of the item.
  • anAction: Reference to an action.

DoInsertSeparator  protected virtual abstract

Inserts a separator line into the underlying toolbar class.

procedure DoInsertSeparator(anIndex: Integer)

Parameters:

  • anIndex: Index of the item.

EndModify  protected dynamic

The EndModify method must be called after adding/removing toolbar buttons.

Component sets like Developer Express require that the developer calls certain utility methods before starting to customize toolbars or menus. In order to provide a consistent access to different component sets, Hydra follows this approach and makes it mandatory for every wrapped component set.

A call to BeginModify must be followed by one to EndModify.

procedure EndModify

GetCount  protected

Gets number of toolbar items.

function GetCount: Integer

GetDockable  protected dynamic

Used to get the Dockable property of the toolbar. Returns true by default.

function GetDockable: Boolean

GetIsModifying  protected dynamic

Returns a value indicating whether the control is currently being updated.

function GetIsModifying: Boolean

GetItems  protected

Gets a toolbar item with specified index.

function GetItems(Index: Integer): IHYVCLToolbarItem

Parameters:

  • Index: Index of the item.

GetLeft  protected virtual abstract

Gets the Left position of the underlying toolbar.

function GetLeft: Integer

GetProperty  protected    (declared in THYObjectReference)

Retrieves the value of the published property of the referenced object.

function GetProperty(const aName: string): variant

Parameters:

  • aName: Name of the property.

GetRefObject  protected    (declared in THYObjectReference)

Gets referenced object.

function GetRefObject: TObject

GetRow  protected virtual abstract

Gets the Row position of the underlying toolbar.

function GetRow: Integer

GetShowHint  protected dynamic abstract

Gets the ShowHint property of the underlying toolbar.

function GetShowHint: Boolean

GetTop  protected virtual abstract

Gets the Top position of the underlying toolbar.

function GetTop: Integer

Insert  protected

Inserts a new item into the position specified by the anIndex parameter and fills it with information from the given action object.

function Insert(anIndex: Integer; anAction: TBasicAction): IHYVCLToolbarItem

Parameters:

  • anIndex: Index of the item.
  • anAction: Reference to an action.

InsertSeparator  protected

Inserts a separator line into the position specified by the anIndex parameter.

procedure InsertSeparator(anIndex: Integer)

Parameters:

  • anIndex: Index of the item.

SetLeft  protected virtual abstract

Sets the Left position of the underlying toolbar.

procedure SetLeft(Value: Integer)

Parameters:

  • Value: New value of the property.

SetProperty  protected    (declared in THYObjectReference)

Sets the value of the published property of the referenced object.

procedure SetProperty(const aName: string; const aPropertyValue: variant)

Parameters:

  • aName: Name of the property.
  • aPropertyValue: Value of the property.

SetRow  protected virtual abstract

Sets the Row position of the underlying toolbar.

procedure SetRow(Value: Integer)

Parameters:

  • Value: New value of the property.

SetShowHint  protected dynamic abstract

Sets the ShowHint property of the underlying toolbar.

procedure SetShowHint(Value: Boolean)

Parameters:

  • Value: New value of the property.

SetTop  protected virtual abstract

Sets the Top position of the underlying toolbar.

procedure SetTop(Value: Integer)

Parameters:

  • Value: New value of the property.