THYTB2KMenuController
Overview
The THYTB2KMenuController class provides methods for dealing with ToolBar2000 menu objects. This class is used to establish a connection between the Hydra framework and a specific menu component.
Use Case
If you wish to use ToolBar2000 TTBToolbar as your menu host, you will need to use the THYTB2KMenuController component for communication between the menu component and the Hydra framework. In order to do so, you have to perform the following steps:
- Create an instance of the THYTB2KMenuController and set the reference in the
MenuBar
property to your TTBToolbar component. - Set the reference to the THYTB2KMenuController in your THYModuleManager
.MenuController
property.
Note: You can read about menu and toolbar usage in the Hydra framework in this article. Please also look at the Actions sample shipped with Hydra to see menu and toolbar merging in action.
Location
- Unit: Hydra.TB2K.UI.pas
- Ancestry: TComponent | THYUpdateableController | THYBaseController | THYBaseMenuController | THYTB2KMenuController
constructor Create override (declared in THYBaseMenuController)
Creates a new instance of the class.
constructor Create(aOwner: TComponent)
Parameters:
- aOwner: Reference to the owner object.
AddReference protected (declared in THYUpdateableController)
Supplying AddReference
calls within BeginUpate
and EndUpdate
pairs allows the subsequent deletion of all added items via a single call to DeleteUpdates
.
procedure AddReference(const anItem: IHYVCLObjectReference)
Parameters:
- anItem: Reference to an object.
BeginUpdate protected override
Calls BeginUpdate
prior to call(s) to AddReference
. Each BeginUpdate
must have an associated EndUpdate
.
Items added by AddReference
can subsequently be removed by a single call to DeleteUpdates
.
procedure BeginUpdate(const aGUID: TGUID)
Parameters:
- aGUID: Unique identifier of the session.
DeleteUpdates protected override
DeleteUpdates
removes all items added to the host's menu and toolbars via AddReference
calls.
procedure DeleteUpdates(const aGUID: TGUID)
Parameters:
- aGUID: Unique identifier of the session.
DoGetItems protected override
Gets reference to top level the menu item from the underlying control.
function DoGetItems: IHYVCLMenuItem
EndUpdate protected override
Calls EndUpdate
following call(s) to AddReference
preceded by BeginUpdate
.
procedure EndUpdate(const aGUID: TGUID)
Parameters:
- aGUID: Unique identifier of the session.
GetIsUpdating protected (declared in THYUpdateableController)
Returns the value which indicates whether controller is being updated.
function GetIsUpdating: Boolean
GetItems protected (declared in THYBaseMenuController)
Gets reference to top level the menu item.
function GetItems: IHYVCLMenuItem
GetUpdateCount protected (declared in THYUpdateableController)
Returns the number of processed updates.
function GetUpdateCount(const aGUID: TGUID): Integer
Parameters:
- aGUID: Unique identifier of the session.
MenuBar
References to the TTBToolbar that will be used to manage your menus.
property MenuBar: TTBToolbar read write
MenuBar
References to the TTBToolbar that will be used to manage your menus.
property MenuBar: TTBToolbar read write
constructor Create override (declared in THYBaseMenuController)
Creates a new instance of the class.
constructor Create(aOwner: TComponent)
Parameters:
- aOwner: Reference to the owner object.
AddReference protected (declared in THYUpdateableController)
Supplying AddReference
calls within BeginUpate
and EndUpdate
pairs allows the subsequent deletion of all added items via a single call to DeleteUpdates
.
procedure AddReference(const anItem: IHYVCLObjectReference)
Parameters:
- anItem: Reference to an object.
BeginUpdate protected override
Calls BeginUpdate
prior to call(s) to AddReference
. Each BeginUpdate
must have an associated EndUpdate
.
Items added by AddReference
can subsequently be removed by a single call to DeleteUpdates
.
procedure BeginUpdate(const aGUID: TGUID)
Parameters:
- aGUID: Unique identifier of the session.
DeleteUpdates protected override
DeleteUpdates
removes all items added to the host's menu and toolbars via AddReference
calls.
procedure DeleteUpdates(const aGUID: TGUID)
Parameters:
- aGUID: Unique identifier of the session.
DoGetItems protected override
Gets reference to top level the menu item from the underlying control.
function DoGetItems: IHYVCLMenuItem
EndUpdate protected override
Calls EndUpdate
following call(s) to AddReference
preceded by BeginUpdate
.
procedure EndUpdate(const aGUID: TGUID)
Parameters:
- aGUID: Unique identifier of the session.
GetIsUpdating protected (declared in THYUpdateableController)
Returns the value which indicates whether controller is being updated.
function GetIsUpdating: Boolean
GetItems protected (declared in THYBaseMenuController)
Gets reference to top level the menu item.
function GetItems: IHYVCLMenuItem
GetUpdateCount protected (declared in THYUpdateableController)
Returns the number of processed updates.
function GetUpdateCount(const aGUID: TGUID): Integer
Parameters:
- aGUID: Unique identifier of the session.