#include "wx/log.h"
#endif
+#ifdef __WXMAC__
+ #include "wx/filename.h"
+#endif
#ifdef __WXGTK__
#include "wx/mdi.h"
if (ext.IsEmpty() || ext == wxT(""))
{
- fileName += ".";
+ fileName += wxT(".");
fileName += docTemplate->GetDefaultExtension();
}
msgTitle = wxString(_("File error"));
#if wxUSE_STD_IOSTREAM
- wxSTD ofstream store(wxString(file.fn_str()).mb_str());
+ wxSTD ofstream store(wxString(file.fn_str()).mb_str()); // ?????
if (store.fail() || store.bad())
#else
- wxFileOutputStream store(wxString(file.fn_str()));
- if (store.LastError() != wxSTREAM_NOERROR)
+ wxFileOutputStream store( file );
+ if (store.GetLastError() != wxSTREAM_NO_ERROR)
#endif
{
(void)wxMessageBox(_("Sorry, could not open this file for saving."), msgTitle, wxOK | wxICON_EXCLAMATION,
Modify(FALSE);
SetFilename(file);
SetDocumentSaved(TRUE);
+#ifdef __WXMAC__
+ wxFileName fn(file) ;
+ fn.MacSetDefaultTypeAndCreator() ;
+#endif
return TRUE;
}
msgTitle = wxString(_("File error"));
#if wxUSE_STD_IOSTREAM
- wxSTD ifstream store(wxString(file.fn_str()).mb_str());
+ wxSTD ifstream store(wxString(file.fn_str()).mb_str()); // ????
if (store.fail() || store.bad())
#else
- wxFileInputStream store(wxString(file.fn_str()));
- if (store.LastError() != wxSTREAM_NOERROR)
+ wxFileInputStream store( file );
+ if (store.GetLastError() != wxSTREAM_NO_ERROR)
#endif
{
(void)wxMessageBox(_("Sorry, could not open this file."), msgTitle, wxOK|wxICON_EXCLAMATION,
LoadObject(store);
if ( !store && !store.eof() )
#else
- int res = LoadObject(store).LastError();
- if ((res != wxSTREAM_NOERROR) &&
+ int res = LoadObject(store).GetLastError();
+ if ((res != wxSTREAM_NO_ERROR) &&
(res != wxSTREAM_EOF))
#endif
{
while (node)
{
wxView *view = (wxView *)node->Data();
- view->OnUpdate(sender, hint);
+ if (view != sender)
+ view->OnUpdate(sender, hint);
node = node->Next();
}
}
void wxDocManager::OnFileNew(wxCommandEvent& WXUNUSED(event))
{
- CreateDocument(wxString(""), wxDOC_NEW);
+ CreateDocument( wxT(""), wxDOC_NEW );
}
void wxDocManager::OnFileOpen(wxCommandEvent& WXUNUSED(event))
{
- if ( !CreateDocument(wxString(""), 0) )
+ if ( !CreateDocument( wxT(""), 0) )
{
OnOpenFileFailure();
}
wxString buf;
buf.Printf(wxT("file%d"), m_fileHistoryN+1);
wxString historyFile;
- while ((m_fileHistoryN <= m_fileMaxFiles) && config.Read(buf, &historyFile) && (historyFile != wxT("")))
+ while ((m_fileHistoryN < m_fileMaxFiles) && config.Read(buf, &historyFile) && (historyFile != wxT("")))
{
m_fileHistory[m_fileHistoryN] = copystring((const wxChar*) historyFile);
m_fileHistoryN ++;
return FALSE;
}
- int len = stream.StreamSize();
+ int len = stream.GetSize();
// TODO: is this the correct test for EOF?
while (stream.TellI() < (len - 1))
{