[Scummvm-cvs-logs] CVS: scummvm/gui dialog.cpp,1.4,1.5 widget.cpp,1.4,1.5 widget.h,1.2,1.3
Max Horn
fingolfin at users.sourceforge.net
Sun Jul 7 14:47:04 CEST 2002
Update of /cvsroot/scummvm/scummvm/gui
In directory usw-pr-cvs1:/tmp/cvs-serv32080/gui
Modified Files:
dialog.cpp widget.cpp widget.h
Log Message:
added dialog nesting code (for now using std::stack, I will provide my own stack class later
Index: dialog.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/dialog.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- dialog.cpp 7 Jul 2002 17:49:25 -0000 1.4
+++ dialog.cpp 7 Jul 2002 21:46:53 -0000 1.5
@@ -74,11 +74,7 @@
void Dialog::close()
{
- // FIXME - this code should be inside the Gui class, and should be
- // extended to support nested dialogs.
- _gui->restoreState();
- _gui->_active = false;
- _gui->_activeDialog = 0;
+ _gui->closeTopDialog();
}
void Dialog::addResText(int x, int y, int w, int h, int resID)
@@ -116,7 +112,7 @@
};
SaveLoadDialog::SaveLoadDialog(NewGui *gui)
-:Dialog (gui, 30, 20, 260, 124)
+ : Dialog (gui, 30, 20, 260, 124)
{
addResText(10, 7, 240, 16, 1);
// addResText(10, 7, 240, 16, 2);
@@ -135,6 +131,8 @@
case kSaveCmd:
break;
case kLoadCmd:
+ // FIXME HACK - just to demo the nesting ability
+ _gui->pauseDialog();
break;
case kPlayCmd:
close();
@@ -152,7 +150,7 @@
PauseDialog::PauseDialog(NewGui *gui)
-:Dialog (gui, 50, 80, 220, 16)
+ : Dialog (gui, 50, 80, 220, 16)
{
addResText(2, 2, 220, 16, 10);
}
Index: widget.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/widget.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- widget.cpp 7 Jul 2002 17:49:25 -0000 1.4
+++ widget.cpp 7 Jul 2002 21:46:53 -0000 1.5
@@ -25,7 +25,7 @@
Widget::Widget (Dialog *boss, int x, int y, int w, int h)
-: _boss(boss), _x(x), _y(y), _w(w), _h(h), _id(0), _flags(0)
+ : _boss(boss), _x(x), _y(y), _w(w), _h(h), _id(0), _flags(0)
{
// Insert into the widget list of the boss
_next = _boss->_firstWidget;
@@ -51,6 +51,7 @@
_x += 4;
_y += 4;
}
+
// Now perform the actual widget draw
drawWidget(_flags & WIDGET_HILITED);
@@ -58,6 +59,7 @@
_x -= 4;
_y -= 4;
}
+
// Restore x/y
_x -= _boss->_x;
_y -= _boss->_y;
@@ -68,7 +70,7 @@
StaticTextWidget::StaticTextWidget(Dialog *boss, int x, int y, int w, int h, const char *text)
-:Widget (boss, x, y, w, h)
+ : Widget (boss, x, y, w, h)
{
// FIXME - maybe we should make a real copy of the string?
_text = text;
@@ -85,7 +87,7 @@
ButtonWidget::ButtonWidget(Dialog *boss, int x, int y, int w, int h, const char *label, uint32 cmd)
-:StaticTextWidget(boss, x, y, w, h, label), _cmd(cmd), _hotkey(0)
+ : StaticTextWidget(boss, x, y, w, h, label), _cmd(cmd), _hotkey(0)
{
_flags = WIDGET_ENABLED | WIDGET_BORDER /* | WIDGET_CLEARBG */ ;
}
Index: widget.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/widget.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- widget.h 6 Jul 2002 12:57:51 -0000 1.2
+++ widget.h 7 Jul 2002 21:46:53 -0000 1.3
@@ -87,8 +87,8 @@
uint32 getCmd();
void handleClick(int button);
- void handleMouseEntered(int button) { printf("handleMouseEntered\n"); setFlags(WIDGET_HILITED); draw(); }
- void handleMouseLeft(int button) { printf("handleMouseLeft\n"); clearFlags(WIDGET_HILITED); draw(); }
+ void handleMouseEntered(int button) { setFlags(WIDGET_HILITED); draw(); }
+ void handleMouseLeft(int button) { clearFlags(WIDGET_HILITED); draw(); }
};
More information about the Scummvm-git-logs
mailing list