X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9c46ea66472d59fe5fe623c456e540e47d922fcf..aa4b7ef978937fe5d93fda9276ecbbee0cd66517:/include/wx/stc/stc.h diff --git a/include/wx/stc/stc.h b/include/wx/stc/stc.h index 62bc6db594..64061f23fc 100644 --- a/include/wx/stc/stc.h +++ b/include/wx/stc/stc.h @@ -1303,9 +1303,7 @@ public: int GetPrintColourMode(); // Find some text in the document. - int FindText(int minPos, int maxPos, - const wxString& text, - bool caseSensitive, bool wholeWord); + int FindText(int minPos, int maxPos, const wxString& text, int flags=0); // On Windows will draw the document into a display context such as a printer. int FormatRange(bool doDraw, @@ -1860,6 +1858,15 @@ 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); @@ -1887,7 +1894,9 @@ public: void SetY(int val) { m_y = val; } 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 int GetPosition() const { return m_position; } int GetKey() const { return m_key; } @@ -1908,7 +1917,9 @@ public: int GetY() const { return m_y; } wxString GetDragText() { return m_dragText; } bool GetDragAllowMove() { return m_dragAllowMove; } +#ifdef STC_USE_DND wxDragResult GetDragResult() { return m_dragResult; } +#endif bool GetShift() const; bool GetControl() const; @@ -1945,8 +1956,10 @@ private: 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 }; #ifndef SWIG @@ -2031,6 +2044,39 @@ typedef void (wxEvtHandler::*wxStyledTextEventFunction)(wxStyledTextEvent&); #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