home *** CD-ROM | disk | FTP | other *** search
/ Prima Shareware 3 / DuCom_Prima-Shareware-3_cd1.bin / PROGRAMO / C / RICHCT / RCHEDTCN.H < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-03  |  3.6 KB  |  111 lines

  1. #if !defined(__rchedtcn_h)              // Sentry, use file only if it's not already included.
  2. #define __rchedtcn_h
  3.  
  4. /*  Project richctrl
  5.     DHB Software
  6.     Copyright ⌐ 1996. All Rights Reserved.
  7.  
  8.     SUBSYSTEM:    richctrl.apx Application
  9.     FILE:         rchedtcn.h
  10.     AUTHOR:       David H. Borg
  11.  
  12.  
  13.     OVERVIEW
  14.     ========
  15.     Class definition for RichEditControl (TEdit).      
  16. */
  17.  
  18. #include <owl\owlpch.h>
  19. #pragma hdrstop
  20.  
  21.  
  22. #include <commctrl.h>            // Windows 95 common controls
  23. #include <richedit.h>            // Windows 95 rich text editor
  24. #include "rchctrla.rh"            // Definition of all resources.
  25.  
  26.  
  27. //{{TEdit = RichEditControl}}
  28. class RichEditControl : public TEdit {
  29. public:
  30.     RichEditControl (TWindow* parent, int id, const char far* text, int x, int y, int w, int h, uint textLen = 0, bool multiline = false, TModule* module = 0);
  31.     virtual ~RichEditControl ();
  32.  
  33. public:
  34.     TFindReplaceDialog::TData FindReplaceData;
  35.     TFindReplaceDialog*       FindReplaceDialog;
  36.     uint                      FindReplaceCmd;
  37.  
  38.     void DoFind();
  39.  
  40. protected:
  41.     TOpenSaveDialog::TData FileData;
  42.     TChooseFontDialog::TData FontData;
  43.     char far* FileName;
  44.     CHARFORMAT charFormat;    // common character format structure
  45.     PARAFORMAT paraFormat;    // common paragraph format structure
  46.     int streamFormat;
  47.     bool updtFontFace, updtFontSize;    // time to update character font info
  48.  
  49.     bool CanClear();
  50.     void RichEditControl::SetFileName (const char far* newName);
  51.     void DoFileOpenCmd();
  52.     bool Open( const char far* fileName);
  53.     static DWORD CALLBACK OpenCallback(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG FAR *pcb);
  54.     void DoSaveAsCmd();
  55.     bool Save( const char far* fileName);
  56.     static DWORD CALLBACK SaveCallback (DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG FAR *pcb);
  57.     void UpdateFormats();
  58.  
  59. //{{RichEditControlVIRTUAL_BEGIN}}
  60. public:
  61.     virtual char far* GetClassName ();
  62.     virtual void Clear ();
  63.     virtual void SetupWindow ();
  64.     virtual bool CanClose ();
  65.     virtual void Paint (TDC& dc, bool erase, TRect& rect);
  66. //{{RichEditControlVIRTUAL_END}}
  67.  
  68. //{{RichEditControlRSP_TBL_BEGIN}}
  69. protected:
  70.     LRESULT CmChangeFontFace(WPARAM wParam, LPARAM lParam);
  71.     void CmEnFontFace (TCommandEnabler &tce);
  72.     LRESULT CmChangeFontSize(WPARAM wParam, LPARAM lParam);
  73.     void CmEnFontSize (TCommandEnabler &tce);
  74.     void CmFileNew ();
  75.     void CmFileSave ();
  76.     void CmEnFileSave (TCommandEnabler &tce);
  77.     void CmFileOpenRtf ();
  78.     void CmFileOpenText ();
  79.     void CmSaveAsRtf ();
  80.     void CmSaveAsText ();
  81.     void CmEnSaveAs (TCommandEnabler &tce);
  82.     void CmEditFind ();
  83.     void CmEnEditFindReplace (TCommandEnabler &tce);
  84.     void CmEditFindNext ();
  85.     void CmEnEditFindNext (TCommandEnabler &tce);
  86.     LRESULT EvFindMsg(WPARAM, LPARAM);  // common dialog message
  87.     void CmFormatBold ();
  88.     void CmEnFormatBold (TCommandEnabler &tce);
  89.     void CmFormatItalic ();
  90.     void CmEnFormatItalic (TCommandEnabler &tce);
  91.     void CmFormatUnderline ();
  92.     void CmEnFormatUnderline (TCommandEnabler &tce);
  93.     void CmFormatLeft ();
  94.     void CmEnFormatLeft (TCommandEnabler &tce);
  95.     void CmFormatCenter ();
  96.     void CmEnFormatCenter (TCommandEnabler &tce);
  97.     void CmFormatRight ();
  98.     void CmEnFormatRight (TCommandEnabler &tce);
  99.     void CmFormatFont ();
  100.     void CmEnFormatFont (TCommandEnabler &tce);
  101.     void EvKeyDown (uint key, uint repeatCount, uint flags);
  102.     void EvLButtonDown (uint modKeys, TPoint& point);
  103.     void CmFilePrint ();
  104. //{{RichEditControlRSP_TBL_END}}
  105. DECLARE_RESPONSE_TABLE(RichEditControl);
  106. };    //{{RichEditControl}}
  107.  
  108.  
  109. #endif                                      // __rchedtcn_h sentry.
  110.  
  111.