Bonjour a tous,
je fais mon apprentissage sur Devcpp et les lib Wxwidgets (Merci a Fredcl au passage pour ses conseils!!). Je me pose une question (peut être idiote d'ailleurs).
Dans les lignes de code ci-dessous j'essaye d'attribuer un evenment a une partie du menu (Police). Cela doit ouvrir une Dial Box mais j'ai toujours une erreur à la compilation :
void MyFrame::OnFont(wxCommandEvent& WXUNUSED(event))
{
wxFontData data;
data.SetInitialFont(mlTextCtrl->GetFont());
data.SetColour(mlTextCtrl->GetForegroundColour());
wxFontDialog dialog(this, &data); //<< L'erreur est ici
if (dialog.ShowModal() == wxID_OK)
{
mlTextCtrl->SetFont(FontDlg.GetFontData().GetChosenFont());
mlTextCtrl->SetForegroundColour(FontDlg.GetFontData().GetColour());
mlTextCtrl->Refresh();
}
}
Message d'erreur :
C:\Dev-Cpp\projet\main.cpp In member function `void MyFrame::OnFont(wxCommandEvent&)':
268 C:\Dev-Cpp\projet\main.cpp `wxFontDialog' undeclared (first use this function)
(Each undeclared identifier is reported only once for each function it appears in.)
268 C:\Dev-Cpp\projet\main.cpp expected `;' before "dialog"
269 C:\Dev-Cpp\projet\main.cpp `dialog' undeclared (first use this function)
271 C:\Dev-Cpp\projet\main.cpp `FontDlg' undeclared (first use this function)
Avez-vous une explication ? Je suis pourtant parie d'un exemple dans l'aide de wxwidgets
Merci a tous.