1 /////////////////////////////////////////////////////////////////////////////// 2 // Name: MadReplaceDialog.h 3 // Description: 4 // Author: madedit@gmail.com 5 // Licence: GPL 6 /////////////////////////////////////////////////////////////////////////////// 7 8 #ifndef _MADREPLACEDIALOG_H_ 9 #define _MADREPLACEDIALOG_H_ 10 11 #include <wx/wxprec.h> 12 #ifdef __BORLANDC__ 13 #pragma hdrstop 14 #endif 15 #ifndef WX_PRECOMP 16 #include <wx/wx.h> 17 #endif 18 19 //Do not add custom headers. 20 //wx-dvcpp designer will remove them 21 ////Header Include Start 22 #include <wx/menu.h> 23 #include <wx/button.h> 24 #include <wx/textctrl.h> 25 #include <wx/stattext.h> 26 #include <wx/checkbox.h> 27 #include <wx/sizer.h> 28 ////Header Include End 29 30 #include <wx/dialog.h> 31 #include <wx/docview.h> 32 #include <wx/fileconf.h> 33 34 //Compatibility for 2.4.x code 35 #ifndef wxCLOSE_BOX 36 #define wxCLOSE_BOX 0x1000 37 #endif 38 #ifndef wxFIXED_MINSIZE 39 #define wxFIXED_MINSIZE 0 40 #endif 41 42 ////Dialog Style Start 43 #undef MadReplaceDialog_STYLE 44 #define MadReplaceDialog_STYLE wxCAPTION | wxRESIZE_BORDER | wxSYSTEM_MENU | wxDIALOG_NO_PARENT | wxCLOSE_BOX 45 ////Dialog Style End 46 47 class MadEdit; 48 49 class MadReplaceDialog : public wxDialog 50 { 51 public: 52 MadReplaceDialog( wxWindow *parent, wxWindowID id = 1, const wxString &title = wxT("Replace"), 53 const wxPoint& pos = wxDefaultPosition, 54 const wxSize& size = wxDefaultSize, 55 long style = MadReplaceDialog_STYLE); 56 virtual ~MadReplaceDialog(); 57 58 public: 59 60 //Do not add custom Control Declarations here. 61 //wx-devcpp will remove them. Try adding the custom code 62 //after the block. 63 ////GUI Control Declaration Start 64 wxMenu *WxPopupMenuRecentReplaceText; 65 wxButton *WxButtonClose; 66 wxButton *WxButtonReplaceAll; 67 wxButton *WxButtonReplace; 68 wxButton *WxButtonFindNext; 69 wxBoxSizer *WxBoxSizer3; 70 wxTextCtrl *WxEditTo; 71 wxStaticText *WxStaticTextTo; 72 wxTextCtrl *WxEditFrom; 73 wxStaticText *WxStaticTextFrom; 74 wxCheckBox *WxCheckBoxSearchInSelection; 75 wxBoxSizer *WxBoxSizer7; 76 wxCheckBox *WxCheckBoxFindHex; 77 wxCheckBox *WxCheckBoxRegex; 78 wxCheckBox *WxCheckBoxWholeWord; 79 wxCheckBox *WxCheckBoxCaseSensitive; 80 wxCheckBox *WxCheckBoxMoveFocus; 81 wxBoxSizer *WxBoxSizer6; 82 wxBoxSizer *WxBoxSizer5; 83 wxBoxSizer *WxBoxSizer4; 84 wxBoxSizer *WxBoxSizer2; 85 wxBoxSizer *WxBoxSizer1; 86 ////GUI Control Declaration End 87 88 private: 89 DECLARE_EVENT_TABLE() 90 91 public: 92 //Note: if you receive any error with these enums, then you need to 93 //change your old form code that are based on the #define control ids. 94 //#defines may replace a numeric value for the enums names. 95 //Try copy pasting the below block in your old Form header Files. 96 enum { 97 ////GUI Enum Control ID Start 98 ID_WXBUTTONCLOSE = 1028, 99 ID_WXBUTTONREPLACEALL = 1027, 100 ID_WXBUTTONREPLACE = 1026, 101 ID_WXBUTTONFINDNEXT = 1025, 102 ID_WXEDITTO = 22, 103 ID_WXSTATICTEXTTO = 21, 104 ID_WXEDITFROM = 20, 105 ID_WXSTATICTEXTFROM = 19, 106 ID_WXCHECKBOXSEARCHINSELECTION = 18, 107 ID_WXCHECKBOXFINDHEX = 1024, 108 ID_WXCHECKBOXREGEX = 1023, 109 ID_WXCHECKBOXWHOLEWORD = 1022, 110 ID_WXCHECKBOXCASESENSITIVE = 1021, 111 ID_WXCHECKBOXMOVEFOCUS = 1029, 112 ////GUI Enum Control ID End 113 ID_MADEDIT1 = 1400, 114 ID_MADEDIT2 = 1401, 115 ID_WXBITMAPBUTTONRECENTFINDTEXT=1402, 116 ID_WXBITMAPBUTTONRECENTREPLACETEXT=1403, 117 118 ID_RECENTFINDTEXT1=1501, // must be the same with MadSearchDialog 119 ID_RECENTFINDTEXT20=1520, 120 ID_RECENTREPLACETEXT1=ID_RECENTFINDTEXT20+1, 121 ID_RECENTREPLACETEXT20=ID_RECENTREPLACETEXT1+19, 122 ID_DUMMY_VALUE_ //Dont Delete this DummyValue 123 }; //End of Enum 124 125 public: 126 void MadReplaceDialogClose(wxCloseEvent& event); 127 void CreateGUIControls(void); 128 129 MadEdit *m_FindText, *m_ReplaceText; 130 wxBitmapButton *WxBitmapButtonRecentFindText, *WxBitmapButtonRecentReplaceText; 131 wxFileHistory *m_RecentReplaceText; 132 133 void WxButtonCloseClick(wxCommandEvent& event); 134 void WxButtonFindNextClick(wxCommandEvent& event); 135 136 void ReadWriteSettings(bool bRead); 137 void UpdateCheckBoxByCBHex(bool check); 138 void UpdateSearchInSelection(bool check); 139 void WxCheckBoxFindHexClick(wxCommandEvent& event); 140 141 void MadReplaceDialogKeyDown(wxKeyEvent& event); 142 143 void WxBitmapButtonRecentFindTextClick(wxCommandEvent& event); 144 void WxBitmapButtonRecentReplaceTextClick(wxCommandEvent& event); 145 void OnRecentFindText(wxCommandEvent& event); 146 void OnRecentReplaceText(wxCommandEvent& event); 147 148 void WxButtonReplaceClick(wxCommandEvent& event); 149 void MadReplaceDialogActivate(wxActivateEvent& event); 150 void WxButtonReplaceAllClick(wxCommandEvent& event); 151 void WxCheckBoxSearchInSelectionClick(wxCommandEvent& event); 152 }; 153 154 extern MadReplaceDialog *g_ReplaceDialog; 155 156 #endif 157 158 159 160 161