]>
git.saurik.com Git - wxWidgets.git/blob - samples/stc/edit.h
d22222f67c93b7062099096280e7e5fe15667750
1 //////////////////////////////////////////////////////////////////////////////
3 // Purpose: STC test module
7 // Copyright: (c) wxGuide
8 // Licence: wxWindows licence
9 //////////////////////////////////////////////////////////////////////////////
14 //----------------------------------------------------------------------------
16 //----------------------------------------------------------------------------
19 //----------------------------------------------------------------------------
21 //----------------------------------------------------------------------------
25 //! wxWidgets/contrib headers
26 #include "wx/stc/stc.h" // styled text control
28 //! application headers
29 #include "prefs.h" // preferences
32 //============================================================================
34 //============================================================================
40 //----------------------------------------------------------------------------
42 class Edit
: public wxStyledTextCtrl
{
43 friend class EditProperties
;
44 friend class EditPrint
;
48 Edit (wxWindow
*parent
, wxWindowID id
= wxID_ANY
,
49 const wxPoint
&pos
= wxDefaultPosition
,
50 const wxSize
&size
= wxDefaultSize
,
63 void OnSize( wxSizeEvent
&event
);
65 void OnEditRedo (wxCommandEvent
&event
);
66 void OnEditUndo (wxCommandEvent
&event
);
67 void OnEditClear (wxCommandEvent
&event
);
68 void OnEditCut (wxCommandEvent
&event
);
69 void OnEditCopy (wxCommandEvent
&event
);
70 void OnEditPaste (wxCommandEvent
&event
);
72 void OnFind (wxCommandEvent
&event
);
73 void OnFindNext (wxCommandEvent
&event
);
74 void OnReplace (wxCommandEvent
&event
);
75 void OnReplaceNext (wxCommandEvent
&event
);
76 void OnBraceMatch (wxCommandEvent
&event
);
77 void OnGoto (wxCommandEvent
&event
);
78 void OnEditIndentInc (wxCommandEvent
&event
);
79 void OnEditIndentRed (wxCommandEvent
&event
);
80 void OnEditSelectAll (wxCommandEvent
&event
);
81 void OnEditSelectLine (wxCommandEvent
&event
);
83 void OnHilightLang (wxCommandEvent
&event
);
84 void OnDisplayEOL (wxCommandEvent
&event
);
85 void OnIndentGuide (wxCommandEvent
&event
);
86 void OnLineNumber (wxCommandEvent
&event
);
87 void OnLongLineOn (wxCommandEvent
&event
);
88 void OnWhiteSpace (wxCommandEvent
&event
);
89 void OnFoldToggle (wxCommandEvent
&event
);
90 void OnSetOverType (wxCommandEvent
&event
);
91 void OnSetReadOnly (wxCommandEvent
&event
);
92 void OnWrapmodeOn (wxCommandEvent
&event
);
93 void OnUseCharset (wxCommandEvent
&event
);
95 void OnChangeCase (wxCommandEvent
&event
);
96 void OnConvertEOL (wxCommandEvent
&event
);
98 void OnMarginClick (wxStyledTextEvent
&event
);
99 void OnCharAdded (wxStyledTextEvent
&event
);
100 void OnKey (wxStyledTextEvent
&event
);
103 wxString
DeterminePrefs (const wxString
&filename
);
104 bool InitializePrefs (const wxString
&filename
);
105 bool UserSettings (const wxString
&filename
);
106 LanguageInfo
const* GetLanguageInfo () {return m_language
;};
110 bool LoadFile (const wxString
&filename
);
112 bool SaveFile (const wxString
&filename
);
114 wxString
GetFilename () {return m_filename
;};
115 void SetFilename (const wxString
&filename
) {m_filename
= filename
;};
121 // lanugage properties
122 LanguageInfo
const* m_language
;
131 DECLARE_EVENT_TABLE()
134 //----------------------------------------------------------------------------
136 class EditProperties
: public wxDialog
{
141 EditProperties (Edit
*edit
, long style
= 0);
147 #if wxUSE_PRINTING_ARCHITECTURE
149 //----------------------------------------------------------------------------
151 class EditPrint
: public wxPrintout
{
156 EditPrint (Edit
*edit
, const wxChar
*title
= wxT(""));
159 bool OnPrintPage (int page
);
160 bool OnBeginDocument (int startPage
, int endPage
);
163 bool HasPage (int page
);
164 void GetPageInfo (int *minPage
, int *maxPage
, int *selPageFrom
, int *selPageTo
);
172 bool PrintScaling (wxDC
*dc
);
175 #endif // wxUSE_PRINTING_ARCHITECTURE