]>
git.saurik.com Git - wxWidgets.git/blob - samples/stc/edit.h
f9c5e7e6bc72f10749a1440382e5a6c273577f18
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 OnAnnotationAdd(wxCommandEvent
& event
);
96 void OnAnnotationRemove(wxCommandEvent
& event
);
97 void OnAnnotationClear(wxCommandEvent
& event
);
98 void OnAnnotationStyle(wxCommandEvent
& event
);
100 void OnChangeCase (wxCommandEvent
&event
);
101 void OnConvertEOL (wxCommandEvent
&event
);
103 void OnMarginClick (wxStyledTextEvent
&event
);
104 void OnCharAdded (wxStyledTextEvent
&event
);
105 void OnKey (wxStyledTextEvent
&event
);
108 wxString
DeterminePrefs (const wxString
&filename
);
109 bool InitializePrefs (const wxString
&filename
);
110 bool UserSettings (const wxString
&filename
);
111 LanguageInfo
const* GetLanguageInfo () {return m_language
;};
115 bool LoadFile (const wxString
&filename
);
117 bool SaveFile (const wxString
&filename
);
119 wxString
GetFilename () {return m_filename
;};
120 void SetFilename (const wxString
&filename
) {m_filename
= filename
;};
126 // lanugage properties
127 LanguageInfo
const* m_language
;
136 DECLARE_EVENT_TABLE()
139 //----------------------------------------------------------------------------
141 class EditProperties
: public wxDialog
{
146 EditProperties (Edit
*edit
, long style
= 0);
152 #if wxUSE_PRINTING_ARCHITECTURE
154 //----------------------------------------------------------------------------
156 class EditPrint
: public wxPrintout
{
161 EditPrint (Edit
*edit
, const wxChar
*title
= wxT(""));
164 bool OnPrintPage (int page
);
165 bool OnBeginDocument (int startPage
, int endPage
);
168 bool HasPage (int page
);
169 void GetPageInfo (int *minPage
, int *maxPage
, int *selPageFrom
, int *selPageTo
);
177 bool PrintScaling (wxDC
*dc
);
180 #endif // wxUSE_PRINTING_ARCHITECTURE