MutEditFile.h
gehe zur Dokumentation dieser Datei
00001 
00062 #ifndef __MUTEDITFILE_H_INCLUDED__
00063 #define __MUTEDITFILE_H_INCLUDED__
00064 
00065 #include "Defs.h"
00066 #include "wx/textctrl.h"
00067 #include "wx/docview.h"
00068 #include "wx/stc/stc.h"
00069 #include "muwx/stclanguage.h"
00070 #include "muconvauto.h"
00071 
00072 namespace mutaborGUI {
00073 
00074         class MutView;
00075 
00076         class MutEditPrint;
00077         class MutEditProperties;
00078 
00079         class MutEditFile : public wxStyledTextCtrl
00080         {
00081                 friend class MutEditProperties;
00082                 friend class MutEditPrint;
00083         public:
00084 
00085                 MutEditFile(wxWindow* parent, 
00086                             const wxPoint& pos = wxDefaultPosition, 
00087                             const wxSize& size = wxDefaultSize, 
00088                             const wxString& value = wxEmptyString, 
00089                             const wxString& name = wxTextCtrlNameStr);
00090         
00091                 MutEditFile(MutView * v,
00092                             wxWindow* parent, 
00093                             const wxPoint& pos = wxDefaultPosition, 
00094                             const wxSize& size = wxDefaultSize, 
00095                             const wxString& value = wxEmptyString, 
00096                             const wxString& name = wxTextCtrlNameStr);
00097 
00098 
00099                 virtual ~MutEditFile();
00100 
00101                 void SetView(MutView * v) { view = v; }
00102 
00103 
00104                 void OnSize( wxSizeEvent &event );
00105                 // edit
00106                 void OnEditRedo (wxCommandEvent &event);
00107                 void OnEditUndo (wxCommandEvent &event);
00108                 void OnEditClear (wxCommandEvent &event);
00109                 void OnEditCut (wxCommandEvent &event);
00110                 void OnEditCopy (wxCommandEvent &event);
00111                 void OnEditPaste (wxCommandEvent &event);
00112                 // find
00113                 void OnFind (wxCommandEvent &event);
00114                 void OnFindNext (wxCommandEvent &event);
00115                 void OnReplace (wxCommandEvent &event);
00116                 void OnReplaceNext (wxCommandEvent &event);
00117                 void OnBraceMatch (wxCommandEvent &event);
00118                 void OnGoto (wxCommandEvent &event);
00119                 void OnEditIndentInc (wxCommandEvent &event);
00120                 void OnEditIndentRed (wxCommandEvent &event);
00121                 void OnEditSelectAll (wxCommandEvent &event);
00122                 void OnEditSelectLine (wxCommandEvent &event);
00124                 void OnHilightLang (wxCommandEvent &event);
00125                 void OnDisplayEOL (wxCommandEvent &event);
00126                 void OnIndentGuide (wxCommandEvent &event);
00127                 void OnLineNumber (wxCommandEvent &event);
00128                 void OnLongLineOn (wxCommandEvent &event);
00129                 void OnWhiteSpace (wxCommandEvent &event);
00130                 void OnFoldToggle (wxCommandEvent &event);
00131                 void OnSetOverType (wxCommandEvent &event);
00132                 void OnSetReadOnly (wxCommandEvent &event);
00133                 void OnWrapmodeOn (wxCommandEvent &event);
00134                 void OnUseCharset (wxCommandEvent &event);
00136                 void OnChangeCase (wxCommandEvent &event);
00137                 void OnConvertEOL (wxCommandEvent &event);
00138                 // stc
00139                 void OnMarginClick (wxStyledTextEvent &event);
00140                 void OnCharAdded  (wxStyledTextEvent &event);
00141 
00143                 wxString DeterminePrefs (const wxString &filename);
00144                 bool InitializePrefs (const wxString &filename);
00145                 bool UserSettings (const wxString &filename);
00146                 LanguageInfo const* GetLanguageInfo () {return m_language;};
00147 
00149                 bool LoadFile ();
00150                 bool LoadFile (const wxString &filename);
00151                 bool SaveFile ();
00152                 bool SaveFile (const wxString &filename);
00153                 bool IsModified ();
00154                 wxString GetFilename () {return m_filename;};
00155                 void SetFilename (const wxString &filename) {m_filename = filename;};
00156 
00157                 
00158         protected:
00159 //      void SetupWindow();
00160 
00161                 bool Compile(bool activate);
00162                 
00163                 bool DoLoadFile(const wxString &filename, int WXUNUSED(fileType));
00164 
00165                 bool DoSaveFile(const wxString& filename, int WXUNUSED(fileType));
00166 
00167                 void CmFileSave(wxCommandEvent& WXUNUSED(event));
00168 
00169                 void CmFileSaveAs(wxCommandEvent& event);
00170 
00171                 void CmCompile(wxCommandEvent& WXUNUSED(event));
00172 
00173                 void CmCompAct(wxCommandEvent& WXUNUSED(event));
00174 
00175                 void CmGetLine(wxCommandEvent& WXUNUSED(event));
00176 
00177                 void CmHelpContext(wxCommandEvent& WXUNUSED(event));
00178 
00179                 void GoErrorLine();
00180 
00181 
00182 #if 0
00183 #if defined(__WXMSW__) && !(wxUSE_UNICODE || wxUSE_WCHAR_T)
00184                 wxString GetValue() const;
00185 
00186                 wxString GetRange(long from, long to) const;
00187 
00188 #if wxUSE_RICHEDIT && (!(wxUSE_UNICODE || wxUSE_WCHAR_T) || wxUSE_UNICODE_MSLU)
00189                 // replace the selection or the entire control contents with the given text
00190                 // in the specified encoding
00191                 bool StreamIn(const wxString& value, wxFontEncoding encoding, bool selOnly);
00192 
00193                 // get the contents of the control out as text in the given encoding
00194                 wxString StreamOut(wxFontEncoding encoding, bool selOnly = false) const;
00195 
00196 #endif // wxUSE_RICHEDIT
00197 #endif
00198 #endif
00199 
00200                 
00201                 // file
00202                 wxString m_filename;
00203 
00204                 // lanugage properties
00205                 LanguageInfo const* m_language;
00206 
00207                 // margin variables
00208                 int m_LineNrID;
00209                 int m_LineNrMargin;
00210                 int m_FoldingID;
00211                 int m_FoldingMargin;
00212                 int m_DividerID;
00213 
00214 
00215                 MutView * view;
00216                 muConvAuto autoConverter;
00217 
00218                 DECLARE_EVENT_TABLE()
00219         private:
00220                 void Init();
00221         };
00222 
00223         
00224         //---------------------------------------------------------------------
00226         class MutEditProperties: public wxDialog {
00227 
00228         public:
00229 
00231                 MutEditProperties (MutEditFile *edit, long style = 0);
00232 
00233         private:
00234 
00235         };
00236 
00237 #if wxUSE_PRINTING_ARCHITECTURE
00238 
00239         //---------------------------------------------------------------------
00241         class MutEditPrint: public wxPrintout {
00242 
00243         public:
00244 
00246                 MutEditPrint (MutEditFile *edit, wxChar *title = _T(""));
00247 
00249                 bool OnPrintPage (int page);
00250                 bool OnBeginDocument (int startPage, int endPage);
00251 
00253                 bool HasPage (int page);
00254                 void GetPageInfo (int *minPage, 
00255                                   int *maxPage, 
00256                                   int *selPageFrom, 
00257                                   int *selPageTo);
00258 
00259         private:
00260                 MutEditFile *m_edit;
00261                 int m_printed;
00262                 wxRect m_pageRect;
00263                 wxRect m_printRect;
00264 
00265                 bool PrintScaling (wxDC *dc);
00266         };
00267 
00268 
00269 
00270 #endif // wxUSE_PRINTING_ARCHITECTURE#endif // wxUSE_PRINTING_ARCHITECTURE
00271 
00272 
00273 
00274 }
00275 #endif // __MUTEDITFILE_H_INCLUDED__
00276 

Erzeugt am Sun Aug 21 2011 10:51:54 für Mutabor von doxygen 1.7.4