]>
git.saurik.com Git - wxWidgets.git/blob - samples/stc/edit.h
1 //////////////////////////////////////////////////////////////////////////////
3 // Purpose: STC test module
6 // Copyright: (c) wxGuide
7 // Licence: wxWindows licence
8 //////////////////////////////////////////////////////////////////////////////
13 //----------------------------------------------------------------------------
15 //----------------------------------------------------------------------------
18 //----------------------------------------------------------------------------
20 //----------------------------------------------------------------------------
24 //! wxWidgets/contrib headers
25 #include "wx/stc/stc.h" // styled text control
27 //! application headers
28 #include "prefs.h" // preferences
31 //============================================================================
33 //============================================================================
39 //----------------------------------------------------------------------------
41 class Edit
: public wxStyledTextCtrl
{
42 friend class EditProperties
;
43 friend class EditPrint
;
47 Edit (wxWindow
*parent
, wxWindowID id
= wxID_ANY
,
48 const wxPoint
&pos
= wxDefaultPosition
,
49 const wxSize
&size
= wxDefaultSize
,
62 void OnSize( wxSizeEvent
&event
);
64 void OnEditRedo (wxCommandEvent
&event
);
65 void OnEditUndo (wxCommandEvent
&event
);
66 void OnEditClear (wxCommandEvent
&event
);
67 void OnEditCut (wxCommandEvent
&event
);
68 void OnEditCopy (wxCommandEvent
&event
);
69 void OnEditPaste (wxCommandEvent
&event
);
71 void OnFind (wxCommandEvent
&event
);
72 void OnFindNext (wxCommandEvent
&event
);
73 void OnReplace (wxCommandEvent
&event
);
74 void OnReplaceNext (wxCommandEvent
&event
);
75 void OnBraceMatch (wxCommandEvent
&event
);
76 void OnGoto (wxCommandEvent
&event
);
77 void OnEditIndentInc (wxCommandEvent
&event
);
78 void OnEditIndentRed (wxCommandEvent
&event
);
79 void OnEditSelectAll (wxCommandEvent
&event
);
80 void OnEditSelectLine (wxCommandEvent
&event
);
82 void OnHilightLang (wxCommandEvent
&event
);
83 void OnDisplayEOL (wxCommandEvent
&event
);
84 void OnIndentGuide (wxCommandEvent
&event
);
85 void OnLineNumber (wxCommandEvent
&event
);
86 void OnLongLineOn (wxCommandEvent
&event
);
87 void OnWhiteSpace (wxCommandEvent
&event
);
88 void OnFoldToggle (wxCommandEvent
&event
);
89 void OnSetOverType (wxCommandEvent
&event
);
90 void OnSetReadOnly (wxCommandEvent
&event
);
91 void OnWrapmodeOn (wxCommandEvent
&event
);
92 void OnUseCharset (wxCommandEvent
&event
);
94 void OnAnnotationAdd(wxCommandEvent
& event
);
95 void OnAnnotationRemove(wxCommandEvent
& event
);
96 void OnAnnotationClear(wxCommandEvent
& event
);
97 void OnAnnotationStyle(wxCommandEvent
& event
);
99 void OnChangeCase (wxCommandEvent
&event
);
100 void OnConvertEOL (wxCommandEvent
&event
);
102 void OnMarginClick (wxStyledTextEvent
&event
);
103 void OnCharAdded (wxStyledTextEvent
&event
);
104 void OnKey (wxStyledTextEvent
&event
);
107 wxString
DeterminePrefs (const wxString
&filename
);
108 bool InitializePrefs (const wxString
&filename
);
109 bool UserSettings (const wxString
&filename
);
110 LanguageInfo
const* GetLanguageInfo () {return m_language
;};
114 bool LoadFile (const wxString
&filename
);
116 bool SaveFile (const wxString
&filename
);
118 wxString
GetFilename () {return m_filename
;};
119 void SetFilename (const wxString
&filename
) {m_filename
= filename
;};
125 // lanugage properties
126 LanguageInfo
const* m_language
;
135 DECLARE_EVENT_TABLE()
138 //----------------------------------------------------------------------------
140 class EditProperties
: public wxDialog
{
145 EditProperties (Edit
*edit
, long style
= 0);
151 #if wxUSE_PRINTING_ARCHITECTURE
153 //----------------------------------------------------------------------------
155 class EditPrint
: public wxPrintout
{
160 EditPrint (Edit
*edit
, const wxChar
*title
= wxT(""));
163 bool OnPrintPage (int page
);
164 bool OnBeginDocument (int startPage
, int endPage
);
167 bool HasPage (int page
);
168 void GetPageInfo (int *minPage
, int *maxPage
, int *selPageFrom
, int *selPageTo
);
176 bool PrintScaling (wxDC
*dc
);
179 #endif // wxUSE_PRINTING_ARCHITECTURE