Marco Hsu Posted November 4, 2016 Share Posted November 4, 2016 I want to let the UniMainMenu control mouse close to the automatic pop-up sub menu, how to set up? Link to comment Share on other sites More sharing options...
Sherzod Posted November 4, 2016 Share Posted November 4, 2016 Hi, For now can you try this solution ?!: 1. type TUniExMainMenu = class(TuniMainMenu) end; 2. procedure TMainForm.UniFormReady(Sender: TObject); var MainMenuJSName: string; begin MainMenuJSName := TUniExMainMenu(UniMainMenu1).GetMenuControl.JSName; UniSession.AddJS(MainMenuJSName + '.items.items.forEach(function(m){m.addListener("mouseover", function(){this.showMenu()})})'); end; Best regards. Link to comment Share on other sites More sharing options...
Marco Hsu Posted November 4, 2016 Author Share Posted November 4, 2016 Thank you ! Link to comment Share on other sites More sharing options...
Frederick Posted October 6, 2023 Share Posted October 6, 2023 I use the above JS code to auto drop down the sub-menu when the mouse cursor is over the TUniMainMenu. How do I auto close the sub-menu when the mouse cursor is not over the TUniMainMenu? -- Frederick (UniGUI Complete - Professional Edition 1.90.0.1573) Link to comment Share on other sites More sharing options...
Sherzod Posted October 6, 2023 Share Posted October 6, 2023 Hello, I will check. Link to comment Share on other sites More sharing options...
Sherzod Posted October 6, 2023 Share Posted October 6, 2023 2 hours ago, Frederick said: I use the above JS code to auto drop down the sub-menu when the mouse cursor is over the TUniMainMenu. How do I auto close the sub-menu when the mouse cursor is not over the TUniMainMenu? Do you have a two-level menu? Link to comment Share on other sites More sharing options...
Frederick Posted October 6, 2023 Share Posted October 6, 2023 Yes. It may possible to have up to 3 levels. Link to comment Share on other sites More sharing options...
Sherzod Posted October 6, 2023 Share Posted October 6, 2023 36 minutes ago, Frederick said: It may possible to have up to 3 levels. Then, if I understand you correctly, this is logically impossible I think. Link to comment Share on other sites More sharing options...
Frederick Posted October 6, 2023 Share Posted October 6, 2023 Ok, thanks anyway Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now