2007-05-30 21:56:52 +00:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
|
|
|
*
|
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
2002-07-05 16:56:53 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
2005-10-18 01:30:26 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2014-02-18 01:34:20 +00:00
|
|
|
*
|
2002-07-05 16:56:53 +00:00
|
|
|
*/
|
|
|
|
|
2011-04-24 08:34:27 +00:00
|
|
|
#include "common/rect.h"
|
2005-06-24 16:05:24 +00:00
|
|
|
|
2012-02-23 00:30:47 +00:00
|
|
|
#ifdef ENABLE_KEYMAPPER
|
|
|
|
#include "common/events.h"
|
|
|
|
#endif
|
|
|
|
|
2010-11-16 10:19:01 +00:00
|
|
|
#include "gui/gui-manager.h"
|
2005-01-10 22:06:49 +00:00
|
|
|
#include "gui/dialog.h"
|
|
|
|
#include "gui/widget.h"
|
2002-07-05 16:56:53 +00:00
|
|
|
|
2003-11-10 23:40:48 +00:00
|
|
|
namespace GUI {
|
|
|
|
|
2002-07-28 20:10:39 +00:00
|
|
|
/*
|
|
|
|
* TODO list
|
2005-01-06 19:09:34 +00:00
|
|
|
* - add some sense of the window being "active" (i.e. in front) or not. If it
|
2002-08-04 01:18:06 +00:00
|
|
|
* was inactive and just became active, reset certain vars (like who is focused).
|
|
|
|
* Maybe we should just add lostFocus and receivedFocus methods to Dialog, just
|
|
|
|
* like we have for class Widget?
|
2002-07-28 20:10:39 +00:00
|
|
|
* ...
|
|
|
|
*/
|
|
|
|
|
2008-08-13 17:46:00 +00:00
|
|
|
Dialog::Dialog(int x, int y, int w, int h)
|
2004-12-25 23:20:37 +00:00
|
|
|
: GuiObject(x, y, w, h),
|
2012-05-03 16:32:08 +00:00
|
|
|
_mouseWidget(0), _focusedWidget(0), _dragWidget(0), _tickleWidget(0), _visible(false),
|
2009-01-02 22:10:00 +00:00
|
|
|
_backgroundType(GUI::ThemeEngine::kDialogBackgroundDefault) {
|
|
|
|
// Some dialogs like LauncherDialog use internally a fixed size, even though
|
|
|
|
// their widgets rely on the layout to be initialized correctly by the theme.
|
|
|
|
// Thus we need to catch screen changes here too. If we do not do that, it
|
|
|
|
// will for example crash after returning to the launcher when the user
|
|
|
|
// started a 640x480 game with a non 1x scaler.
|
|
|
|
g_gui.checkScreenChange();
|
|
|
|
}
|
2006-03-07 19:02:42 +00:00
|
|
|
|
2008-08-13 17:46:00 +00:00
|
|
|
Dialog::Dialog(const Common::String &name)
|
2006-03-07 19:02:42 +00:00
|
|
|
: GuiObject(name),
|
2012-05-03 16:32:08 +00:00
|
|
|
_mouseWidget(0), _focusedWidget(0), _dragWidget(0), _tickleWidget(0), _visible(false),
|
2008-11-10 11:24:55 +00:00
|
|
|
_backgroundType(GUI::ThemeEngine::kDialogBackgroundDefault) {
|
2006-12-27 00:47:57 +00:00
|
|
|
|
|
|
|
// It may happen that we have 3x scaler in launcher (960xY) and then 640x480
|
|
|
|
// game will be forced to 1x. At this stage GUI will not be aware of
|
|
|
|
// resolution change, so widgets will be off screen. This forces it to
|
|
|
|
// recompute
|
|
|
|
//
|
|
|
|
// Fixes bug #1590596: "HE: When 3x graphics are choosen, F5 crashes game"
|
|
|
|
// and bug #1595627: "SCUMM: F5 crashes game (640x480)"
|
2009-01-01 21:41:55 +00:00
|
|
|
g_gui.checkScreenChange();
|
2004-12-25 23:20:37 +00:00
|
|
|
}
|
|
|
|
|
2003-03-06 19:52:54 +00:00
|
|
|
int Dialog::runModal() {
|
2002-10-16 17:37:30 +00:00
|
|
|
// Open up
|
|
|
|
open();
|
2003-03-06 19:52:54 +00:00
|
|
|
|
2002-10-16 17:37:30 +00:00
|
|
|
// Start processing events
|
2003-11-02 02:18:16 +00:00
|
|
|
g_gui.runLoop();
|
2003-03-06 19:52:54 +00:00
|
|
|
|
2002-11-19 01:36:47 +00:00
|
|
|
// Return the result code
|
|
|
|
return _result;
|
2002-10-16 17:37:30 +00:00
|
|
|
}
|
|
|
|
|
2003-03-06 19:52:54 +00:00
|
|
|
void Dialog::open() {
|
2002-11-19 01:36:47 +00:00
|
|
|
_result = 0;
|
2002-09-08 16:00:13 +00:00
|
|
|
_visible = true;
|
2003-11-02 02:18:16 +00:00
|
|
|
g_gui.openDialog(this);
|
2003-11-08 23:22:16 +00:00
|
|
|
|
2008-08-13 19:16:04 +00:00
|
|
|
Widget *w = _firstWidget;
|
2002-09-08 16:00:13 +00:00
|
|
|
// Search for the first objects that wantsFocus() (if any) and give it the focus
|
|
|
|
while (w && !w->wantsFocus()) {
|
|
|
|
w = w->_next;
|
|
|
|
}
|
2003-03-06 19:52:54 +00:00
|
|
|
|
2009-06-06 23:22:48 +00:00
|
|
|
setFocusWidget(w);
|
2002-07-26 20:38:55 +00:00
|
|
|
}
|
|
|
|
|
2003-03-06 19:52:54 +00:00
|
|
|
void Dialog::close() {
|
2002-09-08 16:00:13 +00:00
|
|
|
_visible = false;
|
|
|
|
|
2002-07-26 20:38:55 +00:00
|
|
|
if (_mouseWidget) {
|
|
|
|
_mouseWidget->handleMouseLeft(0);
|
|
|
|
_mouseWidget = 0;
|
|
|
|
}
|
2002-11-21 15:20:52 +00:00
|
|
|
releaseFocus();
|
2009-05-18 21:02:52 +00:00
|
|
|
g_gui.closeTopDialog();
|
2002-11-21 15:20:52 +00:00
|
|
|
}
|
|
|
|
|
2006-08-04 13:55:53 +00:00
|
|
|
void Dialog::reflowLayout() {
|
2006-01-27 15:43:23 +00:00
|
|
|
// The screen has changed. That means the screen visual may also have
|
|
|
|
// changed, so any cached image may be invalid. The subsequent redraw
|
|
|
|
// should be treated as the very first draw.
|
|
|
|
|
|
|
|
Widget *w = _firstWidget;
|
|
|
|
while (w) {
|
2006-08-04 13:55:53 +00:00
|
|
|
w->reflowLayout();
|
2006-01-27 15:43:23 +00:00
|
|
|
w = w->_next;
|
|
|
|
}
|
2006-04-19 01:05:28 +00:00
|
|
|
|
2006-08-04 13:55:53 +00:00
|
|
|
GuiObject::reflowLayout();
|
2006-01-27 15:43:23 +00:00
|
|
|
}
|
|
|
|
|
2012-05-03 16:32:08 +00:00
|
|
|
void Dialog::lostFocus() {
|
|
|
|
if (_tickleWidget) {
|
|
|
|
_tickleWidget->lostFocus();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-06-06 23:22:48 +00:00
|
|
|
void Dialog::setFocusWidget(Widget *widget) {
|
|
|
|
// The focus will change. Tell the old focused widget (if any)
|
|
|
|
// that it lost the focus.
|
|
|
|
releaseFocus();
|
|
|
|
|
|
|
|
// Tell the new focused widget (if any) that it just gained the focus.
|
|
|
|
if (widget)
|
|
|
|
widget->receivedFocus();
|
|
|
|
|
|
|
|
_focusedWidget = widget;
|
|
|
|
}
|
|
|
|
|
2003-03-06 19:52:54 +00:00
|
|
|
void Dialog::releaseFocus() {
|
2002-07-26 20:38:55 +00:00
|
|
|
if (_focusedWidget) {
|
|
|
|
_focusedWidget->lostFocus();
|
|
|
|
_focusedWidget = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-03-06 19:52:54 +00:00
|
|
|
void Dialog::draw() {
|
2009-02-06 23:28:08 +00:00
|
|
|
//TANOKU - FIXME when is this enabled? what does this do?
|
|
|
|
// Update: called on tab drawing, mainly...
|
|
|
|
// we can pass this as open a new dialog or something
|
|
|
|
// g_gui._needRedraw = true;
|
|
|
|
g_gui._redrawStatus = GUI::GuiManager::kRedrawTopDialog;
|
2002-11-10 19:39:32 +00:00
|
|
|
}
|
|
|
|
|
2003-03-06 19:52:54 +00:00
|
|
|
void Dialog::drawDialog() {
|
2005-01-06 19:09:34 +00:00
|
|
|
|
2002-09-08 16:00:13 +00:00
|
|
|
if (!isVisible())
|
|
|
|
return;
|
2002-07-07 13:14:34 +00:00
|
|
|
|
2008-08-13 17:46:00 +00:00
|
|
|
g_gui.theme()->drawDialogBackground(Common::Rect(_x, _y, _x+_w, _y+_h), _backgroundType);
|
2002-07-07 13:14:34 +00:00
|
|
|
|
2003-11-02 22:31:20 +00:00
|
|
|
// Draw all children
|
|
|
|
Widget *w = _firstWidget;
|
2002-07-05 16:56:53 +00:00
|
|
|
while (w) {
|
2008-12-22 11:22:15 +00:00
|
|
|
//if (w->_debugVisible)
|
2008-08-07 10:53:33 +00:00
|
|
|
w->draw();
|
2002-07-05 16:56:53 +00:00
|
|
|
w = w->_next;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-03-06 19:52:54 +00:00
|
|
|
void Dialog::handleMouseDown(int x, int y, int button, int clickCount) {
|
2002-07-16 10:52:48 +00:00
|
|
|
Widget *w;
|
2005-01-06 19:09:34 +00:00
|
|
|
|
2002-07-16 10:52:48 +00:00
|
|
|
w = findWidget(x, y);
|
2005-01-06 19:09:34 +00:00
|
|
|
|
2009-01-02 01:31:46 +00:00
|
|
|
if (w && !(w->getFlags() & WIDGET_IGNORE_DRAG))
|
|
|
|
_dragWidget = w;
|
2002-07-13 18:32:09 +00:00
|
|
|
|
2010-06-15 12:33:20 +00:00
|
|
|
// If the click occurred inside a widget which is not the currently
|
2002-09-08 16:00:13 +00:00
|
|
|
// focused one, change the focus to that widget.
|
2004-12-25 23:20:37 +00:00
|
|
|
if (w && w != _focusedWidget && w->wantsFocus()) {
|
2009-06-06 23:22:48 +00:00
|
|
|
setFocusWidget(w);
|
2002-07-13 22:41:29 +00:00
|
|
|
}
|
2002-07-16 10:52:48 +00:00
|
|
|
|
2004-12-25 23:20:37 +00:00
|
|
|
if (w)
|
|
|
|
w->handleMouseDown(x - (w->getAbsX() - _x), y - (w->getAbsY() - _y), button, clickCount);
|
2002-07-13 18:32:09 +00:00
|
|
|
}
|
|
|
|
|
2003-03-06 19:52:54 +00:00
|
|
|
void Dialog::handleMouseUp(int x, int y, int button, int clickCount) {
|
2002-07-13 22:41:29 +00:00
|
|
|
Widget *w;
|
2003-03-06 19:52:54 +00:00
|
|
|
|
2002-07-13 22:41:29 +00:00
|
|
|
if (_focusedWidget) {
|
2004-12-25 23:20:37 +00:00
|
|
|
//w = _focusedWidget;
|
2005-01-06 19:09:34 +00:00
|
|
|
|
2002-07-13 22:41:29 +00:00
|
|
|
// Lose focus on mouseup unless the widget requested to retain the focus
|
2002-07-16 10:52:48 +00:00
|
|
|
if (! (_focusedWidget->getFlags() & WIDGET_RETAIN_FOCUS )) {
|
2002-11-21 15:20:52 +00:00
|
|
|
releaseFocus();
|
2002-07-16 10:52:48 +00:00
|
|
|
}
|
2002-07-13 22:41:29 +00:00
|
|
|
}
|
|
|
|
|
2009-01-02 01:31:46 +00:00
|
|
|
if (_dragWidget)
|
|
|
|
w = _dragWidget;
|
|
|
|
else
|
|
|
|
w = findWidget(x, y);
|
2004-12-28 21:07:34 +00:00
|
|
|
|
|
|
|
if (w)
|
2003-11-02 17:41:01 +00:00
|
|
|
w->handleMouseUp(x - (w->getAbsX() - _x), y - (w->getAbsY() - _y), button, clickCount);
|
2004-12-25 23:20:37 +00:00
|
|
|
|
2004-12-28 21:07:34 +00:00
|
|
|
_dragWidget = 0;
|
2002-07-05 16:56:53 +00:00
|
|
|
}
|
|
|
|
|
2003-03-06 19:52:54 +00:00
|
|
|
void Dialog::handleMouseWheel(int x, int y, int direction) {
|
2002-10-16 20:32:12 +00:00
|
|
|
Widget *w;
|
|
|
|
|
|
|
|
// This may look a bit backwards, but I think it makes more sense for
|
|
|
|
// the mouse wheel to primarily affect the widget the mouse is at than
|
|
|
|
// the widget that happens to be focused.
|
|
|
|
|
|
|
|
w = findWidget(x, y);
|
|
|
|
if (!w)
|
|
|
|
w = _focusedWidget;
|
|
|
|
if (w)
|
2015-03-21 16:35:47 +00:00
|
|
|
w->handleMouseWheel(x - (w->getAbsX() - _x), y - (w->getAbsY() - _y), direction);
|
2002-10-16 20:32:12 +00:00
|
|
|
}
|
|
|
|
|
2007-06-30 12:26:59 +00:00
|
|
|
void Dialog::handleKeyDown(Common::KeyState state) {
|
2002-07-13 22:41:29 +00:00
|
|
|
if (_focusedWidget) {
|
2007-06-30 12:26:59 +00:00
|
|
|
if (_focusedWidget->handleKeyDown(state))
|
2002-07-27 14:16:14 +00:00
|
|
|
return;
|
2003-07-22 16:30:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Hotkey handling
|
2007-06-30 12:26:59 +00:00
|
|
|
if (state.ascii != 0) {
|
2003-07-23 16:44:15 +00:00
|
|
|
Widget *w = _firstWidget;
|
2007-06-30 12:26:59 +00:00
|
|
|
state.ascii = toupper(state.ascii);
|
2003-07-23 16:44:15 +00:00
|
|
|
while (w) {
|
2007-06-30 12:26:59 +00:00
|
|
|
if (w->_type == kButtonWidget && state.ascii == toupper(((ButtonWidget *)w)->_hotkey)) {
|
2003-07-23 16:44:15 +00:00
|
|
|
// The hotkey for widget w was pressed. We fake a mouse click into the
|
|
|
|
// button by invoking the appropriate methods.
|
|
|
|
w->handleMouseDown(0, 0, 1, 1);
|
|
|
|
w->handleMouseUp(0, 0, 1, 1);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
w = w->_next;
|
2002-07-08 00:29:47 +00:00
|
|
|
}
|
|
|
|
}
|
2002-07-27 14:16:14 +00:00
|
|
|
|
|
|
|
// ESC closes all dialogs by default
|
2007-06-30 12:26:59 +00:00
|
|
|
if (state.keycode == Common::KEYCODE_ESCAPE) {
|
2003-12-06 13:55:50 +00:00
|
|
|
setResult(-1);
|
2002-07-27 14:16:14 +00:00
|
|
|
close();
|
2003-12-06 13:55:50 +00:00
|
|
|
}
|
2003-03-06 19:52:54 +00:00
|
|
|
|
2014-03-31 05:43:54 +00:00
|
|
|
if (state.keycode == Common::KEYCODE_TAB) {
|
|
|
|
// TODO: Maybe add Tab behaviours for all widgets too.
|
|
|
|
// searches through widgets on screen for tab widget
|
|
|
|
Widget *w = _firstWidget;
|
|
|
|
while (w) {
|
|
|
|
if (w->_type == kTabWidget)
|
|
|
|
if (w->handleKeyDown(state))
|
|
|
|
return;
|
|
|
|
|
|
|
|
w = w->_next;
|
|
|
|
}
|
|
|
|
}
|
2002-07-08 00:29:47 +00:00
|
|
|
}
|
|
|
|
|
2007-06-30 12:26:59 +00:00
|
|
|
void Dialog::handleKeyUp(Common::KeyState state) {
|
2003-11-07 02:31:44 +00:00
|
|
|
// Focused widget receives keyup events
|
2002-07-13 22:41:29 +00:00
|
|
|
if (_focusedWidget)
|
2007-06-30 12:26:59 +00:00
|
|
|
_focusedWidget->handleKeyUp(state);
|
2002-07-13 18:32:09 +00:00
|
|
|
}
|
|
|
|
|
2003-03-06 19:52:54 +00:00
|
|
|
void Dialog::handleMouseMoved(int x, int y, int button) {
|
2002-07-13 22:41:29 +00:00
|
|
|
Widget *w;
|
2005-01-06 19:09:34 +00:00
|
|
|
|
2004-12-28 21:07:34 +00:00
|
|
|
if (_focusedWidget && !_dragWidget) {
|
2002-07-13 22:41:29 +00:00
|
|
|
w = _focusedWidget;
|
2003-11-02 17:41:01 +00:00
|
|
|
int wx = w->getAbsX() - _x;
|
|
|
|
int wy = w->getAbsY() - _y;
|
2005-01-06 19:09:34 +00:00
|
|
|
|
2002-07-13 22:41:29 +00:00
|
|
|
// We still send mouseEntered/Left messages to the focused item
|
|
|
|
// (but to no other items).
|
2003-11-02 17:41:01 +00:00
|
|
|
bool mouseInFocusedWidget = (x >= wx && x < wx + w->_w && y >= wy && y < wy + w->_h);
|
2002-07-13 22:41:29 +00:00
|
|
|
if (mouseInFocusedWidget && _mouseWidget != w) {
|
2004-12-25 23:20:37 +00:00
|
|
|
if (_mouseWidget)
|
|
|
|
_mouseWidget->handleMouseLeft(button);
|
2002-07-13 22:41:29 +00:00
|
|
|
_mouseWidget = w;
|
|
|
|
w->handleMouseEntered(button);
|
|
|
|
} else if (!mouseInFocusedWidget && _mouseWidget == w) {
|
|
|
|
_mouseWidget = 0;
|
|
|
|
w->handleMouseLeft(button);
|
|
|
|
}
|
|
|
|
|
2009-01-02 02:48:06 +00:00
|
|
|
if (w->getFlags() & WIDGET_TRACK_MOUSE)
|
|
|
|
w->handleMouseMoved(x - wx, y - wy, button);
|
2002-08-04 01:18:06 +00:00
|
|
|
}
|
2005-01-06 19:09:34 +00:00
|
|
|
|
2009-01-02 02:48:06 +00:00
|
|
|
// We process mouseEntered/Left events if we don't have any
|
|
|
|
// currently active dragged widget or if the currently dragged widget
|
|
|
|
// does not want to be informed about the mouse mouse events.
|
|
|
|
if (!_dragWidget || !(_dragWidget->getFlags() & WIDGET_TRACK_MOUSE))
|
2004-12-28 21:07:34 +00:00
|
|
|
w = findWidget(x, y);
|
2009-01-02 02:48:06 +00:00
|
|
|
else
|
|
|
|
w = _dragWidget;
|
2002-08-04 01:18:06 +00:00
|
|
|
|
|
|
|
if (_mouseWidget != w) {
|
|
|
|
if (_mouseWidget)
|
|
|
|
_mouseWidget->handleMouseLeft(button);
|
2009-01-02 02:48:06 +00:00
|
|
|
|
|
|
|
// If we have a widget in drag mode we prevent mouseEntered
|
|
|
|
// events from being sent to other widgets.
|
|
|
|
if (_dragWidget && w != _dragWidget)
|
|
|
|
w = 0;
|
|
|
|
|
2002-08-04 01:18:06 +00:00
|
|
|
if (w)
|
|
|
|
w->handleMouseEntered(button);
|
|
|
|
_mouseWidget = w;
|
2005-01-06 19:09:34 +00:00
|
|
|
}
|
2002-08-04 01:18:06 +00:00
|
|
|
|
2009-01-02 03:03:06 +00:00
|
|
|
// We only sent mouse move events when the widget requests to be informed about them.
|
2009-01-02 02:48:06 +00:00
|
|
|
if (w && (w->getFlags() & WIDGET_TRACK_MOUSE))
|
2004-12-25 23:20:37 +00:00
|
|
|
w->handleMouseMoved(x - (w->getAbsX() - _x), y - (w->getAbsY() - _y), button);
|
2002-07-06 12:57:51 +00:00
|
|
|
}
|
|
|
|
|
2003-03-06 19:52:54 +00:00
|
|
|
void Dialog::handleTickle() {
|
2003-11-07 02:31:44 +00:00
|
|
|
// Focused widget receives tickle notifications
|
2007-11-04 03:38:30 +00:00
|
|
|
if (_focusedWidget && _focusedWidget->getFlags() & WIDGET_WANT_TICKLE)
|
2002-07-13 22:41:29 +00:00
|
|
|
_focusedWidget->handleTickle();
|
2012-05-03 16:32:08 +00:00
|
|
|
|
|
|
|
if (_tickleWidget && _tickleWidget->getFlags() & WIDGET_WANT_TICKLE)
|
|
|
|
_tickleWidget->handleTickle();
|
2002-07-13 22:41:29 +00:00
|
|
|
}
|
2002-07-06 12:57:51 +00:00
|
|
|
|
2003-03-06 19:52:54 +00:00
|
|
|
void Dialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {
|
2002-07-07 22:44:30 +00:00
|
|
|
switch (cmd) {
|
|
|
|
case kCloseCmd:
|
|
|
|
close();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-02-23 00:30:47 +00:00
|
|
|
#ifdef ENABLE_KEYMAPPER
|
|
|
|
void Dialog::handleOtherEvent(Common::Event evt) { }
|
|
|
|
#endif
|
2002-07-05 16:56:53 +00:00
|
|
|
/*
|
|
|
|
* Determine the widget at location (x,y) if any. Assumes the coordinates are
|
|
|
|
* in the local coordinate system, i.e. relative to the top left of the dialog.
|
|
|
|
*/
|
2003-03-06 19:52:54 +00:00
|
|
|
Widget *Dialog::findWidget(int x, int y) {
|
2003-11-02 18:57:20 +00:00
|
|
|
return Widget::findWidgetInChain(_firstWidget, x, y);
|
2002-07-05 16:56:53 +00:00
|
|
|
}
|
|
|
|
|
2006-04-19 01:05:28 +00:00
|
|
|
Widget *Dialog::findWidget(const char *name) {
|
|
|
|
return Widget::findWidgetInChain(_firstWidget, name);
|
|
|
|
}
|
|
|
|
|
2007-03-16 20:47:41 +00:00
|
|
|
void Dialog::removeWidget(Widget *del) {
|
2006-06-02 15:20:48 +00:00
|
|
|
if (del == _mouseWidget)
|
|
|
|
_mouseWidget = NULL;
|
|
|
|
if (del == _focusedWidget)
|
|
|
|
_focusedWidget = NULL;
|
|
|
|
if (del == _dragWidget)
|
|
|
|
_dragWidget = NULL;
|
|
|
|
|
2012-02-24 21:20:50 +00:00
|
|
|
GuiObject::removeWidget(del);
|
2006-04-19 01:05:28 +00:00
|
|
|
}
|
|
|
|
|
2003-11-10 23:40:48 +00:00
|
|
|
} // End of namespace GUI
|