From 7d45452187b1c2911b688bbed5fb8981a67b1934 Mon Sep 17 00:00:00 2001 From: Ira Rice Date: Tue, 3 Feb 2009 16:33:18 -0700 Subject: Modified the dropdown class to handle opacity. Signed-off-by: Ira Rice --- src/gui/setup_players.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'src/gui/setup_players.cpp') diff --git a/src/gui/setup_players.cpp b/src/gui/setup_players.cpp index c8546b4b..932acee7 100644 --- a/src/gui/setup_players.cpp +++ b/src/gui/setup_players.cpp @@ -21,20 +21,20 @@ #include -#include #include #include "button.h" #include "checkbox.h" +#include "listbox.h" #include "ok_dialog.h" #include "setup_players.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 +135,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,8 +223,7 @@ 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); @@ -232,6 +235,10 @@ Setup_Players::Setup_Players(): mPlayerTitleTable->setDimension(gcn::Rectangle(10, 10, table_width - 1, 10)); mPlayerTitleTable->setBackgroundColor(gcn::Color(0xbf, 0xbf, 0xbf)); + 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, -- cgit v1.2.3-70-g09d2