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) 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: 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 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. 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. 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. Link to comment Share on other sites More sharing options...
Frederick Posted July 19, 2019 Author Share Posted July 19, 2019 Thanks. 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; 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! 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