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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
#include "FenetreCV.h"
#include "parseurdom.h"
#include "competence.h"
#include "experience.h"
#include "offre.h"
#include "jeu.h"
#include <QtGui>

FenetreCV::FenetreCV(){

}


FenetreCV::FenetreCV(MainWindow * _parent, QString &_imageName)  : IWidget(_parent, _imageName) {


    creerBoutons();
   // cv = new CV();
    imgCV = new QLabel(this);
    
    const Offre * off = parentWindow->getJeu()->getOffreActuelle();
    QString bg("../Ressources/fond_offre.png");
    
    WidgetOffre * wOffre = new WidgetOffre(bg,(Offre*)off);
    wOffre->setParent(this);
    wOffre->move(0,0);
    wOffre->show();

    std::vector<Competence>::iterator itvectorCompetence;
    int cpt = 0;
    vectorCompetence = *(parentWindow->getJeu()->getPersonnage()->getListeCompetence());
    QImage fond("../Ressources/zoneD.png");
    QPixmap pixfond(fond.width(),fond.height());
    QPainter paintfond(&pixfond);
    paintfond.drawImage(0,0,fond);
    paintfond.fillRect(fond.rect(),Qt::transparent);

    QLabel * Competences = new QLabel("Competences : ",this,0);
    Competences->setFont(QFont("Times", 14, QFont::Bold));
    Competences->move(590,305);
    QLabel * comp = new QLabel(this,0);
    comp->setPixmap(QPixmap::fromImage(fond));
    comp->resize(380,130);
    comp->move(590,300);

    int x = 590, y = 180;
    cpt = 0;
    for(itvectorCompetence = vectorCompetence.begin(); itvectorCompetence != vectorCompetence.end();itvectorCompetence++ ){
        Competence c = vectorCompetence[cpt];
        QString comp(c.getNom().c_str());
        DragLabel * dragComp = new DragLabel(comp,this);
        mapComp.insert(pair<int,DragLabel*>(cpt,dragComp));
        dragComp->move(x,y);
        dragComp->show();
        x += dragComp->width()+2;
        if(x>970){
            x = 590;
            y += dragComp->height()+2;
        }
        cpt++;
    }

    std::vector<Experience>::iterator itvectorExperience;
    vectorExperience = *(parentWindow->getJeu()->getPersonnage()->getListeExperience());
    QLabel * Experiences = new QLabel("Exp�riences : ",this,0);
    Experiences->setFont(QFont("Times", 14, QFont::Bold));
    Experiences->move(590,515);
    QLabel * exp = new QLabel(this,0);
    exp->setPixmap(QPixmap::fromImage(fond));
    exp->resize(380,130);
    exp->move(590,510);

    x = 590;
    y = 400;
    cpt = 0;
    for(itvectorExperience = vectorExperience.begin(); itvectorExperience != vectorExperience.end();itvectorExperience++ ){
        Experience e = vectorExperience[cpt];
        QString expe(e.getNom().c_str());
        DragLabel * dragExpe = new DragLabel(expe,this);
        mapExpe.insert(pair<int,DragLabel*>(cpt,dragExpe));
        dragExpe->move(x,y);
        dragExpe->show();
        x += dragExpe->width()+2;
        if(x>970){
            x = 590;
            y += dragExpe->height()+2;
        }
        cpt++;
    }

    valider->resize(169,33);
    valider->move(700,650);
    valider->show();

}

void FenetreCV::Debriefing(){

    DragLabel * lab;
    //Competence * comp;
    //Experience * expe;
    for(map<int ,DragLabel*>::iterator itc = mapComp.begin();itc != mapComp.end(); itc++ ){
        lab = itc->second;
        if(lab->pos().x()>590 && lab->pos().x()<970){
            if(lab->pos().y()>300 && lab->pos().y()<430){
                parentWindow->getJeu()->ajouterCompetenceCV(&vectorCompetence[itc->first],1);
                //cv->ajoutCompetenceFin(&vectorCompetence[itc->first]);
            }
        }
    }

    for(map<int,DragLabel*>::iterator ite = mapExpe.begin();ite != mapExpe.end(); ite++ ){
        lab = ite->second;
        if(lab->pos().x()>590 && lab->pos().x()<970){
            if(lab->pos().y()>510 && lab->pos().y()<640){
                parentWindow->getJeu()->ajouterExperienceCV(&vectorExperience[ite->first],1);
                //cv->ajoutExperienceFin(&vectorExperience[ite->first]);
            }
        }
    }

    parentWindow->Debriefing();
}

void FenetreCV::creerBoutons(){

    valider = new QPushButton("Valider",this);

    connect(valider,SIGNAL(clicked()),this,SLOT(Debriefing()));
}

FenetreCV::~FenetreCV() {


}

/*CV * FenetreCV::getCV(){
    return this->cv;
}*/

Commits for Fangh/trunk/FenetreCV.cpp

Diff revisions: vs.
Revision Author Commited Message
42 Diff Diff Mily81 picture Mily81 Fri 05 Mar, 2010 01:28:16 +0000
40 Diff Diff Mily81 picture Mily81 Fri 05 Mar, 2010 00:30:19 +0000
30 Diff Diff Mily81 picture Mily81 Sun 28 Feb, 2010 14:18:35 +0000

Drag and Drop fini, reste déplacement gobelin et correction
erreur pour ajout des competences et expériences dans le cv

28 Diff Diff Mily81 picture Mily81 Sun 28 Feb, 2010 12:07:49 +0000

commit avant suppression de fichiers (car sinon sa bug pour
la suppression) et avec dragNdrop presque fonctionnel ^^

27 Diff Diff Mily81 picture Mily81 Sat 27 Feb, 2010 23:46:14 +0000

Voilou encore un avancement du projet, reste plus qu’une
partie du drag and drop à finir et le déplacement du petit
gobelin

14 Diff Diff Mily81 picture Mily81 Fri 19 Feb, 2010 13:59:13 +0000
11 Diff Diff Mily81 picture Mily81 Fri 19 Feb, 2010 13:44:15 +0000

changement

10 Mily81 picture Mily81 Fri 19 Feb, 2010 13:01:31 +0000

et voilou des interfaces ...