]>
git.saurik.com Git - wxWidgets.git/blob - contrib/samples/stc/edit.h
54034003ae9115571d4f0afdf61c4d7437a33150
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
,
51 long style
= wxSUNKEN_BORDER
|wxVSCROLL
59 void OnSize( wxSizeEvent
&event
);
61 void OnEditRedo (wxCommandEvent
&event
);
62 void OnEditUndo (wxCommandEvent
&event
);
63 void OnEditClear (wxCommandEvent
&event
);
64 void OnEditCut (wxCommandEvent
&event
);
65 void OnEditCopy (wxCommandEvent
&event
);
66 void OnEditPaste (wxCommandEvent
&event
);
68 void OnFind (wxCommandEvent
&event
);
69 void OnFindNext (wxCommandEvent
&event
);
70 void OnReplace (wxCommandEvent
&event
);
71 void OnReplaceNext (wxCommandEvent
&event
);
72 void OnBraceMatch (wxCommandEvent
&event
);
73 void OnGoto (wxCommandEvent
&event
);
74 void OnEditIndentInc (wxCommandEvent
&event
);
75 void OnEditIndentRed (wxCommandEvent
&event
);
76 void OnEditSelectAll (wxCommandEvent
&event
);
77 void OnEditSelectLine (wxCommandEvent
&event
);
79 void OnHilightLang (wxCommandEvent
&event
);
80 void OnDisplayEOL (wxCommandEvent
&event
);
81 void OnIndentGuide (wxCommandEvent
&event
);
82 void OnLineNumber (wxCommandEvent
&event
);
83 void OnLongLineOn (wxCommandEvent
&event
);
84 void OnWhiteSpace (wxCommandEvent
&event
);
85 void OnFoldToggle (wxCommandEvent
&event
);
86 void OnSetOverType (wxCommandEvent
&event
);
87 void OnSetReadOnly (wxCommandEvent
&event
);
88 void OnWrapmodeOn (wxCommandEvent
&event
);
89 void OnUseCharset (wxCommandEvent
&event
);
91 void OnChangeCase (wxCommandEvent
&event
);
92 void OnConvertEOL (wxCommandEvent
&event
);
94 void OnMarginClick (wxStyledTextEvent
&event
);
95 void OnCharAdded (wxStyledTextEvent
&event
);
98 wxString
DeterminePrefs (const wxString
&filename
);
99 bool InitializePrefs (const wxString
&filename
);
100 bool UserSettings (const wxString
&filename
);
101 LanguageInfo
const* GetLanguageInfo () {return m_language
;};
105 bool LoadFile (const wxString
&filename
);
107 bool SaveFile (const wxString
&filename
);
109 wxString
GetFilename () {return m_filename
;};
110 void SetFilename (const wxString
&filename
) {m_filename
= filename
;};
116 // lanugage properties
117 LanguageInfo
const* m_language
;
126 DECLARE_EVENT_TABLE()
129 //----------------------------------------------------------------------------
131 class EditProperties
: public wxDialog
{
136 EditProperties (Edit
*edit
, long style
= 0);
142 //----------------------------------------------------------------------------
144 class EditPrint
: public wxPrintout
{
149 EditPrint (Edit
*edit
, wxChar
*title
= _T(""));
152 bool OnPrintPage (int page
);
153 bool OnBeginDocument (int startPage
, int endPage
);
156 bool HasPage (int page
);
157 void GetPageInfo (int *minPage
, int *maxPage
, int *selPageFrom
, int *selPageTo
);
165 bool PrintScaling (wxDC
*dc
);