Forum Discussion

mikakoistinen's avatar
mikakoistinen
Contributor
8 years ago

TAdvMainMenu item captions

Hi, 

I'm trying to access our Delphi 2007 written application, which main menu is TAdvMainMenu from TMS software.

I can access items by numbers but not by caption. 
On Keyword test this works  

MainMenu     Click ['5'|'7'|'11'] 

But if I change parameter to 'Invoices|Integrations|Some 3rdparty' it says control item 'Invoices' not found.

(I have tried with &-sign and with out - but as fas as I understand & signs are not required).

Then I wrote following testscript, but I see empty messageboxes..

is it so that TAdvMainMenu is not fully compatible ?

 

 

procedure menulist;
var  
  filemenu, i,w;
begin
  w := Aliases.ourApp.OurAppMainForm;  // name changed
  FileMenu := w.MainMenu.Items[0].SubMenu;
  showmessage(w.MainMenu.Items[0].caption);
  for i := 0 to filemenu.count -1 do
  begin
    ShowMessage(filemenu.Items[i].caption)
  end;
end;

3 Replies

  • I don't have any instances of that particular control in the Delphi app I'm working on at the moment.

     

    But I do use tree selectors of various types which use a similar type of locator. I use text with pipe separators, just as you're trying to do. But mine all use 'ClickItem' as their method rather than plain old 'Click'.

     

    Have you tried that?

  • m_essaid's avatar
    m_essaid
    Valued Contributor

    Hi,

     

    I have Delphi and TMS Software components, I tried to help you but I didn't find this type of object. Are you sure TMS provides it ?

     

    Anyway, Colin says very useful things.

    • mikakoistinen's avatar
      mikakoistinen
      Contributor

      HI, 
      Thanks for replies.

      But I can't access clickItem of mainMenu..  I only get Click and Checked options.

       

       

      TadvMainMenu is from TMS. Here's picture from Component Palatte

       

      And link to TMS page http://www.tmssoftware.com/site/advtoolbar.asp

       

      I Wrote  small demo app with standard main menu, and it works like charm.. I guess that there something in TAdvMainMenu...