summaryrefslogtreecommitdiff
path: root/src/gui/setup_players.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/setup_players.cpp')
-rw-r--r--src/gui/setup_players.cpp26
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])));