THYBaseMenuItem

Overview

THYBaseMenuItem is a base class for menu items in the Hydra framework. This class implements the IHYMenuItem interface and provides basic functionality for menu item manipulation.

You will not have to deal with this class directly, instead, you can use the IHYMenuItem interface for menu item manipulation.

Note: For more information on menu and toolbar usage in the Hydra framework, please refer to this article. Please also look at the Actions sample shipped with Hydra to see menu and toolbar merging in action.

Location


 

constructor Create (TObject, THYBaseController)  reintroduce virtual    (declared in THYControl)

Creates a new instance of the class.

constructor Create(anObject: TObject; aController: THYBaseController)

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, THYBaseMenuController)  reintroduce virtual

Creates a new instance of the class.

constructor Create(anObject: TObject; aController: THYBaseMenuController)

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 (TBasicAction): IHYVCLMenuItem  protected overload

function Add(anAction: TBasicAction): IHYVCLMenuItem

Parameters:

  • anAction:

Add (string): IHYVCLMenuItem  protected overload

function Add(const aCaption: string): IHYVCLMenuItem

Parameters:

  • aCaption:

AddMenu  protected

function AddMenu(const aCaption: string): IHYVCLMenuItem

Parameters:

  • aCaption:

AddSeparator  protected

function AddSeparator: IHYVCLMenuItem

Controller    (declared in THYControl)

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

property Controller: THYBaseController read write

Controller

Holds a reference to the menu controller class.

property Controller: THYBaseMenuController read write

Delete  protected

Gets item with given index from the underlying menu.

procedure Delete(Index: Integer)

Parameters:

  • Index: Index of the item.

DestroyObject  protected    (declared in THYObjectReference)

Destroys the referenced object.

procedure DestroyObject

DoDelete  protected virtual abstract

Gets item with given index from the underlying menu.

procedure DoDelete(Index: Integer)

Parameters:

  • Index: Index of the item.

DoGetCount  protected virtual

Gets number of menu items from the underlying menu.

function DoGetCount: Integer

DoGetIndex  protected virtual abstract    (declared in THYControl)

Returns an item index from the underlying control.

function DoGetIndex: Integer

DoGetItems  protected virtual abstract

function DoGetItems(Index: Integer): IHYVCLMenuItem

Parameters:

  • Index:

DoInsert  protected virtual abstract

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

Parameters:

  • anIndex:
  • anAction:

DoInsertMenu  protected virtual abstract

function DoInsertMenu(anIndex: Integer; const aCaption: string): IHYVCLMenuItem

Parameters:

  • anIndex:
  • aCaption:

DoInsertSeparator  protected virtual abstract

function DoInsertSeparator(anIndex: Integer): IHYVCLMenuItem

Parameters:

  • anIndex:

FindMenuItem  protected

function FindMenuItem(const aCaption: string): IHYVCLMenuItem

Parameters:

  • aCaption:

GetAction  protected dynamic    (declared in THYControl)

Gets an action associated with underlying control.

function GetAction: TBasicAction

GetCaption  protected dynamic    (declared in THYControl)

Gets caption of the underlying control.

function GetCaption: string

GetCount  protected

Gets number of menu items.

function GetCount: Integer

GetImages  protected virtual abstract

Gets reference of the image list associated with menu.

function GetImages: TCustomImageList

GetIndex  protected dynamic    (declared in THYControl)

Gets an item index from the underlying control.

function GetIndex: Integer

GetItems  protected

function GetItems(Index: Integer): IHYVCLMenuItem

Parameters:

  • Index:

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

Insert (Integer, TBasicAction): IHYVCLMenuItem  protected overload

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

Parameters:

  • anIndex:
  • anAction:

Insert (Integer, string): IHYVCLMenuItem  protected overload

function Insert(anIndex: Integer; const aCaption: string): IHYVCLMenuItem

Parameters:

  • anIndex:
  • aCaption:

InsertMenu  protected

function InsertMenu(anIndex: Integer; const aCaption: string): IHYVCLMenuItem

Parameters:

  • anIndex:
  • aCaption:

InsertSeparator  protected

function InsertSeparator(anIndex: Integer): IHYVCLMenuItem

Parameters:

  • anIndex:

MenuItemByCaption  protected

function MenuItemByCaption(const aCaption: string): IHYVCLMenuItem

Parameters:

  • aCaption:

SetAction  protected dynamic    (declared in THYControl)

Sets an action associated with underlying control.

procedure SetAction(Value: TBasicAction)

Parameters:

  • Value: Reference to an action.

SetCaption  protected dynamic    (declared in THYControl)

Sets caption of the underlying control.

procedure SetCaption(const Value: string)

Parameters:

  • Value: New value of the caption.

