THYBaseToolbar

Overview

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

You will not deal with this class directly, for toolbar manipulation, you can use the IHYToolbar 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

function Add(anAction: TBasicAction): IHYVCLToolbarItem

Parameters:

  • anAction:

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 write

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

function DoGetItems(Index: Integer): IHYVCLToolbarItem

Parameters:

  • Index:

DoInsert  protected virtual abstract

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

Parameters:

  • anIndex:
  • anAction:

DoInsertSeparator  protected virtual abstract

Gets a toolbar item with specified index from 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

function GetItems(Index: Integer): IHYVCLToolbarItem

Parameters:

  • Index:

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

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

Parameters:

  • anIndex:
  • anAction:

InsertSeparator  protected

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

procedure InsertSeparator(anIndex: Integer)

Parameters:

  • anIndex: Index of the item.

SetLeft  protected virtual abstract

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

procedure SetLeft(Value: Integer)

Parameters:

  • Value: Index of the item.

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

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

procedure SetRow(Value: Integer)

Parameters:

  • Value: Index of the item.

SetShowHint  protected dynamic abstract

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

procedure SetShowHint(Value: Boolean)

Parameters:

  • Value: Index of the item.

SetTop  protected virtual abstract

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

procedure SetTop(Value: Integer)

Parameters:

  • Value: Index of the item.

 

Controller

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

property Controller: THYBaseToolbarController read write

 

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

function Add(anAction: TBasicAction): IHYVCLToolbarItem

Parameters:

  • anAction:

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

function DoGetItems(Index: Integer): IHYVCLToolbarItem

Parameters:

  • Index:

DoInsert  protected virtual abstract

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

Parameters:

  • anIndex:
  • anAction:

DoInsertSeparator  protected virtual abstract

Gets a toolbar item with specified index from 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

function GetItems(Index: Integer): IHYVCLToolbarItem

Parameters:

  • Index:

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

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

Parameters:

  • anIndex:
  • anAction:

InsertSeparator  protected

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

procedure InsertSeparator(anIndex: Integer)

Parameters:

  • anIndex: Index of the item.

SetLeft  protected virtual abstract

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

procedure SetLeft(Value: Integer)

Parameters:

  • Value: Index of the item.

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

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

procedure SetRow(Value: Integer)

Parameters:

  • Value: Index of the item.

SetShowHint  protected dynamic abstract

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

procedure SetShowHint(Value: Boolean)

Parameters:

  • Value: Index of the item.

SetTop  protected virtual abstract

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

procedure SetTop(Value: Integer)

Parameters:

  • Value: Index of the item.

 

Implements