Problème pour ouvrir une deuxième fenêtre..!

kaiesVB Messages postés 3 Date d'inscription dimanche 20 avril 2008 Statut Membre Dernière intervention 2 septembre 2011 - 1 sept. 2011 à 14:19
cs_LA_Tupac Messages postés 305 Date d'inscription jeudi 29 avril 2004 Statut Membre Dernière intervention 18 janvier 2012 - 6 sept. 2011 à 10:41
Bonjour..

Je suis un débutant depuis quelques semaines en langage C++. Sur mon récepteur Linux j'ai voulu crée un petit plugin. J'ai commencé à programmer ce petit plugin sur mon système Stinky Linux, en suivant quelques Tuto sur internet j'ai réussi à faire exécuter la première fenêtre de mon plugin sans erreur.
Bon maintenant j'ai voulu afficher la même fenêtre avec le même contenu en cliquant sur la bouton "Start" mais j'ai pas réussi. je reçois des erreurs. Voici le Code:

// include files nedeed by our code.
#include 
#include <stdio.h>
#include <lib/gui/ewindow.h>
#include <lib/gui/elabel.h>
#include <lib/gui/ebutton.h>
 
 
// Window1.
// The Class declaration of our Main Window
class eBibleMainWindow: public eWindow
{
    // the label to show the text
    eLabel *label;
        // the button
    eButton *ok;
public:
        // the constructor.
    eBibleMainWindow();
        // the destructor.
    ~eBibleMainWindow();
};
 
 
// The plugin entry point, Here start the code execution
extern "C" int plugin_exec( PluginParam *par )
{
    // our demo dialog instance.
    eBibleMainWindow dlg;
        // show the dialog...
    dlg.show();
        // give control to dialog.. (the dialog is modal!)
    int result=dlg.exec();
        // and after it, hide it again.
    dlg.hide();
    return result;
}
 
 
eBibleMainWindow::eBibleMainWindow(): eWindow(1)
{
 
    // move our dialog to 100.100...
    cmove(ePoint(100, 100));
        // ...and give x and y dimensions.
    cresize(eSize(520, 320));
        // set a title.
    setText("My Plugin: Intro");
 
 
    // create a label to show a text.
    label=new eLabel(this);
    // give a position
    label->move(ePoint(95, 120));
    // set the label dimensions
    label->resize(eSize(350, 200));
    // set the label text
    label->setText("Bienvenue---Welcome---Willkommen");
 
 
// create the button
    ok = new eButton(this);
    // set the button text
    ok->setText("About");
    // set position
    ok->move(ePoint((clientrect.width() - 260)/7, clientrect.height() - 60));
    // set size
    ok->resize(eSize(90, 40));
    // set shortcut and pixmap
    ok->setShortcut("red");
    ok->setShortcutPixmap("red");
    // decore with a frame
    ok->loadDeco();
    // function to call when buton is pressed
    CONNECT(ok->selected, eWidget::accept);
    // set focus to the button
    setFocus(ok);
 
// create the button
    ok = new eButton(this);
    // set the button text
    ok->setText("Start");
    // set position
    ok->move(ePoint((clientrect.width() - 90)/2, clientrect.height() - 60));
    // set size
    ok->resize(eSize(90, 40));
    // set shortcut and pixmap
    ok->setShortcut("green");
    ok->setShortcutPixmap("green");
    // decore with a frame
    ok->loadDeco();
    // function to call when buton is pressed
    CONNECT(ok->selected, eBibleMainWindow(): eWindow(1));
    // set focus to the button
    setFocus(ok);
 
// create the button
    ok = new eButton(this);
    // set the button text
    ok->setText("Exit");
    // set position
    ok->move(ePoint((clientrect.width() - 120), clientrect.height() - 60));
    // set size
    ok->resize(eSize(90, 40));
    // set shortcut and pixmap
    ok->setShortcut("blue");
    ok->setShortcutPixmap("blue");
    // decore with a frame
    ok->loadDeco();
    // function to call when buton is pressed
    CONNECT(ok->selected, eWidget::accept);
    // set focus to the button
    setFocus(ok);
 
 
}
 
