make sure the mouse over widget and the focused widget are informed when the dialog is closed

svn-id: r4645
This commit is contained in:
Max Horn 2002-07-26 20:38:55 +00:00
parent b9593a256a
commit e0f1d6c5aa
3 changed files with 26 additions and 13 deletions

View file

@ -57,6 +57,24 @@ void Dialog::teardownScreenBuf()
}
}
void Dialog::open()
{
_gui->openDialog(this);
}
void Dialog::close()
{
if (_mouseWidget) {
_mouseWidget->handleMouseLeft(0);
_mouseWidget = 0;
}
if (_focusedWidget) {
_focusedWidget->lostFocus();
_focusedWidget = 0;
}
_gui->closeTopDialog();
}
void Dialog::draw()
{
Widget *w = _firstWidget;
@ -220,13 +238,6 @@ Widget *Dialog::findWidget(int x, int y)
return w;
}
void Dialog::close()
{
_mouseWidget = 0;
_focusedWidget = 0;
_gui->closeTopDialog();
}
void Dialog::addResText(int x, int y, int w, int h, int resID)
{
// Get the string