summaryrefslogtreecommitdiff
path: root/src/gui/widgets/vertcontainer.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-07-07 11:23:14 -0600
committerJared Adams <jaxad0127@gmail.com>2009-07-07 11:23:14 -0600
commit5662b7d9ad9eb6927df7ca83713d3b6108f59ddc (patch)
tree1e962203f7bf2440b558045967d0f93ccf21bbe4 /src/gui/widgets/vertcontainer.cpp
parent851f67cd9975b090b051decb1deab6b0489d14c5 (diff)
downloadmana-client-5662b7d9ad9eb6927df7ca83713d3b6108f59ddc.tar.gz
mana-client-5662b7d9ad9eb6927df7ca83713d3b6108f59ddc.tar.bz2
mana-client-5662b7d9ad9eb6927df7ca83713d3b6108f59ddc.tar.xz
mana-client-5662b7d9ad9eb6927df7ca83713d3b6108f59ddc.zip
Use tmw-skills.xml instead of hardcoding
Diffstat (limited to 'src/gui/widgets/vertcontainer.cpp')
-rw-r--r--src/gui/widgets/vertcontainer.cpp53
1 files changed, 53 insertions, 0 deletions
diff --git a/src/gui/widgets/vertcontainer.cpp b/src/gui/widgets/vertcontainer.cpp
new file mode 100644
index 00000000..9dd02cdc
--- /dev/null
+++ b/src/gui/widgets/vertcontainer.cpp
@@ -0,0 +1,53 @@
+/*
+ * The Mana World
+ * Copyright (C) 2009 The Mana World Development Team
+ *
+ * This file is part of The Mana World.
+ *
+ * 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
+ * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "gui/widgets/vertcontainer.h"
+
+VertContainer::VertContainer(int spacing):
+ mSpacing(spacing),
+ mCount(0)
+{
+ addWidgetListener(this);
+}
+
+void VertContainer::add(gcn::Widget *widget)
+{
+ Container::add(widget);
+ widget->setPosition(0, mCount * mSpacing);
+ widget->setSize(getWidth(), mSpacing);
+ mCount++;
+ setHeight(mCount * mSpacing);
+}
+
+void VertContainer::clear()
+{
+ Container::clear();
+
+ mCount = 0;
+}
+
+void VertContainer::widgetResized(const gcn::Event &event)
+{
+ for (WidgetListIterator it = mWidgets.begin(); it != mWidgets.end(); it++)
+ {
+ (*it)->setWidth(getWidth());
+ }
+}