Fenetre

Fenetre - #include #include #include #include #include...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
#include "Fenetre.h" #include <string> #include <iostream> #include <stdlib.h> #include <fstream> #include <vector> #include <sstream> #include <time.h> # using namespace std; u /// ****DESSINER UN RECTANGLE**** /// void Fenetre::dessiner_rect_station(QPaintDevice *dev, int x, int y) { QPainter p(dev); p.setBrush(QBrush(Qt::red)); // couleur en fonction if(col == "black") p.setBrush(QBrush(Qt::black)); if(col == "red") p.setBrush(QBrush(Qt::red)); if(col == "blue") p.setBrush(QBrush(Qt::blue)); if(col == "green") p.setBrush(QBrush(Qt::green)); p.drawRect(x-5,y-5,10,10); // x, y, widht, height } /// ****DESSINER UNE CROIX**** /// void Fenetre::dessiner_croix_station(QPaintDevice *dev, int x, int y) { QPainter p(dev); p.setPen(QPen(Qt::red, 4)); // couleur choisie if(col == "black") p.setPen(QPen(Qt::black, 4)); if(col == "blue") p.setPen(QPen(Qt::blue, 4)); if(col == "red") p.setPen(QPen(Qt::red, 4)); if(col == "green") p.setPen(QPen(Qt::green, 4)); p.drawLine (x-12,y-12,x+12,y+12); p.drawLine (x+12,y-12,x-12,y+12); } /// ****SPLIT UNE LIGNE A UN CHARACTERE**** /// // FONCTION POUR SPLIT { vecteur.clear(); string::size_type stTemp = chaine.find(separateur); while(stTemp != string::npos) {
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
vecteur.push_back(chaine.substr(0, stTemp)); chaine = chaine.substr(stTemp + 1); stTemp = chaine.find(separateur); } vecteur.push_back(chaine); return vecteur.size(); } /// µµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµ µµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµ /// /// µµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµ LE CONSTRUCTEUR µµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµ /// µ Fenetre::Fenetre(int x, int y) : QWidget() { setFixedSize(x,y); // la taille cmpt=0; // compteur pour lancer le timer une seule fois plnb = "1"; // mode 1 joueur par défaut // LA MUSIQUE FSOUND_Init(44100, 32, 0); musique = FSOUND_Stream_Open("musiques/ThemeSong.mp3", FSOUND_LOOP_NORMAL, 0, 0); FSOUND_Stream_SetLoopCount(musique, -1); FSOUND_Stream_Play(1, musique); vol = 120; this->setStyleSheet("background-color: rgb(96,183,141)"); // LA BARRE DE MENU menuBar = new QMenuBar(this); menuBar->setFixedSize(x,25); // menus // sous menus QMenu *menuMenu = new QMenu(this); menuMenu = menuBar->addMenu("Menu"); QAction *actionNew = menuMenu->addAction("&Nouvelle Partie"); QAction *actionSave = menuMenu->addAction("&Sauvegarde"); QAction *actionLoad = menuMenu->addAction("&Chargement"); QAction *actionHightScore = menuMenu->addAction("&Hight Score"); QAction *actionQuit = menuMenu->addAction("&Quitter"); QMenu *menuOption = new QMenu(this); menuOption = menuBar->addMenu("&Options"); QAction *actionMusic = menuOption->addAction("&Musique"); QAction *actionColor = menuOption->addAction("Couleur du chemin");
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/01/2009 for the course AV 244 taught by Professor Dub during the Spring '09 term at ECE.

Page1 / 21

Fenetre - #include #include #include #include #include...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online