This commit is contained in:
dougt%netscape.com 2000-03-23 06:38:35 +00:00
Родитель 5c4909b4ce
Коммит 081fe374c9
2 изменённых файлов: 41 добавлений и 0 удалений

Просмотреть файл

@ -45,6 +45,14 @@ enum { eButtonPressed = 0, eCheckboxState = 1, eNumberButtons = 2, eNumberEditfi
*/
void Alert(in nsIDOMWindow inParent, in wstring inDialogTitle, in wstring inMsg);
/**
* Puts up a dialog with OK button, and
* a message with a single checkbox.
* @return the value of the checkbox.
*/
boolean AlertCheck(in nsIDOMWindow inParent, in wstring inDialogTitle, in wstring inMsg,
in wstring inCheckMsg);
/**
* Puts up a dialog with OK and Cancel buttons.
* @return true for OK, false for Cancel

Просмотреть файл

@ -73,6 +73,39 @@ NS_IMETHODIMP nsCommonDialogs::Alert(nsIDOMWindow *inParent, const PRUnichar *i
return rv;
}
NS_IMETHODIMP nsCommonDialogs::AlertCheck(nsIDOMWindow *inParent, const PRUnichar *inWindowTitle,const PRUnichar *inMsg, const PRUnichar *inCheckMsg, PRBool *outCheckValue)
{
nsresult rv;
nsIDialogParamBlock* block = NULL;
rv = nsComponentManager::CreateInstance( kDialogParamBlockCID,
0,
NS_GET_IID(nsIDialogParamBlock),
(void**)&block );
if ( NS_FAILED( rv ) )
return rv;
// Stuff in Parameters
block->SetInt( eNumberButtons,1 );
block->SetString( eMsg, inMsg );
block->SetString( eDialogTitle, inWindowTitle );
nsString url( kAlertIconURL );
block->SetString( eIconURL, url.GetUnicode());
block->SetString( eCheckboxMsg, inCheckMsg );
block->SetInt(eCheckboxState, *outCheckValue );
rv = DoDialog( inParent, block, kPromptURL );
block->GetInt(eCheckboxState, outCheckValue );
NS_IF_RELEASE( block );
return rv;
}
NS_IMETHODIMP nsCommonDialogs::Confirm(nsIDOMWindow *inParent, const PRUnichar *inWindowTitle, const PRUnichar *inMsg, PRBool *_retval)
{
nsresult rv;