- item.m_itemId = m_list->GetNextItem( -1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED );
- while ( item.m_itemId != -1 )
- {
- m_list->GetItem( item );
- paths.Add( dir + item.m_text );
- item.m_itemId = m_list->GetNextItem( item.m_itemId,
- wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED );
- }
-}
-
-void wxFileDialog::GetFilenames(wxArrayString& files) const
-{
- files.Empty();
- if (m_list->GetSelectedItemCount() == 0)
- {
- files.Add( GetFilename() );
- return;
- }
- files.Alloc( m_list->GetSelectedItemCount() );
-
- wxListItem item;
- item.m_mask = wxLIST_MASK_TEXT;
-
- item.m_itemId = m_list->GetNextItem( -1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED );
- while ( item.m_itemId != -1 )
- {
- m_list->GetItem( item );
- files.Add( item.m_text );
- item.m_itemId = m_list->GetNextItem( item.m_itemId,
- wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED );
- }
-}
-
-
-
-// ----------------------------------------------------------------------------
-// global functions
-// ----------------------------------------------------------------------------
-
-wxString
-wxFileSelectorEx(const wxChar *message,
- const wxChar *default_path,
- const wxChar *default_filename,
- int *WXUNUSED(indexDefaultExtension),
- const wxChar *wildcard,
- int flags,
- wxWindow *parent,
- int x, int y)
-{
- // TODO: implement this somehow
- return wxFileSelector(message, default_path, default_filename, wxT(""),
- wildcard, flags, parent, x, y);
-}
-
-wxString wxFileSelector( const wxChar *title,
- const wxChar *defaultDir, const wxChar *defaultFileName,
- const wxChar *defaultExtension, const wxChar *filter, int flags,
- wxWindow *parent, int x, int y )
-{
- wxString filter2;
- if ( defaultExtension && !filter )
- filter2 = wxString(wxT("*.")) + wxString(defaultExtension) ;
- else if ( filter )
- filter2 = filter;
-
- wxString defaultDirString;
- if (defaultDir)
- defaultDirString = defaultDir;
-
- wxString defaultFilenameString;
- if (defaultFileName)
- defaultFilenameString = defaultFileName;
-
- wxFileDialog fileDialog( parent, title, defaultDirString, defaultFilenameString, filter2, flags, wxPoint(x, y) );
-
- if ( fileDialog.ShowModal() == wxID_OK )
- {
- return fileDialog.GetPath();
- }
- else
- {
- return wxEmptyString;
- }
-}
-
-wxString wxLoadFileSelector( const wxChar *what, const wxChar *extension, const wxChar *default_name, wxWindow *parent )
-{
- wxChar *ext = (wxChar *)extension;
-
- wxChar prompt[50];
- wxString str = _("Load %s file");
- wxSprintf(prompt, str, what);
-
- if (*ext == wxT('.')) ext++;
- wxChar wild[60];
- wxSprintf(wild, wxT("*.%s"), ext);
-
- return wxFileSelector (prompt, (const wxChar *) NULL, default_name, ext, wild, 0, parent);
-}
-
-wxString wxSaveFileSelector(const wxChar *what, const wxChar *extension, const wxChar *default_name,
- wxWindow *parent )
-{
- wxChar *ext = (wxChar *)extension;
-
- wxChar prompt[50];
- wxString str = _("Save %s file");
- wxSprintf(prompt, str, what);
-
- if (*ext == wxT('.')) ext++;
- wxChar wild[60];
- wxSprintf(wild, wxT("*.%s"), ext);
-
- return wxFileSelector (prompt, (const wxChar *) NULL, default_name, ext, wild, 0, parent);
-}
-
-
-
-
-
-
-// A module to allow icons table cleanup
-
-class wxFileDialogGenericModule: public wxModule
-{
-DECLARE_DYNAMIC_CLASS(wxFileDialogGenericModule)
-public:
- wxFileDialogGenericModule() {}
- bool OnInit() { return TRUE; }
- void OnExit() { if (g_IconsTable) {delete g_IconsTable; g_IconsTable = NULL;} }
-};
-
-IMPLEMENT_DYNAMIC_CLASS(wxFileDialogGenericModule, wxModule)