home *** CD-ROM | disk | FTP | other *** search
/ C Programming Starter Kit 2.0 / SamsPublishing-CProgrammingStarterKit-v2.0-Win31.iso / bc45 / owlinc.pak / FINDREPL.H < prev    next >
C/C++ Source or Header  |  1997-07-23  |  3KB  |  108 lines

  1. //----------------------------------------------------------------------------
  2. // ObjectWindows
  3. // (C) Copyright 1992, 1994 by Borland International, All Rights Reserved
  4. //
  5. //   Definition of FindReplace- abstract, Find-, Replace- common Dialog 
  6. //   classes
  7. //----------------------------------------------------------------------------
  8. #if !defined(OWL_FINDREPL_H)
  9. #define OWL_FINDREPL_H
  10.  
  11. #if !defined(OWL_COMMDIAL_H)
  12. # include <owl/commdial.h>
  13. #endif
  14.  
  15. class _OWLCLASS TFindReplaceDialog : public TCommonDialog {
  16.   public:
  17.     class _OWLCLASS TData {
  18.       public:
  19.         uint32   Flags;
  20.         uint32   Error;
  21.         char*    FindWhat;
  22.         char*    ReplaceWith;
  23.         int      BuffSize;
  24.       
  25.         TData(uint32 flags = 0, int buffSize = 81);
  26.         TData(const TData& src);
  27.        ~TData();
  28.  
  29.         TData& operator =(const TData& src);
  30.  
  31.         void     Write(opstream& os);
  32.         void     Read(ipstream& is);
  33.     };
  34.  
  35.     TFindReplaceDialog(TWindow*        parent, 
  36.                        TData&          data,
  37.                        TResId          templateId = 0,
  38.                        const char far* title = 0,
  39.                        TModule*        module = 0);
  40.  
  41.     void         UpdateData(LPARAM lParam = 0);
  42.     
  43.   protected:
  44.     FINDREPLACE  fr;
  45.     TData&       Data;
  46.  
  47.     HWND         DoCreate() = 0;
  48.  
  49.     TFindReplaceDialog(TWindow*        parent,
  50.                        TResId          templateId = 0,
  51.                        const char far* title = 0,
  52.                        TModule*        module = 0);
  53.  
  54.     void     Init(TResId templateId);
  55.     bool     DialogFunction(uint message, WPARAM, LPARAM);
  56.  
  57.     //
  58.     // Default behavior inline for message response functions
  59.     //
  60.     void     CmFindNext() {DefaultProcessing();}   //EV_COMMAND(IDOK,
  61.     void     CmReplace() {DefaultProcessing();}    //EV_COMMAND(psh1,
  62.     void     CmReplaceAll() {DefaultProcessing();} //EV_COMMAND(psh2,
  63.     void     CmCancel() {DefaultProcessing();}     //EV_COMMAND(IDCANCEL,
  64.  
  65.     void     EvNCDestroy();
  66.  
  67.   DECLARE_RESPONSE_TABLE(TFindReplaceDialog);
  68.   DECLARE_CASTABLE;
  69. };
  70.  
  71. class _OWLCLASS TFindDialog : public TFindReplaceDialog {
  72.   public:
  73.     TFindDialog(TWindow*        parent,
  74.                 TData&          data,
  75.                 TResId          templateId = 0,
  76.                 const char far* title = 0,
  77.                 TModule*        module = 0);
  78.  
  79.   protected:
  80.     HWND     DoCreate();
  81.  
  82.   private:
  83.     TFindDialog();
  84.     TFindDialog(const TFindDialog&);
  85.  
  86.   DECLARE_CASTABLE;
  87. };
  88.  
  89. class _OWLCLASS TReplaceDialog : public TFindReplaceDialog {
  90.   public:
  91.     TReplaceDialog(TWindow*        parent,
  92.                    TData&          data,
  93.                    TResId          templateId = 0,
  94.                    const char far* title = 0,
  95.                    TModule*        module = 0);
  96.  
  97.   protected:
  98.     HWND     DoCreate();
  99.  
  100.   private:
  101.     TReplaceDialog(const TReplaceDialog&);
  102.     TReplaceDialog& operator=(const TReplaceDialog&);
  103.  
  104.   DECLARE_CASTABLE;
  105. };
  106.  
  107. #endif  // OWL_FINDREPL_H
  108.