begin process at 2012 05 29 21:35:22
  Trouver un code source :
 
dans
 
Accueil > Forum > 

C++ & C++ .NET

 > 

Linux

 > 

Autre

 > 

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


Derniers messages déposésPoser une question dans le forum ou lancer une discussion

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

jeudi 1 septembre 2011 à 14:19:06 | Problème pour ouvrir une deuxième fenêtre..!

kaiesVB

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:

Code C/C++ :
// include files nedeed by our code.
#include <plugin.h>
#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.
}
vendredi 2 septembre 2011 à 14:24:17 | Re : Problème pour ouvrir une deuxième fenêtre..!

kaiesVB

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..!
vendredi 2 septembre 2011 à 15:33:19 | Re : Problème pour ouvrir une deuxième fenêtre..!

LA_Tupac

Membre Club
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
vendredi 2 septembre 2011 à 16:01:59 | Re : Problème pour ouvrir une deuxième fenêtre..!

kaiesVB

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.!


Code C/C++ :
// include files nedeed by our code.
#include <plugin.h>
#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.
} 
lundi 5 septembre 2011 à 01:40:55 | Re : Problème pour ouvrir une deuxième fenêtre..!

LA_Tupac

Membre Club
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)
lundi 5 septembre 2011 à 16:59:16 | Re : Problème pour ouvrir une deuxième fenêtre..!

buno

Administrateur CodeS-SourceS
Hello,
Code C/C++ :
// 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...
mardi 6 septembre 2011 à 10:41:41 | Re : Problème pour ouvrir une deuxième fenêtre..!

LA_Tupac

Membre Club
Oui effectivement ça fait mal aux yeux !
En tout cas respect pour ta patience bruno


Cette discussion est classée dans : button, set, label, ok, to


Répondre à ce message

Sujets en rapport avec ce message

Default Button marche pas [ par guimou ] Salut, j'ai un pb avec une dialogbox : c'est une boite toute simple pour taper son mot de passe, ya juste un edit en mode password, un bouton OK et un Allocation de mémoire a une structure [ par KurpeusLondon ] Bonjour, J'essaye d'initialiser des structures par un appel de fonction qui retourne l'adresse mémoire de la structure fraichement crée. Lorsque je co Erreur de Segmentation [ par sebman ] Bonjour à tous Alors voilà, pour apprendre à programmer, j'ai pomper un code source que j'ai un peu modifier. Le programme initial servait à convert probleme compilation sous dev-Cpp [ glut ! ] [ par augusd ] Mesdames, Messieurs, Je m'amuse actuellement sur Dev-Cpp à coder en utilisant la librairie glut. J'ai pu réaliser en cours deux - trois programmes problème compilation sous Dev-cpp [ librairie glut ] [ WINDOWS ] [ par augusd ] Bonjour à tous Je m'amuse actuellement sur Dev-Cpp à coder en utilisant la librairie glut. J'ai pu réaliser en cours deux - trois programmes. Cepe Image to pdf [ par yvon_bizimana ] Bonjour à tous,je suis entrain de créer un miniBook et je voudrais savoir si quelqu'un sait comment coder une fonction en c ou c++ qui me permettrait Convertir en VB.net ou VB [ par keddada ] bonsoir à tous, j'aurais besoin de convertir le code suivant en vb je précise que j'ai déjà essayé des logiciels qui soit disant le faisait mais cel Convertir int to string ou fonction tostring() [ par kimode ] svp j'ai besoin d'aide je suis bloqué pr la fonction tostring ou comment converatir et concaténer deux chaines dynamiques + les espaces et merci . aide sous telnet ??????? [ par marwen109 ] voila donc mon probléme: je veux envoyer des mails avec SMTP a mon yahoo set localecho //pour le moment ok open mx1.hotmail.com 25 //connexion ok MAI intellitrac X8 X1 X1 plus [ par trax3699 ] Bonjour, Je développe une socket permettant de récuperer les informations géographiques d'un boitier "intellitrac X8" par GPRS. J'arrive à accepter l


Nos sponsors


Sondage...

CalendriCode

Mai 2012
LMMJVSD
 123456
78910111213
14151617181920
21222324252627
28293031   

Consulter la suite du CalendriCode

Photothèque

A découvrir



 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 0,905 sec (3)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales