#include <wx/wx.h>
#include <wx/dnd.h>
+//----------------------------------------------------------------------
+
+// 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
%(VALUES)s
// END of generated section
-//----------------------------------------------------------------------
-// Others
-
-#define wxSTC_MASK_FOLDERS ((1 << wxSTC_MARKNUM_FOLDER) | (1 << wxSTC_MARKNUM_FOLDEROPEN))
-
-
-
//----------------------------------------------------------------------
class ScintillaWX; // forward declare
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
// 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; }
+
+
//----------------------------------------------------------------------
//----------------------------------------------------------------------
+// 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);
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; }
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; }
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;
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
#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