OSDN Git Service

crystaledit: Make almost the same code into a common function
[winmerge-jp/winmerge-jp.git] / Externals / crystaledit / editlib / cfindtextdlg.h
1 ////////////////////////////////////////////////////////////////////////////
2 //  File:       cfindtextdlg.h
3 //  Version:    1.0.0.0
4 //  Created:    29-Dec-1998
5 //
6 //  Author:     Stcherbatchenko Andrei
7 //  E-mail:     windfall@gmx.de
8 //
9 //  Declaration of the CFindTextDlg dialog, a part of Crystal Edit -
10 //  syntax coloring text editor.
11 //
12 //  You are free to use or modify this code to the following restrictions:
13 //  - Acknowledge me somewhere in your about box, simple "Parts of code by.."
14 //  will be enough. If you can't (or don't want to), contact me personally.
15 //  - LEAVE THIS HEADER INTACT
16 ////////////////////////////////////////////////////////////////////////////
17
18 ////////////////////////////////////////////////////////////////////////////
19 //  19-Jul-99
20 //      Ferdinand Prantl:
21 //  +   FEATURE: see cpps ...
22 //
23 //  ... it's being edited very rapidly so sorry for non-commented
24 //        and maybe "ugly" code ...
25 ////////////////////////////////////////////////////////////////////////////
26 /**
27  *  @file cfindtextdlg.h
28  *
29  *  @brief Declaration Find-dialog.
30  */
31 // RCS ID line follows -- this is updated by CVS
32 // $Id$
33
34 #pragma once
35
36 #include "resource.h"
37 #include "memcombo.h"
38
39 class CCrystalTextView;
40
41 /**
42  * @brief Infos about the last search settings (saved in registry)
43  *
44  * @note Is also used in the replace dialog
45  */
46 struct LastSearchInfos
47   {
48     int m_nDirection;       // only for search
49     bool m_bNoWrap;
50     bool m_bMatchCase;
51     CString m_sText;
52     bool m_bWholeWord;
53     bool m_bRegExp;
54     bool m_bNoClose;
55   };
56
57 /////////////////////////////////////////////////////////////////////////////
58 // CFindTextDlg dialog
59
60 class EDITPADC_CLASS CFindTextDlg : public CDialog
61   {
62 private :
63     void UpdateControls();
64     CCrystalTextView * m_pBuddy;
65
66     // Construction
67 public :
68     CFindTextDlg (CCrystalTextView * pBuddy);
69     void SetLastSearch (LPCTSTR sText, bool bMatchCase, bool bWholeWord, bool bRegExp, int nDirection);
70     void UseLastSearch ();
71     LastSearchInfos * GetLastSearchInfos (); 
72
73     CPoint m_ptCurrentPos;
74     LastSearchInfos lastSearch;
75
76     // Dialog Data
77     //{{AFX_DATA(CFindTextDlg)
78   enum { IDD = IDD_EDIT_FIND };
79     CMemComboBox m_ctlFindText;
80     CButton m_ctlWholeWord;
81     int m_nDirection;
82     bool m_bMatchCase;
83     CString m_sText;
84     bool m_bWholeWord;
85     bool m_bRegExp;
86     bool m_bNoWrap;
87     bool m_bNoClose; 
88     //}}AFX_DATA
89
90     // Overrides
91     // ClassWizard generated virtual function overrides
92     //{{AFX_VIRTUAL(CFindTextDlg)
93 protected :
94     virtual void DoDataExchange (CDataExchange * pDX);    // DDX/DDV support
95     //}}AFX_VIRTUAL
96
97     // Implementation
98 protected :
99
100     void UpdateRegExp ();
101     void UpdateLastSearch ();
102     void FindText (int nDirection);
103
104     // Generated message map functions
105     //{{AFX_MSG(CFindTextDlg)
106     virtual void OnOK ();
107     afx_msg void OnChangeEditText ();
108     afx_msg void OnChangeSelected ();
109     virtual BOOL OnInitDialog ();
110     virtual void OnCancel ();
111     afx_msg void OnRegExp ();
112     afx_msg void OnFindPrev ();
113     virtual void PostNcDestroy ();
114     //}}AFX_MSG
115     DECLARE_MESSAGE_MAP ()
116   };