eBibleMainWindow::~eBibleMainWindow()
{
    // we have to do almost nothing here. all widgets are automatically removed
    // since they are child of us. the eWidget-destructor will to this for us.
}
 
 
// Window2.
// The Class declaration of our Main Window
class eBibleMainWindow: public eWindow
{
    // the label to show the text
    eLabel *label;
        // the button
    eButton *ok;
public:
        // the constructor.
    eBibleMainWindow();
        // the destructor.
    ~eBibleMainWindow();
};
 
 
// The plugin entry point, Here start the code execution
extern "C" int plugin_exec( PluginParam *par )
{
    // our demo dialog instance.
    eBibleMainWindow dlg;
        // show the dialog...
    dlg.show();
        // give control to dialog.. (the dialog is modal!)
    int result=dlg.exec();
        // and after it, hide it again.
    dlg.hide();
    return result;
}
 
 
eBibleMainWindow::eBibleMainWindow(): eWindow(1)
{
 
    // move our dialog to 100.100...
    cmove(ePoint(100, 100));
        // ...and give x and y dimensions.
    cresize(eSize(520, 320));
        // set a title.
    setText("My Plugin: Intro");
 
 
    // create a label to show a text.
    label=new eLabel(this);
    // give a position
    label->move(ePoint(95, 120));
    // set the label dimensions
    label->resize(eSize(350, 200));
    // set the label text
    label->setText("Bienvenue---Welcome---Willkommen");
 
 
// create the button
    ok = new eButton(this);
    // set the button text
    ok->setText("About");
    // set position
    ok->move(ePoint((clientrect.width() - 260)/7, clientrect.height() - 60));
    // set size
    ok->resize(eSize(90, 40));
    // set shortcut and pixmap
    ok->setShortcut("red");
    ok->setShortcutPixmap("red");
    // decore with a frame
    ok->loadDeco();
    // function to call when buton is pressed
    CONNECT(ok->selected, eWidget::accept);
    // set focus to the button
    setFocus(ok);
 
// create the button
    ok = new eButton(this);
    // set the button text
    ok->setText("Start");
    // set position
    ok->move(ePoint((clientrect.width() - 90)/2, clientrect.height() - 60));
    // set size
    ok->resize(eSize(90, 40));
    // set shortcut and pixmap
    ok->setShortcut("green");
    ok->setShortcutPixmap("green");
    // decore with a frame
    ok->loadDeco();
    // function to call when buton is pressed
    CONNECT(ok->selected, eWidget::accept);
    // set focus to the button
    setFocus(ok);
 
// create the button
    ok = new eButton(this);
    // set the button text
    ok->setText("Exit");
    // set position
    ok->move(ePoint((clientrect.width() - 120), clientrect.height() - 60));
    // set size
    ok->resize(eSize(90, 40));
    // set shortcut and pixmap
    ok->setShortcut("blue");
    ok->setShortcutPixmap("blue");
    // decore with a frame
    ok->loadDeco();
    // function to call when buton is pressed
    CONNECT(ok->selected, eWidget::accept);
    // set focus to the button
    setFocus(ok);
 
 
}
 
eBibleMainWindow::~eBibleMainWindow()
{
    // we have to do almost nothing here. all widgets are automatically removed
    // since they are child of us. the eWidget-destructor will to this for us.
}

6 réponses

kaiesVB Messages postés 3 Date d'inscription dimanche 20 avril 2008 Statut Membre Dernière intervention 2 septembre 2011
2 sept. 2011 à 14:24
SVP je suis totalement bloqué dans cette étape..! est ce que quelqu'un peut m'aider!! juste le code pour ouvrir une deuxième fenêtre en cliquant sur n'importe quel bouton...!
Merci d'avance..!
0
cs_LA_Tupac Messages postés 305 Date d'inscription jeudi 29 avril 2004 Statut Membre Dernière intervention 18 janvier 2012 1
2 sept. 2011 à 15:33
Ta question est mal formulée, tu ne donne pas l'erreur rencontrée, tu ne dis même pas de quel genre de plugin il s'agit...
En plus ce code n'est vraisemblablement de toi car il est commenté en anglais tout le long ....
Enfin voilà, ! ne t'étone pas si personne ne répond
0
kaiesVB Messages postés 3 Date d'inscription dimanche 20 avril 2008 Statut Membre Dernière intervention 2 septembre 2011
2 sept. 2011 à 16:01
Bonjour..
je vais reformuler ma question.


