diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-02-09 23:47:02 +0100 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-02-09 23:47:02 +0100 |
commit | fa2f3ac593a792c32095c2e885665ec91bb4019d (patch) | |
tree | f44aee845f0229dfcc6b2ad3c74613e0352f36c2 /src/gui/setup_players.cpp | |
parent | 07f7d52f661a74e6d0c780ca53e724651e3dcc48 (diff) | |
parent | 40edf4e91558cffd83d9015a2cf4a16360e27855 (diff) | |
download | mana-fa2f3ac593a792c32095c2e885665ec91bb4019d.tar.gz mana-fa2f3ac593a792c32095c2e885665ec91bb4019d.tar.bz2 mana-fa2f3ac593a792c32095c2e885665ec91bb4019d.tar.xz mana-fa2f3ac593a792c32095c2e885665ec91bb4019d.zip |
Merged with Aethyra master as of 2009-02-09
Conflicts:
A lot of files...
Diffstat (limited to 'src/gui/setup_players.cpp')
-rw-r--r-- | src/gui/setup_players.cpp | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/src/gui/setup_players.cpp b/src/gui/setup_players.cpp index 9a7fb441..5c19bd2b 100644 --- a/src/gui/setup_players.cpp +++ b/src/gui/setup_players.cpp @@ -19,22 +19,24 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include <string> #include <vector> -#include <guichan/widgets/dropdown.hpp> #include <guichan/widgets/label.hpp> #include "button.h" #include "checkbox.h" +#include "listbox.h" #include "ok_dialog.h" +#include "scrollarea.h" #include "setup_players.h" +#include "table.h" +#include "widgets/dropdown.h" #include "widgets/layouthelper.h" #include "../configuration.h" #include "../log.h" -#include "../player_relations.h" -#include "../sound.h" #include "../utils/gettext.h" @@ -135,8 +137,12 @@ public: std::string name = (*player_names)[r]; gcn::Widget *widget = new gcn::Label(name); mWidgets.push_back(widget); + gcn::ListModel *playerRelation = new PlayerRelationListModel(); - gcn::DropDown *choicebox = new gcn::DropDown(new PlayerRelationListModel()); + gcn::DropDown *choicebox = new DropDown(playerRelation, + new ScrollArea(), + new ListBox(playerRelation), + false); choicebox->setSelected(player_relations.getRelation(name)); mWidgets.push_back(choicebox); } @@ -219,19 +225,23 @@ Setup_Players::Setup_Players(): player_relations.getDefault() & PlayerRelation::TRADE)), mDefaultWhisper(new CheckBox(_("Allow whispers"), player_relations.getDefault() & PlayerRelation::WHISPER)), - mDeleteButton(new Button(_("Delete"), ACTION_DELETE, this)), - mIgnoreActionChoicesBox(new gcn::DropDown(new IgnoreChoicesListModel())) + mDeleteButton(new Button(_("Delete"), ACTION_DELETE, this)) { setOpaque(false); + mPlayerTable->setOpaque(false); int table_width = NAME_COLUMN_WIDTH + RELATION_CHOICE_COLUMN_WIDTH; mPlayerTableTitleModel->fixColumnWidth(NAME_COLUMN, NAME_COLUMN_WIDTH); mPlayerTableTitleModel->fixColumnWidth(RELATION_CHOICE_COLUMN, RELATION_CHOICE_COLUMN_WIDTH); - mPlayerTitleTable->setDimension(gcn::Rectangle(10, 10, table_width, 10)); + mPlayerTitleTable->setDimension(gcn::Rectangle(10, 10, table_width - 1, 10)); mPlayerTitleTable->setBackgroundColor(gcn::Color(0xbf, 0xbf, 0xbf)); - for (int i = 0; i < COLUMNS_NR; i++) + gcn::ListModel *ignoreChoices = new IgnoreChoicesListModel(); + mIgnoreActionChoicesBox = new DropDown(ignoreChoices, new ScrollArea(), + new ListBox(ignoreChoices), false); + + for (int i = 0; i < COLUMNS_NR; i++) { mPlayerTableTitleModel->set(0, i, new gcn::Label(gettext(table_titles[i]))); |