shawdown Posted April 30, 2018 Share Posted April 30, 2018 Hello, is it possible to set z-index for TUniPopupMenu? The problem is that I have a TUniPanel with z-index set to 19001. "I can not decrease the z-index of TUniPanel because I need it to stay on the open forms. If I lower the z-index to 19000 the TUniPopupMenu works perfectly. in my TUniPanel I have the following code where z-index is defined. function afterrender(sender, eOpts) { sender.getEl().setStyle("position", "fixed"); sender.getEl().setStyle("left", "3px"); sender.getEl().setStyle("top", "3px"); sender.getEl().setStyle("z-index", 19001); } Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 30, 2018 Share Posted April 30, 2018 Hello, Perhaps one of the solutions: http://forums.unigui.com/index.php?/topic/8155-unipopupmenu-beforeinit-for-customizing/&do=findComment&comment=41667 Quote Link to comment Share on other sites More sharing options...
shawdown Posted April 30, 2018 Author Share Posted April 30, 2018 Hello Delphi Developer. I tried the solution informed but to no avail. Does this solution work well in uniGUI version 1.0.2.1449? Can you give me more details on how to work around the problem with the related post solution? Hello, Perhaps one of the solutions: http://forums.unigui.com/index.php?/topic/8155-unipopupmenu-beforeinit-for-customizing/&do=findComment&comment=41667 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 30, 2018 Share Posted April 30, 2018 Hello, Can you make a simple testcase for your issue ?! Quote Link to comment Share on other sites More sharing options...
shawdown Posted April 30, 2018 Author Share Posted April 30, 2018 The following example is attached. Note that this only happens when MainFormDisplayMode = mfPage TUniPopupMenu.zip Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 30, 2018 Share Posted April 30, 2018 Ok, I will check Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 30, 2018 Share Posted April 30, 2018 Why are you using this?: sender.getEl().setStyle("z-index", 19001); Quote Link to comment Share on other sites More sharing options...
shawdown Posted April 30, 2018 Author Share Posted April 30, 2018 So that TUniPanel stays on the open forms. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 30, 2018 Share Posted April 30, 2018 One possible solution: 1. type TXPopupMenu = class(TUniPopupMenu) end; 2. OnFormReady: procedure TMainForm.UniFormReady(Sender: TObject); begin with TXPopupMenu(UniPopupMenu1).MenuControl.JSInterface do begin JSConfig('alwaysOnTop', [True]); end; end; Quote Link to comment Share on other sites More sharing options...
shawdown Posted April 30, 2018 Author Share Posted April 30, 2018 Perfect. Thank you very much. One possible solution: 1. type TXPopupMenu = class(TUniPopupMenu) end; 2. OnFormReady: procedure TMainForm.UniFormReady(Sender: TObject); begin with TXPopupMenu(UniPopupMenu1).MenuControl.JSInterface do begin JSConfig('alwaysOnTop', [True]); end; end; Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted May 1, 2018 Administrators Share Posted May 1, 2018 It is not recommended to manually change z-Index of components. It will conflict with z-Index hierarchy of Ext JS. Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted May 1, 2018 Administrators Share Posted May 1, 2018 JSConfig('alwaysOnTop', [True]); Correct solution. Quote Link to comment Share on other sites More sharing options...
shawdown Posted May 2, 2018 Author Share Posted May 2, 2018 JSConfig('alwaysOnTop', [True]); Correct solution. Hello Farshad and Delphi Developer. I started using z-index following the indications in this post. http://forums.unigui.com/index.php?/topic/9702-tunipanel-bringtofront/ But I'd like to do it the right way so I'm trying to use "alwaysOnTop" but it has not worked as intended. In the MainForm I have a TUniPanel with property "alwaysOnTop = True" but when opening a form this is on TUniPanel. What better way for this panel to stay on any form that is open? Since then, thank you very much for your attention. alwaysOnTop.zip Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted May 2, 2018 Administrators Share Posted May 2, 2018 There is also a property named alwaysontoopriority Sent from my SM-N950F using Tapatalk Quote Link to comment Share on other sites More sharing options...
shawdown Posted May 2, 2018 Author Share Posted May 2, 2018 Hello Farshad. I tried this property with some values like. 1, 10, 100, 1000, 10000, 100000. Unsuccessfully. I think I'm doing something wrong but I can not find it. Quote Link to comment Share on other sites More sharing options...
shawdown Posted May 3, 2018 Author Share Posted May 3, 2018 Any suggestion? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 3, 2018 Share Posted May 3, 2018 Hi, We will check your testcase Quote Link to comment Share on other sites More sharing options...
shawdown Posted May 7, 2018 Author Share Posted May 7, 2018 Although it is not correct, is there any way to set the z-index for TUniPopupMenu? Because it would solve my problem. If not, I'll try to create a PopUpMenu with a TPanel and a few buttons. I am very happy to use uniGUI. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.