]> git.saurik.com Git - wxWidgets.git/blame - wxPython/contrib/stc/stc.i
simplified gradient code a bit
[wxWidgets.git] / wxPython / contrib / stc / stc.i
CommitLineData
d14a1e28
RD
1/////////////////////////////////////////////////////////////////////////////
2// Name: stc.i
3// Purpose: Wrappers for the wxStyledTextCtrl.
4//
5// Author: Robin Dunn
6//
7// Created: 12-Oct-1999
8// RCS-ID: $Id$
9// Copyright: (c) 2000 by Total Control Software
10// Licence: wxWindows license
11/////////////////////////////////////////////////////////////////////////////
12
c8fac2b6
RD
13%define DOCSTRING
14"The `StyledTextCtrl` provides a text editor that can used as a syntax
15highlighting source code editor, or similar. Lexers for several programming
16languages are built-in."
17%enddef
b2eb030f
RD
18
19%module(package="wx", docstring=DOCSTRING) stc
d14a1e28
RD
20
21
22%{
23#include "wx/wxPython/wxPython.h"
24#include "wx/wxPython/pyclasses.h"
25#include <wx/stc/stc.h>
26
d14a1e28
RD
27%}
28
29//---------------------------------------------------------------------------
30
31%import core.i
96b3fa7c 32%import misc.i // for DnD
3727c043
RD
33//%import gdi.i // for wxFontEncoding
34
54f9ee45 35%pythoncode { wx = _core }
99109c0f 36%pythoncode { __docfilter__ = wx.__DocFilter(globals()) }
d14a1e28 37
b2dc1044
RD
38MAKE_CONST_WXSTRING(STCNameStr);
39
40
f2ccce28 41%include _stc_docstrings.i
d14a1e28 42
3727c043
RD
43enum wxFontEncoding; // forward declare
44
be698f50 45MustHaveApp(wxStyledTextCtrl);
d14a1e28
RD
46
47//---------------------------------------------------------------------------
48// Get all our defs from the REAL header file.
49
50%include stc.h
51
a15585e0 52%extend wxStyledTextCtrl {
3030ae49
RD
53 %pythoncode {
54 GetCaretLineBack = GetCaretLineBackground
55 SetCaretLineBack = SetCaretLineBackground
56 }
e70b4d2d
RD
57
58
59 %property(Anchor, GetAnchor, SetAnchor, doc="See `GetAnchor` and `SetAnchor`");
60 %property(BackSpaceUnIndents, GetBackSpaceUnIndents, SetBackSpaceUnIndents, doc="See `GetBackSpaceUnIndents` and `SetBackSpaceUnIndents`");
61 %property(BufferedDraw, GetBufferedDraw, SetBufferedDraw, doc="See `GetBufferedDraw` and `SetBufferedDraw`");
62 %property(CaretForeground, GetCaretForeground, SetCaretForeground, doc="See `GetCaretForeground` and `SetCaretForeground`");
63 %property(CaretLineBack, GetCaretLineBack, SetCaretLineBack, doc="See `GetCaretLineBack` and `SetCaretLineBack`");
64 %property(CaretLineBackAlpha, GetCaretLineBackAlpha, SetCaretLineBackAlpha, doc="See `GetCaretLineBackAlpha` and `SetCaretLineBackAlpha`");
65 %property(CaretLineBackground, GetCaretLineBackground, SetCaretLineBackground, doc="See `GetCaretLineBackground` and `SetCaretLineBackground`");
66 %property(CaretLineVisible, GetCaretLineVisible, SetCaretLineVisible, doc="See `GetCaretLineVisible` and `SetCaretLineVisible`");
67 %property(CaretPeriod, GetCaretPeriod, SetCaretPeriod, doc="See `GetCaretPeriod` and `SetCaretPeriod`");
68 %property(CaretSticky, GetCaretSticky, SetCaretSticky, doc="See `GetCaretSticky` and `SetCaretSticky`");
69 %property(CaretWidth, GetCaretWidth, SetCaretWidth, doc="See `GetCaretWidth` and `SetCaretWidth`");
70 %property(CodePage, GetCodePage, SetCodePage, doc="See `GetCodePage` and `SetCodePage`");
71 %property(ControlCharSymbol, GetControlCharSymbol, SetControlCharSymbol, doc="See `GetControlCharSymbol` and `SetControlCharSymbol`");
72 %property(CurLine, GetCurLine, doc="See `GetCurLine`");
73 %property(CurLineRaw, GetCurLineRaw, doc="See `GetCurLineRaw`");
74 %property(CurLineUTF8, GetCurLineUTF8, doc="See `GetCurLineUTF8`");
75 %property(CurrentLine, GetCurrentLine, doc="See `GetCurrentLine`");
76 %property(CurrentPos, GetCurrentPos, SetCurrentPos, doc="See `GetCurrentPos` and `SetCurrentPos`");
77 %property(DocPointer, GetDocPointer, SetDocPointer, doc="See `GetDocPointer` and `SetDocPointer`");
78 %property(EOLMode, GetEOLMode, SetEOLMode, doc="See `GetEOLMode` and `SetEOLMode`");
79 %property(EdgeColour, GetEdgeColour, SetEdgeColour, doc="See `GetEdgeColour` and `SetEdgeColour`");
80 %property(EdgeColumn, GetEdgeColumn, SetEdgeColumn, doc="See `GetEdgeColumn` and `SetEdgeColumn`");
81 %property(EdgeMode, GetEdgeMode, SetEdgeMode, doc="See `GetEdgeMode` and `SetEdgeMode`");
82 %property(EndAtLastLine, GetEndAtLastLine, SetEndAtLastLine, doc="See `GetEndAtLastLine` and `SetEndAtLastLine`");
83 %property(EndStyled, GetEndStyled, doc="See `GetEndStyled`");
84 %property(FirstVisibleLine, GetFirstVisibleLine, doc="See `GetFirstVisibleLine`");
85 %property(HighlightGuide, GetHighlightGuide, SetHighlightGuide, doc="See `GetHighlightGuide` and `SetHighlightGuide`");
86 %property(Indent, GetIndent, SetIndent, doc="See `GetIndent` and `SetIndent`");
87 %property(IndentationGuides, GetIndentationGuides, SetIndentationGuides, doc="See `GetIndentationGuides` and `SetIndentationGuides`");
88 %property(LastKeydownProcessed, GetLastKeydownProcessed, SetLastKeydownProcessed, doc="See `GetLastKeydownProcessed` and `SetLastKeydownProcessed`");
89 %property(LayoutCache, GetLayoutCache, SetLayoutCache, doc="See `GetLayoutCache` and `SetLayoutCache`");
90 %property(Length, GetLength, doc="See `GetLength`");
91 %property(Lexer, GetLexer, SetLexer, doc="See `GetLexer` and `SetLexer`");
92 %property(LineCount, GetLineCount, doc="See `GetLineCount`");
93 %property(MarginLeft, GetMarginLeft, SetMarginLeft, doc="See `GetMarginLeft` and `SetMarginLeft`");
94 %property(MarginRight, GetMarginRight, SetMarginRight, doc="See `GetMarginRight` and `SetMarginRight`");
95 %property(MaxLineState, GetMaxLineState, doc="See `GetMaxLineState`");
96 %property(ModEventMask, GetModEventMask, SetModEventMask, doc="See `GetModEventMask` and `SetModEventMask`");
97 %property(Modify, GetModify, doc="See `GetModify`");
98 %property(MouseDownCaptures, GetMouseDownCaptures, SetMouseDownCaptures, doc="See `GetMouseDownCaptures` and `SetMouseDownCaptures`");
99 %property(MouseDwellTime, GetMouseDwellTime, SetMouseDwellTime, doc="See `GetMouseDwellTime` and `SetMouseDwellTime`");
100 %property(Overtype, GetOvertype, SetOvertype, doc="See `GetOvertype` and `SetOvertype`");
101 %property(PasteConvertEndings, GetPasteConvertEndings, SetPasteConvertEndings, doc="See `GetPasteConvertEndings` and `SetPasteConvertEndings`");
102 %property(PrintColourMode, GetPrintColourMode, SetPrintColourMode, doc="See `GetPrintColourMode` and `SetPrintColourMode`");
103 %property(PrintMagnification, GetPrintMagnification, SetPrintMagnification, doc="See `GetPrintMagnification` and `SetPrintMagnification`");
104 %property(PrintWrapMode, GetPrintWrapMode, SetPrintWrapMode, doc="See `GetPrintWrapMode` and `SetPrintWrapMode`");
105 %property(ReadOnly, GetReadOnly, SetReadOnly, doc="See `GetReadOnly` and `SetReadOnly`");
106 %property(STCCursor, GetSTCCursor, SetSTCCursor, doc="See `GetSTCCursor` and `SetSTCCursor`");
107 %property(STCFocus, GetSTCFocus, SetSTCFocus, doc="See `GetSTCFocus` and `SetSTCFocus`");
108 %property(ScrollWidth, GetScrollWidth, SetScrollWidth, doc="See `GetScrollWidth` and `SetScrollWidth`");
109 %property(SearchFlags, GetSearchFlags, SetSearchFlags, doc="See `GetSearchFlags` and `SetSearchFlags`");
110 %property(SelAlpha, GetSelAlpha, SetSelAlpha, doc="See `GetSelAlpha` and `SetSelAlpha`");
111 %property(SelectedText, GetSelectedText, doc="See `GetSelectedText`");
112 %property(SelectedTextRaw, GetSelectedTextRaw, doc="See `GetSelectedTextRaw`");
113 %property(SelectedTextUTF8, GetSelectedTextUTF8, doc="See `GetSelectedTextUTF8`");
114 %property(Selection, GetSelection, SetSelection, doc="See `GetSelection` and `SetSelection`");
115 %property(SelectionEnd, GetSelectionEnd, SetSelectionEnd, doc="See `GetSelectionEnd` and `SetSelectionEnd`");
116 %property(SelectionMode, GetSelectionMode, SetSelectionMode, doc="See `GetSelectionMode` and `SetSelectionMode`");
117 %property(SelectionStart, GetSelectionStart, SetSelectionStart, doc="See `GetSelectionStart` and `SetSelectionStart`");
118 %property(Status, GetStatus, SetStatus, doc="See `GetStatus` and `SetStatus`");
119 %property(StyleBits, GetStyleBits, SetStyleBits, doc="See `GetStyleBits` and `SetStyleBits`");
120 %property(StyleBitsNeeded, GetStyleBitsNeeded, doc="See `GetStyleBitsNeeded`");
121 %property(TabIndents, GetTabIndents, SetTabIndents, doc="See `GetTabIndents` and `SetTabIndents`");
122 %property(TabWidth, GetTabWidth, SetTabWidth, doc="See `GetTabWidth` and `SetTabWidth`");
123 %property(TargetEnd, GetTargetEnd, SetTargetEnd, doc="See `GetTargetEnd` and `SetTargetEnd`");
124 %property(TargetStart, GetTargetStart, SetTargetStart, doc="See `GetTargetStart` and `SetTargetStart`");
125 %property(Text, GetText, SetText, doc="See `GetText` and `SetText`");
126 %property(TextLength, GetTextLength, doc="See `GetTextLength`");
127 %property(TextRaw, GetTextRaw, SetTextRaw, doc="See `GetTextRaw` and `SetTextRaw`");
128 %property(TextUTF8, GetTextUTF8, SetTextUTF8, doc="See `GetTextUTF8` and `SetTextUTF8`");
129 %property(TwoPhaseDraw, GetTwoPhaseDraw, SetTwoPhaseDraw, doc="See `GetTwoPhaseDraw` and `SetTwoPhaseDraw`");
130 %property(UndoCollection, GetUndoCollection, SetUndoCollection, doc="See `GetUndoCollection` and `SetUndoCollection`");
131 %property(UseAntiAliasing, GetUseAntiAliasing, SetUseAntiAliasing, doc="See `GetUseAntiAliasing` and `SetUseAntiAliasing`");
132 %property(UseHorizontalScrollBar, GetUseHorizontalScrollBar, SetUseHorizontalScrollBar, doc="See `GetUseHorizontalScrollBar` and `SetUseHorizontalScrollBar`");
133 %property(UseTabs, GetUseTabs, SetUseTabs, doc="See `GetUseTabs` and `SetUseTabs`");
134 %property(UseVerticalScrollBar, GetUseVerticalScrollBar, SetUseVerticalScrollBar, doc="See `GetUseVerticalScrollBar` and `SetUseVerticalScrollBar`");
135 %property(ViewEOL, GetViewEOL, SetViewEOL, doc="See `GetViewEOL` and `SetViewEOL`");
136 %property(ViewWhiteSpace, GetViewWhiteSpace, SetViewWhiteSpace, doc="See `GetViewWhiteSpace` and `SetViewWhiteSpace`");
137 %property(WrapMode, GetWrapMode, SetWrapMode, doc="See `GetWrapMode` and `SetWrapMode`");
138 %property(WrapStartIndent, GetWrapStartIndent, SetWrapStartIndent, doc="See `GetWrapStartIndent` and `SetWrapStartIndent`");
139 %property(WrapVisualFlags, GetWrapVisualFlags, SetWrapVisualFlags, doc="See `GetWrapVisualFlags` and `SetWrapVisualFlags`");
140 %property(WrapVisualFlagsLocation, GetWrapVisualFlagsLocation, SetWrapVisualFlagsLocation, doc="See `GetWrapVisualFlagsLocation` and `SetWrapVisualFlagsLocation`");
141 %property(XOffset, GetXOffset, SetXOffset, doc="See `GetXOffset` and `SetXOffset`");
142 %property(Zoom, GetZoom, SetZoom, doc="See `GetZoom` and `SetZoom`");
143}
144
145
146%extend wxStyledTextEvent {
147 %property(Alt, GetAlt, doc="See `GetAlt`");
148 %property(Control, GetControl, doc="See `GetControl`");
149 %property(DragAllowMove, GetDragAllowMove, SetDragAllowMove, doc="See `GetDragAllowMove` and `SetDragAllowMove`");
150 %property(DragResult, GetDragResult, SetDragResult, doc="See `GetDragResult` and `SetDragResult`");
151 %property(DragText, GetDragText, SetDragText, doc="See `GetDragText` and `SetDragText`");
152 %property(FoldLevelNow, GetFoldLevelNow, SetFoldLevelNow, doc="See `GetFoldLevelNow` and `SetFoldLevelNow`");
153 %property(FoldLevelPrev, GetFoldLevelPrev, SetFoldLevelPrev, doc="See `GetFoldLevelPrev` and `SetFoldLevelPrev`");
154 %property(Key, GetKey, SetKey, doc="See `GetKey` and `SetKey`");
155 %property(LParam, GetLParam, SetLParam, doc="See `GetLParam` and `SetLParam`");
156 %property(Length, GetLength, SetLength, doc="See `GetLength` and `SetLength`");
157 %property(Line, GetLine, SetLine, doc="See `GetLine` and `SetLine`");
158 %property(LinesAdded, GetLinesAdded, SetLinesAdded, doc="See `GetLinesAdded` and `SetLinesAdded`");
159 %property(ListType, GetListType, SetListType, doc="See `GetListType` and `SetListType`");
160 %property(Margin, GetMargin, SetMargin, doc="See `GetMargin` and `SetMargin`");
161 %property(Message, GetMessage, SetMessage, doc="See `GetMessage` and `SetMessage`");
162 %property(ModificationType, GetModificationType, SetModificationType, doc="See `GetModificationType` and `SetModificationType`");
163 %property(Modifiers, GetModifiers, SetModifiers, doc="See `GetModifiers` and `SetModifiers`");
164 %property(Position, GetPosition, SetPosition, doc="See `GetPosition` and `SetPosition`");
165 %property(Shift, GetShift, doc="See `GetShift`");
166 %property(Text, GetText, SetText, doc="See `GetText` and `SetText`");
167 %property(WParam, GetWParam, SetWParam, doc="See `GetWParam` and `SetWParam`");
168 %property(X, GetX, SetX, doc="See `GetX` and `SetX`");
169 %property(Y, GetY, SetY, doc="See `GetY` and `SetY`");
3030ae49
RD
170}
171
d14a1e28
RD
172//---------------------------------------------------------------------------
173// Python functions to act like the event macros
174
175%pythoncode {
176EVT_STC_CHANGE = wx.PyEventBinder( wxEVT_STC_CHANGE, 1 )
177EVT_STC_STYLENEEDED = wx.PyEventBinder( wxEVT_STC_STYLENEEDED, 1 )
178EVT_STC_CHARADDED = wx.PyEventBinder( wxEVT_STC_CHARADDED, 1 )
179EVT_STC_SAVEPOINTREACHED = wx.PyEventBinder( wxEVT_STC_SAVEPOINTREACHED, 1 )
180EVT_STC_SAVEPOINTLEFT = wx.PyEventBinder( wxEVT_STC_SAVEPOINTLEFT, 1 )
181EVT_STC_ROMODIFYATTEMPT = wx.PyEventBinder( wxEVT_STC_ROMODIFYATTEMPT, 1 )
182EVT_STC_KEY = wx.PyEventBinder( wxEVT_STC_KEY, 1 )
183EVT_STC_DOUBLECLICK = wx.PyEventBinder( wxEVT_STC_DOUBLECLICK, 1 )
184EVT_STC_UPDATEUI = wx.PyEventBinder( wxEVT_STC_UPDATEUI, 1 )
185EVT_STC_MODIFIED = wx.PyEventBinder( wxEVT_STC_MODIFIED, 1 )
186EVT_STC_MACRORECORD = wx.PyEventBinder( wxEVT_STC_MACRORECORD, 1 )
187EVT_STC_MARGINCLICK = wx.PyEventBinder( wxEVT_STC_MARGINCLICK, 1 )
188EVT_STC_NEEDSHOWN = wx.PyEventBinder( wxEVT_STC_NEEDSHOWN, 1 )
d14a1e28
RD
189EVT_STC_PAINTED = wx.PyEventBinder( wxEVT_STC_PAINTED, 1 )
190EVT_STC_USERLISTSELECTION = wx.PyEventBinder( wxEVT_STC_USERLISTSELECTION, 1 )
191EVT_STC_URIDROPPED = wx.PyEventBinder( wxEVT_STC_URIDROPPED, 1 )
192EVT_STC_DWELLSTART = wx.PyEventBinder( wxEVT_STC_DWELLSTART, 1 )
193EVT_STC_DWELLEND = wx.PyEventBinder( wxEVT_STC_DWELLEND, 1 )
194EVT_STC_START_DRAG = wx.PyEventBinder( wxEVT_STC_START_DRAG, 1 )
195EVT_STC_DRAG_OVER = wx.PyEventBinder( wxEVT_STC_DRAG_OVER, 1 )
196EVT_STC_DO_DROP = wx.PyEventBinder( wxEVT_STC_DO_DROP, 1 )
197EVT_STC_ZOOM = wx.PyEventBinder( wxEVT_STC_ZOOM, 1 )
198EVT_STC_HOTSPOT_CLICK = wx.PyEventBinder( wxEVT_STC_HOTSPOT_CLICK, 1 )
199EVT_STC_HOTSPOT_DCLICK = wx.PyEventBinder( wxEVT_STC_HOTSPOT_DCLICK, 1 )
200EVT_STC_CALLTIP_CLICK = wx.PyEventBinder( wxEVT_STC_CALLTIP_CLICK, 1 )
1e9bafca 201EVT_STC_AUTOCOMP_SELECTION = wx.PyEventBinder( wxEVT_STC_AUTOCOMP_SELECTION, 1 )
d14a1e28
RD
202}
203
204//---------------------------------------------------------------------------
205
206%init %{
207%}
208
209
210//---------------------------------------------------------------------------
211