Project

General

Profile

Bug #3652 » 0001-Fix-escape-handling-for-multiple-modeless-WDialogs.patch

Bruce Toll, 11/06/2014 09:44 PM

View differences:

src/Wt/WDialog
void create();
void onEscapePressed();
void onDefaultPressed();
void bringToFront();
DialogCover *cover();
};
src/Wt/WDialog.C
if (dialogs_.empty())
delete this;
else
scheduleRender();
}
virtual bool isExposed(WWidget *w) {
......
return dialog->id() == topDialogId_;
}
void bringToFront(WDialog *dialog) {
if (Utils::erase(dialogs_, dialog)) {
dialogs_.push_back(dialog);
scheduleRender();
}
}
protected:
virtual void render(WFlags<RenderFlag> flags) {
if (dialogs_.empty())
......
}
if (!isModal())
titleBar()->clicked()
.connect("jQuery.data(" + jsRef() + ", 'obj').bringToFront");
titleBar()->clicked().connect(this, &WDialog::bringToFront);
if ( (flags & RenderFull) && autoFocus_)
impl_->setFirstFocus();
......
return 0;
}
void WDialog::bringToFront()
{
doJavaScript("jQuery.data(" + jsRef() + ", 'obj').bringToFront()");
DialogCover *c = cover();
c->bringToFront(this);
}
}
(2-2/2)