#include "wx/file.h" // for wxS_IXXX constants only
#include "wx/filedlg.h" // wxOPEN, wxSAVE...
#include "wx/generic/filedlgg.h"
#include "wx/file.h" // for wxS_IXXX constants only
#include "wx/filedlg.h" // wxOPEN, wxSAVE...
#include "wx/generic/filedlgg.h"
-wxFileData::wxFileData( const wxFileData& fileData )
-{
- m_fileName = fileData.GetFileName();
- m_filePath = fileData.GetFilePath();
- m_size = fileData.GetSize();
- m_dateTime = fileData.GetDateTime();
- m_permissions = fileData.GetPermissions();
- m_type = fileData.GetType();
- m_image = GetImageId();
-}
-
wxFileData::wxFileData( const wxString &filePath, const wxString &fileName, fileType type, int image_id )
{
m_fileName = fileName;
wxFileData::wxFileData( const wxString &filePath, const wxString &fileName, fileType type, int image_id )
{
m_fileName = fileName;
+void wxFileData::Copy( const wxFileData& fileData )
+{
+ m_fileName = fileData.GetFileName();
+ m_filePath = fileData.GetFilePath();
+ m_size = fileData.GetSize();
+ m_dateTime = fileData.GetDateTime();
+ m_permissions = fileData.GetPermissions();
+ m_type = fileData.GetType();
+ m_image = GetImageId();
+}
+
IMPLEMENT_DYNAMIC_CLASS(wxFileCtrl,wxListCtrl)
BEGIN_EVENT_TABLE(wxFileCtrl,wxListCtrl)
IMPLEMENT_DYNAMIC_CLASS(wxFileCtrl,wxListCtrl)
BEGIN_EVENT_TABLE(wxFileCtrl,wxListCtrl)
- EVT_LIST_DELETE_ITEM(-1, wxFileCtrl::OnListDeleteItem)
- EVT_LIST_END_LABEL_EDIT(-1, wxFileCtrl::OnListEndLabelEdit)
- EVT_LIST_COL_CLICK(-1, wxFileCtrl::OnListColClick)
+ EVT_LIST_DELETE_ITEM(wxID_ANY, wxFileCtrl::OnListDeleteItem)
+ EVT_LIST_DELETE_ALL_ITEMS(wxID_ANY, wxFileCtrl::OnListDeleteAllItems)
+ EVT_LIST_END_LABEL_EDIT(wxID_ANY, wxFileCtrl::OnListEndLabelEdit)
+ EVT_LIST_COL_CLICK(wxID_ANY, wxFileCtrl::OnListColClick)
for (n=0; n<count; n++)
{
wxFileData *fd = new wxFileData(paths[n], names[n], wxFileData::is_drive, icons[n]);
for (n=0; n<count; n++)
{
wxFileData *fd = new wxFileData(paths[n], names[n], wxFileData::is_drive, icons[n]);
if (p.IsEmpty()) p = wxT("/");
#endif // __UNIX__
wxFileData *fd = new wxFileData(p, wxT(".."), wxFileData::is_dir, wxFileIconsTable::folder);
if (p.IsEmpty()) p = wxT("/");
#endif // __UNIX__
wxFileData *fd = new wxFileData(p, wxT(".."), wxFileData::is_dir, wxFileIconsTable::folder);
while (cont)
{
wxFileData *fd = new wxFileData(dirPrefix + f, f, wxFileData::is_dir, wxFileIconsTable::folder);
while (cont)
{
wxFileData *fd = new wxFileData(dirPrefix + f, f, wxFileData::is_dir, wxFileIconsTable::folder);
while (cont)
{
wxFileData *fd = new wxFileData(dirPrefix + f, f, wxFileData::is_file, wxFileIconsTable::file);
while (cont)
{
wxFileData *fd = new wxFileData(dirPrefix + f, f, wxFileData::is_file, wxFileIconsTable::file);
const wxPoint& pos )
:wxFileDialogBase(parent, message, defaultDir, defaultFile, wildCard, style, pos)
{
const wxPoint& pos )
:wxFileDialogBase(parent, message, defaultDir, defaultFile, wildCard, style, pos)
{
- wxDialog::Create( parent, -1, message, pos, wxDefaultSize,
+ wxDialog::Create( parent, wxID_ANY, message, pos, wxDefaultSize,
#if wxUSE_TOOLTIPS
but->SetToolTip( _("View files as a list view") );
#endif
buttonsizer->Add( but, 0, wxALL, 5 );
but = new wxBitmapButton(this, ID_REPORT_MODE,
#if wxUSE_TOOLTIPS
but->SetToolTip( _("View files as a list view") );
#endif
buttonsizer->Add( but, 0, wxALL, 5 );
but = new wxBitmapButton(this, ID_REPORT_MODE,
buttonsizer->Add( 30, 5, 1 );
m_upDirButton = new wxBitmapButton(this, ID_UP_DIR,
buttonsizer->Add( 30, 5, 1 );
m_upDirButton = new wxBitmapButton(this, ID_UP_DIR,
#ifndef __DOS__ // VS: Home directory is meaningless in MS-DOS...
but = new wxBitmapButton(this, ID_PARENT_DIR,
#ifndef __DOS__ // VS: Home directory is meaningless in MS-DOS...
but = new wxBitmapButton(this, ID_PARENT_DIR,
- staticsizer->Add( new wxStaticText( this, -1, _("Current directory:") ), 0, wxRIGHT, 10 );
- m_static = new wxStaticText( this, -1, m_dir );
+ staticsizer->Add( new wxStaticText( this, wxID_ANY, _("Current directory:") ), 0, wxRIGHT, 10 );
+ m_static = new wxStaticText( this, wxID_ANY, m_dir );
staticsizer->Add( m_static, 1 );
mainsizer->Add( staticsizer, 0, wxEXPAND | wxLEFT|wxRIGHT|wxBOTTOM, 10 );
staticsizer->Add( m_static, 1 );
mainsizer->Add( staticsizer, 0, wxEXPAND | wxLEFT|wxRIGHT|wxBOTTOM, 10 );
// PDAs have a different screen layout
mainsizer->Add( m_list, 1, wxEXPAND | wxLEFT|wxRIGHT, 5 );
// PDAs have a different screen layout
mainsizer->Add( m_list, 1, wxEXPAND | wxLEFT|wxRIGHT, 5 );
- wxBoxSizer *choicesizer = new wxBoxSizer( wxHORIZONTAL );
- m_choice = new wxChoice( this, ID_CHOICE );
- choicesizer->Add( m_choice, 1, wxCENTER|wxALL, 5 );
- mainsizer->Add( choicesizer, 0, wxEXPAND );
-
wxBoxSizer *textsizer = new wxBoxSizer( wxHORIZONTAL );
m_text = new wxTextCtrl( this, ID_TEXT, m_fileName, wxDefaultPosition, wxDefaultSize, wxPROCESS_ENTER );
textsizer->Add( m_text, 1, wxCENTER | wxALL, 5 );
mainsizer->Add( textsizer, 0, wxEXPAND );
wxBoxSizer *textsizer = new wxBoxSizer( wxHORIZONTAL );
m_text = new wxTextCtrl( this, ID_TEXT, m_fileName, wxDefaultPosition, wxDefaultSize, wxPROCESS_ENTER );
textsizer->Add( m_text, 1, wxCENTER | wxALL, 5 );
mainsizer->Add( textsizer, 0, wxEXPAND );
- m_check = new wxCheckBox( this, ID_CHECK, _("Show hidden files") );
- m_check->SetValue( ms_lastShowHidden );
- textsizer->Add( m_check, 0, wxCENTER|wxALL, 5 );
+ m_check = NULL;
+ m_choice = new wxChoice( this, ID_CHOICE );
+ textsizer->Add( m_choice, 1, wxCENTER|wxALL, 5 );
- buttonsizer->Add( new wxButton( this, wxID_OK, _("OK") ), 0, wxCENTER | wxALL, 5 );
- buttonsizer->Add( new wxButton( this, wxID_CANCEL, _("Cancel") ), 0, wxCENTER | wxALL, 5 );
+ buttonsizer->Add( new wxButton( this, wxID_OK ), 0, wxCENTER | wxALL, 5 );
+ buttonsizer->Add( new wxButton( this, wxID_CANCEL ), 0, wxCENTER | wxALL, 5 );
wxBoxSizer *textsizer = new wxBoxSizer( wxHORIZONTAL );
m_text = new wxTextCtrl( this, ID_TEXT, m_fileName, wxDefaultPosition, wxDefaultSize, wxPROCESS_ENTER );
textsizer->Add( m_text, 1, wxCENTER | wxLEFT|wxRIGHT|wxTOP, 10 );
wxBoxSizer *textsizer = new wxBoxSizer( wxHORIZONTAL );
m_text = new wxTextCtrl( this, ID_TEXT, m_fileName, wxDefaultPosition, wxDefaultSize, wxPROCESS_ENTER );
textsizer->Add( m_text, 1, wxCENTER | wxLEFT|wxRIGHT|wxTOP, 10 );
- textsizer->Add( new wxButton( this, wxID_OK, _("OK") ), 0, wxCENTER | wxLEFT|wxRIGHT|wxTOP, 10 );
+ textsizer->Add( new wxButton( this, wxID_OK ), 0, wxCENTER | wxLEFT|wxRIGHT|wxTOP, 10 );
mainsizer->Add( textsizer, 0, wxEXPAND );
wxBoxSizer *choicesizer = new wxBoxSizer( wxHORIZONTAL );
mainsizer->Add( textsizer, 0, wxEXPAND );
wxBoxSizer *choicesizer = new wxBoxSizer( wxHORIZONTAL );
m_check = new wxCheckBox( this, ID_CHECK, _("Show hidden files") );
m_check->SetValue( ms_lastShowHidden );
choicesizer->Add( m_check, 0, wxCENTER|wxALL, 10 );
m_check = new wxCheckBox( this, ID_CHECK, _("Show hidden files") );
m_check->SetValue( ms_lastShowHidden );
choicesizer->Add( m_check, 0, wxCENTER|wxALL, 10 );
- choicesizer->Add( new wxButton( this, wxID_CANCEL, _("Cancel") ), 0, wxCENTER | wxALL, 10 );
+ choicesizer->Add( new wxButton( this, wxID_CANCEL ), 0, wxCENTER | wxALL, 10 );
void wxGenericFileDialog::DoSetFilterIndex(int filterindex)
{
wxString *str = (wxString*) m_choice->GetClientData( filterindex );
void wxGenericFileDialog::DoSetFilterIndex(int filterindex)
{
wxString *str = (wxString*) m_choice->GetClientData( filterindex );