Bill McMahon Guest
|
Posted: Tue Sep 07, 2004 11:32 pm Post subject: Stymied by TActionMainMenuBar |
|
|
In my app I'm dynamically adding categories to the main menu bar, one
for each site. Each site controls HW therefore I want same menu items
for each site, The dynamic creation works fine, however during the
Execution & Update events, I've not figured out how to determine the
top most menu item, either by caption or tag. I need this info to
access site commands/state. I've tried typecasting to every
possibility that I can think of.
Any help greatly appreciated
Bill
var
i: integer;
Name: string;
SiteMenu: TActionClientItem;
SitesMenu: TActionClient;
SiteHost: TVirtualSite;
begin
SitesMenu := ActionMainMenuBar.FindFirst;
for i := 0 to MaxSites - 1 do
begin
Name := Configuration.ReadString('Site' + IntToStr(i), 'Name',
'Site ' + IntToStr(i));
if SitesMenu <> nil then
begin
SiteMenu := ActionManager.AddCategory('SiteActions', SitesMenu,
False);
SiteMenu.Caption := Name;
SiteMenu.Tag := i;
end;
|
|