SetImages  protected virtual abstract

Sets reference of the image list.

procedure SetImages(Value: TCustomImageList)

Parameters:

  • Value: Reference to an image list.

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.

 

Controller    (declared in THYControl)

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

property Controller: THYBaseController read write

Controller

Holds a reference to the menu controller class.

property Controller: THYBaseMenuController read write

 

constructor Create (TObject, THYBaseController)  reintroduce virtual    (declared in THYControl)

Creates a new instance of the class.

constructor Create(anObject: TObject; aController: THYBaseController)

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, THYBaseMenuController)  reintroduce virtual

Creates a new instance of the class.

constructor Create(anObject: TObject; aController: THYBaseMenuController)

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 (TBasicAction): IHYVCLMenuItem  protected overload

function Add(anAction: TBasicAction): IHYVCLMenuItem

Parameters:

  • anAction:

Add (string): IHYVCLMenuItem  protected overload

function Add(const aCaption: string): IHYVCLMenuItem

Parameters:

  • aCaption:

AddMenu  protected

function AddMenu(const aCaption: string): IHYVCLMenuItem

Parameters:

  • aCaption:

AddSeparator  protected

function AddSeparator: IHYVCLMenuItem

Delete  protected

Gets item with given index from the underlying menu.

procedure Delete(Index: Integer)

Parameters:

  • Index: Index of the item.

DestroyObject  protected    (declared in THYObjectReference)

Destroys the referenced object.

procedure DestroyObject

DoDelete  protected virtual abstract

Gets item with given index from the underlying menu.

procedure DoDelete(Index: Integer)

Parameters:

  • Index: Index of the item.

DoGetCount  protected virtual

Gets number of menu items from the underlying menu.

function DoGetCount: Integer

DoGetIndex  protected virtual abstract    (declared in THYControl)

Returns an item index from the underlying control.

function DoGetIndex: Integer

DoGetItems  protected virtual abstract

function DoGetItems(Index: Integer): IHYVCLMenuItem

Parameters:

  • Index:

DoInsert  protected virtual abstract

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

Parameters:

  • anIndex:
  • anAction:

DoInsertMenu  protected virtual abstract

function DoInsertMenu(anIndex: Integer; const aCaption: string): IHYVCLMenuItem

Parameters:

  • anIndex:
  • aCaption:

DoInsertSeparator  protected virtual abstract

function DoInsertSeparator(anIndex: Integer): IHYVCLMenuItem

Parameters:

  • anIndex:

FindMenuItem  protected

function FindMenuItem(const aCaption: string): IHYVCLMenuItem

Parameters:

  • aCaption:

GetAction  protected dynamic    (declared in THYControl)

Gets an action associated with underlying control.

function GetAction: TBasicAction

GetCaption  protected dynamic    (declared in THYControl)

Gets caption of the underlying control.

function GetCaption: string

GetCount  protected

Gets number of menu items.

function GetCount: Integer

GetImages  protected virtual abstract

Gets reference of the image list associated with menu.

function GetImages: TCustomImageList

GetIndex  protected dynamic    (declared in THYControl)

Gets an item index from the underlying control.

function GetIndex: Integer

GetItems  protected

function GetItems(Index: Integer): IHYVCLMenuItem

Parameters:

  • Index:

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

Insert (Integer, TBasicAction): IHYVCLMenuItem  protected overload

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

Parameters:

  • anIndex:
  • anAction:

Insert (Integer, string): IHYVCLMenuItem  protected overload

function Insert(anIndex: Integer; const aCaption: string): IHYVCLMenuItem

Parameters:

  • anIndex:
  • aCaption:

InsertMenu  protected

function InsertMenu(anIndex: Integer; const aCaption: string): IHYVCLMenuItem

Parameters:

  • anIndex:
  • aCaption:

InsertSeparator  protected

function InsertSeparator(anIndex: Integer): IHYVCLMenuItem

Parameters:

  • anIndex:

MenuItemByCaption  protected

function MenuItemByCaption(const aCaption: string): IHYVCLMenuItem

Parameters:

  • aCaption:

SetAction  protected dynamic    (declared in THYControl)

Sets an action associated with underlying control.

procedure SetAction(Value: TBasicAction)

Parameters:

  • Value: Reference to an action.

SetCaption  protected dynamic    (declared in THYControl)

Sets caption of the underlying control.

procedure SetCaption(const Value: string)

Parameters:

  • Value: New value of the caption.

SetImages  protected virtual abstract

Sets reference of the image list.

procedure SetImages(Value: TCustomImageList)

Parameters:

  • Value: Reference to an image list.

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.

 

Implements

 

  • Hydra support for Menus and Toolbars (Delphi)
  • IHYMenuItem