// Retrieve the text of the line containing the caret.
// Returns the index of the caret on the line.
- wxString GetCurLine(int* OUTPUT=NULL);
+ #ifdef SWIG
+ wxString GetCurLine(int* OUTPUT);
+#else
+ wxString GetCurLine(int* linePos=NULL);
+#endif
// Retrieve the position of the last correctly styled character.
int GetEndStyled();
int GetModEventMask();
// Change internal focus flag
- void SetFocus(bool focus);
+ void SetSTCFocus(bool focus);
// Get internal focus flag
- bool GetFocus();
+ bool GetSTCFocus();
// Change error status - 0 = OK
void SetStatus(int statusCode);
0),
'GetCurLine' : (0,
- 'wxString %s(int* OUTPUT=NULL);',
+ '#ifdef SWIG\n wxString %s(int* OUTPUT);\n#else\n wxString GetCurLine(int* linePos=NULL);\n#endif',
'''wxString %s(int* linePos) {
wxString text;
int len = LineLength(GetCurrentLine());
- if (!len) return "";
- char* buf = text.GetWriteBuf(len);
-
- int pos = SendMsg(%s, len, (long)buf);
+ if (!len) {
+ if (linePos) *linePos = 0;
+ return "";
+ }
+ // Need an extra byte because SCI_GETCURLINE writes a null to the string
+ char* buf = text.GetWriteBuf(len+1);
+
+ int pos = SendMsg(%s, len+1, (long)buf);
text.UngetWriteBuf(len);
if (linePos) *linePos = pos;
'''wxString %s() {
wxString text;
- int len = GetTextLength()+1;
- char* buff = text.GetWriteBuf(len);
+ int len = GetTextLength();
+ char* buff = text.GetWriteBuf(len+1); // leave room for the null...
- SendMsg(%s, len, (long)buff);
- text.UngetWriteBuf(len-1);
+ SendMsg(%s, len+1, (long)buff);
+ text.UngetWriteBuf(len);
return text;''',
('Retrieve all the text in the document.', )),
0),
'GrabFocus' : (None, 0, 0, 0),
+ 'SetFocus' : ('SetSTCFocus', 0, 0, 0),
+ 'GetFocus' : ('GetSTCFocus', 0, 0, 0),
+
'' : ('', 0, 0, 0),
$(D)\Indicator.obj \
$(D)\KeyMap.obj \
$(D)\KeyWords.obj \
+ $(D)\LineMarker.obj \
+ $(D)\PropSet.obj \
+ $(D)\RESearch.obj \
+ $(D)\ScintillaBase.obj \
+ $(D)\Style.obj \
+ $(D)\UniConversion.obj \
+ $(D)\ViewStyle.obj \
+ $(D)\WindowAccessor.obj \
+ \
+ $(D)\LexAda.obj \
+ $(D)\LexAVE.obj \
+ $(D)\LexConf.obj \
$(D)\LexCPP.obj \
+ $(D)\LexEiffel.obj \
$(D)\LexHTML.obj \
+ $(D)\LexLisp.obj \
$(D)\LexLua.obj \
$(D)\LexOthers.obj \
+ $(D)\LexPascal.obj \
$(D)\LexPerl.obj \
$(D)\LexPython.obj \
+ $(D)\LexRuby.obj \
$(D)\LexSQL.obj \
$(D)\LexVB.obj \
- $(D)\LineMarker.obj \
- $(D)\PosRegExp.obj \
- $(D)\PropSet.obj \
- $(D)\ScintillaBase.obj \
- $(D)\Style.obj \
- $(D)\UniConversion.obj \
- $(D)\ViewStyle.obj \
- $(D)\WindowAccessor.obj \
\
$(D)\PlatWX.obj \
$(D)\ScintillaWX.obj \
wxString wxStyledTextCtrl::GetCurLine(int* linePos) {
wxString text;
int len = LineLength(GetCurrentLine());
- if (!len) return "";
- char* buf = text.GetWriteBuf(len);
-
- int pos = SendMsg(2027, len, (long)buf);
+ if (!len) {
+ if (linePos) *linePos = 0;
+ return "";
+ }
+ // Need an extra byte because SCI_GETCURLINE writes a null to the string
+ char* buf = text.GetWriteBuf(len+1);
+
+ int pos = SendMsg(2027, len+1, (long)buf);
text.UngetWriteBuf(len);
if (linePos) *linePos = pos;
// Retrieve all the text in the document.
wxString wxStyledTextCtrl::GetText() {
wxString text;
- int len = GetTextLength()+1;
- char* buff = text.GetWriteBuf(len);
+ int len = GetTextLength();
+ char* buff = text.GetWriteBuf(len+1); // leave room for the null...
- SendMsg(2182, len, (long)buff);
- text.UngetWriteBuf(len-1);
+ SendMsg(2182, len+1, (long)buff);
+ text.UngetWriteBuf(len);
return text;
}
}
// Change internal focus flag
-void wxStyledTextCtrl::SetFocus(bool focus) {
+void wxStyledTextCtrl::SetSTCFocus(bool focus) {
SendMsg(2380, focus, 0);
}
// Get internal focus flag
-bool wxStyledTextCtrl::GetFocus() {
+bool wxStyledTextCtrl::GetSTCFocus() {
return SendMsg(2381, 0, 0) != 0;
}
// Retrieve the text of the line containing the caret.
// Returns the index of the caret on the line.
- wxString GetCurLine(int* OUTPUT=NULL);
+ #ifdef SWIG
+ wxString GetCurLine(int* OUTPUT);
+#else
+ wxString GetCurLine(int* linePos=NULL);
+#endif
// Retrieve the position of the last correctly styled character.
int GetEndStyled();
int GetModEventMask();
// Change internal focus flag
- void SetFocus(bool focus);
+ void SetSTCFocus(bool focus);
// Get internal focus flag
- bool GetFocus();
+ bool GetSTCFocus();
// Change error status - 0 = OK
void SetStatus(int statusCode);
0),
'GetCurLine' : (0,
- 'wxString %s(int* OUTPUT=NULL);',
+ '#ifdef SWIG\n wxString %s(int* OUTPUT);\n#else\n wxString GetCurLine(int* linePos=NULL);\n#endif',
'''wxString %s(int* linePos) {
wxString text;
int len = LineLength(GetCurrentLine());
- if (!len) return "";
- char* buf = text.GetWriteBuf(len);
-
- int pos = SendMsg(%s, len, (long)buf);
+ if (!len) {
+ if (linePos) *linePos = 0;
+ return "";
+ }
+ // Need an extra byte because SCI_GETCURLINE writes a null to the string
+ char* buf = text.GetWriteBuf(len+1);
+
+ int pos = SendMsg(%s, len+1, (long)buf);
text.UngetWriteBuf(len);
if (linePos) *linePos = pos;
'''wxString %s() {
wxString text;
- int len = GetTextLength()+1;
- char* buff = text.GetWriteBuf(len);
+ int len = GetTextLength();
+ char* buff = text.GetWriteBuf(len+1); // leave room for the null...
- SendMsg(%s, len, (long)buff);
- text.UngetWriteBuf(len-1);
+ SendMsg(%s, len+1, (long)buff);
+ text.UngetWriteBuf(len);
return text;''',
('Retrieve all the text in the document.', )),
0),
'GrabFocus' : (None, 0, 0, 0),
+ 'SetFocus' : ('SetSTCFocus', 0, 0, 0),
+ 'GetFocus' : ('GetSTCFocus', 0, 0, 0),
+
'' : ('', 0, 0, 0),
$(D)\Indicator.obj \
$(D)\KeyMap.obj \
$(D)\KeyWords.obj \
+ $(D)\LineMarker.obj \
+ $(D)\PropSet.obj \
+ $(D)\RESearch.obj \
+ $(D)\ScintillaBase.obj \
+ $(D)\Style.obj \
+ $(D)\UniConversion.obj \
+ $(D)\ViewStyle.obj \
+ $(D)\WindowAccessor.obj \
+ \
+ $(D)\LexAda.obj \
+ $(D)\LexAVE.obj \
+ $(D)\LexConf.obj \
$(D)\LexCPP.obj \
+ $(D)\LexEiffel.obj \
$(D)\LexHTML.obj \
+ $(D)\LexLisp.obj \
$(D)\LexLua.obj \
$(D)\LexOthers.obj \
+ $(D)\LexPascal.obj \
$(D)\LexPerl.obj \
$(D)\LexPython.obj \
+ $(D)\LexRuby.obj \
$(D)\LexSQL.obj \
$(D)\LexVB.obj \
- $(D)\LineMarker.obj \
- $(D)\PosRegExp.obj \
- $(D)\PropSet.obj \
- $(D)\ScintillaBase.obj \
- $(D)\Style.obj \
- $(D)\UniConversion.obj \
- $(D)\ViewStyle.obj \
- $(D)\WindowAccessor.obj \
\
$(D)\PlatWX.obj \
$(D)\ScintillaWX.obj \
wxString wxStyledTextCtrl::GetCurLine(int* linePos) {
wxString text;
int len = LineLength(GetCurrentLine());
- if (!len) return "";
- char* buf = text.GetWriteBuf(len);
-
- int pos = SendMsg(2027, len, (long)buf);
+ if (!len) {
+ if (linePos) *linePos = 0;
+ return "";
+ }
+ // Need an extra byte because SCI_GETCURLINE writes a null to the string
+ char* buf = text.GetWriteBuf(len+1);
+
+ int pos = SendMsg(2027, len+1, (long)buf);
text.UngetWriteBuf(len);
if (linePos) *linePos = pos;
// Retrieve all the text in the document.
wxString wxStyledTextCtrl::GetText() {
wxString text;
- int len = GetTextLength()+1;
- char* buff = text.GetWriteBuf(len);
+ int len = GetTextLength();
+ char* buff = text.GetWriteBuf(len+1); // leave room for the null...
- SendMsg(2182, len, (long)buff);
- text.UngetWriteBuf(len-1);
+ SendMsg(2182, len+1, (long)buff);
+ text.UngetWriteBuf(len);
return text;
}
}
// Change internal focus flag
-void wxStyledTextCtrl::SetFocus(bool focus) {
+void wxStyledTextCtrl::SetSTCFocus(bool focus) {
SendMsg(2380, focus, 0);
}
// Get internal focus flag
-bool wxStyledTextCtrl::GetFocus() {
+bool wxStyledTextCtrl::GetSTCFocus() {
return SendMsg(2381, 0, 0) != 0;
}