bool wxTextCtrlBase::SaveFile(const wxString& filename)
{
wxString filenameToUse = filename.IsEmpty() ? m_filename : filename;
- if ( !filenameToUse )
+ if ( filenameToUse.empty() )
{
// what kind of message to give? is it an error or a program bug?
wxLogDebug(wxT("Can't save textctrl to file without filename."));
}
#if wxUSE_FFILE
- wxFFile file(filename, _T("w"));
+ wxFFile file(filenameToUse, _T("w"));
if ( file.IsOpened() && file.Write(GetValue()) )
{
// it's not modified any longer
DiscardEdits();
- m_filename = filename;
+ // if it worked, save for future calls
+ m_filename = filenameToUse;
return TRUE;
}
+#endif // wxUSE_FFILE
wxLogError(_("The text couldn't be saved."));
-#endif // wxUSE_FFILE
return FALSE;
}
}
}
+// ----------------------------------------------------------------------------
+// hit testing
+// ----------------------------------------------------------------------------
+
+wxTextCtrlHitTestResult
+wxTextCtrlBase::HitTest(const wxPoint& WXUNUSED(pt),
+ wxTextCoord * WXUNUSED(col),
+ wxTextCoord * WXUNUSED(row)) const
+{
+ // not implemented
+ return wxTE_HT_UNKNOWN;
+}
#else // !wxUSE_TEXTCTRL