Bonjour,
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
wxPanel* MyFrame::CreatePanel(){
 
  wxPanel* Panel = new wxPanel(this,wxID_ANY,wxDefaultPosition,wxDefaultSize,wxTAB_TRAVERSAL,_("panel"));
 
    wxBoxSizer*s1 = new wxBoxSizer(wxHORIZONTAL);
    m_choice = new wxChoice(Panel,ID_Choice,
                               wxDefaultPosition, wxDefaultSize,
                               0, NULL, wxLB_MULTIPLE |wxLB_ALWAYS_SB );
 
 
      s1->Add(1, 1, 1, wxEXPAND);
      s1->Add(new wxStaticText(Panel, wxID_ANY, wxT("Indice :")),0,wxALL,10);
      s1->Add(m_choice,0,wxALL,3);
      s1->Add(1, 1, 1, wxEXPAND);
      s1->SetItemMinSize((size_t)1, 50, 20);
 
      //essai
      wxBoxSizer* s2 = new wxBoxSizer(wxHORIZONTAL);
      m_sliderIdx=new wxSlider(Panel,ID_Slider_ind,0,0,20,wxDefaultPosition,wxSize(120,40),wxSL_HORIZONTAL);
      wxSpinCtrl* SpinCtrl_ind = new wxSpinCtrl(Panel,ID_Spin,
                                _(""),
                                wxDefaultPosition, wxSize(40,20),
                                wxSP_ARROW_KEYS,
                                0,20,0, _T("wxSpinCtrl"));
 
      s2->Add(1, 1, 1, wxEXPAND);
      s2->Add(new wxStaticText(Panel, wxID_ANY, wxT("Value:")),0,wxALL,10);
      s2->Add(m_sliderIdx,0,wxALL,0);
      s2->Add(SpinCtrl_ind,0,wxALL,10);
      s2->Add(1, 1, 1, wxEXPAND);
      s2->SetItemMinSize((size_t)1, 50, 20);
      //
 
 
 
      wxStaticBoxSizer* cont_sizer = new wxStaticBoxSizer(wxVERTICAL,Panel, _T("Indice"));
      cont_sizer->Add(s1);
      cont_sizer->Add(s2);
      Panel->SetAutoLayout(TRUE);
      Panel->SetSizer(cont_sizer);
 
 return Panel;
Pour les besoins d'un projet j'ai été amené à construire une sorte de palette d'outils ( un peu comme Gimp) que je gère avec wxAuiManager ( voir ci-dessus) en faisant l'appel suivant :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
  m_mgr.AddPane(CreatePanel(), wxAuiPaneInfo().
                  Name(wxT("settings")).Caption(wxT("Settings")). 	
                  Dockable(false).Left().Layer(1).Position(2).Hide());

Jusque là tout marche bien!
http://picasaweb.google.com/olivier....AlbumSansTitre

Comme vous pouvez le voir,je peux choisir un indice puis sa valeur. Or, je suis amené à fixer la valeur de plusieurs indices, les uns après les autres ( si je choisis le troisieme indice, je dois fixer la valeur des 2 premiers indices )...
Je voudrais qu'en fonction de l'indice choisis , apparaissent plusieurs wxSlider...le problème, c'est que je souhaite pas toucher à la methode creatpanel() mais rajouter ces wxSlider dynamiquement.
merci