Quantcast
Channel: Daz Script Developer Discussion - Daz 3D Forums
Viewing all articles
Browse latest Browse all 1067

How to stop the "Enter" key from activating the first button in the dialog?

$
0
0

How do I stop the "Enter" key from activating the first button on the dialog?

Tests:

run script, press the enter key.

run script, click on any text box, type something, press the enter key.

 

// Create Dialog Box
var Form = new DzDialog();
Form.caption = "The 'Enter' key test.";

var count1 = 0;
var count2 = 0;

var lineEdit = new DzLineEdit(Form);
lineEdit.setGeometry( 10, 10, 100, 23 );

// Create and define DzPushButton: 'pushButton'
var pushButton = new DzPushButton( Form );
pushButton.setGeometry( 120, 10, 75, 23 );
pushButton.text = "Clicked 0";
pushButton.objectName = 'pushButton';

connect( pushButton, "clicked()", function() {
	pushButton.text = "Clicked "+(++count1);
} );

connect( pushButton, "released()", function() {
	pushButton.text = "Clicked "+(++count1);
} );
connect( pushButton, "pressed()", function() {
	pushButton.text = "Clicked "+(++count1);
} );

var lineEdit2 = new DzLineEdit(Form);
lineEdit2.setGeometry( 10, 50, 100, 23 );

var pushButton2 = new DzPushButton( Form );
pushButton2.setGeometry( 120, 50, 75, 23 );
pushButton2.text = "Clicked 0";
pushButton2.objectName = 'pushButton2';

connect( pushButton2, "clicked()", function() {
	pushButton2.text = "Clicked "+(++count2);
} );

var bResult = Form.exec();
if( bResult ) {
	// Do if dialog box was accepted
} else {
	// Do if dialog box was canceled
}

 


Viewing all articles
Browse latest Browse all 1067

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>