kaiesVB
Messages postés3Date d'inscriptiondimanche 20 avril 2008StatutMembreDernière intervention 2 septembre 2011
-
1 sept. 2011 à 14:19
cs_LA_Tupac
Messages postés305Date d'inscriptionjeudi 29 avril 2004StatutMembreDernière intervention18 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.
}
kaiesVB
Messages postés3Date d'inscriptiondimanche 20 avril 2008StatutMembreDerniè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..!
cs_LA_Tupac
Messages postés305Date d'inscriptionjeudi 29 avril 2004StatutMembreDernière intervention18 janvier 20121 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
kaiesVB
Messages postés3Date d'inscriptiondimanche 20 avril 2008StatutMembreDerniè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.
}