IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

wxWidgets Discussion :

superposition dans un wxnotebook


Sujet :

wxWidgets

  1. #1
    Futur Membre du Club
    Profil pro
    Inscrit en
    Août 2005
    Messages
    7
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2005
    Messages : 7
    Points : 5
    Points
    5
    Par défaut superposition dans un wxnotebook
    Bonjour,


    J'ai un soucis avec les wxnotebook. Je cherche à rajouter des onglets dans un code déjà existant je n'arrive pas à faire afficher les données dans l'onglet.

    Voilà le résultat :





    et voici la partie de code en question


    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
     
    enum {
      Notebook_Event
    };
     
    BEGIN_EVENT_TABLE( MetaDataPanel, wxPanel )
    END_EVENT_TABLE()
     
    MetaDataPanel::MetaDataPanel( intf_thread_t *_p_intf,
                                  wxWindow* _p_parent,
                                  bool _b_modifiable ):
        wxPanel( _p_parent, -1 )
    {
        int flags= wxTE_PROCESS_ENTER;
        /* Initializations */
        p_intf = _p_intf;
        p_parent = _p_parent;
        b_modifiable = _b_modifiable;
     
        SetAutoLayout( TRUE );
     
        wxBoxSizer *panel_sizer = new wxBoxSizer( wxVERTICAL );
     
        wxFlexGridSizer *sizer = new wxFlexGridSizer(2,8,20);
        sizer->AddGrowableCol(1);
     
        if( !b_modifiable )
            flags |= wxTE_READONLY;
     
        /* URI Textbox */
        wxStaticText *uri_static =
               new wxStaticText( this, -1, wxU(_("URI")) );
        sizer->Add( uri_static, 0 , wxALL , 0 );
     
        uri_text = new wxTextCtrl( this, -1,
                wxU(""), wxDefaultPosition, wxSize( 300, -1 ), flags );
        sizer->Add( uri_text, 1 ,  wxALL|wxEXPAND , 0 );
     
        /* Name Textbox */
        wxStaticText *name_static =
               new wxStaticText(  this, -1, wxU(_("Name")) );
        sizer->Add( name_static, 0 , wxALL , 0  );
     
        name_text = new wxTextCtrl( this, -1,
                wxU(""), wxDefaultPosition, wxSize( 300, -1 ), flags );
        sizer->Add( name_text, 1 , wxALL|wxEXPAND , 0 );
        sizer->Layout();
        /* Debut des onglets */
        notebook = new wxNotebook( this, Notebook_Event );
        wxBoxSizer *notebook_sizer = new wxBoxSizer( wxHORIZONTAL );
        notebook_sizer->Add( notebook, 1, wxVERTICAL, 0 );
        notebook->AddPage( InfoMeta( notebook ), wxU(_("Metadata")) );
        notebook->AddPage( InfoCam( notebook ), wxU(_("Camera")) );
        notebook_sizer->Layout();
     
        panel_sizer->Add( sizer, 0, wxEXPAND | wxALL, 5 );
        panel_sizer->Add( notebook_sizer, 1, wxEXPAND | wxALL, 5 );
        panel_sizer->Layout();
        SetSizerAndFit( panel_sizer );
    }
     
    wxPanel *MetaDataPanel::InfoMeta( wxWindow *parent )
    {
     
        wxPanel *panel = new wxPanel( parent, -1 );
     
    #if 1 //THOM
        wxFlexGridSizer *meta_sizer = new wxFlexGridSizer(2,11,20);
        meta_sizer->AddGrowableCol(1);
     
    #define ADD_META( string, widget ) {                                        \
            meta_sizer->Add( new wxStaticText( this, -1, wxU(_(string) ) ),1,   \
                             wxTOP|wxRIGHT|wxLEFT|wxEXPAND, 0 );                \
            widget = new wxStaticText( this, -1, wxU( "" ) );                   \
            meta_sizer->Add( widget, 1, wxTOP|wxRIGHT|wxLEFT|wxEXPAND, 0 ); }
     
        ADD_META( VLC_META_ARTIST, artist_text );
        ADD_META( VLC_META_GENRE, genre_text );
        ADD_META( VLC_META_COPYRIGHT, copyright_text );
        ADD_META( VLC_META_COLLECTION, collection_text );
        ADD_META( VLC_META_SEQ_NUM, seqnum_text );
        ADD_META( VLC_META_DESCRIPTION, description_text );
        ADD_META( VLC_META_RATING, rating_text );
        ADD_META( VLC_META_DATE, date_text );
        ADD_META( VLC_META_LANGUAGE, language_text );
        ADD_META( VLC_META_NOW_PLAYING, nowplaying_text );
        ADD_META( VLC_META_PUBLISHER, publisher_text );
     
        meta_sizer->Layout();
        panel->SetSizerAndFit( meta_sizer );
    #endif
     
        return panel;
    }

  2. #2
    Expert éminent
    Avatar de PRomu@ld
    Homme Profil pro
    Ingénieur de Recherche
    Inscrit en
    Avril 2005
    Messages
    4 155
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 38
    Localisation : France, Vienne (Poitou Charente)

    Informations professionnelles :
    Activité : Ingénieur de Recherche
    Secteur : Enseignement

    Informations forums :
    Inscription : Avril 2005
    Messages : 4 155
    Points : 6 486
    Points
    6 486
    Par défaut
    Celà est tout simplement du au fait que tu n'ajoutes pas tes informations dans l'onglet mais sur le widget parent, c'est à dire ta frame, c'est pour celà que tu as une supperposition.

    En fait, wxNotebook fonctionne ainsi :

    Tu crée le notebook, tu crée des panel qui sont tes pages et ensuite tu appelle s AddPage sur ces panels. Ainsi, si tu veux modifer des infos de tes onglets, il faut que tu modifie un des panel qui est dans ton wxNotebook.

    http://www.wxwidgets.org/manuals/2.6...xnotebook.html

  3. #3
    Membre actif Avatar de Suryavarman
    Homme Profil pro
    Développeur 3D
    Inscrit en
    Mai 2006
    Messages
    233
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 40
    Localisation : France, Hérault (Languedoc Roussillon)

    Informations professionnelles :
    Activité : Développeur 3D
    Secteur : Tourisme - Loisirs

    Informations forums :
    Inscription : Mai 2006
    Messages : 233
    Points : 245
    Points
    245
    Par défaut
    Yes j'ai aussi ce problème Merci .

  4. #4
    Futur Membre du Club
    Profil pro
    Inscrit en
    Août 2005
    Messages
    7
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2005
    Messages : 7
    Points : 5
    Points
    5
    Par défaut
    merci, je vais tester

Discussions similaires

  1. [2008] Superposition dans un graphe
    Par syl_sof dans le forum SSRS
    Réponses: 2
    Dernier message: 02/07/2012, 10h34
  2. Superposition dans des objets de type Table
    Par soso78 dans le forum ASP.NET
    Réponses: 2
    Dernier message: 11/04/2009, 00h17
  3. Superposition dans sous menu
    Par tamiii dans le forum Mise en page CSS
    Réponses: 1
    Dernier message: 21/02/2008, 17h09
  4. Problème de superposition dans un formulaire
    Par vallica dans le forum Balisage (X)HTML et validation W3C
    Réponses: 6
    Dernier message: 17/01/2007, 15h20
  5. Probleme de superposition dans une GridLayout !
    Par [MD]KiKi dans le forum AWT/Swing
    Réponses: 7
    Dernier message: 05/05/2006, 14h32

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo