]>
git.saurik.com Git - wxWidgets.git/blob - samples/stc/edit.h
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
);
102 wxString
DeterminePrefs (const wxString
&filename
);
103 bool InitializePrefs (const wxString
&filename
);
104 bool UserSettings (const wxString
&filename
);
105 LanguageInfo
const* GetLanguageInfo () {return m_language
;};
109 bool LoadFile (const wxString
&filename
);
111 bool SaveFile (const wxString
&filename
);
113 wxString
GetFilename () {return m_filename
;};
114 void SetFilename (const wxString
&filename
) {m_filename
= filename
;};
120 // lanugage properties
121 LanguageInfo
const* m_language
;
130 DECLARE_EVENT_TABLE()
133 //----------------------------------------------------------------------------
135 class EditProperties
: public wxDialog
{
140 EditProperties (Edit
*edit
, long style
= 0);
146 #if wxUSE_PRINTING_ARCHITECTURE
148 //----------------------------------------------------------------------------
150 class EditPrint
: public wxPrintout
{
155 EditPrint (Edit
*edit
, const wxChar
*title
= wxT(""));
158 bool OnPrintPage (int page
);
159 bool OnBeginDocument (int startPage
, int endPage
);
162 bool HasPage (int page
);
163 void GetPageInfo (int *minPage
, int *maxPage
, int *selPageFrom
, int *selPageTo
);
171 bool PrintScaling (wxDC
*dc
);
174 #endif // wxUSE_PRINTING_ARCHITECTURE