Klaus, here is a replacement for the global confirm( ) that does what you need. Of course you can also set the local strings for 'Yes' and 'No' in some global object and adapt the code so you do not have to pass the strings every time.
MyConfirm = function( sPrompt, bDefault, sTitle, sYes, sNo )
{
var oDlg = new Window( 'dialog', sTitle, [0,0,200,100] );
oDlg.add( 'statictext', [30,30,170,45], sPrompt );
var btnYes = oDlg.add( 'button', [50,60,90,80], sYes );
var btnNo = oDlg.add( 'button', [110,60,150,80], sNo );
if( bDefault )
{
oDlg.defaultElement = btnNo;
}
else
{
oDlg.defaultElement = btnYes;
}
var bResult = false;
btnYes.onClick = function( )
{
bResult = true;
oDlg.hide( );
}
btnNo.onClick = function( )
{
oDlg.hide( );
}
oDlg.center( );
oDlg.show( );
return bResult;
}
The only thing missing compared to the confirm( ) function is the question mark icon. You should be able to add that if you need it.