Le code qui suit est un code fonctionnel sans erreurs. il affiche une fenêtre dedans écrit "Bienvenue-Welcome-Wilkommen" et un bouton "start". Ce que je veux c'est quand je clique sur Start je reçois une nouvelle fenêtre pour ajouter d'autre informations. J'ai pas su ce que je dois ajouter dans le code pour affiché cette deuxième fenêtre.!


// include files nedeed by our code.
#include 
#include <stdio.h>
#include <lib/gui/ewindow.h>
#include <lib/gui/elabel.h>
#include <lib/gui/ebutton.h>



// The Class declaration of our Main Window
class eBibleMainWindow: public eWindow
{
// the label to show the text
eLabel *label;
// the button
eButton *ok;
public:
// the constructor.
eBibleMainWindow();
// the destructor.
~eBibleMainWindow();
};


// The plugin entry point, Here start the code execution
extern "C" int plugin_exec( PluginParam *par )
{
// our demo dialog instance.
eBibleMainWindow dlg;
// show the dialog...
dlg.show();
// give control to dialog.. (the dialog is modal!)
int result=dlg.exec();
// and after it, hide it again.
dlg.hide();
return result;
}


eBibleMainWindow::eBibleMainWindow(): eWindow(1)
{

// move our dialog to 100.100...
cmove(ePoint(100, 100));
// ...and give x and y dimensions.
cresize(eSize(520, 320));
// set a title.
setText("My Plugin: Intro");


// create a label to show a text.
label=new eLabel(this);
// give a position
label->move(ePoint(95, 120));
// set the label dimensions
label->resize(eSize(350, 200));
// set the label text
label->setText("Bienvenue---Welcome---Willkommen");


// create the button
ok = new eButton(this);
// set the button text
ok->setText("Start");
// set position
ok->move(ePoint((clientrect.width() - 90)/2, clientrect.height() - 60));
// set size
ok->resize(eSize(90, 40));
// set shortcut and pixmap
ok->setShortcut("green");
ok->setShortcutPixmap("green");
// decore with a frame
ok->loadDeco();
// function to call when buton is pressed
CONNECT(ok->selected, eBibleMainWindow(): eWindow(1));
// set focus to the button
setFocus(ok);



}

eBibleMainWindow::~eBibleMainWindow()
{
// we have to do almost nothing here. all widgets are automatically removed
// since they are child of us. the eWidget-destructor will to this for us.
} 
0
cs_LA_Tupac Messages postés 305 Date d'inscription jeudi 29 avril 2004 Statut Membre Dernière intervention 18 janvier 2012 1
5 sept. 2011 à 01:40
Tu peux reformuler comme tu veux, si tu ne donne pas plus d'infos pragmatiques personne ne pourra t'aider ... (voudra?... oui c'est mieux)
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
BunoCS Messages postés 15476 Date d'inscription lundi 11 juillet 2005 Statut Modérateur Dernière intervention 3 mai 2024 103
5 sept. 2011 à 16:59
Hello,
// function to call when buton is pressed
CONNECT(ok->selected, eBibleMainWindow(): eWindow(1));

Je ne comprend pas trop ton écriture. As-tu suivi un tuto?

@+
Buno
----------------------------------------
L'urgent est fait, l'impossible est en cours. Pour les miracles, prévoir un délai...
0
cs_LA_Tupac Messages postés 305 Date d'inscription jeudi 29 avril 2004 Statut Membre Dernière intervention 18 janvier 2012 1
6 sept. 2011 à 10:41
Oui effectivement ça fait mal aux yeux !
En tout cas respect pour ta patience bruno
0
Rejoignez-nous