memtext.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. ///////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/memtext.h
  3. // Purpose: wxMemoryText allows to use wxTextBuffer without a file
  4. // Created: 14.11.01
  5. // Author: Morten Hanssen
  6. // Copyright: (c) 2001 Morten Hanssen
  7. // Licence: wxWindows licence
  8. ///////////////////////////////////////////////////////////////////////////////
  9. #ifndef _WX_MEMTEXT_H
  10. #define _WX_MEMTEXT_H
  11. #include "wx/defs.h"
  12. // there is no separate setting for wxMemoryText, it's smallish anyhow
  13. #if wxUSE_TEXTBUFFER
  14. // ----------------------------------------------------------------------------
  15. // wxMemoryText
  16. // ----------------------------------------------------------------------------
  17. class WXDLLIMPEXP_BASE wxMemoryText : public wxTextBuffer
  18. {
  19. public:
  20. // Constructors.
  21. wxMemoryText() { }
  22. wxMemoryText(const wxString& name) : wxTextBuffer(name) { }
  23. protected:
  24. virtual bool OnExists() const
  25. { return false; }
  26. virtual bool OnOpen(const wxString & WXUNUSED(strBufferName),
  27. wxTextBufferOpenMode WXUNUSED(OpenMode))
  28. { return true; }
  29. virtual bool OnClose()
  30. { return true; }
  31. virtual bool OnRead(const wxMBConv& WXUNUSED(conv))
  32. { return true; }
  33. virtual bool OnWrite(wxTextFileType WXUNUSED(typeNew),
  34. const wxMBConv& WXUNUSED(conv) = wxMBConvUTF8())
  35. { return true; }
  36. private:
  37. wxDECLARE_NO_COPY_CLASS(wxMemoryText);
  38. };
  39. #endif // wxUSE_TEXTBUFFER
  40. #endif // _WX_MEMTEXT_H