Subversion Repository Public Repository

Fangh

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#include "WidgetOffre.h"
#include "jeu.h"

WidgetOffre::WidgetOffre() : IWidget(), offre(NULL) {
}

WidgetOffre::WidgetOffre(QString & _backgroundName, Offre * _offre)
    : IWidget(_backgroundName), offre(_offre){

    QFont font("Times", 25, QFont::Bold);
    QColor rouge(255, 0, 0, 255);
    QColor blanc(255, 255, 255, 255);
    QColor noir(0, 0, 0, 255);
    QString texte("Offre");

    Label *titre = new Label();
    titre->setFont(font);
    titre->setFontColor(rouge);
    titre->setAlignment(Qt::AlignCenter);
    titre->addText(texte, 0, 120, width(), 30);

    Label *titreOffre = new Label();
    font.setPointSize(15);
    titreOffre->setFont(font);
    titreOffre->setFontColor(blanc);
    texte.clear();
    texte.append(offre->getTitre().c_str());
    titreOffre->addText(texte, 60, 90, width(), 30);

    texte.clear();
    texte.append(offre->getDescription()->c_str());

    QLabel *description = new QLabel(texte);
    font.setPointSize(10);
    description->setFont(font);
    description->setContentsMargins(50, 0, 0, 0);

    QLabel *seigneurOffrant = new QLabel(texte);
    font.setPointSize(10);
    seigneurOffrant->setFont(font);
    seigneurOffrant->setContentsMargins(50, 0, 0, 0);

    QLabel *typeCompetence = new QLabel("");
    font.setPointSize(10);
    typeCompetence->setFont(font);
    typeCompetence->setContentsMargins(50, 0, 0, 0);
    TYPE_COMPETENCE t = offre->getType();
    texte.clear();
    texte.append("Type comp�tence : ");
    if (t == AUCUN) texte.append("Aucun");
    else if (t == MARTIALES) texte.append("Martiale");
    else if (t == GENERALES) texte.append("G�n�rale");
    else if (t == MARTIALES) texte.append("Magiques");
    else if (t == MARTIALES) texte.append("Acad�mique");
    typeCompetence->setText(texte);

    FlowLayout * mainLayout = new FlowLayout();
    mainLayout->addWidget(titre);
    mainLayout->addWidget(titreOffre);
    mainLayout->addWidget(description);
    mainLayout->addWidget(seigneurOffrant);
    mainLayout->addWidget(typeCompetence);
    mainLayout->setContentsMargins(0,0,0,0);
    setLayout(mainLayout);

    titre->setFixedSize(width(), 180);//int z=180;
    titreOffre->setFixedWidth(width());
    description->setFixedWidth(width());
    seigneurOffrant->setFixedWidth(width());
    typeCompetence->setFixedWidth(width());

    setFixedSize(width(), height());
}

WidgetOffre::~WidgetOffre() {
}

void WidgetOffre::setOffre(Offre * _offre) {
    offre = _offre;
}

void WidgetOffre::update() {

}

Commits for Fangh/trunk/WidgetOffre.cpp

Diff revisions: vs.
Revision Author Commited Message
42 Diff Diff Mily81 picture Mily81 Fri 05 Mar, 2010 01:28:16 +0000
24 Diff Diff willix picture willix Thu 25 Feb, 2010 22:19:20 +0000
22 Diff Diff willix picture willix Thu 25 Feb, 2010 15:17:33 +0000
20 willix picture willix Wed 24 Feb, 2010 02:32:01 +0000