home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c082_122 / 3.ddi / OWLINC.ZIP / EDIT.H < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-10  |  2.7 KB  |  88 lines

  1. // ObjectWindows - (C) Copyright 1992 by Borland International
  2.  
  3. #ifndef __EDIT_H
  4. #define __EDIT_H
  5.  
  6.  
  7. #ifndef __STATIC_H
  8. #include <static.h>
  9. #endif
  10.  
  11. #pragma option -Vo-
  12. #if     defined(__BCOPT__) && !defined(_ALLOW_po)
  13. #pragma option -po-
  14. #endif
  15.  
  16. _CLASSDEF(TEdit)
  17.  
  18.   /* TEdit */
  19. class _EXPORT TEdit : public TStatic
  20. {
  21. public:
  22.     TEdit(PTWindowsObject AParent, int AnId, LPSTR AText, int X,
  23.           int Y, int W, int H, WORD ATextLen, BOOL Multiline,
  24.           PTModule AModule = NULL);
  25.     TEdit(PTWindowsObject AParent, int ResourceId, WORD ATextLen,
  26.           PTModule AModule = NULL);
  27.  
  28.     void Undo();
  29.     BOOL CanUndo();
  30.     void Paste();
  31.     void Copy();
  32.     void Cut();
  33.     int GetNumLines();
  34.     int GetLineLength(int LineNumber);
  35.     BOOL GetLine(LPSTR ATextString, int StrSize, int LineNumber);
  36.     void GetSubText(LPSTR ATextString, int StartPos, int EndPos);
  37.     BOOL DeleteSubText(int StartPos, int EndPos);
  38.     BOOL DeleteLine(int LineNumber);
  39.     void GetSelection(Rint StartPos, Rint EndPos);
  40.     BOOL DeleteSelection();
  41.     BOOL IsModified();
  42.     void ClearModify();
  43.     int GetLineFromPos(int CharPos);
  44.     int GetLineIndex(int LineNumber);
  45.     void Scroll(int HorizontalUnit, int VerticalUnit);
  46.     BOOL SetSelection(int StartPos, int EndPos);
  47.     void Insert(LPSTR ATextString);
  48.     int Search(int StartPos, LPSTR AText, BOOL CaseSensitive);
  49.  
  50.     static PTStreamable build();
  51.  
  52. protected:
  53.     virtual LPSTR GetClassName()
  54.     { return "EDIT"; }
  55.     virtual void SetupWindow();
  56.     virtual void CMEditCut(RTMessage Msg) = [CM_FIRST + CM_EDITCUT];
  57.     virtual void CMEditCopy(RTMessage Msg) = [CM_FIRST + CM_EDITCOPY];
  58.     virtual void CMEditPaste(RTMessage Msg) = [CM_FIRST + CM_EDITPASTE];
  59.     virtual void CMEditDelete(RTMessage Msg) =
  60.                                         [CM_FIRST + CM_EDITDELETE];
  61.     virtual void CMEditClear(RTMessage Msg) = [CM_FIRST + CM_EDITCLEAR];
  62.     virtual void CMEditUndo(RTMessage Msg) = [CM_FIRST + CM_EDITUNDO];
  63.     virtual void ENErrSpace(RTMessage Msg) = [NF_FIRST + EN_ERRSPACE];
  64.  
  65.     TEdit(StreamableInit) : TStatic(streamableInit) {};
  66.  
  67. private:
  68.     virtual const Pchar streamableName() const
  69.         { return "TEdit"; }
  70. };
  71.  
  72. inline Ripstream operator >> ( Ripstream is, RTEdit cl )
  73.     { return is >> (RTStreamable )cl; }
  74. inline Ripstream operator >> ( Ripstream is, RPTEdit cl )
  75.     { return is >> (RPvoid)cl; }
  76.  
  77. inline Ropstream operator << ( Ropstream os, RTEdit cl )
  78.     { return os << (RTStreamable )cl; }
  79. inline Ropstream operator << ( Ropstream os, PTEdit cl )
  80.     { return os << (PTStreamable )cl; }
  81.  
  82. #pragma option -Vo.
  83. #if     defined(__BCOPT__) && !defined(_ALLOW_po)
  84. #pragma option -po.
  85. #endif
  86.  
  87. #endif
  88.