Bug #3652 » 0001-Fix-escape-handling-for-multiple-modeless-WDialogs.patch
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);
|
||
}
|
||
}
|
- « Previous
- 1
- 2
- Next »