d.bernaert Posted December 22, 2018 Share Posted December 22, 2018 Hello, I have a button and in the onclick event I show a popup menu with the following code: PopupMenuMore.Popup(0, 36, Sender); This shows the popup menu aligned to the left side of the button. I would like to align it to the right side of the button. Therefore I would need to have the width of the pop-up. Is that possible? Thx, Dominique Quote Link to comment Share on other sites More sharing options...
Sherzod Posted December 22, 2018 Share Posted December 22, 2018 Hi, And what if you will use UniMenuButton instead? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted December 22, 2018 Share Posted December 22, 2018 4 hours ago, d.bernaert said: I would like to align it to the right side of the button. Therefore I would need to have the width of the pop-up. procedure TMainForm.UniButton1Click(Sender: TObject); begin PopupMenuMore.Popup((Sender as TUniButton).Width, 36, Sender); end; Quote Link to comment Share on other sites More sharing options...
d.bernaert Posted December 22, 2018 Author Share Posted December 22, 2018 Hi Sherzod, thx, but that's not what I am looking for. I want the right of the popup to align with the right of the button. This is the actual situation (screenshot), but I would like the right of the pop-up to align with the right of the button, so if the text of one of the pop-up menu items is large, it should expand to the left. Thx, Dominique Quote Link to comment Share on other sites More sharing options...
Sherzod Posted December 22, 2018 Share Posted December 22, 2018 25 minutes ago, Sherzod said: And what if you will use UniMenuButton instead? procedure TMainForm.UniFormCreate(Sender: TObject); begin UniMenuButton1.JSInterface.JSConfig('menuAlign', ['tr-br?']); end; ? Quote Link to comment Share on other sites More sharing options...
d.bernaert Posted December 22, 2018 Author Share Posted December 22, 2018 Sherzod, solved this way! Would you mind to share how you get all this knowledge? I would like to study all this stuff and get more knowledge. Do you have suggestions concerning this? Thx, Dominique Quote Link to comment Share on other sites More sharing options...
Sherzod Posted December 22, 2018 Share Posted December 22, 2018 16 minutes ago, d.bernaert said: Would you mind to share how you get all this knowledge? I would like to study all this stuff and get more knowledge. You can also read and learn the ExtJS documentation, for example UniMenuButton configs: https://docs.sencha.com/extjs/6.6.0/classic/Ext.button.Split.html#configs 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.