X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1bc32508684ff0b49fcf0f03ef27e31669fc2eae..22a3a1994cbfdb7138590ed944ef6dd2093fda19:/contrib/src/stc/stc.h.in diff --git a/contrib/src/stc/stc.h.in b/contrib/src/stc/stc.h.in index cf6d811049..157a7bfc23 100644 --- a/contrib/src/stc/stc.h.in +++ b/contrib/src/stc/stc.h.in @@ -24,6 +24,13 @@ #include #include +//---------------------------------------------------------------------- + +// Should a wxPopupWindow be used for the call tips and autocomplete windows? +#ifndef wxSTC_USE_POPUP +#define wxSTC_USE_POPUP 1 +#endif + //---------------------------------------------------------------------- // BEGIN generated section. The following code is automatically generated // by gen_iface.py. Do not edit this file. Edit stc.h.in instead @@ -32,13 +39,6 @@ %(VALUES)s // END of generated section -//---------------------------------------------------------------------- -// Others - -#define wxSTC_MASK_FOLDERS ((1 << wxSTC_MARKNUM_FOLDER) | (1 << wxSTC_MARKNUM_FOLDEROPEN)) - - - //---------------------------------------------------------------------- class ScintillaWX; // forward declare @@ -57,7 +57,7 @@ public: wxStyledTextCtrl(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, - const char* name = "styledtext"); + const wxString& name = wxPySTCNameStr); %%pragma(python) addtomethod = "__init__:self._setOORInfo(self)" #else @@ -148,6 +148,19 @@ public: // Send a message to Scintilla long SendMsg(int msg, long wp=0, long lp=0); + + // Set the vertical scrollbar to use instead of the ont that's built-in. + void SetVScrollBar(wxScrollBar* bar) { m_vScrollBar = bar; } + + + // Set the horizontal scrollbar to use instead of the ont that's built-in. + void SetHScrollBar(wxScrollBar* bar) { m_hScrollBar = bar; } + + // Can be used to prevent the EVT_CHAR handler from adding the char + bool GetLastKeydownProcessed() { return m_lastKeyDownConsumed; } + void SetLastKeydownProcessed(bool val) { m_lastKeyDownConsumed = val; } + + //---------------------------------------------------------------------- @@ -156,10 +169,12 @@ private: // Event handlers void OnPaint(wxPaintEvent& evt); void OnScrollWin(wxScrollWinEvent& evt); + void OnScroll(wxScrollEvent& evt); void OnSize(wxSizeEvent& evt); void OnMouseLeftDown(wxMouseEvent& evt); void OnMouseMove(wxMouseEvent& evt); void OnMouseLeftUp(wxMouseEvent& evt); + void OnMouseRightUp(wxMouseEvent& evt); void OnContextMenu(wxContextMenuEvent& evt); void OnMouseWheel(wxMouseEvent& evt); void OnChar(wxKeyEvent& evt); @@ -183,6 +198,8 @@ private: ScintillaWX* m_swx; wxStopWatch m_stopWatch; + wxScrollBar* m_vScrollBar; + wxScrollBar* m_hScrollBar; bool m_lastKeyDownConsumed; @@ -193,16 +210,28 @@ private: //---------------------------------------------------------------------- +// SWIG can't handle "#if" type of conditionals, onlu "#ifdef" +#ifdef SWIG +#define STC_USE_DND 1 +#else +#if wxUSE_DRAG_AND_DROP +#define STC_USE_DND 1 +#endif +#endif + class wxStyledTextEvent : public wxCommandEvent { public: wxStyledTextEvent(wxEventType commandType=0, int id=0); +#ifndef SWIG + wxStyledTextEvent(const wxStyledTextEvent& event); +#endif ~wxStyledTextEvent() {} void SetPosition(int pos) { m_position = pos; } void SetKey(int k) { m_key = k; } void SetModifiers(int m) { m_modifiers = m; } void SetModificationType(int t) { m_modificationType = t; } - void SetText(const char* t) { m_text = t; } + void SetText(const wxString& t) { m_text = t; } void SetLength(int len) { m_length = len; } void SetLinesAdded(int num) { m_linesAdded = num; } void SetLine(int val) { m_line = val; } @@ -215,9 +244,9 @@ public: void SetListType(int val) { m_listType = val; } void SetX(int val) { m_x = val; } void SetY(int val) { m_y = val; } -#ifndef __WXMAC__ // #if wxUSE_DRAG_AND_DROP void SetDragText(const wxString& val) { m_dragText = val; } void SetDragAllowMove(bool val) { m_dragAllowMove = val; } +#ifdef STC_USE_DND void SetDragResult(wxDragResult val) { m_dragResult = val; } #endif @@ -238,9 +267,9 @@ public: int GetListType() const { return m_listType; } int GetX() const { return m_x; } int GetY() const { return m_y; } -#ifndef __WXMAC__ // #if wxUSE_DRAG_AND_DROP wxString GetDragText() { return m_dragText; } bool GetDragAllowMove() { return m_dragAllowMove; } +#ifdef STC_USE_DND wxDragResult GetDragResult() { return m_dragResult; } #endif @@ -248,7 +277,7 @@ public: bool GetControl() const; bool GetAlt() const; - void CopyObject(wxObject& obj) const; + virtual wxEvent* Clone() const { return new wxStyledTextEvent(*this); } #ifndef SWIG private: @@ -276,10 +305,10 @@ private: int m_x; int m_y; -#ifndef __WXMAC__ // #if wxUSE_DRAG_AND_DROP wxString m_dragText; // wxEVT_STC_START_DRAG, wxEVT_STC_DO_DROP bool m_dragAllowMove; // wxEVT_STC_START_DRAG +#if wxUSE_DRAG_AND_DROP wxDragResult m_dragResult; // wxEVT_STC_DRAG_OVER,wxEVT_STC_DO_DROP #endif #endif @@ -306,11 +335,10 @@ BEGIN_DECLARE_EVENT_TYPES() DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_URIDROPPED, 1666) DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DWELLSTART, 1667) DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DWELLEND, 1668) -#if wxUSE_DRAG_AND_DROP DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_START_DRAG, 1669) DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DRAG_OVER, 1670) DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DO_DROP, 1671) -#endif + DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_ZOOM, 1672) END_DECLARE_EVENT_TYPES() #else enum { @@ -333,11 +361,10 @@ END_DECLARE_EVENT_TYPES() wxEVT_STC_URIDROPPED, wxEVT_STC_DWELLSTART, wxEVT_STC_DWELLEND, -#ifndef __WXMAC__ // #if wxUSE_DRAG_AND_DROP wxEVT_STC_START_DRAG, wxEVT_STC_DRAG_OVER, wxEVT_STC_DO_DROP, -#endif + wxEVT_STC_ZOOM, }; #endif @@ -365,14 +392,46 @@ typedef void (wxEvtHandler::*wxStyledTextEventFunction)(wxStyledTextEvent&); #define EVT_STC_URIDROPPED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_URIDROPPED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ), #define EVT_STC_DWELLSTART(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DWELLSTART, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ), #define EVT_STC_DWELLEND(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DWELLEND, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ), -#if wxUSE_DRAG_AND_DROP #define EVT_STC_START_DRAG(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_START_DRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ), #define EVT_STC_DRAG_OVER(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DRAG_OVER, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ), #define EVT_STC_DO_DROP(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DO_DROP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ), -#endif +#define EVT_STC_ZOOM(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_ZOOM, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ), #endif //---------------------------------------------------------------------- +// Utility functions used within wxSTC + +#ifndef SWIG + +inline wxString stc2wx(const char* str) { +#if wxUSE_UNICODE + return wxString(str, wxConvUTF8); +#else + return wxString(str); +#endif +} + +inline wxString stc2wx(const char* str, size_t len) { +#if wxUSE_UNICODE + return wxString(str, wxConvUTF8, len); +#else + return wxString(str, len); +#endif +} + +#if wxUSE_UNICODE +inline const wxWX2MBbuf wx2stc(const wxString& str) { + return str.mb_str(wxConvUTF8); +} +#else +inline const wxWX2MBbuf wx2stc(const wxString& str) { + return str.mbc_str(); +} +#endif + +#endif + + //---------------------------------------------------------------------- #endif