don't crash if the extra controls are not used in the file dialog (closes #10260)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57389 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -877,8 +877,7 @@ void MyFrame::FileOpen(wxCommandEvent& WXUNUSED(event) )
|
|||||||
if (dialog.ShowModal() == wxID_OK)
|
if (dialog.ShowModal() == wxID_OK)
|
||||||
{
|
{
|
||||||
wxString info;
|
wxString info;
|
||||||
MyExtraPanel *extra_panel
|
wxWindow * const extra = dialog.GetExtraControl();
|
||||||
= static_cast<MyExtraPanel*>(dialog.GetExtraControl());
|
|
||||||
info.Printf(_T("Full file name: %s\n")
|
info.Printf(_T("Full file name: %s\n")
|
||||||
_T("Path: %s\n")
|
_T("Path: %s\n")
|
||||||
_T("Name: %s\n")
|
_T("Name: %s\n")
|
||||||
@@ -886,7 +885,8 @@ void MyFrame::FileOpen(wxCommandEvent& WXUNUSED(event) )
|
|||||||
dialog.GetPath().c_str(),
|
dialog.GetPath().c_str(),
|
||||||
dialog.GetDirectory().c_str(),
|
dialog.GetDirectory().c_str(),
|
||||||
dialog.GetFilename().c_str(),
|
dialog.GetFilename().c_str(),
|
||||||
extra_panel->GetInfo().c_str());
|
extra ? static_cast<MyExtraPanel*>(extra)->GetInfo()
|
||||||
|
: wxString("None"));
|
||||||
wxMessageDialog dialog2(this, info, _T("Selected file"));
|
wxMessageDialog dialog2(this, info, _T("Selected file"));
|
||||||
dialog2.ShowModal();
|
dialog2.ShowModal();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user