diff options
author | Ira Rice <irarice@gmail.com> | 2009-02-03 16:33:18 -0700 |
---|---|---|
committer | Ira Rice <irarice@gmail.com> | 2009-02-03 16:33:18 -0700 |
commit | 7d45452187b1c2911b688bbed5fb8981a67b1934 (patch) | |
tree | 173857b19d0662837a48178739412aec908b040e /src/gui/setup_players.cpp | |
parent | 8857a59c3818c1ce6eeb6c054cb5543bfc35c087 (diff) | |
download | mana-7d45452187b1c2911b688bbed5fb8981a67b1934.tar.gz mana-7d45452187b1c2911b688bbed5fb8981a67b1934.tar.bz2 mana-7d45452187b1c2911b688bbed5fb8981a67b1934.tar.xz mana-7d45452187b1c2911b688bbed5fb8981a67b1934.zip |
Modified the dropdown class to handle opacity.
Signed-off-by: Ira Rice <irarice@gmail.com>
Diffstat (limited to 'src/gui/setup_players.cpp')
-rw-r--r-- | src/gui/setup_players.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
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 <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 "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, |