syssubmenu dynamic items fail

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #35783
    skippy
    Participant

    Hi,

    I'm working with Delphi XE2 and I want to add specific filenames in the popup menu of the Tsskinprovider.syssubmenu. I have created the popup menu during design tzime with 2 other items and in the create routine of the form I check for the existing files. For every file I add one item:

    if sf.Files.Count > 0 then

    begin

    for i := 0 to sf.Files.Count-1 do

    begin

    item := TMenuItem.Create(self);

    item.OnClick := mnuFileItemClick;

    item.Caption := ChangeFileExt(ExtractFileName(sf.Files.Strings),'');

    MainPopMenu.Items.Add(item);

    end;

    end;

    MainPopMenu is assigned to skinprovider syssubmenu

    When I start the program, the added items are not shown, only the two items which I added at design time. If I popup the popupmenu by code, it shows all items. During the tests I also noticed that when you assign the popup menu to syssubmenu by code rather than design time, it won't show up.

    Thanks & Regards

    skippy

    #50636
    skippy
    Participant

    I have tried

    sSkinManager1.SkinableMenus.HookPopupMenu(MainPopMenu, sSkinManager1.Active);

    but it doesn't help.

    I have also noticed that OnPupop is not firing on the popup menu.

    #50639
    skippy
    Participant

    any hint ?

    #50644
    Support
    Keymaster

    Hello Skippy!

    Try this code, please:

    Code:
    sSkinProvider1.SystemMenu.Generate;

    This submenu can't be refreshed automatically.

    #50729
    skippy
    Participant

    does not help unfortunately…

    I have now tried a titkebar and the popupmenu is updated but the dynamic items are not skinned properly.

    #50740
    Support
    Keymaster

    If you have added dynamic items, then you should initialize them manually:

    http://www.alphaskins.com/forum/index.php?showtopic=6244

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.