Пример #1
0
void Carre::dessiner(Fenetre f, Couleur c) const
{
	f.choixCouleurTrace(c);
	f.traceLigne(this->x, this->y, this->x + this->longueur, this->y);
	f.traceLigne(this->x, this->y, this->x, this->y + this->longueur);
	f.traceLigne(this->x + this->longueur, this->y, this->x + this->longueur, this->y + this->longueur + 1);
	f.traceLigne(this->x, this->y + this->longueur, this->x + this->longueur, this->y + this->longueur);
}
Пример #2
0
int main(int argc, char **argv)
{
	QApplication app(argc, argv);

	Fenetre f;
	f.show();

	return app.exec();
}
Пример #3
0
int main(int argc, char* argv[])
{
    QApplication app(argc, argv);

    Fenetre *maFenetre = new Fenetre();
    maFenetre->show();

    return app.exec();
}
Пример #4
0
int main(int argc, char* argv[])
{
    QApplication app(argc, argv);

    Fenetre fenetre;
    fenetre.show();

    return app.exec();
}
Пример #5
0
int main (int argc, char **argv)
{

    gtk_init(&argc, &argv);

    Fenetre f;
    Souris s;
    int b, x, y;

    unsigned short int tabX[10000]; //abscisses
    unsigned short int tabY[10000]; //ordonnées
    unsigned short int i=0;

    f.apparait("Exercice Bonus", 800, 800, 0, 0, 65535, 0, 0);

    s.associerA(f);

    while (!s.testeBoutons(x,y,b)); //attendre un clic pour démarrer les traitements

    while(!(b==3))
    {
        if(b==1) //si on fait clic gauche -> nouveau point (et trait si plus de deux points)
        {
            f.choixCouleurTrace(0, 0, 0);

            tabX[i]=x;
            tabY[i]=y;

            if((0<i) && (i<10000)) //pour tracer un trait il faut deux points (i<0) et ne peut en placer que 50 (i<50 avec le décalage du tab qui commence à 0)
                f.traceLigne(tabX[i-1],tabY[i-1],tabX[i],tabY[i],1); //on trace un trait noir entre les deux derniers points
            else if(i==0) //on met le if pour éviter de faire des points quand on a dépassé i=49
                f.traceArc(tabX[i],tabY[i],1,1,0,360,1); //pour matérialiser le premier point on dessine un cercle de diametre 1

            if (i < 10000) //une fois tous les traits dessinés on arrête de se déplacer dans le tab, en attendant un clic M ou D
                i+=1; //on incrémente i
        }
        else if(b==2) //si on fait clic milieu -> supprimer point (et trait si plus de deux points)
        {
            f.choixCouleurTrace(f.couleurFond());

            if (i > 0) //quand i vaut 0 on est au début du tableau de mémoire des coordonées -> on ne décrémente plus
                i-=1; //on décrémente i

            if((0<i) && (i<10000)) //même chose que pour le trait noir
                f.traceLigne(tabX[i-1],tabY[i-1],tabX[i],tabY[i],1); //on dessine en blanc par dessus l'ancien trait noir
            else if(i==0) //on ne dessine plus de point blanc quand il n'y a plus de points noirs
                f.traceArc(tabX[i],tabY[i],1,1,0,360,1); //pour supprimer le premier point on dessine un cercle de diametre 1 en blanc
        }

        s.testeBoutons(x,y,b); //on attend un autre clic
    }

    f.disparait();

    return 0;
}
Пример #6
0
void GUIContext::UpdateDocking(int ResizeOnly)
{
Fenetre *Me;

for (Me = FenList; Me; Me = Me->GCFenChain)
	{
	Me->DockUpdate(ResizeOnly);
	} // if

} // GUIContext::UpdateDocking
Пример #7
0
void Bouton::dessiner(Fenetre f, Couleur color) const
{
	if(this->estActif)
	{
		f.choixCouleurTrace(color);
		f.remplitEllipse(this->c.coordX() - this->c.rayon()/2,
                         this->c.coordY() - this->c.rayon()/2,
                         this->c.rayon(),
                         this->c.rayon());
	}
}
Пример #8
0
int main(int argc, char **argv)
{
  QApplication maestro(argc, argv);

  Fenetre MainWin;
  maestro.setMainWidget(&MainWin);
  MainWin.connect(&maestro, SIGNAL(lastWindowClosed()), &maestro, SLOT(quit()));

  MainWin.show();
  return maestro.exec();
}
Пример #9
0
void GUIContext::GoModal(void)
{
Fenetre *Me;

++ModalLevel;
if (ModalLevel > 0)
	{
	for (Me = FenList; Me; Me = Me->GCFenChain)
		{
		Me->UpdateModal();
		} // if
	} // if

} // GUIContext::GoModal
Пример #10
0
int main(int argc, char *argv[]){

    QApplication app(argc, argv);

    QString locale = QLocale::system().name();
    QTranslator translator;
    translator.load(QString("qt_") + locale, QLibraryInfo::location(QLibraryInfo::TranslationsPath));
    app.installTranslator(&translator);

    Fenetre *fenetre = new Fenetre();
    fenetre->show();

    return app.exec();
}
Пример #11
0
void GUIContext::EndModal(void)
{
Fenetre *Me;

if (ModalLevel > 0)
	{
	ModalLevel--;
	} // if
if (ModalLevel < 1)
	{
	for (Me = FenList; Me; Me = Me->GCFenChain)
		{
		Me->UpdateModal();
		} // if
	} // if

} // GUIContext::EndModal
Пример #12
0
void setXYCheckeur(sf::Sprite &Checkeur, Fenetre Fen, sf::Sprite &Case1, sf::Sprite &Case2, sf::Sprite &Case3)
{
	if(Fen.getLargeur()==1152)
	{
		Checkeur.SetX(Case1.GetPosition().x);
		Checkeur.SetY(Case1.GetPosition().y);
	}
	else if(Fen.getLargeur()==1024)
	{
		Checkeur.SetX(Case2.GetPosition().x);
		Checkeur.SetY(Case2.GetPosition().y);
	}
	else
	{
		Checkeur.SetX(Case3.GetPosition().x);
		Checkeur.SetY(Case3.GetPosition().y);
	}
}
Пример #13
0
int main (int argc, char* argv[])
{
    gtk_init(&argc, &argv);

    Fenetre f;
    Souris s;
    Carre c;
    int x, y, b;

    f.apparait("Exo 3", 400, 400, 0, 0);
    f.choixCouleurTrace(0,0,0);

    c.placer(100,20);
    c.dimensionner(40);
    c.definirCouleur(65535,0,0);


    c.afficher(f);

    s.associerA(f);

    f.choixCouleurTrace(65535, 0, 0);

    while (!s.testeBoutons(x, y, b));

    while (b!=3)
    {
        if(b==1 && c.touche(x, y) && (c.couleur().rouge() == 65535) && (c.couleur().vert()==0) && (c.couleur().bleu() == 0))
        {
            c.definirCouleur(Couleur(0,0, 65535));
            c.afficher(f);
        }
        else if(b==1 && c.touche(x, y) && (c.couleur().rouge() == 0) && (c.couleur().vert()==0) && (c.couleur().bleu() == 65535))
        {
            c.definirCouleur(Couleur(65535,0, 0));
            c.afficher(f);
        }
        while (!s.testeBoutons(x, y, b));
    }

    f.disparait();

    return 0;
}
Пример #14
0
void Bouton::effacer(Fenetre& f) const
{
    this->c.effacer(f);
	this->dessiner(f, f.couleurFond());
}
Пример #15
0
void Carre::effacer(Fenetre f) const
{
	this->dessiner(f, f.couleurFond());
}