QTfrontend/teamselect.h
author displacer
Sun, 05 Feb 2006 12:48:35 +0000
changeset 61 505691a09dee
parent 50 9ab4067dabec
child 63 27e2b5bb6d4b
permissions -rw-r--r--
colors added to teamselwidget
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
50
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
     1
#ifndef _TEAM_SELECT_INCLUDED
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
     2
#define _TEAM_SELECT_INCLUDED
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
     3
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
     4
#include <QWidget>
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
     5
#include <QVBoxLayout>
61
505691a09dee colors added to teamselwidget
displacer
parents: 50
diff changeset
     6
#include <QFrame>
50
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
     7
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
     8
#include <list>
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
     9
#include <map>
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    10
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    11
using namespace std;
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    12
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    13
struct tmprop
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    14
{
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    15
  tmprop(QString nm) : teamName(nm){};
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    16
  QString teamName;
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    17
  QString pixmapFileName;
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    18
  bool operator==(const tmprop& t1) const {
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    19
    return teamName==t1.teamName;
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    20
  };
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    21
  bool operator<(const tmprop& t1) const {
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    22
    return teamName<t1.teamName;
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    23
  };
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    24
};
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    25
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    26
class TeamSelWidget : public QWidget
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    27
{
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    28
  Q_OBJECT
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    29
 
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    30
 public:
61
505691a09dee colors added to teamselwidget
displacer
parents: 50
diff changeset
    31
  TeamSelWidget(QWidget* parent=0);
50
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    32
  void addTeam(tmprop team);
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    33
  void removeTeam(tmprop team);
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    34
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    35
private slots:
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    36
  void changeTeamStatus(tmprop team);
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    37
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    38
 private:
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    39
  QVBoxLayout mainLayout;
61
505691a09dee colors added to teamselwidget
displacer
parents: 50
diff changeset
    40
505691a09dee colors added to teamselwidget
displacer
parents: 50
diff changeset
    41
  QFrame* playingColorFrame;
505691a09dee colors added to teamselwidget
displacer
parents: 50
diff changeset
    42
  QFrame* dontPlayingColorFrame;
505691a09dee colors added to teamselwidget
displacer
parents: 50
diff changeset
    43
  QGridLayout* playingLayout;
505691a09dee colors added to teamselwidget
displacer
parents: 50
diff changeset
    44
  QGridLayout* dontPlayingLayout;
50
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    45
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    46
  list<tmprop> curPlayingTeams;
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    47
  list<tmprop> curDontPlayingTeams;
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    48
  map<tmprop, QWidget*> teamToWidget;
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    49
};
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    50
9ab4067dabec TeamSelect widget alpha added
displacer
parents:
diff changeset
    51
#endif // _TEAM_SELECT_INCLUDED