[Scummvm-cvs-logs] SF.net SVN: scummvm: [26147] scummvm/trunk/gui
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Fri Mar 16 21:47:41 CET 2007
Revision: 26147
http://scummvm.svn.sourceforge.net/scummvm/?rev=26147&view=rev
Author: fingolfin
Date: 2007-03-16 13:47:41 -0700 (Fri, 16 Mar 2007)
Log Message:
-----------
Added new file gui/object.cpp (collecting GuiObject methods in there), and renamed Dialog::deleteWidget to Dialog::removeWidget (name was misleading, the removed object does *not* get deleted)
Modified Paths:
--------------
scummvm/trunk/gui/dialog.cpp
scummvm/trunk/gui/dialog.h
scummvm/trunk/gui/launcher.cpp
scummvm/trunk/gui/module.mk
scummvm/trunk/gui/newgui.cpp
scummvm/trunk/gui/object.h
Added Paths:
-----------
scummvm/trunk/gui/object.cpp
Modified: scummvm/trunk/gui/dialog.cpp
===================================================================
--- scummvm/trunk/gui/dialog.cpp 2007-03-16 20:45:35 UTC (rev 26146)
+++ scummvm/trunk/gui/dialog.cpp 2007-03-16 20:47:41 UTC (rev 26147)
@@ -323,7 +323,7 @@
return Widget::findWidgetInChain(_firstWidget, name);
}
-void Dialog::deleteWidget(Widget *del) {
+void Dialog::removeWidget(Widget *del) {
if (del == _mouseWidget)
_mouseWidget = NULL;
if (del == _focusedWidget)
@@ -362,8 +362,4 @@
return new ButtonWidget(boss, x, y, w, h, label, cmd, hotkey);
}
-uint32 GuiObject::getMillis() {
- return g_system->getMillis();
-}
-
} // End of namespace GUI
Modified: scummvm/trunk/gui/dialog.h
===================================================================
--- scummvm/trunk/gui/dialog.h 2007-03-16 20:45:35 UTC (rev 26146)
+++ scummvm/trunk/gui/dialog.h 2007-03-16 20:47:41 UTC (rev 26147)
@@ -82,7 +82,7 @@
Widget *findWidget(int x, int y); // Find the widget at pos x,y if any
Widget *findWidget(const char *name);
- void deleteWidget(Widget *widget);
+ void removeWidget(Widget *widget);
ButtonWidget *addButton(GuiObject *boss, int x, int y, const Common::String &label, uint32 cmd, char hotkey);
Modified: scummvm/trunk/gui/launcher.cpp
===================================================================
--- scummvm/trunk/gui/launcher.cpp 2007-03-16 20:45:35 UTC (rev 26146)
+++ scummvm/trunk/gui/launcher.cpp 2007-03-16 20:47:41 UTC (rev 26147)
@@ -892,7 +892,7 @@
}
if (_logo) {
- deleteWidget(_logo);
+ removeWidget(_logo);
_logo->setNext(0);
delete _logo;
_logo = 0;
Modified: scummvm/trunk/gui/module.mk
===================================================================
--- scummvm/trunk/gui/module.mk 2007-03-16 20:45:35 UTC (rev 26146)
+++ scummvm/trunk/gui/module.mk 2007-03-16 20:47:41 UTC (rev 26147)
@@ -15,6 +15,7 @@
massadd.o \
message.o \
newgui.o \
+ object.o \
options.o \
PopUpWidget.o \
ScrollBarWidget.o \
Modified: scummvm/trunk/gui/newgui.cpp
===================================================================
--- scummvm/trunk/gui/newgui.cpp 2007-03-16 20:45:35 UTC (rev 26146)
+++ scummvm/trunk/gui/newgui.cpp 2007-03-16 20:47:41 UTC (rev 26147)
@@ -54,11 +54,6 @@
kKeyRepeatSustainDelay = 100
};
-// HACK. FIXME. This doesn't belong here. But otherwise it creates compilation problems
-GuiObject::GuiObject(const Common::String &name) : _firstWidget(0) {
- _name = name;
-}
-
void GuiObject::reflowLayout() {
if (!_name.empty()) {
if ((_x = g_gui.evaluator()->getVar(_name + ".x")) == EVAL_UNDEF_VAR)
Added: scummvm/trunk/gui/object.cpp
===================================================================
--- scummvm/trunk/gui/object.cpp (rev 0)
+++ scummvm/trunk/gui/object.cpp 2007-03-16 20:47:41 UTC (rev 26147)
@@ -0,0 +1,45 @@
+/* ScummVM - Scumm Interpreter
+ * Copyright (C) 2002-2007 The ScummVM project
+ *
+ * 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
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ */
+
+#include "common/stdafx.h"
+#include "common/system.h"
+#include "gui/object.h"
+#include "gui/widget.h"
+
+namespace GUI {
+
+GuiObject::GuiObject(const Common::String &name) : _firstWidget(0) {
+ _name = name;
+}
+
+GuiObject::~GuiObject() {
+/* TODO: Enable this at some point? Right now it causes crashes
+ delete _firstWidget;
+ _firstWidget = 0;
+*/
+}
+
+uint32 GuiObject::getMillis() {
+ return g_system->getMillis();
+}
+
+
+} // End of namespace GUI
Property changes on: scummvm/trunk/gui/object.cpp
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Rev Author URL Id
Name: svn:eol-style
+ native
Modified: scummvm/trunk/gui/object.h
===================================================================
--- scummvm/trunk/gui/object.h 2007-03-16 20:45:35 UTC (rev 26146)
+++ scummvm/trunk/gui/object.h 2007-03-16 20:47:41 UTC (rev 26147)
@@ -1,5 +1,5 @@
/* ScummVM - Scumm Interpreter
- * Copyright (C) 2002-2006 The ScummVM project
+ * Copyright (C) 2002-2007 The ScummVM project
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -66,6 +66,7 @@
public:
GuiObject(int x, int y, int w, int h) : _x(x), _y(y), _w(w), _h(h), _name(""), _firstWidget(0) { }
GuiObject(const Common::String &name);
+ ~GuiObject();
virtual int16 getAbsX() const { return _x; }
virtual int16 getAbsY() const { return _y; }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list