Frederick Posted July 19, 2019 Share Posted July 19, 2019 I am using the Neptune theme. When displaying a Messagedlg() dialogue control with mbYesNo buttons, I would like to set the default button to mbNo. Additionally, I would like to display a different colour when the mouse cursor hovers over a button, like FMSoft's customer login form. How do I do both? -- Frederick (UniGUI Complete - Professional Edition 1.90.0.1505) Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 19, 2019 Share Posted July 19, 2019 52 minutes ago, Frederick said: When displaying a Messagedlg() dialogue control with mbYesNo buttons, I would like to set the default button to mbNo. This old post may help you: Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 19, 2019 Share Posted July 19, 2019 1 hour ago, Frederick said: Additionally, I would like to display a different colour when the mouse cursor hovers over a button, like FMSoft's customer login form. It's using uni_sencha as a theme Quote Link to comment Share on other sites More sharing options...
Frederick Posted July 19, 2019 Author Share Posted July 19, 2019 5 hours ago, Sherzod said: This old post may help you: I must be doing something wrong here. My code is:- UniSession.AddJS('Ext.override(Ext.MessageBox, {defaultButton: 2});'); messagedlg('Are you sure you want to delete this record?', mtConfirmation, mbYesNo, CheckDelete); and mbYes is still always positioned to by default. Changing the defaultButton value to 1 or 3 makes no difference. Quote Link to comment Share on other sites More sharing options...
Frederick Posted July 19, 2019 Author Share Posted July 19, 2019 5 hours ago, Sherzod said: It's using uni_sencha as a theme Ok, thanks. I can live with this theme until I am proficient with creating my own theme or modifying an existing one. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 19, 2019 Share Posted July 19, 2019 15 minutes ago, Frederick said: and mbYes is still always positioned to by default. Changing the defaultButton value to 1 or 3 makes no difference. Ok, I will check. Quote Link to comment Share on other sites More sharing options...
Frederick Posted July 19, 2019 Author Share Posted July 19, 2019 Thanks. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 19, 2019 Share Posted July 19, 2019 2 hours ago, Frederick said: and mbYes is still always positioned to by default. Changing the defaultButton value to 1 or 3 makes no difference. Can you try this approach for now? procedure TMainForm.UniButton5Click(Sender: TObject); var btnID: string; begin btnID := 'no'; //"ok", "yes", "no", "cancel" UniSession.AddJS('Ext.MessageBox.beforeShow=function(){Ext.MessageBox.defaultFocus=Ext.MessageBox.queryById("'+ btnID +'")};'); MessageDlg('Dialog2', mtConfirmation, mbYesNo, DCallBack2); end; Quote Link to comment Share on other sites More sharing options...
Frederick Posted July 19, 2019 Author Share Posted July 19, 2019 Thanks. This new code does the trick. However, the code is pretty intense! 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.