+// Clear the annotations from all lines
+void wxStyledTextCtrl::AnnotationClearAll()
+{
+ SendMsg(2547, 0, 0);
+}
+
+// Set the visibility for the annotations for a view
+void wxStyledTextCtrl::AnnotationSetVisible(int visible)
+{
+ SendMsg(2548, visible, 0);
+}
+
+// Get the visibility for the annotations for a view
+int wxStyledTextCtrl::AnnotationGetVisible() const
+{
+ return SendMsg(2549, 0, 0);
+}
+
+// Get the start of the range of style numbers used for annotations
+void wxStyledTextCtrl::AnnotationSetStyleOffset(int style)
+{
+ SendMsg(2550, style, 0);
+}
+
+// Get the start of the range of style numbers used for annotations
+int wxStyledTextCtrl::AnnotationGetStyleOffset() const
+{
+ return SendMsg(2551, 0, 0);
+}
+
+// Add a container action to the undo stack
+void wxStyledTextCtrl::AddUndoAction(int token, int flags)
+{
+ SendMsg(2560, token, flags);
+}
+
+// Find the position of a character from a point within the window.
+int wxStyledTextCtrl::CharPositionFromPoint(int x, int y)
+{
+ return SendMsg(2561, x, y);
+}
+
+// Find the position of a character from a point within the window.
+// Return INVALID_POSITION if not close to text.
+int wxStyledTextCtrl::CharPositionFromPointClose(int x, int y)
+{
+ return SendMsg(2562, x, y);
+}
+
+// Set whether multiple selections can be made
+void wxStyledTextCtrl::SetMultipleSelection(bool multipleSelection)
+{
+ SendMsg(2563, multipleSelection, 0);
+}
+
+// Whether multiple selections can be made
+bool wxStyledTextCtrl::GetMultipleSelection() const
+{
+ return SendMsg(2564, 0, 0) != 0;
+}
+
+// Set whether typing can be performed into multiple selections
+void wxStyledTextCtrl::SetAdditionalSelectionTyping(bool additionalSelectionTyping)
+{
+ SendMsg(2565, additionalSelectionTyping, 0);
+}
+
+// Whether typing can be performed into multiple selections
+bool wxStyledTextCtrl::GetAdditionalSelectionTyping() const
+{
+ return SendMsg(2566, 0, 0) != 0;
+}
+
+// Set whether additional carets will blink
+void wxStyledTextCtrl::SetAdditionalCaretsBlink(bool additionalCaretsBlink)
+{
+ SendMsg(2567, additionalCaretsBlink, 0);
+}
+
+// Whether additional carets will blink
+bool wxStyledTextCtrl::GetAdditionalCaretsBlink() const
+{
+ return SendMsg(2568, 0, 0) != 0;
+}
+
+// Set whether additional carets are visible
+void wxStyledTextCtrl::SetAdditionalCaretsVisible(bool additionalCaretsBlink)
+{
+ SendMsg(2608, additionalCaretsBlink, 0);
+}
+
+// Whether additional carets are visible
+bool wxStyledTextCtrl::GetAdditionalCaretsVisible() const
+{
+ return SendMsg(2609, 0, 0) != 0;
+}
+
+// How many selections are there?
+int wxStyledTextCtrl::GetSelections() const
+{
+ return SendMsg(2570, 0, 0);
+}
+
+// Clear selections to a single empty stream selection
+void wxStyledTextCtrl::ClearSelections()
+{
+ SendMsg(2571, 0, 0);
+}
+
+// Add a selection
+int wxStyledTextCtrl::AddSelection(int caret, int anchor)
+{
+ return SendMsg(2573, caret, anchor);
+}
+
+// Set the main selection
+void wxStyledTextCtrl::SetMainSelection(int selection)
+{
+ SendMsg(2574, selection, 0);
+}
+
+// Which selection is the main selection
+int wxStyledTextCtrl::GetMainSelection() const
+{
+ return SendMsg(2575, 0, 0);
+}
+void wxStyledTextCtrl::SetSelectionNCaret(int selection, int pos)
+{
+ SendMsg(2576, selection, pos);
+}
+int wxStyledTextCtrl::GetSelectionNCaret(int selection) const
+{
+ return SendMsg(2577, selection, 0);
+}
+void wxStyledTextCtrl::SetSelectionNAnchor(int selection, int posAnchor)
+{
+ SendMsg(2578, selection, posAnchor);
+}
+int wxStyledTextCtrl::GetSelectionNAnchor(int selection) const
+{
+ return SendMsg(2579, selection, 0);
+}
+void wxStyledTextCtrl::SetSelectionNCaretVirtualSpace(int selection, int space)
+{
+ SendMsg(2580, selection, space);
+}
+int wxStyledTextCtrl::GetSelectionNCaretVirtualSpace(int selection) const
+{
+ return SendMsg(2581, selection, 0);
+}
+void wxStyledTextCtrl::SetSelectionNAnchorVirtualSpace(int selection, int space)
+{
+ SendMsg(2582, selection, space);
+}
+int wxStyledTextCtrl::GetSelectionNAnchorVirtualSpace(int selection) const
+{
+ return SendMsg(2583, selection, 0);
+}
+
+// Sets the position that starts the selection - this becomes the anchor.
+void wxStyledTextCtrl::SetSelectionNStart(int selection, int pos)
+{
+ SendMsg(2584, selection, pos);
+}
+
+// Returns the position at the start of the selection.
+int wxStyledTextCtrl::GetSelectionNStart(int selection) const
+{
+ return SendMsg(2585, selection, 0);
+}
+
+// Sets the position that ends the selection - this becomes the currentPosition.
+void wxStyledTextCtrl::SetSelectionNEnd(int selection, int pos)
+{
+ SendMsg(2586, selection, pos);
+}
+
+// Returns the position at the end of the selection.
+int wxStyledTextCtrl::GetSelectionNEnd(int selection) const
+{
+ return SendMsg(2587, selection, 0);
+}
+void wxStyledTextCtrl::SetRectangularSelectionCaret(int pos)
+{
+ SendMsg(2588, pos, 0);
+}
+int wxStyledTextCtrl::GetRectangularSelectionCaret() const
+{
+ return SendMsg(2589, 0, 0);
+}
+void wxStyledTextCtrl::SetRectangularSelectionAnchor(int posAnchor)
+{
+ SendMsg(2590, posAnchor, 0);
+}
+int wxStyledTextCtrl::GetRectangularSelectionAnchor() const
+{
+ return SendMsg(2591, 0, 0);
+}
+void wxStyledTextCtrl::SetRectangularSelectionCaretVirtualSpace(int space)
+{
+ SendMsg(2592, space, 0);
+}
+int wxStyledTextCtrl::GetRectangularSelectionCaretVirtualSpace() const
+{
+ return SendMsg(2593, 0, 0);
+}
+void wxStyledTextCtrl::SetRectangularSelectionAnchorVirtualSpace(int space)
+{
+ SendMsg(2594, space, 0);
+}
+int wxStyledTextCtrl::GetRectangularSelectionAnchorVirtualSpace() const
+{
+ return SendMsg(2595, 0, 0);
+}
+void wxStyledTextCtrl::SetVirtualSpaceOptions(int virtualSpaceOptions)
+{
+ SendMsg(2596, virtualSpaceOptions, 0);
+}
+int wxStyledTextCtrl::GetVirtualSpaceOptions() const
+{
+ return SendMsg(2597, 0, 0);
+}
+
+// On GTK+, allow selecting the modifier key to use for mouse-based
+// rectangular selection. Often the window manager requires Alt+Mouse Drag
+// for moving windows.
+// Valid values are SCMOD_CTRL(default), SCMOD_ALT, or SCMOD_SUPER.
+void wxStyledTextCtrl::SetRectangularSelectionModifier(int modifier)
+{
+ SendMsg(2598, modifier, 0);
+}
+
+// Get the modifier key used for rectangular selection.
+int wxStyledTextCtrl::GetRectangularSelectionModifier() const
+{
+ return SendMsg(2599, 0, 0);
+}
+
+// Set the foreground colour of additional selections.
+// Must have previously called SetSelFore with non-zero first argument for this to have an effect.
+void wxStyledTextCtrl::SetAdditionalSelForeground(const wxColour& fore)
+{
+ SendMsg(2600, wxColourAsLong(fore), 0);
+}
+
+// Set the background colour of additional selections.
+// Must have previously called SetSelBack with non-zero first argument for this to have an effect.
+void wxStyledTextCtrl::SetAdditionalSelBackground(const wxColour& back)
+{
+ SendMsg(2601, wxColourAsLong(back), 0);
+}
+
+// Set the alpha of the selection.
+void wxStyledTextCtrl::SetAdditionalSelAlpha(int alpha)
+{
+ SendMsg(2602, alpha, 0);
+}
+
+// Get the alpha of the selection.
+int wxStyledTextCtrl::GetAdditionalSelAlpha() const
+{
+ return SendMsg(2603, 0, 0);
+}
+
+// Set the foreground colour of additional carets.
+void wxStyledTextCtrl::SetAdditionalCaretForeground(const wxColour& fore)
+{
+ SendMsg(2604, wxColourAsLong(fore), 0);
+}
+
+// Get the foreground colour of additional carets.
+wxColour wxStyledTextCtrl::GetAdditionalCaretForeground() const
+{
+ long c = SendMsg(2605, 0, 0);
+ return wxColourFromLong(c);
+}
+
+// Set the main selection to the next selection.
+void wxStyledTextCtrl::RotateSelection()
+{
+ SendMsg(2606, 0, 0);
+}
+
+// Swap that caret and anchor of the main selection.
+void wxStyledTextCtrl::SwapMainAnchorCaret()
+{
+ SendMsg(2607, 0, 0);
+}
+
+// Indicate that the internal state of a lexer has changed over a range and therefore
+// there may be a need to redraw.
+int wxStyledTextCtrl::ChangeLexerState(int start, int end)
+{
+ return SendMsg(2617, start, end);
+}
+
+// Find the next line at or after lineStart that is a contracted fold header line.
+// Return -1 when no more lines.
+int wxStyledTextCtrl::ContractedFoldNext(int lineStart)
+{
+ return SendMsg(2618, lineStart, 0);
+}
+
+// Centre current line in window.
+void wxStyledTextCtrl::VerticalCentreCaret()
+{
+ SendMsg(2619, 0, 0);
+}
+
+// Move the selected lines up one line, shifting the line above after the selection
+void wxStyledTextCtrl::MoveSelectedLinesUp()
+{
+ SendMsg(2620, 0, 0);
+}
+
+// Move the selected lines down one line, shifting the line below before the selection
+void wxStyledTextCtrl::MoveSelectedLinesDown()
+{
+ SendMsg(2621, 0, 0);
+}
+
+// Set the identifier reported as idFrom in notification messages.
+void wxStyledTextCtrl::SetIdentifier(int identifier)
+{
+ SendMsg(2622, identifier, 0);
+}
+
+// Get the identifier.
+int wxStyledTextCtrl::GetIdentifier() const
+{
+ return SendMsg(2623, 0, 0);
+}
+
+// Set the width for future RGBA image data.
+void wxStyledTextCtrl::RGBAImageSetWidth(int width)
+{
+ SendMsg(2624, width, 0);
+}
+
+// Set the height for future RGBA image data.
+void wxStyledTextCtrl::RGBAImageSetHeight(int height)
+{
+ SendMsg(2625, height, 0);
+}
+
+// Define a marker from RGBA data.
+// It has the width and height from RGBAImageSetWidth/Height
+void wxStyledTextCtrl::MarkerDefineRGBAImage(int markerNumber, const unsigned char* pixels) {
+ SendMsg(2626, markerNumber, (sptr_t)pixels);
+}
+
+// Register an RGBA image for use in autocompletion lists.
+// It has the width and height from RGBAImageSetWidth/Height
+void wxStyledTextCtrl::RegisterRGBAImage(int type, const unsigned char* pixels) {
+ SendMsg(2627, type, (sptr_t)pixels);
+}
+
+// Scroll to start of document.
+void wxStyledTextCtrl::ScrollToStart()
+{
+ SendMsg(2628, 0, 0);
+}
+
+// Scroll to end of document.
+void wxStyledTextCtrl::ScrollToEnd()
+{
+ SendMsg(2629, 0, 0);
+}
+
+// Set the technology used.
+void wxStyledTextCtrl::SetTechnology(int technology)
+{
+ SendMsg(2630, technology, 0);
+}
+
+// Get the tech.
+int wxStyledTextCtrl::GetTechnology() const
+{
+ return SendMsg(2631, 0, 0);
+}
+
+// Create an ILoader*.
+void* wxStyledTextCtrl::CreateLoader(int bytes) const {
+ return (void*)(sptr_t)SendMsg(2632, bytes);
+}
+
+// Start notifying the container of all key presses and commands.
+void wxStyledTextCtrl::StartRecord()
+{
+ SendMsg(3001, 0, 0);
+}
+
+// Stop notifying the container of all key presses and commands.
+void wxStyledTextCtrl::StopRecord()
+{
+ SendMsg(3002, 0, 0);
+}
+
+// Set the lexing language of the document.
+void wxStyledTextCtrl::SetLexer(int lexer)
+{
+ SendMsg(4001, lexer, 0);
+}
+
+// Retrieve the lexing language of the document.
+int wxStyledTextCtrl::GetLexer() const
+{
+ return SendMsg(4002, 0, 0);
+}
+
+// Colourise a segment of the document using the current lexing language.
+void wxStyledTextCtrl::Colourise(int start, int end)
+{
+ SendMsg(4003, start, end);
+}
+
+// Set up a value that may be used by a lexer for some optional feature.
+void wxStyledTextCtrl::SetProperty(const wxString& key, const wxString& value)
+{
+ SendMsg(4004, (sptr_t)(const char*)wx2stc(key), (sptr_t)(const char*)wx2stc(value));
+}
+
+// Set up the key words used by the lexer.
+void wxStyledTextCtrl::SetKeyWords(int keywordSet, const wxString& keyWords)
+{
+ SendMsg(4005, keywordSet, (sptr_t)(const char*)wx2stc(keyWords));
+}
+
+// Set the lexing language of the document based on string name.
+void wxStyledTextCtrl::SetLexerLanguage(const wxString& language)
+{
+ SendMsg(4006, 0, (sptr_t)(const char*)wx2stc(language));
+}
+
+// Retrieve a 'property' value previously set with SetProperty.
+wxString wxStyledTextCtrl::GetProperty(const wxString& key) {
+ int len = SendMsg(SCI_GETPROPERTY, (sptr_t)(const char*)wx2stc(key), 0);
+ if (!len) return wxEmptyString;
+
+ wxMemoryBuffer mbuf(len+1);
+ char* buf = (char*)mbuf.GetWriteBuf(len+1);
+ SendMsg(4008, (uptr_t)(const char*)wx2stc(key), (sptr_t)buf);
+ mbuf.UngetWriteBuf(len);
+ mbuf.AppendByte(0);
+ return stc2wx(buf);
+}
+
+// Retrieve a 'property' value previously set with SetProperty,
+// with '$()' variable replacement on returned buffer.
+wxString wxStyledTextCtrl::GetPropertyExpanded(const wxString& key) {
+ int len = SendMsg(SCI_GETPROPERTYEXPANDED, (uptr_t)(const char*)wx2stc(key), 0);
+ if (!len) return wxEmptyString;
+
+ wxMemoryBuffer mbuf(len+1);
+ char* buf = (char*)mbuf.GetWriteBuf(len+1);
+ SendMsg(4009, (uptr_t)(const char*)wx2stc(key), (sptr_t)buf);
+ mbuf.UngetWriteBuf(len);
+ mbuf.AppendByte(0);
+ return stc2wx(buf);
+}
+
+// Retrieve a 'property' value previously set with SetProperty,
+// interpreted as an int AFTER any '$()' variable replacement.
+int wxStyledTextCtrl::GetPropertyInt(const wxString& key) const
+{
+ return SendMsg(4010, (sptr_t)(const char*)wx2stc(key), 0);
+}
+
+// Retrieve the number of bits the current lexer needs for styling.
+int wxStyledTextCtrl::GetStyleBitsNeeded() const
+{
+ return SendMsg(4011, 0, 0);
+}
+
+// For private communication between an application and a known lexer.
+void* wxStyledTextCtrl::PrivateLexerCall(int operation, void* pointer) {
+ return (void*)(sptr_t)SendMsg(4013, operation, (sptr_t)pointer);
+}
+
+// Retrieve a '\n' separated list of properties understood by the current lexer.
+wxString wxStyledTextCtrl::PropertyNames() const {
+ int msg = 4014;
+ int len = SendMsg(msg, 0, (sptr_t)NULL);
+ if (!len) return wxEmptyString;
+
+ wxMemoryBuffer mbuf(len+1);
+ char* buf = (char*)mbuf.GetWriteBuf(len+1);
+ SendMsg(msg, 0, (sptr_t)buf);
+ mbuf.UngetWriteBuf(len);
+ mbuf.AppendByte(0);
+ return stc2wx(buf);
+}
+
+// Retrieve the type of a property.
+int wxStyledTextCtrl::PropertyType(const wxString& name)
+{
+ return SendMsg(4015, (sptr_t)(const char*)wx2stc(name), 0);
+}
+
+// Describe a property.
+wxString wxStyledTextCtrl::DescribeProperty(const wxString& name) const {
+ int msg = 4016;
+ int len = SendMsg(msg, (sptr_t)(const char*)wx2stc(name), (sptr_t)NULL);
+ if (!len) return wxEmptyString;
+
+ wxMemoryBuffer mbuf(len+1);
+ char* buf = (char*)mbuf.GetWriteBuf(len+1);
+ SendMsg(msg, (sptr_t)(const char*)wx2stc(name), (sptr_t)buf);
+ mbuf.UngetWriteBuf(len);
+ mbuf.AppendByte(0);
+ return stc2wx(buf);
+}
+
+// Retrieve a '\n' separated list of descriptions of the keyword sets understood by the current lexer.
+wxString wxStyledTextCtrl::DescribeKeyWordSets() const {
+ int msg = 4017;
+ int len = SendMsg(msg, 0, (sptr_t)NULL);
+ if (!len) return wxEmptyString;
+
+ wxMemoryBuffer mbuf(len+1);
+ char* buf = (char*)mbuf.GetWriteBuf(len+1);
+ SendMsg(msg, 0, (sptr_t)buf);
+ mbuf.UngetWriteBuf(len);
+ mbuf.AppendByte(0);
+ return stc2wx(buf);
+}
+
+//}}}
+//----------------------------------------------------------------------
+
+
+// Returns the line number of the line with the caret.
+int wxStyledTextCtrl::GetCurrentLine() {
+ int line = LineFromPosition(GetCurrentPos());
+ return line;
+}
+
+
+// Extract style settings from a spec-string which is composed of one or
+// more of the following comma separated elements:
+//
+// bold turns on bold
+// italic turns on italics
+// fore:[name or #RRGGBB] sets the foreground colour
+// back:[name or #RRGGBB] sets the background colour
+// face:[facename] sets the font face name to use
+// size:[num] sets the font size in points
+// eol turns on eol filling
+// underline turns on underlining
+//
+void wxStyledTextCtrl::StyleSetSpec(int styleNum, const wxString& spec) {
+
+ wxStringTokenizer tkz(spec, wxT(","));
+ while (tkz.HasMoreTokens()) {
+ wxString token = tkz.GetNextToken();
+
+ wxString option = token.BeforeFirst(':');
+ wxString val = token.AfterFirst(':');
+
+ if (option == wxT("bold"))
+ StyleSetBold(styleNum, true);
+
+ else if (option == wxT("italic"))
+ StyleSetItalic(styleNum, true);
+
+ else if (option == wxT("underline"))
+ StyleSetUnderline(styleNum, true);
+
+ else if (option == wxT("eol"))
+ StyleSetEOLFilled(styleNum, true);
+
+ else if (option == wxT("size")) {
+ long points;
+ if (val.ToLong(&points))
+ StyleSetSize(styleNum, points);
+ }
+
+ else if (option == wxT("face"))
+ StyleSetFaceName(styleNum, val);
+
+ else if (option == wxT("fore"))
+ StyleSetForeground(styleNum, wxColourFromSpec(val));