diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-01-08 20:38:41 +0100 |
---|---|---|
committer | Ira Rice <irarice@gmail.com> | 2009-01-08 15:13:57 -0700 |
commit | 3f8387402ee7b528026450232cb457c8ae1cf4e2 (patch) | |
tree | 116b90cd11dd3c7c4b61259ae12418e0e4bb424f /src/gui | |
parent | 6c20e3e7dc031955d30d0edd313254976c36f0d4 (diff) | |
download | mana-client-3f8387402ee7b528026450232cb457c8ae1cf4e2.tar.gz mana-client-3f8387402ee7b528026450232cb457c8ae1cf4e2.tar.bz2 mana-client-3f8387402ee7b528026450232cb457c8ae1cf4e2.tar.xz mana-client-3f8387402ee7b528026450232cb457c8ae1cf4e2.zip |
Removed the unused Box, VBox and HBox classes
They were once meant for doing layout, but never used and the way
they're implemented they would be relayouting with every draw, which
isn't really nice.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/box.cpp | 42 | ||||
-rw-r--r-- | src/gui/box.h | 58 | ||||
-rw-r--r-- | src/gui/hbox.cpp | 39 | ||||
-rw-r--r-- | src/gui/hbox.h | 35 | ||||
-rw-r--r-- | src/gui/vbox.cpp | 43 | ||||
-rw-r--r-- | src/gui/vbox.h | 35 |
6 files changed, 0 insertions, 252 deletions
diff --git a/src/gui/box.cpp b/src/gui/box.cpp deleted file mode 100644 index 59d8c135..00000000 --- a/src/gui/box.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/* - * The Mana World - * Copyright 2004 The Mana World Development Team - * - * This file is part of The Mana World. - * - * The Mana World 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. - * - * The Mana World 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 The Mana World; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "box.h" - -Box::Box(): - padding(0) -{ - setOpaque(false); -} - -Box::~Box() -{ -} - -unsigned int Box::getPadding() -{ - return padding; -} - -void Box::setPadding(unsigned int p) -{ - padding = p; -} diff --git a/src/gui/box.h b/src/gui/box.h deleted file mode 100644 index 46654b48..00000000 --- a/src/gui/box.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * The Mana World - * Copyright 2004 The Mana World Development Team - * - * This file is part of The Mana World. - * - * The Mana World 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. - * - * The Mana World 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 The Mana World; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#ifndef BOX_H -#define BOX_H - -#include <guichan/widgets/container.hpp> - -#include "../guichanfwd.h" - -class Box : public gcn::Container -{ - public: - /** - * Returns padding. - */ - unsigned int getPadding(); - - /** - * Sets padding between widgets. - */ - void setPadding(unsigned int); - - protected: - Box(); - virtual ~Box(); - - /** - * Spacing between client widgets. - */ - unsigned int padding; - - virtual void draw(gcn::Graphics *) = 0; - - typedef std::list<gcn::Widget*> Widgets; - typedef Widgets::iterator WidgetIterator; -}; - -#endif diff --git a/src/gui/hbox.cpp b/src/gui/hbox.cpp deleted file mode 100644 index 020e85c6..00000000 --- a/src/gui/hbox.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/* - * The Mana World - * Copyright 2004 The Mana World Development Team - * - * This file is part of The Mana World. - * - * The Mana World 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. - * - * The Mana World 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 The Mana World; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "hbox.h" - -void HBox::draw(gcn::Graphics *graphics) -{ - int widgetCount = mWidgets.size(); - int childHeight = getHeight(); - if (widgetCount == 0) - return; - int childWidth = getWidth() / widgetCount; - - int i = 0; - for (WidgetIterator w = mWidgets.begin(); w != mWidgets.end(); w++) { - (*w)->setPosition(childWidth * i - padding, 0); - (*w)->setSize(childWidth, childHeight); - i++; - } - gcn::Container::draw(graphics); -} diff --git a/src/gui/hbox.h b/src/gui/hbox.h deleted file mode 100644 index da70a53c..00000000 --- a/src/gui/hbox.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * The Mana World - * Copyright 2004 The Mana World Development Team - * - * This file is part of The Mana World. - * - * The Mana World 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. - * - * The Mana World 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 The Mana World; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef HBOX_H -#define HBOX_H - -#include "box.h" - -#include "../guichanfwd.h" - -class HBox : public Box -{ - public: - void draw(gcn::Graphics *); -}; - -#endif diff --git a/src/gui/vbox.cpp b/src/gui/vbox.cpp deleted file mode 100644 index 2ec1112d..00000000 --- a/src/gui/vbox.cpp +++ /dev/null @@ -1,43 +0,0 @@ -/* - * The Mana World - * Copyright 2004 The Mana World Development Team - * - * This file is part of The Mana World. - * - * The Mana World 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. - * - * The Mana World 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 The Mana World; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "vbox.h" - -void VBox::draw(gcn::Graphics *graphics) -{ - if (mWidgets.empty()) - { - return; - } - - int childWidth = getWidth(); - int childHeight = getHeight() / mWidgets.size(); - int i = 0; - - for (WidgetIterator w = mWidgets.begin(); w != mWidgets.end(); w++) - { - (*w)->setPosition(0, childHeight * i - padding); - (*w)->setSize(childWidth, childHeight); - i++; - } - - gcn::Container::draw(graphics); -} diff --git a/src/gui/vbox.h b/src/gui/vbox.h deleted file mode 100644 index 4538338f..00000000 --- a/src/gui/vbox.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * The Mana World - * Copyright 2004 The Mana World Development Team - * - * This file is part of The Mana World. - * - * The Mana World 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. - * - * The Mana World 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 The Mana World; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef VBOX_H -#define VBOX_H - -#include "box.h" - -#include "../guichanfwd.h" - -class VBox : public Box -{ - public: - void draw(gcn::Graphics *); -}; - -#endif |