Bonjour,

vu que je commence a comprendre comment marche wxWidget et qu'il faut éviter les declaration de wxWindow* en tant que membre de class (evité les duplications), j'ai essayé de récuperer des valeurs d'une wxCheckBoxList en utilisant FindWindow.

Le probleme c'est que visiblement la wxWindow* que je recupere n'est pas du type wxCheckBoxList, et je ne comprend pas pourquoi...

qqun aurait une idée d'ou vient mon probleme ??

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
 
void MyFrame::initComponent() {
 
wxPanel *panel = new wxPanel(this);
 
...
 
wxPanel *subpanel = new wxPanel(panel);
wxCheckListBox *clb = new wxCheckListBox(subpanel,ID_CTRL_CAM_ON, wxDefaultPosition, wxDefaultSize,strings, wxLB_MULTIPLE);
Connect(ID_CTRL_CAM_ON,wxEVT_COMMAND_CHECKLISTBOX_TOGGLED,wxCommandEventHandler(MyFrame::OnEnableCam));
 
}
 
 
void MyFrame::OnEnableCam(wxCommandEvent& event) {
	wxWindow *wintmp = this->FindWindow(ID_CTRL_CAM_ON);
	if(wintmp->IsKindOf(CLASSINFO(wxCheckListBox))) { ##Always false
		wxCheckListBox* clb = (wxCheckListBox*)wintmp;
                clb->IsChecked(0); ## If we don't check the KindOf we have an error here
        }
}