home *** CD-ROM | disk | FTP | other *** search
/ CICA 1995 May / cica_0595_4.zip / cica_0595_4 / UTIL / MSWSRC35 / XFILEWND.H < prev   
C/C++ Source or Header  |  1993-08-19  |  2KB  |  79 lines

  1. // ObjectWindows - (C) Copyright 1992 by Borland International
  2.  
  3. #ifndef __FILEWND_H
  4. #define __FILEWND_H
  5.  
  6. #ifndef __EDITWND_H
  7. #include <editwnd.h>
  8. #endif
  9.  
  10. #ifndef __FILEDIAL_H
  11. #include <filedial.h>
  12. #endif
  13.  
  14. #pragma option -Vo-
  15. #if     defined(__BCOPT__) && !defined(_ALLOW_po)
  16. #pragma option -po-
  17. #endif
  18.  
  19.  /* TxFileWindow */
  20.  
  21. _CLASSDEF(TxFileWindow)
  22.  
  23. class _EXPORT TxFileWindow : public TEditWindow
  24. {
  25. public:
  26.     LPSTR FileName;
  27.     BOOL IsNewFile;
  28.  
  29.     TxFileWindow(PTWindowsObject AParent, LPSTR ATitle, LPSTR AFileName,
  30.                 PTModule AModule = NULL);
  31.     virtual ~TxFileWindow();
  32.  
  33.     virtual BOOL CanClear();
  34.     virtual BOOL CanClose();
  35.     void NewFile();
  36.     void Open();
  37.     BOOL Read();
  38.     void ReplaceWith(LPSTR AFileName);
  39.     BOOL Save();
  40.     BOOL SaveAs();
  41.     void SetFileName(LPSTR AFileName);
  42.     BOOL Write();
  43.  
  44.     static PTStreamable build();
  45.  
  46. protected:
  47.     virtual void SetupWindow();
  48.     virtual void CMFileNew(RTMessage Msg) = [CM_FIRST + CM_FILENEW];
  49.     virtual void CMFileOpen(RTMessage Msg) = [CM_FIRST + CM_FILEOPEN];
  50.     virtual void CMFileSave(RTMessage Msg) = [CM_FIRST + CM_FILESAVE];
  51.     virtual void CMFileSaveAs(RTMessage Msg) =
  52.                                          [CM_FIRST + CM_FILESAVEAS];
  53.  
  54.     TxFileWindow(StreamableInit) : TEditWindow(streamableInit) {};
  55.     virtual void write (Ropstream os);
  56.     virtual Pvoid read (Ripstream is);
  57.  
  58. private:
  59.     virtual const Pchar streamableName() const
  60.         { return "TxFileWindow"; }
  61. };
  62.  
  63. inline Ripstream operator >> ( Ripstream is, RTxFileWindow cl )
  64.     { return is >> (RTStreamable)cl; }
  65. inline Ripstream operator >> ( Ripstream is, RPTxFileWindow cl )
  66.     { return is >> (RPvoid)cl; }
  67.  
  68. inline Ropstream operator << ( Ropstream os, RTxFileWindow cl )
  69.     { return os << (RTStreamable)cl; }
  70. inline Ropstream operator << ( Ropstream os, PTxFileWindow cl )
  71.     { return os << (PTStreamable)cl; }
  72.  
  73. #pragma option -Vo.
  74. #if     defined(__BCOPT__) && !defined(_ALLOW_po)
  75. #pragma option -po.
  76. #endif
  77.  
  78. #endif
  79.