Code: Select all
void _2Frame::OpenFile(wxCommandEvent& WXUNUSED(event))
{
wxFileDialog *OpenDialog = new wxFileDialog(this, _("Choose a file to open"), wxEmptyString, wxEmptyString,_("Text files (*.txt)|*.txt|C++ Source Files (*.cpp, *.cxx)|*.cpp;*.cxx|C Source files (*.c)|*.c|C header files (*.h)|*.h"), wxFD_OPEN, wxDefaultPosition);
// Creates a "open file" dialog with 4 file types
if (OpenDialog->ShowModal() == wxID_OK) // if the user click "Open" instead of "cancel"
{
CurrentDocPath = OpenDialog->GetPath();
// Sets our current document to the file the user selected
TextCtrl1->LoadFile(CurrentDocPath); //Opens that file
// Set the Title to reflect the file open
OpenDialog->GetFilename();
//SetTitle(wxString(("Edit - "))<<
}
}
what is the cause?
error
Code: Select all
H:\SML\_2Main.cpp|408|error: `wxFileDialog' was not declared in this scope|
H:\SML\_2Main.cpp|408|error: `OpenDialog' was not declared in this scope|
H:\SML\_2Main.cpp|408|error: `wxFileDialog' is not a type|
H:\SML\_2Main.cpp|408|error: `wxFD_OPEN' was not declared in this scope|