I want a confirmation dialog with server-side generated messages. Has anyone built this yet?
Basically, I just want a QDialog with nameable buttons (at least two, but ideally a configurable number), and a way to register callbacks for when those buttons are hit.
If no one else has one, I'll be building one. How does the following syntax look?
<?
public function dlgConfirm_Create()
{
$this->dlgConfirm = new QQuestionDialog($this);
$this->dlgConfirm->Text = "Should I dissapear?";
$this->dlgConfirm->AddButton('Yes', new QServerAction('btnYes_Click'));
$this->dlgConfirm->AddButton('No', new QServerAction('btnNo_Click'));
$this->dlgConfirm->AddButton('Maybe', new QServerAction('btnMaybe_Click'));
}
public function btnYes_Click()
{
$this->dlgConfirm->HideDialog();
}
public function btnNo_Click()
{
//don't do stuff
}
public function btnMaybe_Click()
{
//Don't give up that easily
$this->dlgConfirm->Text = "I mean it! Should I dissapear?";
$this->dlgConfirm->RemoveButton('Maybe');
}
?>
.bc