git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5511
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
DECLARE_DYNAMIC_CLASS(wxFileDialog)
DECLARE_EVENT_TABLE()
DECLARE_DYNAMIC_CLASS(wxFileDialog)
DECLARE_EVENT_TABLE()
- static long m_lastViewStyle; // list or report?
- static bool m_lastShowHidden;
+ static long s_lastViewStyle; // list or report?
+ static bool s_lastShowHidden;
};
// File selector - backward compatibility
};
// File selector - backward compatibility
#include "wx/mimetype.h"
#include "wx/image.h"
#include "wx/module.h"
#include "wx/mimetype.h"
#include "wx/image.h"
#include "wx/module.h"
EVT_CHECKBOX(ID_CHECK,wxFileDialog::OnCheck)
END_EVENT_TABLE()
EVT_CHECKBOX(ID_CHECK,wxFileDialog::OnCheck)
END_EVENT_TABLE()
-long wxFileDialog::m_lastViewStyle = wxLC_LIST;
-bool wxFileDialog::m_lastShowHidden = FALSE;
+long wxFileDialog::s_lastViewStyle = wxLC_LIST;
+bool wxFileDialog::s_lastShowHidden = FALSE;
wxFileDialog::wxFileDialog(wxWindow *parent,
const wxString& message,
wxFileDialog::wxFileDialog(wxWindow *parent,
const wxString& message,
+ if (wxConfig::Get(FALSE))
+ {
+ wxConfig::Get() -> Read(wxT("/wxWindows/wxFileDialog/ViewStyle"), &s_lastViewStyle);
+ wxConfig::Get() -> Read(wxT("/wxWindows/wxFileDialog/ShowHidden"), &s_lastShowHidden);
+ }
+
m_message = message;
m_dialogStyle = style;
m_message = message;
m_dialogStyle = style;
if (m_dialogStyle & wxMULTIPLE)
m_list = new wxFileCtrl( this, ID_LIST_CTRL, m_dir, firstWild, wxDefaultPosition,
if (m_dialogStyle & wxMULTIPLE)
m_list = new wxFileCtrl( this, ID_LIST_CTRL, m_dir, firstWild, wxDefaultPosition,
- wxSize(440,180), m_lastViewStyle | wxSUNKEN_BORDER );
+ wxSize(440,180), s_lastViewStyle | wxSUNKEN_BORDER );
else
m_list = new wxFileCtrl( this, ID_LIST_CTRL, m_dir, firstWild, wxDefaultPosition,
else
m_list = new wxFileCtrl( this, ID_LIST_CTRL, m_dir, firstWild, wxDefaultPosition,
- wxSize(440,180), m_lastViewStyle | wxSUNKEN_BORDER | wxLC_SINGLE_SEL );
- m_list -> ShowHidden(m_lastShowHidden);
+ wxSize(440,180), s_lastViewStyle | wxSUNKEN_BORDER | wxLC_SINGLE_SEL );
+ m_list -> ShowHidden(s_lastShowHidden);
mainsizer->Add( m_list, 1, wxEXPAND | wxLEFT|wxRIGHT, 10 );
wxBoxSizer *textsizer = new wxBoxSizer( wxHORIZONTAL );
mainsizer->Add( m_list, 1, wxEXPAND | wxLEFT|wxRIGHT, 10 );
wxBoxSizer *textsizer = new wxBoxSizer( wxHORIZONTAL );
m_choice = new wxChoice( this, ID_CHOICE );
choicesizer->Add( m_choice, 1, wxCENTER|wxALL, 10 );
m_check = new wxCheckBox( this, ID_CHECK, _("Show hidden files") );
m_choice = new wxChoice( this, ID_CHOICE );
choicesizer->Add( m_choice, 1, wxCENTER|wxALL, 10 );
m_check = new wxCheckBox( this, ID_CHECK, _("Show hidden files") );
- m_check->SetValue( m_lastShowHidden );
+ m_check->SetValue( s_lastShowHidden );
choicesizer->Add( m_check, 0, wxCENTER|wxALL, 10 );
choicesizer->Add( new wxButton( this, wxID_CANCEL, _("Cancel") ), 0, wxCENTER | wxALL, 10 );
mainsizer->Add( choicesizer, 0, wxEXPAND );
choicesizer->Add( m_check, 0, wxCENTER|wxALL, 10 );
choicesizer->Add( new wxButton( this, wxID_CANCEL, _("Cancel") ), 0, wxCENTER | wxALL, 10 );
mainsizer->Add( choicesizer, 0, wxEXPAND );
mainsizer->Fit( this );
mainsizer->SetSizeHints( this );
mainsizer->Fit( this );
mainsizer->SetSizeHints( this );
Centre( wxBOTH );
if (m_fileName.IsEmpty())
Centre( wxBOTH );
if (m_fileName.IsEmpty())
wxFileDialog::~wxFileDialog()
{
wxFileDialog::~wxFileDialog()
{
+ if (wxConfig::Get(FALSE))
+ {
+ wxConfig::Get() -> Write(wxT("/wxWindows/wxFileDialog/ViewStyle"), s_lastViewStyle);
+ wxConfig::Get() -> Write(wxT("/wxWindows/wxFileDialog/ShowHidden"), s_lastShowHidden);
+ }
}
void wxFileDialog::OnChoice( wxCommandEvent &event )
}
void wxFileDialog::OnChoice( wxCommandEvent &event )
void wxFileDialog::OnCheck( wxCommandEvent &event )
{
void wxFileDialog::OnCheck( wxCommandEvent &event )
{
- m_list->ShowHidden( (m_lastShowHidden = event.GetInt() != 0) );
+ m_list->ShowHidden( (s_lastShowHidden = event.GetInt() != 0) );
}
void wxFileDialog::OnActivated( wxListEvent &event )
}
void wxFileDialog::OnActivated( wxListEvent &event )
void wxFileDialog::OnList( wxCommandEvent &WXUNUSED(event) )
{
m_list->ChangeToListMode();
void wxFileDialog::OnList( wxCommandEvent &WXUNUSED(event) )
{
m_list->ChangeToListMode();
- m_lastViewStyle = wxLC_LIST;
+ s_lastViewStyle = wxLC_LIST;
m_list->SetFocus();
}
void wxFileDialog::OnReport( wxCommandEvent &WXUNUSED(event) )
{
m_list->ChangeToReportMode();
m_list->SetFocus();
}
void wxFileDialog::OnReport( wxCommandEvent &WXUNUSED(event) )
{
m_list->ChangeToReportMode();
- m_lastViewStyle = wxLC_REPORT;
+ s_lastViewStyle = wxLC_REPORT;