467
554
// Set the symbol used for a particular marker number,
468
555
// and optionally the fore and background colours.
469
void wxScintilla::MarkerDefine (int markerNumber, int markerSymbol) {
470
SendMsg (SCI_MARKERDEFINE, markerNumber, markerSymbol);
556
void wxScintilla::MarkerDefine (int markerNumber, int markerSymbol,
557
const wxColour& foreground,
558
const wxColour& background)
560
SendMsg(SCI_MARKERDEFINE, markerNumber, markerSymbol);
562
MarkerSetForeground(markerNumber, foreground);
564
MarkerSetBackground(markerNumber, background);
473
567
// Set the foreground colour used for a particular marker number.
474
void wxScintilla::MarkerSetForeground (int markerNumber, const wxColour& fore) {
475
SendMsg (SCI_MARKERSETFORE, markerNumber, wxColourAsLong(fore));
568
void wxScintilla::MarkerSetForeground (int markerNumber, const wxColour& fore)
570
SendMsg(SCI_MARKERSETFORE, markerNumber, wxColourAsLong(fore));
478
573
// Set the background colour used for a particular marker number.
479
void wxScintilla::MarkerSetBackground (int markerNumber, const wxColour& back) {
480
SendMsg (SCI_MARKERSETBACK, markerNumber, wxColourAsLong(back));
574
void wxScintilla::MarkerSetBackground (int markerNumber, const wxColour& back)
576
SendMsg(SCI_MARKERSETBACK, markerNumber, wxColourAsLong(back));
483
579
// Add a marker to a line, returning an ID which can be used to find or delete the marker.
484
int wxScintilla::MarkerAdd (int line, int markerNumber) {
485
return SendMsg (SCI_MARKERADD, line, markerNumber);
580
int wxScintilla::MarkerAdd (int line, int markerNumber)
582
return SendMsg(SCI_MARKERADD, line, markerNumber);
488
585
// Delete a marker from a line.
489
void wxScintilla::MarkerDelete (int line, int markerNumber) {
490
SendMsg (SCI_MARKERDELETE, line, markerNumber);
586
void wxScintilla::MarkerDelete (int line, int markerNumber)
588
SendMsg(SCI_MARKERDELETE, line, markerNumber);
493
591
// Delete all markers with a particular number from all lines.
494
void wxScintilla::MarkerDeleteAll (int markerNumber) {
495
SendMsg (SCI_MARKERDELETEALL, markerNumber, 0);
592
void wxScintilla::MarkerDeleteAll (int markerNumber)
594
SendMsg(SCI_MARKERDELETEALL, markerNumber, 0);
498
597
// Get a bit mask of all the markers set on a line.
499
int wxScintilla::MarkerGet (int line) {
500
return SendMsg (SCI_MARKERGET, line, 0);
598
int wxScintilla::MarkerGet (int line)
600
return SendMsg(SCI_MARKERGET, line, 0);
503
603
// Find the next line after lineStart that includes a marker in mask.
504
int wxScintilla::MarkerNext (int lineStart, int markerMask) {
505
return SendMsg (SCI_MARKERNEXT, lineStart, markerMask);
604
int wxScintilla::MarkerNext (int lineStart, int markerMask)
606
return SendMsg(SCI_MARKERNEXT, lineStart, markerMask);
508
609
// Find the previous line before lineStart that includes a marker in mask.
509
int wxScintilla::MarkerPrevious (int lineStart, int markerMask) {
510
return SendMsg (SCI_MARKERPREVIOUS, lineStart, markerMask);
610
int wxScintilla::MarkerPrevious (int lineStart, int markerMask)
612
return SendMsg(SCI_MARKERPREVIOUS, lineStart, markerMask);
513
615
// Define a marker from a bitmap
514
void wxScintilla::MarkerDefineBitmap (int markerNumber, const wxBitmap& bmp) {
515
// convert bmp to a xpm in a string
516
wxMemoryOutputStream strm;
517
wxImage img = bmp.ConvertToImage();
518
#if wxCHECK_VERSION(2, 5, 0)
519
if (img.HasAlpha()) img.ConvertAlphaToMask();
521
img.SaveFile(strm, wxBITMAP_TYPE_XPM);
522
size_t len = strm.GetSize();
523
char* buff = new char[len+1];
524
strm.CopyTo(buff, len);
526
SendMsg (SCI_MARKERDEFINEPIXMAP, markerNumber, (long)buff);
616
void wxScintilla::MarkerDefineBitmap (int markerNumber, const wxBitmap& bmp)
618
// convert bmp to a xpm in a string
619
wxMemoryOutputStream strm;
620
wxImage img = bmp.ConvertToImage();
622
img.ConvertAlphaToMask();
623
img.SaveFile(strm, wxBITMAP_TYPE_XPM);
624
size_t len = strm.GetSize();
625
char* buff = new char[len+1];
626
strm.CopyTo(buff, len);
628
SendMsg(SCI_MARKERDEFINEPIXMAP, markerNumber, (sptr_t)buff);
530
633
// Add a set of markers to a line.
531
void wxScintilla::MarkerAddSet (int line, int markerSet) {
532
SendMsg (SCI_MARKERADDSET, line, markerSet);
634
void wxScintilla::MarkerAddSet (int line, int set)
636
SendMsg(SCI_MARKERADDSET, line, set);
639
// Set the alpha used for a marker that is drawn in the text area, not the margin.
640
void wxScintilla::MarkerSetAlpha (int markerNumber, int alpha)
642
SendMsg(SCI_MARKERSETALPHA, markerNumber, alpha);
535
645
// Set a margin to be either numeric or symbolic.
536
void wxScintilla::SetMarginType (int margin, int marginType) {
537
SendMsg (SCI_SETMARGINTYPEN, margin, marginType);
646
void wxScintilla::SetMarginType (int margin, int marginType)
648
SendMsg(SCI_SETMARGINTYPEN, margin, marginType);
540
651
// Retrieve the type of a margin.
541
int wxScintilla::GetMarginType (int margin) {
542
return SendMsg (SCI_GETMARGINTYPEN, margin, 0);
652
int wxScintilla::GetMarginType (int margin) const
654
return SendMsg(SCI_GETMARGINTYPEN, margin, 0);
545
657
// Set the width of a margin to a width expressed in pixels.
546
void wxScintilla::SetMarginWidth (int margin, int pixels) {
547
SendMsg (SCI_SETMARGINWIDTHN, margin, pixels);
658
void wxScintilla::SetMarginWidth (int margin, int pixelWidth)
660
SendMsg(SCI_SETMARGINWIDTHN, margin, pixelWidth);
550
663
// Retrieve the width of a margin in pixels.
551
int wxScintilla::GetMarginWidth (int margin) {
552
return SendMsg (SCI_GETMARGINWIDTHN, margin, 0);
664
int wxScintilla::GetMarginWidth (int margin) const
666
return SendMsg(SCI_GETMARGINWIDTHN, margin, 0);
555
669
// Set a mask that determines which markers are displayed in a margin.
556
void wxScintilla::SetMarginMask (int margin, int mask) {
557
SendMsg (SCI_SETMARGINMASKN, margin, mask);
670
void wxScintilla::SetMarginMask (int margin, int mask)
672
SendMsg(SCI_SETMARGINMASKN, margin, mask);
560
675
// Retrieve the marker mask of a margin.
561
int wxScintilla::GetMarginMask (int margin) {
562
return SendMsg (SCI_GETMARGINMASKN, margin, 0);
676
int wxScintilla::GetMarginMask (int margin) const
678
return SendMsg(SCI_GETMARGINMASKN, margin, 0);
565
681
// Make a margin sensitive or insensitive to mouse clicks.
566
void wxScintilla::SetMarginSensitive (int margin, bool sensitive) {
567
SendMsg (SCI_SETMARGINSENSITIVEN, margin, sensitive);
682
void wxScintilla::SetMarginSensitive (int margin, bool sensitive)
684
SendMsg(SCI_SETMARGINSENSITIVEN, margin, sensitive);
570
687
// Retrieve the mouse click sensitivity of a margin.
571
bool wxScintilla::GetMarginSensitive (int margin) {
572
return SendMsg (SCI_GETMARGINSENSITIVEN, margin, 0) != 0;
688
bool wxScintilla::GetMarginSensitive (int margin) const
690
return SendMsg(SCI_GETMARGINSENSITIVEN, margin, 0) != 0;
575
693
// Clear all the styles and make equivalent to the global default style.
576
void wxScintilla::StyleClearAll() {
577
SendMsg (SCI_STYLECLEARALL, 0, 0);
694
void wxScintilla::StyleClearAll()
696
SendMsg(SCI_STYLECLEARALL, 0, 0);
580
699
// Set the foreground colour of a style.
581
void wxScintilla::StyleSetForeground (int style, const wxColour& fore) {
582
SendMsg (SCI_STYLESETFORE, style, wxColourAsLong(fore));
700
void wxScintilla::StyleSetForeground (int style, const wxColour& fore)
702
SendMsg(SCI_STYLESETFORE, style, wxColourAsLong(fore));
585
705
// Set the background colour of a style.
586
void wxScintilla::StyleSetBackground (int style, const wxColour& back) {
587
SendMsg (SCI_STYLESETBACK, style, wxColourAsLong(back));
706
void wxScintilla::StyleSetBackground (int style, const wxColour& back)
708
SendMsg(SCI_STYLESETBACK, style, wxColourAsLong(back));
590
711
// Set a style to be bold or not.
591
void wxScintilla::StyleSetBold (int style, bool bold) {
592
SendMsg (SCI_STYLESETBOLD, style, bold);
712
void wxScintilla::StyleSetBold (int style, bool bold)
714
SendMsg(SCI_STYLESETBOLD, style, bold);
595
717
// Set a style to be italic or not.
596
void wxScintilla::StyleSetItalic (int style, bool italic) {
597
SendMsg (SCI_STYLESETITALIC, style, italic);
718
void wxScintilla::StyleSetItalic (int style, bool italic)
720
SendMsg(SCI_STYLESETITALIC, style, italic);
600
723
// Set the size of characters of a style.
601
void wxScintilla::StyleSetSize (int style, int sizePoints) {
602
SendMsg (SCI_STYLESETSIZE, style, sizePoints);
724
void wxScintilla::StyleSetSize (int style, int sizePoints)
726
SendMsg(SCI_STYLESETSIZE, style, sizePoints);
605
729
// Set the font of a style.
606
void wxScintilla::StyleSetFaceName (int style, const wxString& fontName) {
607
SendMsg (SCI_STYLESETFONT, style, (long)(const char*)wx2sci(fontName));
730
void wxScintilla::StyleSetFaceName (int style, const wxString& fontName)
732
SendMsg(SCI_STYLESETFONT, style, (sptr_t)(const char*)wx2sci(fontName));
610
735
// Set a style to have its end of line filled or not.
611
void wxScintilla::StyleSetEOLFilled (int style, bool filled) {
612
SendMsg (SCI_STYLESETEOLFILLED, style, filled);
736
void wxScintilla::StyleSetEOLFilled (int style, bool filled)
738
SendMsg(SCI_STYLESETEOLFILLED, style, filled);
615
741
// Reset the default style to its state at startup
616
void wxScintilla::StyleResetDefault() {
617
SendMsg (SCI_STYLERESETDEFAULT, 0, 0);
742
void wxScintilla::StyleResetDefault()
744
SendMsg(SCI_STYLERESETDEFAULT, 0, 0);
620
747
// Set a style to be underlined or not.
621
void wxScintilla::StyleSetUnderline (int style, bool underline) {
622
SendMsg (SCI_STYLESETUNDERLINE, style, underline);
748
void wxScintilla::StyleSetUnderline (int style, bool underline)
750
SendMsg(SCI_STYLESETUNDERLINE, style, underline);
753
// Get the foreground colour of a style.
754
wxColour wxScintilla::StyleGetForeground(int style) const
756
long c = SendMsg(SCI_STYLEGETFORE, style, 0);
757
return wxColourFromLong(c);
760
// Get the background colour of a style.
761
wxColour wxScintilla::StyleGetBackground(int style) const
763
long c = SendMsg(SCI_STYLEGETBACK, style, 0);
764
return wxColourFromLong(c);
767
// Get is a style bold or not.
768
bool wxScintilla::StyleGetBold(int style) const
770
return SendMsg(SCI_STYLEGETBOLD, style, 0) != 0;
773
// Get is a style italic or not.
774
bool wxScintilla::StyleGetItalic(int style) const
776
return SendMsg(SCI_STYLEGETITALIC, style, 0) != 0;
779
// Get the size of characters of a style.
780
int wxScintilla::StyleGetSize(int style) const
782
return SendMsg(SCI_STYLEGETSIZE, style, 0);
785
// Get the font facename of a style
786
wxString wxScintilla::StyleGetFaceName(int style)
788
long msg = SCI_STYLEGETFONT;
789
long len = SendMsg(msg, style, 0);
790
wxMemoryBuffer mbuf(len+1);
791
char* buf = (char*)mbuf.GetWriteBuf(len+1);
792
SendMsg(msg, style, (sptr_t)buf);
793
mbuf.UngetWriteBuf(len);
798
// Get is a style to have its end of line filled or not.
799
bool wxScintilla::StyleGetEOLFilled(int style) const
801
return SendMsg(SCI_STYLEGETEOLFILLED, style, 0) != 0;
804
// Get is a style underlined or not.
805
bool wxScintilla::StyleGetUnderline(int style) const
807
return SendMsg(SCI_STYLEGETUNDERLINE, style, 0) != 0;
810
// Get is a style mixed case, or to force upper or lower case.
811
int wxScintilla::StyleGetCase(int style) const
813
return SendMsg(SCI_STYLEGETCASE, style, 0);
816
// Get the character get of the font in a style.
817
int wxScintilla::StyleGetCharacterSet(int style) const
819
return SendMsg(SCI_STYLEGETCHARACTERSET, style, 0);
822
// Get is a style visible or not.
823
bool wxScintilla::StyleGetVisible(int style) const
825
return SendMsg(SCI_STYLEGETVISIBLE, style, 0) != 0;
828
// Get is a style changeable or not (read only).
829
// Experimental feature, currently buggy.
830
bool wxScintilla::StyleGetChangeable(int style) const
832
return SendMsg(SCI_STYLEGETCHANGEABLE, style, 0) != 0;
835
// Get is a style a hotspot or not.
836
bool wxScintilla::StyleGetHotSpot(int style) const
838
return SendMsg(SCI_STYLEGETHOTSPOT, style, 0) != 0;
625
841
// Set a style to be mixed case, or to force upper or lower case.
626
void wxScintilla::StyleSetCase (int style, int caseMode) {
627
SendMsg (SCI_STYLESETCASE, style, caseMode);
842
void wxScintilla::StyleSetCase (int style, int caseForce)
844
SendMsg(SCI_STYLESETCASE, style, caseForce);
630
847
// Set a style to be a hotspot or not.
631
void wxScintilla::StyleSetHotSpot (int style, bool hotspot) {
632
SendMsg (SCI_STYLESETHOTSPOT, style, hotspot);
635
// Set the foreground colour of the selection and whether to use this setting.
636
void wxScintilla::SetSelForeground (bool useSetting, const wxColour& fore) {
637
SendMsg (SCI_SETSELFORE, useSetting, wxColourAsLong(fore));
640
// Set the background colour of the selection and whether to use this setting.
641
void wxScintilla::SetSelBackground (bool useSetting, const wxColour& back) {
642
SendMsg (SCI_SETSELBACK, useSetting, wxColourAsLong(back));
848
void wxScintilla::StyleSetHotSpot (int style, bool hotspot)
850
SendMsg(SCI_STYLESETHOTSPOT, style, hotspot);
853
// Set the foreground colour of the main and additional selections and whether to use this setting.
854
void wxScintilla::SetSelForeground(bool useSetting, const wxColour& fore)
856
SendMsg(SCI_SETSELFORE, useSetting, wxColourAsLong(fore));
859
// Set the background colour of the main and additional selections and whether to use this setting.
860
void wxScintilla::SetSelBackground(bool useSetting, const wxColour& back)
862
SendMsg(SCI_SETSELBACK, useSetting, wxColourAsLong(back));
865
// Get the alpha of the selection.
866
int wxScintilla::GetSelAlpha () const
868
return SendMsg(SCI_GETSELALPHA, 0, 0);
871
// Set the alpha of the selection.
872
void wxScintilla::SetSelAlpha (int alpha)
874
SendMsg(SCI_SETSELALPHA, alpha, 0);
877
// Is the selection end of line filled?
878
bool wxScintilla::GetSelEOLFilled() const
880
return SendMsg(SCI_GETSELEOLFILLED, 0, 0) != 0;
883
// Set the selection to have its end of line filled or not.
884
void wxScintilla::SetSelEOLFilled(bool filled)
886
SendMsg(SCI_SETSELEOLFILLED, filled, 0);
645
889
// Set the foreground colour of the caret.
646
void wxScintilla::SetCaretForeground (const wxColour& fore) {
647
SendMsg (SCI_SETCARETFORE, wxColourAsLong(fore), 0);
890
void wxScintilla::SetCaretForeground (const wxColour& fore)
892
SendMsg(SCI_SETCARETFORE, wxColourAsLong(fore), 0);
650
895
// When key+modifier combination km is pressed perform msg.
651
void wxScintilla::CmdKeyAssign (int key, int modifiers, int cmd) {
652
SendMsg (SCI_ASSIGNCMDKEY, MAKELONG(key, modifiers), cmd);
896
void wxScintilla::CmdKeyAssign (int key, int modifiers, int cmd)
898
SendMsg(SCI_ASSIGNCMDKEY, MAKELONG(key, modifiers), cmd);
655
901
// When key+modifier combination km is pressed do nothing.
656
void wxScintilla::CmdKeyClear (int key, int modifiers) {
657
SendMsg (SCI_CLEARCMDKEY, MAKELONG(key, modifiers));
902
void wxScintilla::CmdKeyClear (int key, int modifiers)
904
SendMsg(SCI_CLEARCMDKEY, MAKELONG(key, modifiers));
660
907
// Drop all key mappings.
661
void wxScintilla::CmdKeyClearAll() {
662
SendMsg (SCI_CLEARALLCMDKEYS, 0, 0);
908
void wxScintilla::CmdKeyClearAll()
910
SendMsg(SCI_CLEARALLCMDKEYS, 0, 0);
665
913
// Set the styles for a segment of the document.
666
void wxScintilla::SetStyleBytes (int length, char* styleBytes) {
667
SendMsg (SCI_SETSTYLINGEX, length, (long)styleBytes);
914
void wxScintilla::SetStyleBytes (int length, char* styleBytes)
916
SendMsg(SCI_SETSTYLINGEX, length, (sptr_t)styleBytes);
670
919
// Set a style to be visible or not.
671
void wxScintilla::StyleSetVisible (int style, bool visible) {
672
SendMsg (SCI_STYLESETVISIBLE, style, visible);
920
void wxScintilla::StyleSetVisible (int style, bool visible)
922
SendMsg(SCI_STYLESETVISIBLE, style, visible);
675
925
// Get the time in milliseconds that the caret is on and off.
676
int wxScintilla::GetCaretPeriod() {
677
return SendMsg (SCI_GETCARETPERIOD, 0, 0);
926
int wxScintilla::GetCaretPeriod() const
928
return SendMsg(SCI_GETCARETPERIOD, 0, 0);
680
931
// Get the time in milliseconds that the caret is on and off. 0 = steady on.
681
void wxScintilla::SetCaretPeriod (int milliseconds) {
682
SendMsg (SCI_SETCARETPERIOD, milliseconds, 0);
932
void wxScintilla::SetCaretPeriod (int periodMilliseconds)
934
SendMsg(SCI_SETCARETPERIOD, periodMilliseconds, 0);
685
937
// Set the set of characters making up words for when moving or selecting by word.
686
// First sets deaults like SetCharsDefault.
687
void wxScintilla::SetWordChars (const wxString& characters) {
688
SendMsg (SCI_SETWORDCHARS, 0, (long)(const char*)wx2sci(characters));
938
// First sets defaults like SetCharsDefault.
939
void wxScintilla::SetWordChars (const wxString& characters)
941
SendMsg(SCI_SETWORDCHARS, 0, (sptr_t)(const char*)wx2sci(characters));
691
944
// Start a sequence of actions that is undone and redone as a unit.
692
945
// May be nested.
693
void wxScintilla::BeginUndoAction() {
694
SendMsg (SCI_BEGINUNDOACTION, 0, 0);
946
void wxScintilla::BeginUndoAction()
948
SendMsg(SCI_BEGINUNDOACTION, 0, 0);
697
951
// End a sequence of actions that is undone and redone as a unit.
698
void wxScintilla::EndUndoAction() {
699
SendMsg (SCI_ENDUNDOACTION, 0, 0);
952
void wxScintilla::EndUndoAction()
954
SendMsg(SCI_ENDUNDOACTION, 0, 0);
702
957
// Set an indicator to plain, squiggle or TT.
703
void wxScintilla::IndicatorSetStyle (int indic, int style) {
704
SendMsg (SCI_INDICSETSTYLE, indic, style);
958
void wxScintilla::IndicatorSetStyle (int indic, int style)
960
SendMsg(SCI_INDICSETSTYLE, indic, style);
707
963
// Retrieve the style of an indicator.
708
int wxScintilla::IndicatorGetStyle (int indic) {
709
return SendMsg (SCI_INDICGETSTYLE, indic, 0);
964
int wxScintilla::IndicatorGetStyle (int indic) const
966
return SendMsg(SCI_INDICGETSTYLE, indic, 0);
712
969
// Set the foreground colour of an indicator.
713
void wxScintilla::IndicatorSetForeground (int indic, const wxColour& fore) {
714
SendMsg (SCI_INDICSETFORE, indic, wxColourAsLong(fore));
970
void wxScintilla::IndicatorSetForeground (int indic, const wxColour& fore)
972
SendMsg(SCI_INDICSETFORE, indic, wxColourAsLong(fore));
717
975
// Retrieve the foreground colour of an indicator.
718
wxColour wxScintilla::IndicatorGetForeground (int indic) {
719
long colour = SendMsg (SCI_INDICGETFORE, indic, 0);
720
return wxColourFromLong(colour);
976
wxColour wxScintilla::IndicatorGetForeground (int indic) const
978
long c = SendMsg(SCI_INDICGETFORE, indic, 0);
979
return wxColourFromLong(c);
982
// Set an indicator to draw under text or over(default).
983
void wxScintilla::IndicatorSetUnder(int indic, bool under)
985
SendMsg(SCI_INDICSETUNDER, indic, under);
988
// Retrieve whether indicator drawn under or over text.
989
bool wxScintilla::IndicatorGetUnder(int indic) const
991
return SendMsg(SCI_INDICGETUNDER, indic, 0) != 0;
723
994
// Set the foreground colour of all whitespace and whether to use this setting.
724
void wxScintilla::SetWhitespaceForeground (bool useSetting, const wxColour& fore) {
725
SendMsg (SCI_SETWHITESPACEFORE, useSetting, wxColourAsLong(fore));
995
void wxScintilla::SetWhitespaceForeground (bool useSetting, const wxColour& fore)
997
SendMsg(SCI_SETWHITESPACEFORE, useSetting, wxColourAsLong(fore));
728
1000
// Set the background colour of all whitespace and whether to use this setting.
729
void wxScintilla::SetWhitespaceBackground (bool useSetting, const wxColour& back) {
730
SendMsg (SCI_SETWHITESPACEBACK, useSetting, wxColourAsLong(back));
1001
void wxScintilla::SetWhitespaceBackground (bool useSetting, const wxColour& back)
1003
SendMsg(SCI_SETWHITESPACEBACK, useSetting, wxColourAsLong(back));
1006
// Set the size of the dots used to mark space characters.
1007
void wxScintilla::SetWhitespaceSize(int size)
1009
SendMsg(SCI_SETWHITESPACESIZE, size, 0);
1012
// Get the size of the dots used to mark space characters.
1013
int wxScintilla::GetWhitespaceSize() const
1015
return SendMsg(SCI_GETWHITESPACESIZE, 0, 0);
733
1018
// Divide each styling byte into lexical class bits (default: 5) and indicator
734
1019
// bits (default: 3). If a lexer requires more than 32 lexical states, then this
735
1020
// is used to expand the possible states.
736
void wxScintilla::SetStyleBits (int bits) {
737
SendMsg (SCI_SETSTYLEBITS, bits, 0);
1021
void wxScintilla::SetStyleBits (int bits)
1023
SendMsg(SCI_SETSTYLEBITS, bits, 0);
740
1026
// Retrieve number of bits in style bytes used to hold the lexical state.
741
int wxScintilla::GetStyleBits() {
742
return SendMsg (SCI_GETSTYLEBITS, 0, 0);
1027
int wxScintilla::GetStyleBits() const
1029
return SendMsg(SCI_GETSTYLEBITS, 0, 0);
745
1032
// Used to hold extra styling information for each line.
746
void wxScintilla::SetLineState (int line, int state) {
747
SendMsg (SCI_SETLINESTATE, line, state);
1033
void wxScintilla::SetLineState (int line, int state)
1035
SendMsg(SCI_SETLINESTATE, line, state);
750
1038
// Retrieve the extra styling information for a line.
751
int wxScintilla::GetLineState (int line) {
752
return SendMsg (SCI_GETLINESTATE, line, 0);
1039
int wxScintilla::GetLineState (int line) const
1041
return SendMsg(SCI_GETLINESTATE, line, 0);
755
1044
// Retrieve the last line number that has line state.
756
int wxScintilla::GetMaxLineState() {
757
return SendMsg (SCI_GETMAXLINESTATE, 0, 0);
1045
int wxScintilla::GetMaxLineState() const
1047
return SendMsg(SCI_GETMAXLINESTATE, 0, 0);
760
1050
// Is the background of the line containing the caret in a different colour?
761
bool wxScintilla::GetCaretLineVisible() {
762
return SendMsg (SCI_GETCARETLINEVISIBLE, 0, 0) != 0;
1051
bool wxScintilla::GetCaretLineVisible() const
1053
return SendMsg(SCI_GETCARETLINEVISIBLE, 0, 0) != 0;
765
1056
// Display the background of the line containing the caret in a different colour.
766
void wxScintilla::SetCaretLineVisible (bool show) {
767
SendMsg (SCI_SETCARETLINEVISIBLE, show, 0);
1057
void wxScintilla::SetCaretLineVisible (bool show)
1059
SendMsg(SCI_SETCARETLINEVISIBLE, show, 0);
770
1062
// Get the colour of the background of the line containing the caret.
771
wxColour wxScintilla::GetCaretLineBackground() {
772
long colour = SendMsg (SCI_GETCARETLINEBACK, 0, 0);
773
return wxColourFromLong (colour);
1063
wxColour wxScintilla::GetCaretLineBackground() const
1065
long c = SendMsg(SCI_GETCARETLINEBACK, 0, 0);
1066
return wxColourFromLong(c);
776
1069
// Set the colour of the background of the line containing the caret.
777
void wxScintilla::SetCaretLineBackground (const wxColour& back) {
778
SendMsg (SCI_SETCARETLINEBACK, wxColourAsLong(back), 0);
1070
void wxScintilla::SetCaretLineBackground (const wxColour& back)
1072
SendMsg(SCI_SETCARETLINEBACK, wxColourAsLong(back), 0);
781
1075
// Set a style to be changeable or not (read only).
782
1076
// Experimental feature, currently buggy.
783
void wxScintilla::StyleSetChangeable (int style, bool changeable) {
784
SendMsg (SCI_STYLESETCHANGEABLE, style, changeable);
1077
void wxScintilla::StyleSetChangeable (int style, bool changeable)
1079
SendMsg(SCI_STYLESETCHANGEABLE, style, changeable);
787
1082
// Display a auto-completion list.
788
1083
// The lenEntered parameter indicates how many characters before
789
1084
// the caret should be used to provide context.
790
void wxScintilla::AutoCompShow (int lenEntered, const wxString& itemList) {
791
SendMsg (SCI_AUTOCSHOW, lenEntered, (long)(const char*)wx2sci(itemList));
1085
void wxScintilla::AutoCompShow (int lenEntered, const wxString& itemList)
1087
SendMsg(SCI_AUTOCSHOW, lenEntered, (sptr_t)(const char*)wx2sci(itemList));
794
1090
// Remove the auto-completion list from the screen.
795
void wxScintilla::AutoCompCancel() {
796
SendMsg (SCI_AUTOCCANCEL, 0, 0);
1091
void wxScintilla::AutoCompCancel()
1093
SendMsg(SCI_AUTOCCANCEL, 0, 0);
799
1096
// Is there an auto-completion list visible?
800
bool wxScintilla::AutoCompActive() {
801
return SendMsg (SCI_AUTOCACTIVE, 0, 0) != 0;
1097
bool wxScintilla::AutoCompActive()
1099
return SendMsg(SCI_AUTOCACTIVE, 0, 0) != 0;
804
1102
// Retrieve the position of the caret when the auto-completion list was displayed.
805
int wxScintilla::AutoCompPosStart() {
806
return SendMsg (SCI_AUTOCPOSSTART, 0, 0);
1103
int wxScintilla::AutoCompPosStart()
1105
return SendMsg(SCI_AUTOCPOSSTART, 0, 0);
809
1108
// User has selected an item so remove the list and insert the selection.
810
void wxScintilla::AutoCompComplete() {
811
SendMsg (SCI_AUTOCCOMPLETE, 0, 0);
1109
void wxScintilla::AutoCompComplete()
1111
SendMsg(SCI_AUTOCCOMPLETE, 0, 0);
814
1114
// Define a set of character that when typed cancel the auto-completion list.
815
void wxScintilla::AutoCompStops (const wxString& characterSet) {
816
SendMsg (SCI_AUTOCSTOPS, 0, (long)(const char*)wx2sci(characterSet));
1115
void wxScintilla::AutoCompStops (const wxString& characterSet)
1117
SendMsg(SCI_AUTOCSTOPS, 0, (long)(const char*)wx2sci(characterSet));
819
1120
// Change the separator character in the string setting up an auto-completion list.
820
1121
// Default is space but can be changed if items contain space.
821
void wxScintilla::AutoCompSetSeparator (int separatorCharacter) {
822
SendMsg (SCI_AUTOCSETSEPARATOR, separatorCharacter, 0);
1122
void wxScintilla::AutoCompSetSeparator (int separatorCharacter)
1124
SendMsg(SCI_AUTOCSETSEPARATOR, separatorCharacter, 0);
825
1127
// Retrieve the auto-completion list separator character.
826
int wxScintilla::AutoCompGetSeparator() {
827
return SendMsg (SCI_AUTOCGETSEPARATOR, 0, 0);
1128
int wxScintilla::AutoCompGetSeparator() const
1130
return SendMsg(SCI_AUTOCGETSEPARATOR, 0, 0);
830
1133
// Select the item in the auto-completion list that starts with a string.
831
void wxScintilla::AutoCompSelect (const wxString& text) {
832
SendMsg (SCI_AUTOCSELECT, 0, (long)(const char*)wx2sci(text));
1134
void wxScintilla::AutoCompSelect (const wxString& text)
1136
SendMsg(SCI_AUTOCSELECT, 0, (sptr_t)(const char*)wx2sci(text));
835
1139
// Should the auto-completion list be cancelled if the user backspaces to a
836
1140
// position before where the box was created.
837
void wxScintilla::AutoCompSetCancelAtStart (bool cancel) {
838
SendMsg (SCI_AUTOCSETCANCELATSTART, cancel, 0);
1141
void wxScintilla::AutoCompSetCancelAtStart (bool cancel)
1143
SendMsg(SCI_AUTOCSETCANCELATSTART, cancel, 0);
841
1146
// Retrieve whether auto-completion cancelled by backspacing before start.
842
bool wxScintilla::AutoCompGetCancelAtStart() {
843
return SendMsg (SCI_AUTOCGETCANCELATSTART, 0, 0) != 0;
1147
bool wxScintilla::AutoCompGetCancelAtStart() const
1149
return SendMsg(SCI_AUTOCGETCANCELATSTART, 0, 0) != 0;
846
1152
// Define a set of characters that when typed will cause the autocompletion to
847
1153
// choose the selected item.
848
void wxScintilla::AutoCompSetFillUps (const wxString& characterSet) {
849
SendMsg (SCI_AUTOCSETFILLUPS, 0, (long)(const char*)wx2sci(characterSet));
1154
void wxScintilla::AutoCompSetFillUps (const wxString& characterSet)
1156
SendMsg(SCI_AUTOCSETFILLUPS, 0, (sptr_t)(const char*)wx2sci(characterSet));
852
1159
// Should a single item auto-completion list automatically choose the item.
853
void wxScintilla::AutoCompSetChooseSingle (bool chooseSingle) {
854
SendMsg (SCI_AUTOCSETCHOOSESINGLE, chooseSingle, 0);
1160
void wxScintilla::AutoCompSetChooseSingle (bool chooseSingle)
1162
SendMsg(SCI_AUTOCSETCHOOSESINGLE, chooseSingle, 0);
857
1165
// Retrieve whether a single item auto-completion list automatically choose the item.
858
bool wxScintilla::AutoCompGetChooseSingle() {
859
return SendMsg (SCI_AUTOCGETCHOOSESINGLE, 0, 0) != 0;
1166
bool wxScintilla::AutoCompGetChooseSingle() const
1168
return SendMsg(SCI_AUTOCGETCHOOSESINGLE, 0, 0) != 0;
862
1171
// Set whether case is significant when performing auto-completion searches.
863
void wxScintilla::AutoCompSetIgnoreCase (bool ignoreCase) {
864
SendMsg (SCI_AUTOCSETIGNORECASE, ignoreCase, 0);
1172
void wxScintilla::AutoCompSetIgnoreCase (bool ignoreCase)
1174
SendMsg(SCI_AUTOCSETIGNORECASE, ignoreCase, 0);
867
1177
// Retrieve state of ignore case flag.
868
bool wxScintilla::AutoCompGetIgnoreCase() {
869
return SendMsg (SCI_AUTOCGETIGNORECASE, 0, 0) != 0;
1178
bool wxScintilla::AutoCompGetIgnoreCase() const
1180
return SendMsg(SCI_AUTOCGETIGNORECASE, 0, 0) != 0;
872
1183
// Display a list of strings and send notification when user chooses one.
873
void wxScintilla::UserListShow (int listType, const wxString& itemList) {
874
SendMsg (SCI_USERLISTSHOW, listType, (long)(const char*)wx2sci(itemList));
1184
void wxScintilla::UserListShow (int listType, const wxString& itemList)
1186
SendMsg(SCI_USERLISTSHOW, listType, (sptr_t)(const char*)wx2sci(itemList));
877
1189
// Set whether or not autocompletion is hidden automatically when nothing matches.
878
void wxScintilla::AutoCompSetAutoHide (bool autoHide) {
879
SendMsg (SCI_AUTOCSETAUTOHIDE, autoHide, 0);
1190
void wxScintilla::AutoCompSetAutoHide (bool autoHide)
1192
SendMsg(SCI_AUTOCSETAUTOHIDE, autoHide, 0);
882
1195
// Retrieve whether or not autocompletion is hidden automatically when nothing matches.
883
bool wxScintilla::AutoCompGetAutoHide() {
884
return SendMsg (SCI_AUTOCGETAUTOHIDE, 0, 0) != 0;
1196
bool wxScintilla::AutoCompGetAutoHide() const
1198
return SendMsg(SCI_AUTOCGETAUTOHIDE, 0, 0) != 0;
887
1201
// Set whether or not autocompletion deletes any word characters
888
1202
// after the inserted text upon completion.
889
void wxScintilla::AutoCompSetDropRestOfWord (bool dropRestOfWord) {
890
SendMsg (SCI_AUTOCSETDROPRESTOFWORD, dropRestOfWord, 0);
1203
void wxScintilla::AutoCompSetDropRestOfWord (bool dropRestOfWord)
1205
SendMsg(SCI_AUTOCSETDROPRESTOFWORD, dropRestOfWord, 0);
893
1208
// Retrieve whether or not autocompletion deletes any word characters
894
1209
// after the inserted text upon completion.
895
bool wxScintilla::AutoCompGetDropRestOfWord() {
896
return SendMsg (SCI_AUTOCGETDROPRESTOFWORD, 0, 0) != 0;
1210
bool wxScintilla::AutoCompGetDropRestOfWord() const
1212
return SendMsg(SCI_AUTOCGETDROPRESTOFWORD, 0, 0) != 0;
899
1215
// Register an image for use in autocompletion lists.
900
void wxScintilla::RegisterImage (int type, const wxBitmap& bmp) {
901
// convert bmp to a xpm in a string
902
wxMemoryOutputStream strm;
903
wxImage img = bmp.ConvertToImage();
904
#if wxCHECK_VERSION(2, 5, 0)
905
if (img.HasAlpha()) img.ConvertAlphaToMask();
907
img.SaveFile(strm, wxBITMAP_TYPE_XPM);
908
size_t len = strm.GetSize();
909
char* buff = new char[len+1];
910
strm.CopyTo(buff, len);
912
SendMsg(SCI_REGISTERIMAGE, type, (long)buff);
1216
void wxScintilla::RegisterImage (int type, const wxBitmap& bmp)
1218
// convert bmp to a xpm in a string
1219
wxMemoryOutputStream strm;
1220
wxImage img = bmp.ConvertToImage();
1222
img.ConvertAlphaToMask();
1223
img.SaveFile(strm, wxBITMAP_TYPE_XPM);
1224
size_t len = strm.GetSize();
1225
char* buff = new char[len+1];
1226
strm.CopyTo(buff, len);
1228
SendMsg(SCI_REGISTERIMAGE, type, (sptr_t)buff);
916
1233
// Clear all the registered images.
917
void wxScintilla::ClearRegisteredImages() {
918
SendMsg (SCI_CLEARREGISTEREDIMAGES, 0, 0);
1234
void wxScintilla::ClearRegisteredImages()
1236
SendMsg(SCI_CLEARREGISTEREDIMAGES, 0, 0);
921
1239
// Retrieve the auto-completion list type-separator character.
922
int wxScintilla::AutoCompGetTypeSeparator() {
923
return SendMsg (SCI_AUTOCGETTYPESEPARATOR, 0, 0);
1240
int wxScintilla::AutoCompGetTypeSeparator() const
1242
return SendMsg(SCI_AUTOCGETTYPESEPARATOR, 0, 0);
926
1245
// Change the type-separator character in the string setting up an auto-completion list.
927
1246
// Default is '?' but can be changed if items contain '?'.
928
void wxScintilla::AutoCompSetTypeSeparator (int separatorCharacter) {
929
SendMsg (SCI_AUTOCSETTYPESEPARATOR, separatorCharacter, 0);
1247
void wxScintilla::AutoCompSetTypeSeparator (int separatorCharacter)
1249
SendMsg(SCI_AUTOCSETTYPESEPARATOR, separatorCharacter, 0);
932
1252
// Set the maximum width, in characters, of auto-completion and user lists.
933
1253
// Set to 0 to autosize to fit longest item, which is the default.
934
void wxScintilla::AutoCompSetMaxWidth (int characterCount) {
935
SendMsg (SCI_AUTOCSETMAXWIDTH, characterCount, 0);
1254
void wxScintilla::AutoCompSetMaxWidth (int characterCount)
1256
SendMsg(SCI_AUTOCSETMAXWIDTH, characterCount, 0);
938
1259
// Get the maximum width, in characters, of auto-completion and user lists.
939
int wxScintilla::AutoCompGetMaxWidth() {
940
return SendMsg (SCI_AUTOCGETMAXWIDTH, 0, 0);
1260
int wxScintilla::AutoCompGetMaxWidth() const
1262
return SendMsg(SCI_AUTOCGETMAXWIDTH, 0, 0);
943
1265
// Set the maximum height, in rows, of auto-completion and user lists.
944
1266
// The default is 5 rows.
945
void wxScintilla::AutoCompSetMaxHeight (int rowCount) {
946
SendMsg (SCI_AUTOCSETMAXHEIGHT, rowCount, 0);
1267
void wxScintilla::AutoCompSetMaxHeight (int rowCount)
1269
SendMsg(SCI_AUTOCSETMAXHEIGHT, rowCount, 0);
949
1272
// Set the maximum height, in rows, of auto-completion and user lists.
950
int wxScintilla::AutoCompGetMaxHeight() {
951
return SendMsg (SCI_AUTOCGETMAXHEIGHT, 0, 0);
1273
int wxScintilla::AutoCompGetMaxHeight() const
1275
return SendMsg(SCI_AUTOCGETMAXHEIGHT, 0, 0);
954
1278
// Set the number of spaces used for one level of indentation.
955
void wxScintilla::SetIndent (int indentSize) {
956
SendMsg (SCI_SETINDENT, indentSize, 0);
1279
void wxScintilla::SetIndent (int indentSize)
1281
SendMsg(SCI_SETINDENT, indentSize, 0);
959
1284
// Retrieve indentation size.
960
int wxScintilla::GetIndent() {
961
return SendMsg (SCI_GETINDENT, 0, 0);
1285
int wxScintilla::GetIndent() const
1287
return SendMsg(SCI_GETINDENT, 0, 0);
964
1290
// Indentation will only use space characters if useTabs is false, otherwise
965
1291
// it will use a combination of tabs and spaces.
966
void wxScintilla::SetUseTabs (bool useTabs) {
967
SendMsg (SCI_SETUSETABS, useTabs, 0);
1292
void wxScintilla::SetUseTabs (bool useTabs)
1294
SendMsg(SCI_SETUSETABS, useTabs, 0);
970
1297
// Retrieve whether tabs will be used in indentation.
971
bool wxScintilla::GetUseTabs() {
972
return SendMsg (SCI_GETUSETABS, 0, 0) != 0;
1298
bool wxScintilla::GetUseTabs() const
1300
return SendMsg(SCI_GETUSETABS, 0, 0) != 0;
975
1303
// Change the indentation of a line to a number of columns.
976
void wxScintilla::SetLineIndentation (int line, int indentSize) {
977
SendMsg (SCI_SETLINEINDENTATION, line, indentSize);
1304
void wxScintilla::SetLineIndentation (int line, int indentSize)
1306
SendMsg(SCI_SETLINEINDENTATION, line, indentSize);
980
1309
// Retrieve the number of columns that a line is indented.
981
int wxScintilla::GetLineIndentation (int line) {
982
return SendMsg (SCI_GETLINEINDENTATION, line, 0);
1310
int wxScintilla::GetLineIndentation (int line) const
1312
return SendMsg(SCI_GETLINEINDENTATION, line, 0);
985
1315
// Retrieve the position before the first non indentation character on a line.
986
int wxScintilla::GetLineIndentPosition (int line) {
987
return SendMsg (SCI_GETLINEINDENTPOSITION, line, 0);
1316
int wxScintilla::GetLineIndentPosition (int line) const
1318
return SendMsg(SCI_GETLINEINDENTPOSITION, line, 0);
990
1321
// Retrieve the column number of a position, taking tab width into account.
991
int wxScintilla::GetColumn (int pos) {
992
return SendMsg (SCI_GETCOLUMN, pos, 0);
1322
int wxScintilla::GetColumn (int pos) const
1324
return SendMsg(SCI_GETCOLUMN, pos, 0);
995
1327
// Show or hide the horizontal scroll bar.
996
void wxScintilla::SetUseHorizontalScrollBar (bool show) {
997
SendMsg (SCI_SETHSCROLLBAR, show, 0);
1328
void wxScintilla::SetUseHorizontalScrollBar (bool show)
1330
SendMsg(SCI_SETHSCROLLBAR, show, 0);
1000
1333
// Is the horizontal scroll bar visible?
1001
bool wxScintilla::GetUseHorizontalScrollBar() {
1002
return SendMsg (SCI_GETHSCROLLBAR, 0, 0) != 0;
1334
bool wxScintilla::GetUseHorizontalScrollBar() const
1336
return SendMsg(SCI_GETHSCROLLBAR, 0, 0) != 0;
1005
1339
// Show or hide indentation guides.
1006
void wxScintilla::SetIndentationGuides (bool show) {
1007
SendMsg (SCI_SETINDENTATIONGUIDES, show, 0);
1340
void wxScintilla::SetIndentationGuides (int indentView)
1342
SendMsg(SCI_SETINDENTATIONGUIDES, indentView, 0);
1010
1345
// Are the indentation guides visible?
1011
bool wxScintilla::GetIndentationGuides() {
1012
return SendMsg (SCI_GETINDENTATIONGUIDES, 0, 0) != 0;
1346
int wxScintilla::GetIndentationGuides() const
1348
return SendMsg(SCI_GETINDENTATIONGUIDES, 0, 0);
1015
1351
// Set the highlighted indentation guide column.
1016
1352
// 0 = no highlighted guide.
1017
void wxScintilla::SetHighlightGuide (int column) {
1018
SendMsg (SCI_SETHIGHLIGHTGUIDE, column, 0);
1353
void wxScintilla::SetHighlightGuide (int column)
1355
SendMsg(SCI_SETHIGHLIGHTGUIDE, column, 0);
1021
1358
// Get the highlighted indentation guide column.
1022
int wxScintilla::GetHighlightGuide() {
1023
return SendMsg (SCI_GETHIGHLIGHTGUIDE, 0, 0);
1359
int wxScintilla::GetHighlightGuide() const
1361
return SendMsg(SCI_GETHIGHLIGHTGUIDE, 0, 0);
1026
1364
// Get the position after the last visible characters on a line.
1027
int wxScintilla::GetLineEndPosition (int line) {
1028
return SendMsg (SCI_GETLINEENDPOSITION, line, 0);
1365
int wxScintilla::GetLineEndPosition (int line) const
1367
return SendMsg(SCI_GETLINEENDPOSITION, line, 0);
1031
1370
// Get the code page used to interpret the bytes of the document as characters.
1032
int wxScintilla::GetCodePage() {
1033
return SendMsg (SCI_GETCODEPAGE, 0, 0);
1371
int wxScintilla::GetCodePage() const
1373
return SendMsg(SCI_GETCODEPAGE, 0, 0);
1036
1376
// Get the foreground colour of the caret.
1037
wxColour wxScintilla::GetCaretForeground() {
1038
long colour = SendMsg (SCI_GETCARETFORE, 0, 0);
1039
return wxColourFromLong(colour);
1377
wxColour wxScintilla::GetCaretForeground() const
1379
long c = SendMsg(SCI_GETCARETFORE, 0, 0);
1380
return wxColourFromLong(c);
1042
1383
// Get use palette (SCI_GETUSEPALETTE) not supported
1044
1385
// In read-only mode?
1045
bool wxScintilla::GetReadOnly() {
1046
return SendMsg (SCI_GETREADONLY, 0, 0) != 0;
1386
bool wxScintilla::GetReadOnly() const
1388
return SendMsg(SCI_GETREADONLY, 0, 0) != 0;
1049
1391
// Sets the position of the caret.
1050
void wxScintilla::SetCurrentPos (int pos) {
1051
SendMsg (SCI_SETCURRENTPOS, pos, 0);
1392
void wxScintilla::SetCurrentPos (int pos)
1394
SendMsg(SCI_SETCURRENTPOS, pos, 0);
1054
1397
// Sets the position that starts the selection - this becomes the anchor.
1055
void wxScintilla::SetSelectionStart (int pos) {
1056
SendMsg (SCI_SETSELECTIONSTART, pos, 0);
1398
void wxScintilla::SetSelectionStart(int pos)
1400
SendMsg(SCI_SETSELECTIONSTART, pos, 0);
1059
1403
// Returns the position at the start of the selection.
1060
int wxScintilla::GetSelectionStart() {
1061
return SendMsg (SCI_GETSELECTIONSTART, 0, 0);
1404
int wxScintilla::GetSelectionStart() const
1406
return SendMsg(SCI_GETSELECTIONSTART, 0, 0);
1064
1409
// Sets the position that ends the selection - this becomes the currentPosition.
1065
void wxScintilla::SetSelectionEnd (int pos) {
1066
SendMsg (SCI_SETSELECTIONEND, pos, 0);
1410
void wxScintilla::SetSelectionEnd(int pos)
1412
SendMsg(SCI_SETSELECTIONEND, pos, 0);
1069
1415
// Returns the position at the end of the selection.
1070
int wxScintilla::GetSelectionEnd() {
1071
return SendMsg (SCI_GETSELECTIONEND, 0, 0);
1416
int wxScintilla::GetSelectionEnd() const
1418
return SendMsg(SCI_GETSELECTIONEND, 0, 0);
1074
1421
// Sets the print magnification added to the point size of each style for printing.
1075
void wxScintilla::SetPrintMagnification (int magnification) {
1076
SendMsg (SCI_SETPRINTMAGNIFICATION, magnification, 0);
1422
void wxScintilla::SetPrintMagnification (int magnification)
1424
SendMsg(SCI_SETPRINTMAGNIFICATION, magnification, 0);
1079
1427
// Returns the print magnification.
1080
int wxScintilla::GetPrintMagnification() {
1081
return SendMsg (SCI_GETPRINTMAGNIFICATION, 0, 0);
1428
int wxScintilla::GetPrintMagnification() const
1430
return SendMsg(SCI_GETPRINTMAGNIFICATION, 0, 0);
1084
1433
// Modify colours when printing for clearer printed text.
1085
void wxScintilla::SetPrintColourMode (int mode) {
1086
SendMsg (SCI_SETPRINTCOLOURMODE, mode, 0);
1434
void wxScintilla::SetPrintColourMode (int mode)
1436
SendMsg(SCI_SETPRINTCOLOURMODE, mode, 0);
1089
1439
// Returns the print colour mode.
1090
int wxScintilla::GetPrintColourMode() {
1091
return SendMsg (SCI_GETPRINTCOLOURMODE, 0, 0);
1440
int wxScintilla::GetPrintColourMode() const
1442
return SendMsg(SCI_GETPRINTCOLOURMODE, 0, 0);
1094
1445
// Find some text in the document.
1095
int wxScintilla::FindText (int minPos, int maxPos, const wxString& text, int flags, int* lengthFound) {
1446
int wxScintilla::FindText (int minPos, int maxPos,
1447
const wxString& text,
1097
1452
ft.chrg.cpMin = minPos;
1098
1453
ft.chrg.cpMax = maxPos;
1099
1454
wxWX2MBbuf buf = (wxWX2MBbuf)wx2sci(text);
1100
1455
ft.lpstrText = (char*)(const char*)buf;
1101
int ret = SendMsg (SCI_FINDTEXT, flags, (long)&ft);
1102
if (lengthFound) *lengthFound = ft.chrgText.cpMax - ft.chrgText.cpMin;
1457
int ret = SendMsg(SCI_FINDTEXT, flags, (sptr_t)&ft);
1459
*lengthFound = ft.chrgText.cpMax - ft.chrgText.cpMin;
1106
1464
// On Windows, will draw the document into a display context such as a printer.
1107
int wxScintilla::FormatRange (bool doDraw, int startPos, int endPos,
1108
wxDC* draw, wxDC* target, wxRect renderRect, wxRect pageRect) {
1465
int wxScintilla::FormatRange (bool doDraw,
1109
1473
RangeToFormat fr;
1110
1475
if (endPos < startPos) {
1111
int temp = startPos;
1476
int temp = startPos;
1116
1481
fr.hdcTarget = target;
1374
1778
// matched in the last search operation which were surrounded by \( and \).
1375
1779
// Returns the length of the replacement text including any change
1376
1780
// caused by processing the \d patterns.
1377
int wxScintilla::ReplaceTargetRE (const wxString& text) {
1782
int wxScintilla::ReplaceTargetRE (const wxString& text)
1378
1784
wxWX2MBbuf buf = (wxWX2MBbuf)wx2sci(text);
1379
return SendMsg (SCI_REPLACETARGETRE, strlen(buf), (long)(const char*)buf);
1785
return SendMsg(SCI_REPLACETARGETRE, strlen(buf), (sptr_t)(const char*)buf);
1382
1788
// Search for a counted string in the target and set the target to the found
1383
1789
// range. Text is counted so it can contain NULs.
1384
1790
// Returns length of range or -1 for failure in which case target is not moved.
1385
int wxScintilla::SearchInTarget (const wxString& text) {
1792
int wxScintilla::SearchInTarget (const wxString& text)
1386
1794
wxWX2MBbuf buf = (wxWX2MBbuf)wx2sci(text);
1387
return SendMsg (SCI_SEARCHINTARGET, strlen(buf), (long)(const char*)buf);
1795
return SendMsg(SCI_SEARCHINTARGET, strlen(buf), (sptr_t)(const char*)buf);
1390
1798
// Set the search flags used by SearchInTarget.
1391
void wxScintilla::SetSearchFlags (int flags) {
1392
SendMsg (SCI_SETSEARCHFLAGS, flags, 0);
1799
void wxScintilla::SetSearchFlags (int flags)
1801
SendMsg(SCI_SETSEARCHFLAGS, flags, 0);
1395
1804
// Get the search flags used by SearchInTarget.
1396
int wxScintilla::GetSearchFlags() {
1397
return SendMsg (SCI_GETSEARCHFLAGS, 0, 0);
1805
int wxScintilla::GetSearchFlags() const
1807
return SendMsg(SCI_GETSEARCHFLAGS, 0, 0);
1400
1810
// Show a call tip containing a definition near position pos.
1401
void wxScintilla::CallTipShow (int pos, const wxString& definition) {
1402
SendMsg (SCI_CALLTIPSHOW, pos, (long)(const char*)wx2sci(definition));
1811
void wxScintilla::CallTipShow (int pos, const wxString& definition)
1813
SendMsg(SCI_CALLTIPSHOW, pos, (long)(const char*)wx2sci(definition));
1405
1816
// Remove the call tip from the screen.
1406
void wxScintilla::CallTipCancel() {
1407
SendMsg (SCI_CALLTIPCANCEL, 0, 0);
1817
void wxScintilla::CallTipCancel()
1819
SendMsg(SCI_CALLTIPCANCEL, 0, 0);
1410
1822
// Is there an active call tip?
1411
bool wxScintilla::CallTipActive() {
1412
return SendMsg (SCI_CALLTIPACTIVE, 0, 0) != 0;
1823
bool wxScintilla::CallTipActive()
1825
return SendMsg(SCI_CALLTIPACTIVE, 0, 0) != 0;
1415
1828
// Retrieve the position where the caret was before displaying the call tip.
1416
int wxScintilla::CallTipPosAtStart() {
1417
return SendMsg (SCI_CALLTIPPOSSTART, 0, 0);
1829
int wxScintilla::CallTipPosAtStart()
1831
return SendMsg(SCI_CALLTIPPOSSTART, 0, 0);
1420
1834
// Highlight a segment of the definition.
1421
void wxScintilla::CallTipSetHighlight (int startPos, int endPos) {
1422
SendMsg (SCI_CALLTIPSETHLT, startPos, endPos);
1835
void wxScintilla::CallTipSetHighlight (int start, int end)
1837
SendMsg(SCI_CALLTIPSETHLT, start, end);
1425
1840
// Set the background colour for the call tip.
1426
void wxScintilla::CallTipSetBackground (const wxColour& back) {
1427
SendMsg (SCI_CALLTIPSETBACK, wxColourAsLong(back), 0);
1841
void wxScintilla::CallTipSetBackground (const wxColour& back)
1843
SendMsg(SCI_CALLTIPSETBACK, wxColourAsLong(back), 0);
1430
1846
// Set the foreground colour for the call tip.
1431
void wxScintilla::CallTipSetForeground (const wxColour& fore) {
1432
SendMsg (SCI_CALLTIPSETFORE, wxColourAsLong(fore), 0);
1847
void wxScintilla::CallTipSetForeground (const wxColour& fore)
1849
SendMsg(SCI_CALLTIPSETFORE, wxColourAsLong(fore), 0);
1435
1852
// Set the foreground colour for the highlighted part of the call tip.
1436
void wxScintilla::CallTipSetForegroundHighlight (const wxColour& fore) {
1437
SendMsg (SCI_CALLTIPSETFOREHLT, wxColourAsLong(fore), 0);
1853
void wxScintilla::CallTipSetForegroundHighlight (const wxColour& fore)
1855
SendMsg(SCI_CALLTIPSETFOREHLT, wxColourAsLong(fore), 0);
1858
// Enable use of STYLE_CALLTIP and set call tip tab size in pixels.
1859
void wxScintilla::CallTipUseStyle (int tabSize)
1861
SendMsg(SCI_CALLTIPUSESTYLE, tabSize, 0);
1440
1864
// Find the display line of a document line taking hidden lines into account.
1441
int wxScintilla::VisibleFromDocLine (int line) {
1442
return SendMsg (SCI_VISIBLEFROMDOCLINE, line, 0);
1865
int wxScintilla::VisibleFromDocLine (int line)
1867
return SendMsg(SCI_VISIBLEFROMDOCLINE, line, 0);
1445
1870
// Find the document line of a display line taking hidden lines into account.
1446
int wxScintilla::DocLineFromVisible (int lineDisplay) {
1447
return SendMsg (SCI_DOCLINEFROMVISIBLE, lineDisplay, 0);
1871
int wxScintilla::DocLineFromVisible (int lineDisplay)
1873
return SendMsg(SCI_DOCLINEFROMVISIBLE, lineDisplay, 0);
1450
1876
// The number of display lines needed to wrap a document line
1451
int wxScintilla::WrapCount (int line) {
1452
return SendMsg (SCI_WRAPCOUNT, line, 0);
1877
int wxScintilla::WrapCount (int line)
1879
return SendMsg(SCI_WRAPCOUNT, line, 0);
1455
1882
// Set the fold level of a line.
1456
1883
// This encodes an integer level along with flags indicating whether the
1457
1884
// line is a header and whether it is effectively white space.
1458
void wxScintilla::SetFoldLevel (int line, int level) {
1459
SendMsg (SCI_SETFOLDLEVEL, line, level);
1885
void wxScintilla::SetFoldLevel (int line, int level)
1887
SendMsg(SCI_SETFOLDLEVEL, line, level);
1462
1890
// Retrieve the fold level of a line.
1463
int wxScintilla::GetFoldLevel (int line) {
1464
return SendMsg (SCI_GETFOLDLEVEL, line, 0);
1891
int wxScintilla::GetFoldLevel (int line) const
1893
return SendMsg(SCI_GETFOLDLEVEL, line, 0);
1467
1896
// Find the last child line of a header line.
1468
int wxScintilla::GetLastChild (int line, int level) {
1469
return SendMsg (SCI_GETLASTCHILD, line, level);
1897
int wxScintilla::GetLastChild (int line, int level) const
1899
return SendMsg(SCI_GETLASTCHILD, line, level);
1472
1902
// Find the parent line of a child line.
1473
int wxScintilla::GetFoldParent (int line) {
1474
return SendMsg (SCI_GETFOLDPARENT, line, 0);
1903
int wxScintilla::GetFoldParent (int line) const
1905
return SendMsg(SCI_GETFOLDPARENT, line, 0);
1477
1908
// Make a range of lines visible.
1478
void wxScintilla::ShowLines (int lineStart, int lineEnd) {
1479
SendMsg (SCI_SHOWLINES, lineStart, lineEnd);
1909
void wxScintilla::ShowLines (int lineStart, int lineEnd)
1911
SendMsg(SCI_SHOWLINES, lineStart, lineEnd);
1482
1914
// Make a range of lines invisible.
1483
void wxScintilla::HideLines (int lineStart, int lineEnd) {
1484
SendMsg (SCI_HIDELINES, lineStart, lineEnd);
1915
void wxScintilla::HideLines (int lineStart, int lineEnd)
1917
SendMsg(SCI_HIDELINES, lineStart, lineEnd);
1487
1920
// Is a line visible?
1488
bool wxScintilla::GetLineVisible (int line) {
1489
return SendMsg (SCI_GETLINEVISIBLE, line, 0) != 0;
1921
bool wxScintilla::GetLineVisible (int line) const
1923
return SendMsg(SCI_GETLINEVISIBLE, line, 0) != 0;
1492
1926
// Show the children of a header line.
1493
void wxScintilla::SetFoldExpanded (int line, bool expanded) {
1494
SendMsg (SCI_SETFOLDEXPANDED, line, expanded);
1927
void wxScintilla::SetFoldExpanded (int line, bool expanded)
1929
SendMsg(SCI_SETFOLDEXPANDED, line, expanded);
1497
1932
// Is a header line expanded?
1498
bool wxScintilla::GetFoldExpanded (int line) {
1499
return SendMsg (SCI_GETFOLDEXPANDED, line, 0) != 0;
1933
bool wxScintilla::GetFoldExpanded (int line) const
1935
return SendMsg(SCI_GETFOLDEXPANDED, line, 0) != 0;
1502
1938
// Switch a header line between expanded and contracted.
1503
void wxScintilla::ToggleFold (int line) {
1504
SendMsg (SCI_TOGGLEFOLD, line, 0);
1939
void wxScintilla::ToggleFold (int line)
1941
SendMsg(SCI_TOGGLEFOLD, line, 0);
1507
1944
// Ensure a particular line is visible by expanding any header line hiding it.
1508
void wxScintilla::EnsureVisible (int line) {
1509
SendMsg (SCI_ENSUREVISIBLE, line, 0);
1945
void wxScintilla::EnsureVisible (int line)
1947
SendMsg(SCI_ENSUREVISIBLE, line, 0);
1512
1950
// Set some style options for folding.
1513
void wxScintilla::SetFoldFlags (int flags) {
1951
void wxScintilla::SetFoldFlags (int flags)
1514
1953
SendMsg(SCI_SETFOLDFLAGS, flags, 0);
1517
1956
// Ensure a particular line is visible by expanding any header line hiding it.
1518
1957
// Use the currently set visibility policy to determine which range to display.
1519
void wxScintilla::EnsureVisibleEnforcePolicy (int line) {
1520
SendMsg (SCI_ENSUREVISIBLEENFORCEPOLICY, line, 0);
1958
void wxScintilla::EnsureVisibleEnforcePolicy (int line)
1960
SendMsg(SCI_ENSUREVISIBLEENFORCEPOLICY, line, 0);
1523
1963
// Sets whether a tab pressed when caret is within indentation indents.
1524
void wxScintilla::SetTabIndents (bool tabIndents) {
1525
SendMsg (SCI_SETTABINDENTS, tabIndents, 0);
1964
void wxScintilla::SetTabIndents (bool tabIndents)
1966
SendMsg(SCI_SETTABINDENTS, tabIndents, 0);
1528
1969
// Does a tab pressed when caret is within indentation indent?
1529
bool wxScintilla::GetTabIndents() {
1530
return SendMsg (SCI_GETTABINDENTS, 0, 0) != 0;
1970
bool wxScintilla::GetTabIndents() const
1972
return SendMsg(SCI_GETTABINDENTS, 0, 0) != 0;
1533
1975
// Sets whether a backspace pressed when caret is within indentation unindents.
1534
void wxScintilla::SetBackSpaceUnIndents (bool bsUnIndents) {
1535
SendMsg (SCI_SETBACKSPACEUNINDENTS, bsUnIndents, 0);
1976
void wxScintilla::SetBackSpaceUnIndents (bool bsUnIndents)
1978
SendMsg(SCI_SETBACKSPACEUNINDENTS, bsUnIndents, 0);
1538
1981
// Does a backspace pressed when caret is within indentation unindent?
1539
bool wxScintilla::GetBackSpaceUnIndents() {
1540
return SendMsg (SCI_GETBACKSPACEUNINDENTS, 0, 0) != 0;
1982
bool wxScintilla::GetBackSpaceUnIndents() const
1984
return SendMsg(SCI_GETBACKSPACEUNINDENTS, 0, 0) != 0;
1543
1987
// Sets the time the mouse must sit still to generate a mouse dwell event.
1544
void wxScintilla::SetMouseDwellTime (int periodMilliseconds) {
1545
SendMsg (SCI_SETMOUSEDWELLTIME, periodMilliseconds, 0);
1988
void wxScintilla::SetMouseDwellTime (int periodMilliseconds)
1990
SendMsg(SCI_SETMOUSEDWELLTIME, periodMilliseconds, 0);
1548
1993
// Retrieve the time the mouse must sit still to generate a mouse dwell event.
1549
int wxScintilla::GetMouseDwellTime() {
1550
return SendMsg (SCI_GETMOUSEDWELLTIME, 0, 0);
1994
int wxScintilla::GetMouseDwellTime() const
1996
return SendMsg(SCI_GETMOUSEDWELLTIME, 0, 0);
1553
1999
// Get position of start of word.
1554
int wxScintilla::WordStartPosition (int pos, bool onlyWordCharacters) {
1555
return SendMsg (SCI_WORDSTARTPOSITION, pos, onlyWordCharacters);
2000
int wxScintilla::WordStartPosition (int pos, bool onlyWordCharacters)
2002
return SendMsg(SCI_WORDSTARTPOSITION, pos, onlyWordCharacters);
1558
2005
// Get position of end of word.
1559
int wxScintilla::WordEndPosition (int pos, bool onlyWordCharacters) {
1560
return SendMsg (SCI_WORDENDPOSITION, pos, onlyWordCharacters);
2006
int wxScintilla::WordEndPosition (int pos, bool onlyWordCharacters)
2008
return SendMsg(SCI_WORDENDPOSITION, pos, onlyWordCharacters);
1563
2011
// Sets whether text is word wrapped.
1564
void wxScintilla::SetWrapMode (int mode) {
1565
SendMsg (SCI_SETWRAPMODE, mode, 0);
2012
void wxScintilla::SetWrapMode (int mode)
2014
SendMsg(SCI_SETWRAPMODE, mode, 0);
1568
2017
// Retrieve whether text is word wrapped.
1569
int wxScintilla::GetWrapMode() {
1570
return SendMsg (SCI_GETWRAPMODE, 0, 0);
2018
int wxScintilla::GetWrapMode() const
2020
return SendMsg(SCI_GETWRAPMODE, 0, 0);
1573
2023
// Set the display mode of visual flags for wrapped lines.
1574
void wxScintilla::SetWrapVisualFlags (int wrapVisualFlags) {
1575
SendMsg (SCI_SETWRAPVISUALFLAGS, wrapVisualFlags, 0);
2024
void wxScintilla::SetWrapVisualFlags (int wrapVisualFlags)
2026
SendMsg(SCI_SETWRAPVISUALFLAGS, wrapVisualFlags, 0);
1578
2029
// Retrive the display mode of visual flags for wrapped lines.
1579
int wxScintilla::GetWrapVisualFlags() {
1580
return SendMsg (SCI_GETWRAPVISUALFLAGS, 0, 0);
2030
int wxScintilla::GetWrapVisualFlags() const
2032
return SendMsg(SCI_GETWRAPVISUALFLAGS, 0, 0);
1583
2035
// Set the location of visual flags for wrapped lines.
1584
void wxScintilla::SetWrapVisualFlagsLocation (int wrapVisualFlagsLocation) {
1585
SendMsg (SCI_SETWRAPVISUALFLAGSLOCATION, wrapVisualFlagsLocation, 0);
2036
void wxScintilla::SetWrapVisualFlagsLocation (int wrapVisualFlagsLocation)
2038
SendMsg(SCI_SETWRAPVISUALFLAGSLOCATION, wrapVisualFlagsLocation, 0);
1588
2041
// Retrive the location of visual flags for wrapped lines.
1589
int wxScintilla::GetWrapVisualFlagsLocation() {
1590
return SendMsg (SCI_GETWRAPVISUALFLAGSLOCATION, 0, 0);
2042
int wxScintilla::GetWrapVisualFlagsLocation() const
2044
return SendMsg(SCI_GETWRAPVISUALFLAGSLOCATION, 0, 0);
1593
2047
// Set the start indent for wrapped lines.
1594
void wxScintilla::SetWrapStartIndent (int indent) {
1595
SendMsg (SCI_SETWRAPSTARTINDENT, indent, 0);
2048
void wxScintilla::SetWrapStartIndent (int indent)
2050
SendMsg(SCI_SETWRAPSTARTINDENT, indent, 0);
1598
2053
// Retrive the start indent for wrapped lines.
1599
int wxScintilla::GetWrapStartIndent() {
1600
return SendMsg (SCI_GETWRAPSTARTINDENT, 0, 0);
2054
int wxScintilla::GetWrapStartIndent() const
2056
return SendMsg(SCI_GETWRAPSTARTINDENT, 0, 0);
2059
// Sets how wrapped sublines are placed. Default is fixed.
2060
void wxScintilla::SetWrapIndentMode(int mode)
2062
SendMsg(SCI_SETWRAPINDENTMODE, mode, 0);
2065
// Retrieve how wrapped sublines are placed. Default is fixed.
2066
int wxScintilla::GetWrapIndentMode() const
2068
return SendMsg(SCI_GETWRAPINDENTMODE, 0, 0);
1603
2071
// Sets the degree of caching of layout information.
1604
void wxScintilla::SetLayoutCache (int mode) {
1605
SendMsg (SCI_SETLAYOUTCACHE, mode, 0);
2072
void wxScintilla::SetLayoutCache (int mode)
2074
SendMsg(SCI_SETLAYOUTCACHE, mode, 0);
1608
2077
// Retrieve the degree of caching of layout information.
1609
int wxScintilla::GetLayoutCache() {
1610
return SendMsg (SCI_GETLAYOUTCACHE, 0, 0);
2078
int wxScintilla::GetLayoutCache() const
2080
return SendMsg(SCI_GETLAYOUTCACHE, 0, 0);
1613
2083
// Sets the document width assumed for scrolling.
1614
void wxScintilla::SetScrollWidth (int pixels) {
1615
SendMsg (SCI_SETSCROLLWIDTH, pixels, 0);
2084
void wxScintilla::SetScrollWidth (int pixelWidth)
2086
SendMsg(SCI_SETSCROLLWIDTH, pixelWidth, 0);
1618
2089
// Retrieve the document width assumed for scrolling.
1619
int wxScintilla::GetScrollWidth() {
1620
return SendMsg (SCI_GETSCROLLWIDTH, 0, 0);
2090
int wxScintilla::GetScrollWidth() const
2092
return SendMsg(SCI_GETSCROLLWIDTH, 0, 0);
2095
// Sets whether the maximum width line displayed is used to set scroll width.
2096
void wxScintilla::SetScrollWidthTracking(bool tracking)
2098
SendMsg(SCI_SETSCROLLWIDTHTRACKING, tracking, 0);
2101
// Retrieve whether the scroll width tracks wide lines.
2102
bool wxScintilla::GetScrollWidthTracking() const
2104
return SendMsg(SCI_GETSCROLLWIDTHTRACKING, 0, 0) != 0;
1623
2107
// Measure the pixel width of some text in a particular style.
1624
2108
// NUL terminated text argument.
1625
2109
// Does not handle tab or control characters.
1626
int wxScintilla::TextWidth (int style, const wxString& text) {
1627
return SendMsg (SCI_TEXTWIDTH, style, (long)(const char*)wx2sci(text));
2110
int wxScintilla::TextWidth (int style, const wxString& text)
2112
return SendMsg(SCI_TEXTWIDTH, style, (sptr_t)(const char*)wx2sci(text));
1630
2115
// Sets the scroll range so that maximum scroll position has
1631
2116
// the last line at the bottom of the view (default).
1632
2117
// Setting this to false allows scrolling one page below the last line.
1633
void wxScintilla::SetEndAtLastLine (bool endAtLastLine) {
1634
SendMsg (SCI_SETENDATLASTLINE, endAtLastLine, 0);
2118
void wxScintilla::SetEndAtLastLine (bool endAtLastLine)
2120
SendMsg(SCI_SETENDATLASTLINE, endAtLastLine, 0);
1637
2123
// Retrieve whether the maximum scroll position has the last
1638
2124
// line at the bottom of the view.
1639
int wxScintilla::GetEndAtLastLine() {
1640
return SendMsg (SCI_GETENDATLASTLINE, 0, 0);
2125
bool wxScintilla::GetEndAtLastLine() const
2127
return SendMsg(SCI_GETENDATLASTLINE, 0, 0) != 0;
1643
2130
// Retrieve the height of a particular line of text in pixels.
1644
int wxScintilla::TextHeight (int line) {
1645
return SendMsg (SCI_TEXTHEIGHT, line, 0);
2131
int wxScintilla::TextHeight (int line)
2133
return SendMsg(SCI_TEXTHEIGHT, line, 0);
1648
2136
// Show or hide the vertical scroll bar.
1649
void wxScintilla::SetUseVerticalScrollBar (bool show) {
1650
SendMsg (SCI_SETVSCROLLBAR, show, 0);
2137
void wxScintilla::SetUseVerticalScrollBar (bool show)
2139
SendMsg(SCI_SETVSCROLLBAR, show, 0);
1653
2142
// Is the vertical scroll bar visible?
1654
bool wxScintilla::GetUseVerticalScrollBar() {
1655
return SendMsg (SCI_GETVSCROLLBAR, 0, 0) != 0;
2143
bool wxScintilla::GetUseVerticalScrollBar() const
2145
return SendMsg(SCI_GETVSCROLLBAR, 0, 0) != 0;
1658
2148
// Add text to the document at current position.
1659
void wxScintilla::AppendText (const wxString& text) {
2149
void wxScintilla::AppendText (const wxString& text)
1660
2151
wxWX2MBbuf buf = (wxWX2MBbuf)wx2sci(text);
1661
SendMsg (SCI_APPENDTEXT, strlen(buf), (long)(const char*)buf);
2152
SendMsg(SCI_APPENDTEXT, strlen(buf), (sptr_t)(const char*)buf);
1664
2155
// Append a string to the end of the document without changing the selection.
1665
void wxScintilla::AppendText (int length, const wxString& text) {
1666
SendMsg (SCI_APPENDTEXT, length, (long)(const char*)wx2sci(text));
2156
void wxScintilla::AppendText (int length, const wxString& text)
2158
SendMsg(SCI_APPENDTEXT, length, (sptr_t)(const char*)wx2sci(text));
1669
2161
// Is drawing done in two phases with backgrounds drawn before foregrounds?
1670
bool wxScintilla::GetTwoPhaseDraw() {
1671
return SendMsg (SCI_GETTWOPHASEDRAW, 0, 0) != 0;
2162
bool wxScintilla::GetTwoPhaseDraw() const
2164
return SendMsg(SCI_GETTWOPHASEDRAW, 0, 0) != 0;
1674
2167
// In twoPhaseDraw mode, drawing is performed in two phases, first the background
1675
2168
// and then the foreground. This avoids chopping off characters that overlap the next run.
1676
void wxScintilla::SetTwoPhaseDraw (bool twoPhase) {
1677
SendMsg (SCI_SETTWOPHASEDRAW, twoPhase, 0);
2169
void wxScintilla::SetTwoPhaseDraw (bool twoPhase)
2171
SendMsg(SCI_SETTWOPHASEDRAW, twoPhase, 0);
2174
// Choose the quality level for text from the FontQuality enumeration.
2175
void wxScintilla::SetFontQuality(int fontQuality)
2177
SendMsg(SCI_SETFONTQUALITY, fontQuality, 0);
2180
// Retrieve the quality level for text.
2181
int wxScintilla::GetFontQuality() const
2183
return SendMsg(SCI_GETFONTQUALITY, 0, 0);
2186
// Scroll so that a display line is at the top of the display.
2187
void wxScintilla::SetFirstVisibleLine(int lineDisplay)
2189
SendMsg(SCI_SETFIRSTVISIBLELINE, lineDisplay, 0);
1680
2192
// Make the target range start and end be the same as the selection range start and end.
1681
void wxScintilla::TargetFromSelection() {
1682
SendMsg (SCI_TARGETFROMSELECTION, 0, 0);
2193
void wxScintilla::TargetFromSelection()
2195
SendMsg(SCI_TARGETFROMSELECTION, 0, 0);
1685
2198
// Join the lines in the target.
1686
void wxScintilla::LinesJoin() {
1687
SendMsg (SCI_LINESJOIN, 0, 0);
2199
void wxScintilla::LinesJoin()
2201
SendMsg(SCI_LINESJOIN, 0, 0);
1690
// Split the lines in the target into lines that are less wide than pixel where possible.
1691
void wxScintilla::LinesSplit (int pixels) {
1692
SendMsg (SCI_LINESSPLIT, pixels, 0);
2204
// Split the lines in the target into lines that are less wide than pixelWidth
2206
void wxScintilla::LinesSplit (int pixelWidth)
2208
SendMsg(SCI_LINESSPLIT, pixelWidth, 0);
1695
2211
// Set the colours used as a chequerboard pattern in the fold margin
1696
void wxScintilla::SetFoldMarginColour (bool useSetting, const wxColour& back) {
1697
SendMsg (SCI_SETFOLDMARGINCOLOUR, useSetting, wxColourAsLong(back));
2212
void wxScintilla::SetFoldMarginColour (bool useSetting, const wxColour& back)
2214
SendMsg(SCI_SETFOLDMARGINCOLOUR, useSetting, wxColourAsLong(back));
1699
void wxScintilla::SetFoldMarginHiColour (bool useSetting, const wxColour& fore) {
1700
SendMsg (SCI_SETFOLDMARGINHICOLOUR, useSetting, wxColourAsLong(fore));
2216
void wxScintilla::SetFoldMarginHiColour (bool useSetting, const wxColour& fore)
2218
SendMsg(SCI_SETFOLDMARGINHICOLOUR, useSetting, wxColourAsLong(fore));
1703
2221
// Move caret down one line.
1704
void wxScintilla::LineDown() {
1705
SendMsg (SCI_LINEDOWN, 0, 0);
2222
void wxScintilla::LineDown()
2224
SendMsg(SCI_LINEDOWN, 0, 0);
1708
2227
// Move caret down one line extending selection to new caret position.
1709
void wxScintilla::LineDownExtend() {
1710
SendMsg (SCI_LINEDOWNEXTEND, 0, 0);
2228
void wxScintilla::LineDownExtend()
2230
SendMsg(SCI_LINEDOWNEXTEND, 0, 0);
1713
2233
// Move caret up one line.
1714
void wxScintilla::LineUp() {
1715
SendMsg (SCI_LINEUP, 0, 0);
2234
void wxScintilla::LineUp()
2236
SendMsg(SCI_LINEUP, 0, 0);
1718
2239
// Move caret up one line extending selection to new caret position.
1719
void wxScintilla::LineUpExtend() {
1720
SendMsg (SCI_LINEUPEXTEND, 0, 0);
2240
void wxScintilla::LineUpExtend()
2242
SendMsg(SCI_LINEUPEXTEND, 0, 0);
1723
2245
// Move caret left one character.
1724
void wxScintilla::CharLeft() {
1725
SendMsg (SCI_CHARLEFT, 0, 0);
2246
void wxScintilla::CharLeft()
2248
SendMsg(SCI_CHARLEFT, 0, 0);
1728
2251
// Move caret left one character extending selection to new caret position.
1729
void wxScintilla::CharLeftExtend() {
1730
SendMsg (SCI_CHARLEFTEXTEND, 0, 0);
2252
void wxScintilla::CharLeftExtend()
2254
SendMsg(SCI_CHARLEFTEXTEND, 0, 0);
1733
2257
// Move caret right one character.
1734
void wxScintilla::CharRight() {
1735
SendMsg (SCI_CHARRIGHT, 0, 0);
2258
void wxScintilla::CharRight()
2260
SendMsg(SCI_CHARRIGHT, 0, 0);
1738
2263
// Move caret right one character extending selection to new caret position.
1739
void wxScintilla::CharRightExtend() {
1740
SendMsg (SCI_CHARRIGHTEXTEND, 0, 0);
2264
void wxScintilla::CharRightExtend()
2266
SendMsg(SCI_CHARRIGHTEXTEND, 0, 0);
1743
2269
// Move caret left one word.
1744
void wxScintilla::WordLeft() {
1745
SendMsg (SCI_WORDLEFT, 0, 0);
2270
void wxScintilla::WordLeft()
2272
SendMsg(SCI_WORDLEFT, 0, 0);
1748
2275
// Move caret left one word extending selection to new caret position.
1749
void wxScintilla::WordLeftExtend() {
1750
SendMsg (SCI_WORDLEFTEXTEND, 0, 0);
2276
void wxScintilla::WordLeftExtend()
2278
SendMsg(SCI_WORDLEFTEXTEND, 0, 0);
1753
2281
// Move caret right one word.
1754
void wxScintilla::WordRight() {
1755
SendMsg (SCI_WORDRIGHT, 0, 0);
2282
void wxScintilla::WordRight()
2284
SendMsg(SCI_WORDRIGHT, 0, 0);
1758
2287
// Move caret right one word extending selection to new caret position.
1759
void wxScintilla::WordRightExtend() {
1760
SendMsg (SCI_WORDRIGHTEXTEND, 0, 0);
2288
void wxScintilla::WordRightExtend()
2290
SendMsg(SCI_WORDRIGHTEXTEND, 0, 0);
1763
2293
// Move caret to first position on line.
1764
void wxScintilla::Home() {
1765
SendMsg (SCI_HOME, 0, 0);
2294
void wxScintilla::Home()
2296
SendMsg(SCI_HOME, 0, 0);
1768
2299
// Move caret to first position on line extending selection to new caret position.
1769
void wxScintilla::HomeExtend() {
1770
SendMsg (SCI_HOMEEXTEND, 0, 0);
2300
void wxScintilla::HomeExtend()
2302
SendMsg(SCI_HOMEEXTEND, 0, 0);
1773
2305
// Move caret to last position on line.
1774
void wxScintilla::LineEnd() {
1775
SendMsg (SCI_LINEEND, 0, 0);
2306
void wxScintilla::LineEnd()
2308
SendMsg(SCI_LINEEND, 0, 0);
1778
2311
// Move caret to last position on line extending selection to new caret position.
1779
void wxScintilla::LineEndExtend() {
1780
SendMsg (SCI_LINEENDEXTEND, 0, 0);
2312
void wxScintilla::LineEndExtend()
2314
SendMsg(SCI_LINEENDEXTEND, 0, 0);
1783
2317
// Move caret to first position in document.
1784
void wxScintilla::DocumentStart() {
1785
SendMsg (SCI_DOCUMENTSTART, 0, 0);
2318
void wxScintilla::DocumentStart()
2320
SendMsg(SCI_DOCUMENTSTART, 0, 0);
1788
2323
// Move caret to first position in document extending selection to new caret position.
1789
void wxScintilla::DocumentStartExtend() {
1790
SendMsg (SCI_DOCUMENTSTARTEXTEND, 0, 0);
2324
void wxScintilla::DocumentStartExtend()
2326
SendMsg(SCI_DOCUMENTSTARTEXTEND, 0, 0);
1793
2329
// Move caret to last position in document.
1794
void wxScintilla::DocumentEnd() {
1795
SendMsg (SCI_DOCUMENTEND, 0, 0);
2330
void wxScintilla::DocumentEnd()
2332
SendMsg(SCI_DOCUMENTEND, 0, 0);
1798
2335
// Move caret to last position in document extending selection to new caret position.
1799
void wxScintilla::DocumentEndExtend() {
1800
SendMsg (SCI_DOCUMENTENDEXTEND, 0, 0);
2336
void wxScintilla::DocumentEndExtend()
2338
SendMsg(SCI_DOCUMENTENDEXTEND, 0, 0);
1803
2341
// Move caret one page up.
1804
void wxScintilla::PageUp() {
1805
SendMsg (SCI_PAGEUP, 0, 0);
2342
void wxScintilla::PageUp()
2344
SendMsg(SCI_PAGEUP, 0, 0);
1808
2347
// Move caret one page up extending selection to new caret position.
1809
void wxScintilla::PageUpExtend() {
1810
SendMsg (SCI_PAGEUPEXTEND, 0, 0);
2348
void wxScintilla::PageUpExtend()
2350
SendMsg(SCI_PAGEUPEXTEND, 0, 0);
1813
2353
// Move caret one page down.
1814
void wxScintilla::PageDown() {
1815
SendMsg (SCI_PAGEDOWN, 0, 0);
2354
void wxScintilla::PageDown()
2356
SendMsg(SCI_PAGEDOWN, 0, 0);
1818
2359
// Move caret one page down extending selection to new caret position.
1819
void wxScintilla::PageDownExtend() {
1820
SendMsg (SCI_PAGEDOWNEXTEND, 0, 0);
2360
void wxScintilla::PageDownExtend()
2362
SendMsg(SCI_PAGEDOWNEXTEND, 0, 0);
1823
2365
// Switch from insert to overtype mode or the reverse.
1824
void wxScintilla::EditToggleOvertype() {
1825
SendMsg (SCI_EDITTOGGLEOVERTYPE, 0, 0);
2366
void wxScintilla::EditToggleOvertype()
2368
SendMsg(SCI_EDITTOGGLEOVERTYPE, 0, 0);
1828
2371
// Cancel any modes such as call tip or auto-completion list display.
1829
void wxScintilla::Cancel() {
1830
SendMsg (SCI_CANCEL, 0, 0);
2372
void wxScintilla::Cancel()
2374
SendMsg(SCI_CANCEL, 0, 0);
1833
2377
// Delete the selection or if no selection, the character before the caret.
1834
void wxScintilla::DeleteBack() {
1835
SendMsg (SCI_DELETEBACK, 0, 0);
2378
void wxScintilla::DeleteBack()
2380
SendMsg(SCI_DELETEBACK, 0, 0);
1838
2383
// If selection is empty or all on one line replace the selection with a tab character.
1839
2384
// If more than one line selected, indent the lines.
1840
void wxScintilla::Tab() {
1841
SendMsg (SCI_TAB, 0, 0);
2385
void wxScintilla::Tab()
2387
SendMsg(SCI_TAB, 0, 0);
1844
2390
// Dedent the selected lines.
1845
void wxScintilla::BackTab() {
1846
SendMsg (SCI_BACKTAB, 0, 0);
2391
void wxScintilla::BackTab()
2393
SendMsg(SCI_BACKTAB, 0, 0);
1849
2396
// Insert a new line, may use a CRLF, CR or LF depending on EOL mode.
1850
void wxScintilla::NewLine() {
1851
SendMsg (SCI_NEWLINE, 0, 0);
2397
void wxScintilla::NewLine()
2399
SendMsg(SCI_NEWLINE, 0, 0);
1854
2402
// Insert a Form Feed character.
1855
void wxScintilla::FormFeed() {
1856
SendMsg (SCI_FORMFEED, 0, 0);
2403
void wxScintilla::FormFeed()
2405
SendMsg(SCI_FORMFEED, 0, 0);
1859
2408
// Move caret to before first visible character on line.
1860
2409
// If already there move to first character on line.
1861
void wxScintilla::VCHome() {
1862
SendMsg (SCI_VCHOME, 0, 0);
2410
void wxScintilla::VCHome()
2412
SendMsg(SCI_VCHOME, 0, 0);
1865
2415
// Like VCHome but extending selection to new caret position.
1866
void wxScintilla::VCHomeExtend() {
1867
SendMsg (SCI_VCHOMEEXTEND, 0, 0);
2416
void wxScintilla::VCHomeExtend()
2418
SendMsg(SCI_VCHOMEEXTEND, 0, 0);
1870
2421
// Magnify the displayed text by increasing the sizes by 1 point.
1871
void wxScintilla::ZoomIn() {
1872
SendMsg (SCI_ZOOMIN, 0, 0);
2422
void wxScintilla::ZoomIn()
2424
SendMsg(SCI_ZOOMIN, 0, 0);
1875
2427
// Make the displayed text smaller by decreasing the sizes by 1 point.
1876
void wxScintilla::ZoomOut() {
1877
SendMsg (SCI_ZOOMOUT, 0, 0);
2428
void wxScintilla::ZoomOut()
2430
SendMsg(SCI_ZOOMOUT, 0, 0);
1880
2433
// Delete the word to the left of the caret.
1881
void wxScintilla::DelWordLeft() {
1882
SendMsg (SCI_DELWORDLEFT, 0, 0);
2434
void wxScintilla::DelWordLeft()
2436
SendMsg(SCI_DELWORDLEFT, 0, 0);
1885
2439
// Delete the word to the right of the caret.
1886
void wxScintilla::DelWordRight() {
1887
SendMsg (SCI_DELWORDRIGHT, 0, 0);
2440
void wxScintilla::DelWordRight()
2442
SendMsg(SCI_DELWORDRIGHT, 0, 0);
2445
// Delete the word to the right of the caret, but not the trailing non-word characters.
2446
void wxScintilla::DelWordRightEnd()
2448
SendMsg(SCI_DELWORDRIGHTEND, 0, 0);
1890
2451
// Cut the line containing the caret.
1891
void wxScintilla::LineCut() {
1892
SendMsg (SCI_LINECUT, 0, 0);
2452
void wxScintilla::LineCut()
2454
SendMsg(SCI_LINECUT, 0, 0);
1895
2457
// Delete the line containing the caret.
1896
void wxScintilla::LineDelete() {
1897
SendMsg (SCI_LINEDELETE, 0, 0);
2458
void wxScintilla::LineDelete()
2460
SendMsg(SCI_LINEDELETE, 0, 0);
1900
2463
// Switch the current line with the previous.
1901
void wxScintilla::LineTranspose() {
1902
SendMsg (SCI_LINETRANSPOSE, 0, 0);
2464
void wxScintilla::LineTranspose()
2466
SendMsg(SCI_LINETRANSPOSE, 0, 0);
1905
2469
// Duplicate the current line.
1906
void wxScintilla::LineDuplicate() {
1907
SendMsg (SCI_LINEDUPLICATE, 0, 0);
2470
void wxScintilla::LineDuplicate()
2472
SendMsg(SCI_LINEDUPLICATE, 0, 0);
1910
2475
// Transform the selection to lower case.
1911
void wxScintilla::LowerCase() {
1912
SendMsg (SCI_LOWERCASE, 0, 0);
2476
void wxScintilla::LowerCase()
2478
SendMsg(SCI_LOWERCASE, 0, 0);
1915
2481
// Transform the selection to upper case.
1916
void wxScintilla::UpperCase() {
1917
SendMsg (SCI_UPPERCASE, 0, 0);
2482
void wxScintilla::UpperCase()
2484
SendMsg(SCI_UPPERCASE, 0, 0);
1920
2487
// Scroll the document down, keeping the caret visible.
1921
void wxScintilla::LineScrollDown() {
1922
SendMsg (SCI_LINESCROLLDOWN, 0, 0);
2488
void wxScintilla::LineScrollDown()
2490
SendMsg(SCI_LINESCROLLDOWN, 0, 0);
1925
2493
// Scroll the document up, keeping the caret visible.
1926
void wxScintilla::LineScrollUp() {
1927
SendMsg (SCI_LINESCROLLUP, 0, 0);
2494
void wxScintilla::LineScrollUp()
2496
SendMsg(SCI_LINESCROLLUP, 0, 0);
1930
2499
// Delete the selection or if no selection, the character before the caret.
1931
2500
// Will not delete the character before at the start of a line.
1932
void wxScintilla::DeleteBackNotLine() {
1933
SendMsg (SCI_DELETEBACKNOTLINE, 0, 0);
2501
void wxScintilla::DeleteBackNotLine()
2503
SendMsg(SCI_DELETEBACKNOTLINE, 0, 0);
1936
2506
// Move caret to first position on display line.
1937
void wxScintilla::HomeDisplay() {
1938
SendMsg (SCI_HOMEDISPLAY, 0, 0);
2507
void wxScintilla::HomeDisplay()
2509
SendMsg(SCI_HOMEDISPLAY, 0, 0);
1941
2512
// Move caret to first position on display line extending selection to
1942
2513
// new caret position.
1943
void wxScintilla::HomeDisplayExtend() {
1944
SendMsg (SCI_HOMEDISPLAYEXTEND, 0, 0);
2514
void wxScintilla::HomeDisplayExtend()
2516
SendMsg(SCI_HOMEDISPLAYEXTEND, 0, 0);
1947
2519
// Move caret to last position on display line.
1948
void wxScintilla::LineEndDisplay() {
1949
SendMsg (SCI_LINEENDDISPLAY, 0, 0);
2520
void wxScintilla::LineEndDisplay()
2522
SendMsg(SCI_LINEENDDISPLAY, 0, 0);
1952
2525
// Move caret to last position on display line extending selection to new
1953
2526
// caret position.
1954
void wxScintilla::LineEndDisplayExtend() {
1955
SendMsg (SCI_LINEENDDISPLAYEXTEND, 0, 0);
2527
void wxScintilla::LineEndDisplayExtend()
2529
SendMsg(SCI_LINEENDDISPLAYEXTEND, 0, 0);
1958
2532
// These are like their namesakes Home(Extend)?, LineEnd(Extend)?, VCHome(Extend)?
1960
2534
// They go first to the start / end of the display line, like (Home|LineEnd)Display
1961
2535
// The difference is that, the cursor is already at the point, it goes on to the start
1962
2536
// or end of the document line, as appropriate for (Home|LineEnd|VCHome)(Extend)?.
1963
void wxScintilla::HomeWrap() {
1964
SendMsg (SCI_HOMEWRAP, 0, 0);
1966
void wxScintilla::HomeWrapExtend() {
1967
SendMsg (SCI_HOMEWRAPEXTEND, 0, 0);
1969
void wxScintilla::LineEndWrap() {
1970
SendMsg (SCI_LINEENDWRAP, 0, 0);
1972
void wxScintilla::LineEndWrapExtend() {
1973
SendMsg (SCI_LINEENDWRAPEXTEND, 0, 0);
1975
void wxScintilla::VCHomeWrap() {
1976
SendMsg (SCI_VCHOMEWRAP, 0, 0);
1978
void wxScintilla::VCHomeWrapExtend() {
1979
SendMsg (SCI_VCHOMEWRAPEXTEND, 0, 0);
2537
void wxScintilla::HomeWrap()
2539
SendMsg(SCI_HOMEWRAP, 0, 0);
2541
void wxScintilla::HomeWrapExtend()
2543
SendMsg(SCI_HOMEWRAPEXTEND, 0, 0);
2545
void wxScintilla::LineEndWrap()
2547
SendMsg(SCI_LINEENDWRAP, 0, 0);
2549
void wxScintilla::LineEndWrapExtend()
2551
SendMsg(SCI_LINEENDWRAPEXTEND, 0, 0);
2553
void wxScintilla::VCHomeWrap()
2555
SendMsg(SCI_VCHOMEWRAP, 0, 0);
2557
void wxScintilla::VCHomeWrapExtend()
2559
SendMsg(SCI_VCHOMEWRAPEXTEND, 0, 0);
1982
2562
// Copy the line containing the caret.
1983
void wxScintilla::LineCopy() {
1984
SendMsg (SCI_LINECOPY, 0, 0);
2563
void wxScintilla::LineCopy()
2565
SendMsg(SCI_LINECOPY, 0, 0);
1987
2568
// Move the caret inside current view if it's not there already.
1988
void wxScintilla::MoveCaretInsideView() {
1989
SendMsg (SCI_MOVECARETINSIDEVIEW, 0, 0);
2569
void wxScintilla::MoveCaretInsideView()
2571
SendMsg(SCI_MOVECARETINSIDEVIEW, 0, 0);
1992
// How many characters are on a line, not including end of line characters?
1993
int wxScintilla::LineLength (int line) {
1994
return SendMsg (SCI_LINELENGTH, line, 0);
2574
// How many characters are on a line, including end of line characters?
2575
int wxScintilla::LineLength (int line) const
2577
return SendMsg(SCI_LINELENGTH, line, 0);
1997
2580
// Highlight the characters at two positions.
1998
void wxScintilla::BraceHighlight (int pos1, int pos2) {
1999
SendMsg (SCI_BRACEHIGHLIGHT, pos1, pos2);
2581
void wxScintilla::BraceHighlight (int pos1, int pos2)
2583
SendMsg(SCI_BRACEHIGHLIGHT, pos1, pos2);
2002
2586
// Highlight the character at a position indicating there is no matching brace.
2003
void wxScintilla::BraceBadLight (int pos) {
2004
SendMsg (SCI_BRACEBADLIGHT, pos, 0);
2587
void wxScintilla::BraceBadLight (int pos)
2589
SendMsg(SCI_BRACEBADLIGHT, pos, 0);
2007
2592
// Find the position of a matching brace or INVALID_POSITION if no match.
2008
int wxScintilla::BraceMatch (int pos) {
2009
return SendMsg (SCI_BRACEMATCH, pos, 0);
2593
int wxScintilla::BraceMatch (int pos)
2595
return SendMsg(SCI_BRACEMATCH, pos, 0);
2012
2598
// Are the end of line characters visible?
2013
bool wxScintilla::GetViewEOL() {
2014
return SendMsg (SCI_GETVIEWEOL, 0, 0) != 0;
2599
bool wxScintilla::GetViewEOL() const
2601
return SendMsg(SCI_GETVIEWEOL, 0, 0) != 0;
2017
2604
// Make the end of line characters visible or invisible.
2018
void wxScintilla::SetViewEOL (bool visible) {
2019
SendMsg (SCI_SETVIEWEOL, visible, 0);
2605
void wxScintilla::SetViewEOL (bool visible)
2607
SendMsg(SCI_SETVIEWEOL, visible, 0);
2022
2610
// Retrieve a pointer to the document object.
2023
void* wxScintilla::GetDocPointer() {
2024
return (void*)SendMsg (SCI_GETDOCPOINTER);
2611
void* wxScintilla::GetDocPointer()
2613
return (void*)SendMsg(SCI_GETDOCPOINTER);
2027
2616
// Change the document object used.
2028
void wxScintilla::SetDocPointer (void* docPointer) {
2029
SendMsg (SCI_SETDOCPOINTER, 0, (long)docPointer);
2617
void wxScintilla::SetDocPointer (void* docPointer)
2619
SendMsg(SCI_SETDOCPOINTER, 0, (sptr_t)docPointer);
2032
2622
// Set which document modification events are sent to the container.
2033
void wxScintilla::SetModEventMask (int mask) {
2034
SendMsg (SCI_SETMODEVENTMASK, mask, 0);
2623
void wxScintilla::SetModEventMask (int mask)
2625
SendMsg(SCI_SETMODEVENTMASK, mask, 0);
2037
2628
// Retrieve the column number which text should be kept within.
2038
int wxScintilla::GetEdgeColumn() {
2039
return SendMsg (SCI_GETEDGECOLUMN, 0, 0);
2629
int wxScintilla::GetEdgeColumn() const
2631
return SendMsg(SCI_GETEDGECOLUMN, 0, 0);
2042
2634
// Set the column number of the edge.
2043
2635
// If text goes past the edge then it is highlighted.
2044
void wxScintilla::SetEdgeColumn (int column) {
2045
SendMsg (SCI_SETEDGECOLUMN, column, 0);
2636
void wxScintilla::SetEdgeColumn (int column)
2638
SendMsg(SCI_SETEDGECOLUMN, column, 0);
2048
2641
// Retrieve the edge highlight mode.
2049
int wxScintilla::GetEdgeMode() {
2050
return SendMsg (SCI_GETEDGEMODE, 0, 0);
2642
int wxScintilla::GetEdgeMode() const
2644
return SendMsg(SCI_GETEDGEMODE, 0, 0);
2053
2647
// The edge may be displayed by a line (EDGE_LINE) or by highlighting text that
2054
2648
// goes beyond it (EDGE_BACKGROUND) or not displayed at all (EDGE_NONE).
2055
void wxScintilla::SetEdgeMode (int mode) {
2056
SendMsg (SCI_SETEDGEMODE, mode, 0);
2649
void wxScintilla::SetEdgeMode (int mode)
2651
SendMsg(SCI_SETEDGEMODE, mode, 0);
2059
2654
// Retrieve the colour used in edge indication.
2060
wxColour wxScintilla::GetEdgeColour() {
2061
long colour = SendMsg (SCI_GETEDGECOLOUR, 0, 0);
2655
wxColour wxScintilla::GetEdgeColour() const
2657
long colour = SendMsg(SCI_GETEDGECOLOUR, 0, 0);
2062
2658
return wxColourFromLong(colour);
2065
2661
// Change the colour used in edge indication.
2066
void wxScintilla::SetEdgeColour (const wxColour& colour) {
2067
SendMsg (SCI_SETEDGECOLOUR, wxColourAsLong(colour), 0);
2662
void wxScintilla::SetEdgeColour (const wxColour& edgeColour)
2664
SendMsg(SCI_SETEDGECOLOUR, wxColourAsLong(edgeColour), 0);
2070
2667
// Sets the current caret position to be the search anchor.
2071
void wxScintilla::SearchAnchor() {
2072
SendMsg (SCI_SEARCHANCHOR, 0, 0);
2668
void wxScintilla::SearchAnchor()
2670
SendMsg(SCI_SEARCHANCHOR, 0, 0);
2075
2673
// Find some text starting at the search anchor.
2076
2674
// Does not ensure the selection is visible.
2077
int wxScintilla::SearchNext (int flags, const wxString& text) {
2078
return SendMsg (SCI_SEARCHNEXT, flags, (long)(const char*)wx2sci(text));
2675
int wxScintilla::SearchNext (int flags, const wxString& text)
2677
return SendMsg(SCI_SEARCHNEXT, flags, (sptr_t)(const char*)wx2sci(text));
2081
2680
// Find some text starting at the search anchor and moving backwards.
2082
2681
// Does not ensure the selection is visible.
2083
int wxScintilla::SearchPrev (int flags, const wxString& text) {
2084
return SendMsg (SCI_SEARCHPREV, flags, (long)(const char*)wx2sci(text));
2682
int wxScintilla::SearchPrev (int flags, const wxString& text)
2684
return SendMsg(SCI_SEARCHPREV, flags, (sptr_t)(const char*)wx2sci(text));
2087
2687
// Retrieves the number of lines completely visible.
2088
int wxScintilla::LinesOnScreen() {
2089
return SendMsg (SCI_LINESONSCREEN, 0, 0);
2688
int wxScintilla::LinesOnScreen() const
2690
return SendMsg(SCI_LINESONSCREEN, 0, 0);
2092
2693
// Set whether a pop up menu is displayed automatically when the user presses
2093
2694
// the wrong mouse button.
2094
void wxScintilla::UsePopUp (bool allowPopUp) {
2095
SendMsg (SCI_USEPOPUP, allowPopUp, 0);
2695
void wxScintilla::UsePopUp (bool allowPopUp)
2697
SendMsg(SCI_USEPOPUP, allowPopUp, 0);
2098
2700
// Is the selection rectangular? The alternative is the more common stream selection.
2099
bool wxScintilla::SelectionIsRectangle() {
2100
return SendMsg (SCI_SELECTIONISRECTANGLE, 0, 0) != 0;
2701
bool wxScintilla::SelectionIsRectangle() const
2703
return SendMsg(SCI_SELECTIONISRECTANGLE, 0, 0) != 0;
2103
2706
// Set the zoom level. This number of points is added to the size of all fonts.
2104
2707
// It may be positive to magnify or negative to reduce.
2105
void wxScintilla::SetZoom (int zoom) {
2106
SendMsg (SCI_SETZOOM, zoom, 0);
2708
void wxScintilla::SetZoom (int zoom)
2710
SendMsg(SCI_SETZOOM, zoom, 0);
2109
2713
// Retrieve the zoom level.
2110
int wxScintilla::GetZoom() {
2111
return SendMsg (SCI_GETZOOM, 0, 0);
2714
int wxScintilla::GetZoom() const
2716
return SendMsg(SCI_GETZOOM, 0, 0);
2114
2719
// Create a new document object.
2115
2720
// Starts with reference count of 1 and not selected into editor.
2116
void* wxScintilla::CreateDocument() {
2117
return (void*)SendMsg (SCI_CREATEDOCUMENT, 0, 0);
2721
void* wxScintilla::CreateDocument()
2723
return (void*)SendMsg(SCI_CREATEDOCUMENT, 0, 0);
2120
2726
// Extend life of document.
2121
void wxScintilla::AddRefDocument (void* docPointer) {
2122
SendMsg (SCI_ADDREFDOCUMENT, 0, (long)docPointer);
2727
void wxScintilla::AddRefDocument (void* docPointer)
2729
SendMsg(SCI_ADDREFDOCUMENT, 0, (sptr_t)docPointer);
2125
2732
// Release a reference to the document, deleting document if it fades to black.
2126
void wxScintilla::ReleaseDocument (void* docPointer) {
2127
SendMsg (SCI_RELEASEDOCUMENT, 0, (long)docPointer);
2733
void wxScintilla::ReleaseDocument (void* docPointer)
2735
SendMsg(SCI_RELEASEDOCUMENT, 0, (sptr_t)docPointer);
2130
2738
// Get which document modification events are sent to the container.
2131
int wxScintilla::GetModEventMask() {
2132
return SendMsg (SCI_GETMODEVENTMASK, 0, 0);
2739
int wxScintilla::GetModEventMask() const
2741
return SendMsg(SCI_GETMODEVENTMASK, 0, 0);
2135
2744
// Change internal focus flag.
2136
void wxScintilla::SetSCIFocus (bool focus) {
2137
SendMsg (SCI_SETFOCUS, focus, 0);
2745
void wxScintilla::SetSCIFocus (bool focus)
2747
SendMsg(SCI_SETFOCUS, focus, 0);
2140
2750
// Get internal focus flag.
2141
bool wxScintilla::GetSCIFocus() {
2142
return SendMsg (SCI_GETFOCUS, 0, 0) != 0;
2751
bool wxScintilla::GetSCIFocus() const
2753
return SendMsg(SCI_GETFOCUS, 0, 0) != 0;
2145
2756
// Change error status - 0 = OK.
2146
void wxScintilla::SetStatus (int status) {
2147
SendMsg (SCI_SETSTATUS, status, 0);
2757
void wxScintilla::SetStatus (int statusCode)
2759
SendMsg(SCI_SETSTATUS, statusCode, 0);
2150
2762
// Get error status.
2151
int wxScintilla::GetStatus() {
2152
return SendMsg (SCI_GETSTATUS, 0, 0);
2763
int wxScintilla::GetStatus() const
2765
return SendMsg(SCI_GETSTATUS, 0, 0);
2155
2768
// Set whether the mouse is captured when its button is pressed.
2156
void wxScintilla::SetMouseDownCaptures (bool captures) {
2157
SendMsg (SCI_SETMOUSEDOWNCAPTURES, captures, 0);
2769
void wxScintilla::SetMouseDownCaptures (bool captures)
2771
SendMsg(SCI_SETMOUSEDOWNCAPTURES, captures, 0);
2160
2774
// Get whether mouse gets captured.
2161
bool wxScintilla::GetMouseDownCaptures() {
2162
return SendMsg (SCI_GETMOUSEDOWNCAPTURES, 0, 0) != 0;
2775
bool wxScintilla::GetMouseDownCaptures() const
2777
return SendMsg(SCI_GETMOUSEDOWNCAPTURES, 0, 0) != 0;
2165
2780
// Sets the cursor to one of the SC_CURSOR* values.
2166
void wxScintilla::SetCursorType (int cursorType) {
2781
void wxScintilla::SetSCICursor (int cursorType)
2167
2783
SendMsg(SCI_SETCURSOR, cursorType, 0);
2170
2786
// Get cursor type.
2171
int wxScintilla::GetCursorType() {
2172
return SendMsg (SCI_GETCURSOR, 0, 0);
2787
int wxScintilla::GetSCICursor() const
2789
return SendMsg(SCI_GETCURSOR, 0, 0);
2175
2792
// Change the way control characters are displayed:
2176
2793
// If symbol is < 32, keep the drawn way, else, use the given character.
2177
void wxScintilla::SetControlCharSymbol (int symbol) {
2178
SendMsg (SCI_SETCONTROLCHARSYMBOL, symbol, 0);
2794
void wxScintilla::SetControlCharSymbol (int symbol)
2796
SendMsg(SCI_SETCONTROLCHARSYMBOL, symbol, 0);
2181
2799
// Get the way control characters are displayed.
2182
int wxScintilla::GetControlCharSymbol() {
2183
return SendMsg (SCI_GETCONTROLCHARSYMBOL, 0, 0);
2800
int wxScintilla::GetControlCharSymbol() const
2802
return SendMsg(SCI_GETCONTROLCHARSYMBOL, 0, 0);
2186
2805
// Move to the previous change in capitalisation.
2187
void wxScintilla::WordPartLeft() {
2188
SendMsg (SCI_WORDPARTLEFT, 0, 0);
2806
void wxScintilla::WordPartLeft()
2808
SendMsg(SCI_WORDPARTLEFT, 0, 0);
2191
2811
// Move to the previous change in capitalisation extending selection
2192
2812
// to new caret position.
2193
void wxScintilla::WordPartLeftExtend() {
2194
SendMsg (SCI_WORDPARTLEFTEXTEND, 0, 0);
2813
void wxScintilla::WordPartLeftExtend()
2815
SendMsg(SCI_WORDPARTLEFTEXTEND, 0, 0);
2197
2818
// Move to the change next in capitalisation.
2198
void wxScintilla::WordPartRight() {
2199
SendMsg (SCI_WORDPARTRIGHT, 0, 0);
2819
void wxScintilla::WordPartRight()
2821
SendMsg(SCI_WORDPARTRIGHT, 0, 0);
2202
2824
// Move to the next change in capitalisation extending selection
2203
2825
// to new caret position.
2204
void wxScintilla::WordPartRightExtend() {
2205
SendMsg (SCI_WORDPARTRIGHTEXTEND, 0, 0);
2826
void wxScintilla::WordPartRightExtend()
2828
SendMsg(SCI_WORDPARTRIGHTEXTEND, 0, 0);
2208
2831
// Set the way the display area is determined when a particular line
2209
2832
// is to be moved to by Find, FindNext, GotoLine, etc.
2210
void wxScintilla::SetVisiblePolicy (int visiblePolicy, int visibleSlop) {
2211
SendMsg (SCI_SETVISIBLEPOLICY, visiblePolicy, visibleSlop);
2833
void wxScintilla::SetVisiblePolicy (int visiblePolicy, int visibleSlop)
2835
SendMsg(SCI_SETVISIBLEPOLICY, visiblePolicy, visibleSlop);
2214
2838
// Delete back from the current position to the start of the line.
2215
void wxScintilla::DelLineLeft() {
2216
SendMsg (SCI_DELLINELEFT, 0, 0);
2839
void wxScintilla::DelLineLeft()
2841
SendMsg(SCI_DELLINELEFT, 0, 0);
2219
2844
// Delete forwards from the current position to the end of the line.
2220
void wxScintilla::DelLineRight() {
2221
SendMsg (SCI_DELLINERIGHT, 0, 0);
2845
void wxScintilla::DelLineRight()
2847
SendMsg(SCI_DELLINERIGHT, 0, 0);
2224
2850
// Get and Set the xOffset (ie, horizonal scroll position).
2225
void wxScintilla::SetXOffset (int newOffset) {
2226
SendMsg (SCI_SETXOFFSET, newOffset, 0);
2851
void wxScintilla::SetXOffset (int newOffset)
2853
SendMsg(SCI_SETXOFFSET, newOffset, 0);
2228
int wxScintilla::GetXOffset() {
2229
return SendMsg (SCI_GETXOFFSET, 0, 0);
2855
int wxScintilla::GetXOffset() const
2857
return SendMsg(SCI_GETXOFFSET, 0, 0);
2232
2860
// Set the last x chosen value to be the caret x position.
2233
void wxScintilla::ChooseCaretX() {
2234
SendMsg (SCI_CHOOSECARETX, 0, 0);
2861
void wxScintilla::ChooseCaretX()
2863
SendMsg(SCI_CHOOSECARETX, 0, 0);
2866
// Set the focus to this Scintilla widget (GTK+ specific)
2237
2867
// Grab focus (SCI_GRABFOCUS) not supported
2239
2869
// Set the way the caret is kept visible when going sideway.
2240
2870
// The exclusion zone is given in pixels.
2241
void wxScintilla::SetXCaretPolicy (int caretPolicy, int caretSlop) {
2242
SendMsg (SCI_SETXCARETPOLICY, caretPolicy, caretSlop);
2871
void wxScintilla::SetXCaretPolicy (int caretPolicy, int caretSlop)
2873
SendMsg(SCI_SETXCARETPOLICY, caretPolicy, caretSlop);
2245
2876
// Set the way the line the caret is on is kept visible.
2246
2877
// The exclusion zone is given in lines.
2247
void wxScintilla::SetYCaretPolicy (int caretPolicy, int caretSlop) {
2248
SendMsg (SCI_SETYCARETPOLICY, caretPolicy, caretSlop);
2878
void wxScintilla::SetYCaretPolicy (int caretPolicy, int caretSlop)
2880
SendMsg(SCI_SETYCARETPOLICY, caretPolicy, caretSlop);
2251
2883
// Set printing to line wrapped (SC_WRAP_WORD) or not line wrapped (SC_WRAP_NONE).
2252
void wxScintilla::SetPrintWrapMode (int mode) {
2253
SendMsg (SCI_SETPRINTWRAPMODE, mode, 0);
2884
void wxScintilla::SetPrintWrapMode (int mode)
2886
SendMsg(SCI_SETPRINTWRAPMODE, mode, 0);
2256
2889
// Is printing line wrapped?
2257
int wxScintilla::GetPrintWrapMode() {
2258
return SendMsg (SCI_GETPRINTWRAPMODE, 0, 0);
2890
int wxScintilla::GetPrintWrapMode() const
2892
return SendMsg(SCI_GETPRINTWRAPMODE, 0, 0);
2261
2895
// Set a fore colour for active hotspots.
2262
void wxScintilla::SetHotspotActiveForeground (bool useSetting, const wxColour& fore) {
2263
SendMsg (SCI_SETHOTSPOTACTIVEFORE, useSetting, wxColourAsLong(fore));
2896
void wxScintilla::SetHotspotActiveForeground (bool useSetting, const wxColour& fore)
2898
SendMsg(SCI_SETHOTSPOTACTIVEFORE, useSetting, wxColourAsLong(fore));
2901
// Get the fore colour for active hotspots.
2902
wxColour wxScintilla::GetHotspotActiveForeground() const
2904
long c = SendMsg(SCI_GETHOTSPOTACTIVEFORE, 0, 0);
2905
return wxColourFromLong(c);
2266
2908
// Set a back colour for active hotspots.
2267
void wxScintilla::SetHotspotActiveBackground (bool useSetting, const wxColour& back) {
2268
SendMsg (SCI_SETHOTSPOTACTIVEBACK, useSetting, wxColourAsLong(back));
2909
void wxScintilla::SetHotspotActiveBackground (bool useSetting, const wxColour& back)
2911
SendMsg(SCI_SETHOTSPOTACTIVEBACK, useSetting, wxColourAsLong(back));
2914
// Get the back colour for active hotspots.
2915
wxColour wxScintilla::GetHotspotActiveBackground() const
2917
long c = SendMsg(SCI_GETHOTSPOTACTIVEBACK, 0, 0);
2918
return wxColourFromLong(c);
2271
2921
// Enable / Disable underlining active hotspots.
2272
void wxScintilla::SetHotspotActiveUnderline (bool underline) {
2273
SendMsg (SCI_SETHOTSPOTACTIVEUNDERLINE, underline, 0);
2922
void wxScintilla::SetHotspotActiveUnderline (bool underline)
2924
SendMsg(SCI_SETHOTSPOTACTIVEUNDERLINE, underline, 0);
2927
// Get whether underlining for active hotspots.
2928
bool wxScintilla::GetHotspotActiveUnderline() const
2930
return SendMsg(SCI_GETHOTSPOTACTIVEUNDERLINE, 0, 0) != 0;
2276
2933
// Limit hotspots to single line so hotspots on two lines don't merge.
2277
void wxScintilla::SetHotspotSingleLine (bool singleLine) {
2934
void wxScintilla::SetHotspotSingleLine (bool singleLine)
2278
2936
SendMsg(SCI_SETHOTSPOTSINGLELINE, singleLine, 0);
2939
// Get the HotspotSingleLine property
2940
bool wxScintilla::GetHotspotSingleLine() const
2942
return SendMsg(SCI_GETHOTSPOTSINGLELINE, 0, 0) != 0;
2281
2945
// Move caret between paragraphs (delimited by empty lines).
2282
void wxScintilla::ParaDown() {
2283
SendMsg (SCI_PARADOWN, 0, 0);
2285
void wxScintilla::ParaDownExtend() {
2286
SendMsg (SCI_PARADOWNEXTEND, 0, 0);
2288
void wxScintilla::ParaUp() {
2289
SendMsg (SCI_PARAUP, 0, 0);
2291
void wxScintilla::ParaUpExtend() {
2292
SendMsg (SCI_PARAUPEXTEND, 0, 0);
2946
void wxScintilla::ParaDown()
2948
SendMsg(SCI_PARADOWN, 0, 0);
2950
void wxScintilla::ParaDownExtend()
2952
SendMsg(SCI_PARADOWNEXTEND, 0, 0);
2954
void wxScintilla::ParaUp()
2956
SendMsg(SCI_PARAUP, 0, 0);
2958
void wxScintilla::ParaUpExtend()
2960
SendMsg(SCI_PARAUPEXTEND, 0, 0);
2295
2963
// Given a valid document position, return the previous position taking code
2296
2964
// page into account. Returns 0 if passed 0.
2297
int wxScintilla::PositionBefore (int pos) {
2298
return SendMsg (SCI_POSITIONBEFORE, pos, 0);
2965
int wxScintilla::PositionBefore (int pos)
2967
return SendMsg(SCI_POSITIONBEFORE, pos, 0);
2301
2970
// Given a valid document position, return the next position taking code
2302
2971
// page into account. Maximum value returned is the last position in the document.
2303
int wxScintilla::PositionAfter (int pos) {
2304
return SendMsg (SCI_POSITIONAFTER, pos, 0);
2972
int wxScintilla::PositionAfter (int pos)
2974
return SendMsg(SCI_POSITIONAFTER, pos, 0);
2307
2977
// Copy a range of text to the clipboard. Positions are clipped into the document.
2308
void wxScintilla::CopyRange (int startPos, int endPos) {
2309
SendMsg (SCI_COPYRANGE, startPos, endPos);
2978
void wxScintilla::CopyRange (int start, int end)
2980
SendMsg(SCI_COPYRANGE, start, end);
2312
2983
// Copy argument text to the clipboard.
2313
void wxScintilla::CopyText (int length, const wxString& text) {
2314
SendMsg (SCI_COPYTEXT, length, (long)(const char*)wx2sci(text));
2984
void wxScintilla::CopyText (int length, const wxString& text)
2986
SendMsg(SCI_COPYTEXT, length, (sptr_t)(const char*)wx2sci(text));
2317
// Set the selection mode to stream (SC_SEL_STREAM) or rectangular (SC_SEL_RECTANGLE) or
2989
// Set the selection mode to stream (SC_SEL_STREAM) or rectangular (SC_SEL_RECTANGLE/SC_SEL_THIN) or
2318
2990
// by lines (SC_SEL_LINES).
2319
void wxScintilla::SetSelectionMode (int mode) {
2320
SendMsg (SCI_SETSELECTIONMODE, mode, 0);
2991
void wxScintilla::SetSelectionMode (int mode)
2993
SendMsg(SCI_SETSELECTIONMODE, mode, 0);
2323
2996
// Get the mode of the current selection.
2324
int wxScintilla::GetSelectionMode() {
2325
return SendMsg (SCI_GETSELECTIONMODE, 0, 0);
2997
int wxScintilla::GetSelectionMode() const
2999
return SendMsg(SCI_GETSELECTIONMODE, 0, 0);
2328
3002
// Retrieve the position of the start of the selection at the given line (INVALID_POSITION if no selection on this line).
2329
int wxScintilla::GetLineSelStartPosition (int line) {
2330
return SendMsg (SCI_GETLINESELSTARTPOSITION, line, 0);
3003
int wxScintilla::GetLineSelStartPosition (int line)
3005
return SendMsg(SCI_GETLINESELSTARTPOSITION, line, 0);
2333
3008
// Retrieve the position of the end of the selection at the given line (INVALID_POSITION if no selection on this line).
2334
int wxScintilla::GetLineSelEndPosition (int line) {
2335
return SendMsg (SCI_GETLINESELENDPOSITION, line, 0);
3009
int wxScintilla::GetLineSelEndPosition (int line)
3011
return SendMsg(SCI_GETLINESELENDPOSITION, line, 0);
2338
3014
// Move caret down one line, extending rectangular selection to new caret position.
2339
void wxScintilla::LineDownRectExtend() {
2340
SendMsg (SCI_LINEDOWNRECTEXTEND, 0, 0);
3015
void wxScintilla::LineDownRectExtend()
3017
SendMsg(SCI_LINEDOWNRECTEXTEND, 0, 0);
2343
3020
// Move caret up one line, extending rectangular selection to new caret position.
2344
void wxScintilla::LineUpRectExtend() {
2345
SendMsg (SCI_LINEUPRECTEXTEND, 0, 0);
3021
void wxScintilla::LineUpRectExtend()
3023
SendMsg(SCI_LINEUPRECTEXTEND, 0, 0);
2348
3026
// Move caret left one character, extending rectangular selection to new caret position.
2349
void wxScintilla::CharLeftRectExtend() {
2350
SendMsg (SCI_CHARLEFTRECTEXTEND, 0, 0);
3027
void wxScintilla::CharLeftRectExtend()
3029
SendMsg(SCI_CHARLEFTRECTEXTEND, 0, 0);
2353
3032
// Move caret right one character, extending rectangular selection to new caret position.
2354
void wxScintilla::CharRightRectExtend() {
2355
SendMsg (SCI_CHARRIGHTRECTEXTEND, 0, 0);
3033
void wxScintilla::CharRightRectExtend()
3035
SendMsg(SCI_CHARRIGHTRECTEXTEND, 0, 0);
2358
3038
// Move caret to first position on line, extending rectangular selection to new caret position.
2359
void wxScintilla::HomeRectExtend() {
2360
SendMsg (SCI_HOMERECTEXTEND, 0, 0);
3039
void wxScintilla::HomeRectExtend()
3041
SendMsg(SCI_HOMERECTEXTEND, 0, 0);
2363
3044
// Move caret to before first visible character on line.
2364
3045
// If already there move to first character on line.
2365
3046
// In either case, extend rectangular selection to new caret position.
2366
void wxScintilla::VCHomeRectExtend() {
2367
SendMsg (SCI_VCHOMERECTEXTEND, 0, 0);
3047
void wxScintilla::VCHomeRectExtend()
3049
SendMsg(SCI_VCHOMERECTEXTEND, 0, 0);
2370
3052
// Move caret to last position on line, extending rectangular selection to new caret position.
2371
void wxScintilla::LineEndRectExtend() {
2372
SendMsg (SCI_LINEENDRECTEXTEND, 0, 0);
3053
void wxScintilla::LineEndRectExtend()
3055
SendMsg(SCI_LINEENDRECTEXTEND, 0, 0);
2375
3058
// Move caret one page up, extending rectangular selection to new caret position.
2376
void wxScintilla::PageUpRectExtend() {
2377
SendMsg (SCI_PAGEUPRECTEXTEND, 0, 0);
3059
void wxScintilla::PageUpRectExtend()
3061
SendMsg(SCI_PAGEUPRECTEXTEND, 0, 0);
2380
3064
// Move caret one page down, extending rectangular selection to new caret position.
2381
void wxScintilla::PageDownRectExtend() {
2382
SendMsg (SCI_PAGEDOWNRECTEXTEND, 0, 0);
3065
void wxScintilla::PageDownRectExtend()
3067
SendMsg(SCI_PAGEDOWNRECTEXTEND, 0, 0);
2385
3070
// Move caret to top of page, or one page up if already at top of page.
2386
void wxScintilla::StutteredPageUp() {
2387
SendMsg (SCI_STUTTEREDPAGEUP, 0, 0);
3071
void wxScintilla::StutteredPageUp()
3073
SendMsg(SCI_STUTTEREDPAGEUP, 0, 0);
2390
3076
// Move caret to top of page, or one page up if already at top of page, extending selection to new caret position.
2391
void wxScintilla::StutteredPageUpExtend() {
2392
SendMsg (SCI_STUTTEREDPAGEUPEXTEND, 0, 0);
3077
void wxScintilla::StutteredPageUpExtend()
3079
SendMsg(SCI_STUTTEREDPAGEUPEXTEND, 0, 0);
2395
3082
// Move caret to bottom of page, or one page down if already at bottom of page.
2396
void wxScintilla::StutteredPageDown() {
2397
SendMsg (SCI_STUTTEREDPAGEDOWN, 0, 0);
3083
void wxScintilla::StutteredPageDown()
3085
SendMsg(SCI_STUTTEREDPAGEDOWN, 0, 0);
2400
3088
// Move caret to bottom of page, or one page down if already at bottom of page, extending selection to new caret position.
2401
void wxScintilla::StutteredPageDownExtend() {
2402
SendMsg (SCI_STUTTEREDPAGEDOWNEXTEND, 0, 0);
3089
void wxScintilla::StutteredPageDownExtend()
3091
SendMsg(SCI_STUTTEREDPAGEDOWNEXTEND, 0, 0);
2405
3094
// Move caret left one word, position cursor at end of word.
2406
void wxScintilla::WordLeftEnd() {
2407
SendMsg (SCI_WORDLEFTEND, 0, 0);
3095
void wxScintilla::WordLeftEnd()
3097
SendMsg(SCI_WORDLEFTEND, 0, 0);
2410
3100
// Move caret left one word, position cursor at end of word, extending selection to new caret position.
2411
void wxScintilla::WordLeftEndExtend() {
2412
SendMsg (SCI_WORDLEFTENDEXTEND, 0, 0);
3101
void wxScintilla::WordLeftEndExtend()
3103
SendMsg(SCI_WORDLEFTENDEXTEND, 0, 0);
2415
3106
// Move caret right one word, position cursor at end of word.
2416
void wxScintilla::WordRightEnd() {
2417
SendMsg (SCI_WORDRIGHTEND, 0, 0);
3107
void wxScintilla::WordRightEnd()
3109
SendMsg(SCI_WORDRIGHTEND, 0, 0);
2420
3112
// Move caret right one word, position cursor at end of word, extending selection to new caret position.
2421
void wxScintilla::WordRightEndExtend() {
2422
SendMsg (SCI_WORDRIGHTENDEXTEND, 0, 0);
3113
void wxScintilla::WordRightEndExtend()
3115
SendMsg(SCI_WORDRIGHTENDEXTEND, 0, 0);
2425
3118
// Set the set of characters making up whitespace for when moving or selecting by word.
2426
3119
// Should be called after SetWordChars.
2427
void wxScintilla::SetWhitespaceChars (const wxString& characters) {
2428
SendMsg (SCI_SETWHITESPACECHARS, 0, (long)(const char*)wx2sci(characters));
3120
void wxScintilla::SetWhitespaceChars (const wxString& characters)
3122
SendMsg(SCI_SETWHITESPACECHARS, 0, (sptr_t)(const char*)wx2sci(characters));
2431
3125
// Reset the set of characters for whitespace and word characters to the defaults.
2432
void wxScintilla::SetCharsDefault() {
2433
SendMsg (SCI_SETCHARSDEFAULT, 0, 0);
3126
void wxScintilla::SetCharsDefault()
3128
SendMsg(SCI_SETCHARSDEFAULT, 0, 0);
2436
3131
// Get currently selected item position in the auto-completion list
2437
int wxScintilla::AutoCompGetCurrent() {
2438
return SendMsg (SCI_AUTOCGETCURRENT, 0, 0);
3132
int wxScintilla::AutoCompGetCurrent()
3134
return SendMsg(SCI_AUTOCGETCURRENT, 0, 0);
3137
// Get currently selected item text in the auto-completion list
3138
// Returns the length of the item text
3139
wxString wxScintilla::AutoCGetCurrentText()
3143
// determine the selected text range
3144
len = SendMsg(SCI_AUTOCGETCURRENTTEXT, 0, 0);
3145
if (!len) return wxEmptyString;
3147
wxMemoryBuffer mbuf(len+2);
3148
char* buf = (char*)mbuf.GetWriteBuf(len+1);
3149
SendMsg(SCI_AUTOCGETCURRENTTEXT, 0, (sptr_t)buf);
3150
mbuf.UngetWriteBuf(len);
2441
3155
// Enlarge the document to a particular size of text bytes.
2442
void wxScintilla::Allocate (int bytes) {
2443
SendMsg (SCI_ALLOCATE, bytes, 0);
3156
void wxScintilla::Allocate (int bytes)
3158
SendMsg(SCI_ALLOCATE, bytes, 0);
2446
3161
// Target as UTF8 (SCI_TARGETASUTF8) not supported
2450
3165
// Set endoce from UTF8 (SCI_ENCODEDFROMUTF8) not supported
2452
// Returns the position of a column on a line taking the width of tabs into account.
2453
int wxScintilla::FindColumn (int line, int column) {
2454
return SendMsg (SCI_ENCODEDFROMUTF8, line, column);
3167
// Find the position of a column on a line taking into account tabs and
3168
// multi-byte characters. If beyond end of line, return line end position.
3169
int wxScintilla::FindColumn (int line, int column)
3171
return SendMsg(SCI_ENCODEDFROMUTF8, line, column);
2457
3174
// Can the caret preferred x position only be changed by explicit movement commands?
2458
bool wxScintilla::GetCaretSticky () {
2459
return SendMsg (SCI_GETCARETSTICKY, 0, 0) != 0;
3175
bool wxScintilla::GetCaretSticky () const
3177
return SendMsg(SCI_GETCARETSTICKY, 0, 0) != 0;
2462
3180
// Stop the caret preferred x position changing when the user types.
2463
void wxScintilla::SetCaretSticky (bool useCaretStickyBehaviour) {
2464
SendMsg (SCI_SETCARETSTICKY, useCaretStickyBehaviour, 0);
3181
void wxScintilla::SetCaretSticky (bool useCaretStickyBehaviour)
3183
SendMsg(SCI_SETCARETSTICKY, useCaretStickyBehaviour, 0);
2467
3186
// Switch between sticky and non-sticky: meant to be bound to a key.
2468
void wxScintilla::ToggleCaretSticky () {
2469
SendMsg (SCI_TOGGLECARETSTICKY, 0, 0);
2472
// Enable/Disable convert-on-paste for line endings.
2473
void wxScintilla::SetPasteConvertEndings (bool convert) {
2474
SendMsg (SCI_SETPASTECONVERTENDINGS, convert, 0);
2477
// Get convert-on-paste setting.
2478
bool wxScintilla::GetPasteConvertEndings () {
2479
return SendMsg (SCI_GETPASTECONVERTENDINGS, 0, 0) != 0;
3187
void wxScintilla::ToggleCaretSticky ()
3189
SendMsg(SCI_TOGGLECARETSTICKY, 0, 0);
3192
// Enable/Disable convert-on-paste for line endings
3193
void wxScintilla::SetPasteConvertEndings (bool convert)
3195
SendMsg(SCI_SETPASTECONVERTENDINGS, convert, 0);
3198
// Get convert-on-paste setting
3199
bool wxScintilla::GetPasteConvertEndings () const
3201
return SendMsg(SCI_GETPASTECONVERTENDINGS, 0, 0) != 0;
2482
3204
// Duplicate the selection. If selection empty duplicate the line containing the caret.
2483
void wxScintilla::SelectionDuplicate () {
2484
SendMsg (SCI_SELECTIONDUPLICATE, 0, 0);
3205
void wxScintilla::SelectionDuplicate ()
3207
SendMsg(SCI_SELECTIONDUPLICATE, 0, 0);
3210
// Set background alpha of the caret line.
3211
void wxScintilla::SetCaretLineBackAlpha(int alpha)
3213
SendMsg(SCI_SETCARETLINEBACKALPHA, alpha, 0);
3216
// Get the background alpha of the caret line.
3217
int wxScintilla::GetCaretLineBackAlpha () const
3219
return SendMsg(SCI_GETCARETLINEBACKALPHA, 0, 0);
3222
// Set the style of the caret to be drawn.
3223
void wxScintilla::SetCaretStyle(int caretStyle)
3225
SendMsg(SCI_SETCARETSTYLE, caretStyle, 0);
3228
// Returns the current style of the caret.
3229
int wxScintilla::GetCaretStyle() const
3231
return SendMsg(SCI_GETCARETSTYLE, 0, 0);
3234
// Set the indicator used for IndicatorFillRange and IndicatorClearRange
3235
void wxScintilla::SetIndicatorCurrent(int indicator)
3237
SendMsg(SCI_SETINDICATORCURRENT, indicator, 0);
3240
// Get the current indicator
3241
int wxScintilla::GetIndicatorCurrent() const
3243
return SendMsg(SCI_GETINDICATORCURRENT, 0, 0);
3246
// Set the value used for IndicatorFillRange
3247
void wxScintilla::SetIndicatorValue(int value)
3249
SendMsg(SCI_SETINDICATORVALUE, value, 0);
3252
// Get the current indicator vaue
3253
int wxScintilla::GetIndicatorValue() const
3255
return SendMsg(SCI_GETINDICATORVALUE, 0, 0);
3258
// Turn a indicator on over a range.
3259
void wxScintilla::IndicatorFillRange(int position, int fillLength)
3261
SendMsg(SCI_INDICATORFILLRANGE, position, fillLength);
3264
// Turn a indicator off over a range.
3265
void wxScintilla::IndicatorClearRange(int position, int clearLength)
3267
SendMsg(SCI_INDICATORCLEARRANGE, position, clearLength);
3270
// Are any indicators present at position?
3271
int wxScintilla::IndicatorAllOnFor(int position)
3273
return SendMsg(SCI_INDICATORALLONFOR, position, 0);
3276
// What value does a particular indicator have at at a position?
3277
int wxScintilla::IndicatorValueAt(int indicator, int position)
3279
return SendMsg(SCI_INDICATORVALUEAT, indicator, position);
3282
// Where does a particular indicator start?
3283
int wxScintilla::IndicatorStart(int indicator, int position)
3285
return SendMsg(SCI_INDICATORSTART, indicator, position);
3288
// Where does a particular indicator end?
3289
int wxScintilla::IndicatorEnd(int indicator, int position)
3291
return SendMsg(SCI_INDICATOREND, indicator, position);
3294
// Set number of entries in position cache
3295
void wxScintilla::SetPositionCacheSize(int size)
3297
SendMsg(SCI_SETPOSITIONCACHE, size, 0);
3300
// How many entries are allocated to the position cache?
3301
int wxScintilla::GetPositionCacheSize() const
3303
return SendMsg(SCI_GETPOSITIONCACHE, 0, 0);
3306
// Copy the selection, if selection empty copy the line with the caret
3307
void wxScintilla::CopyAllowLine()
3309
SendMsg(SCI_COPYALLOWLINE, 0, 0);
3312
// Compact the document buffer and return a read-only pointer to the
3313
// characters in the document.
3314
// defined later as wxUIntPtr wxScintilla::GetCharacterPointer() const;
3316
int wxScintilla::GetCharacterPointer() const
3318
return SendMsg(SCI_GETCHARACTERPOINTER, 0, 0);
3322
// Always interpret keyboard input as Unicode
3323
void wxScintilla::SetKeysUnicode(bool keysUnicode)
3325
SendMsg(SCI_SETKEYSUNICODE, keysUnicode, 0);
3328
// Are keys always interpreted as Unicode?
3329
bool wxScintilla::GetKeysUnicode() const
3331
return SendMsg(SCI_GETKEYSUNICODE, 0, 0) != 0;
3334
// Set the alpha fill colour of the given indicator.
3335
void wxScintilla::IndicSetAlpha(int indicator, int alpha)
3337
SendMsg(SCI_INDICSETALPHA, indicator, alpha);
3340
// Get the alpha fill colour of the given indicator.
3341
int wxScintilla::IndicGetAlpha(int indicator) const
3343
return SendMsg(SCI_INDICGETALPHA, indicator, 0);
3346
// Set extra ascent for each line
3347
void wxScintilla::SetExtraAscent(int extraAscent)
3349
SendMsg(SCI_SETEXTRAASCENT, extraAscent, 0);
3352
// Get extra ascent for each line
3353
int wxScintilla::GetExtraAscent() const
3355
return SendMsg(SCI_GETEXTRAASCENT, 0, 0);
3358
// Set extra descent for each line
3359
void wxScintilla::SetExtraDescent(int extraDescent)
3361
SendMsg(SCI_SETEXTRADESCENT, extraDescent, 0);
3364
// Get extra descent for each line
3365
int wxScintilla::GetExtraDescent() const
3367
return SendMsg(SCI_GETEXTRADESCENT, 0, 0);
3370
// Which symbol was defined for markerNumber with MarkerDefine
3371
int wxScintilla::MarkerSymbolDefined(int markerNumber)
3373
return SendMsg(SCI_MARKERSYMBOLDEFINED, markerNumber, 0);
3376
// Set the text in the text margin for a line
3377
void wxScintilla::MarginSetText(int line, const wxString& text)
3379
SendMsg(SCI_MARGINSETTEXT, line, (sptr_t)(const char*)wx2sci(text));
3382
// Get the text in the text margin for a line
3383
wxString wxScintilla::MarginGetText(int line) const
3385
int len = LineLength(line);
3386
if (!len) return wxEmptyString;
3388
wxMemoryBuffer mbuf(len+1);
3389
char* buf = (char*)mbuf.GetWriteBuf(len+1);
3390
SendMsg(SCI_MARGINGETTEXT, (sptr_t)buf);
3391
mbuf.UngetWriteBuf(len);
3396
// Set the style number for the text margin for a line
3397
void wxScintilla::MarginSetStyle(int line, int style)
3399
SendMsg(SCI_MARGINSETSTYLE, line, style);
3402
// Get the style number for the text margin for a line
3403
int wxScintilla::MarginGetStyle(int line) const
3405
return SendMsg(SCI_MARGINGETSTYLE, line, 0);
3408
// Set the style in the text margin for a line
3409
void wxScintilla::MarginSetStyles(int line, const wxString& styles)
3411
SendMsg(SCI_MARGINSETSTYLES, line, (sptr_t)(const char*)wx2sci(styles));
3414
// Get the styles in the text margin for a line
3415
wxString wxScintilla::MarginGetStyles(int line) const
3417
int len = LineLength(line);
3418
if (!len) return wxEmptyString;
3420
wxMemoryBuffer mbuf(len+1);
3421
char* buf = (char*)mbuf.GetWriteBuf(len+1);
3422
SendMsg(SCI_MARGINGETSTYLES, (sptr_t)buf);
3423
mbuf.UngetWriteBuf(len);
3428
// Clear the margin text on all lines
3429
void wxScintilla::MarginTextClearAll()
3431
SendMsg(SCI_MARGINTEXTCLEARALL, 0, 0);
3434
// Get the start of the range of style numbers used for margin text
3435
void wxScintilla::MarginSetStyleOffset(int style)
3437
SendMsg(SCI_MARGINSETSTYLEOFFSET, style, 0);
3440
// Get the start of the range of style numbers used for margin text
3441
int wxScintilla::MarginGetStyleOffset() const
3443
return SendMsg(SCI_MARGINGETSTYLEOFFSET, 0, 0);
3446
// Set the annotation text for a line
3447
void wxScintilla::AnnotationSetText(int line, const wxString& text)
3449
SendMsg(SCI_ANNOTATIONSETTEXT, line, (sptr_t)(const char*)wx2sci(text));
3452
// Get the annotation text for a line
3453
wxString wxScintilla::AnnotationGetText(int line) const
3455
int len = LineLength(line);
3456
if (!len) return wxEmptyString;
3458
wxMemoryBuffer mbuf(len+1);
3459
char* buf = (char*)mbuf.GetWriteBuf(len+1);
3460
SendMsg(SCI_ANNOTATIONGETTEXT, (sptr_t)buf);
3461
mbuf.UngetWriteBuf(len);
3466
// Set the style number for the annotations for a line
3467
void wxScintilla::AnnotationSetStyle(int line, int style)
3469
SendMsg(SCI_ANNOTATIONSETSTYLE, line, style);
3472
// Get the style number for the annotations for a line
3473
int wxScintilla::AnnotationGetStyle(int line) const
3475
return SendMsg(SCI_ANNOTATIONGETSTYLE, line, 0);
3478
// Set the annotation styles for a line
3479
void wxScintilla::AnnotationSetStyles(int line, const wxString& styles)
3481
SendMsg(SCI_ANNOTATIONSETSTYLES, line, (sptr_t)(const char*)wx2sci(styles));
3484
// Get the annotation styles for a line
3485
wxString wxScintilla::AnnotationGetStyles(int line) const
3487
int len = LineLength(line);
3488
if (!len) return wxEmptyString;
3490
wxMemoryBuffer mbuf(len+1);
3491
char* buf = (char*)mbuf.GetWriteBuf(len+1);
3492
SendMsg(SCI_ANNOTATIONGETSTYLES, (sptr_t)buf);
3493
mbuf.UngetWriteBuf(len);
3498
// Get the number of annotation lines for a line
3499
int wxScintilla::AnnotationGetLines(int line) const
3501
return SendMsg(SCI_ANNOTATIONGETLINES, line, 0);
3504
// Clear the annotations from all lines
3505
void wxScintilla::AnnotationClearAll()
3507
SendMsg(SCI_ANNOTATIONCLEARALL, 0, 0);
3510
// Set the visibility for the annotations for a view
3511
void wxScintilla::AnnotationSetVisible(int visible)
3513
SendMsg(SCI_ANNOTATIONSETVISIBLE, visible, 0);
3516
// Get the visibility for the annotations for a view
3517
int wxScintilla::AnnotationGetVisible() const
3519
return SendMsg(SCI_ANNOTATIONGETVISIBLE, 0, 0);
3522
// Get the start of the range of style numbers used for annotations
3523
void wxScintilla::AnnotationSetStyleOffset(int style)
3525
SendMsg(SCI_ANNOTATIONSETSTYLEOFFSET, style, 0);
3528
// Get the start of the range of style numbers used for annotations
3529
int wxScintilla::AnnotationGetStyleOffset() const
3531
return SendMsg(SCI_ANNOTATIONGETSTYLEOFFSET, 0, 0);
3534
// Add a container action to the undo stack
3535
void wxScintilla::AddUndoAction(int token, int flags)
3537
SendMsg(SCI_ADDUNDOACTION, token, flags);
3540
// Find the position of a character from a point within the window.
3541
int wxScintilla::CharPositionFromPoint(int x, int y)
3543
return SendMsg(SCI_CHARPOSITIONFROMPOINT, x, y);
3546
// Find the position of a character from a point within the window.
3547
// Return INVALID_POSITION if not close to text.
3548
int wxScintilla::CharPositionFromPointClose(int x, int y)
3550
return SendMsg(SCI_CHARPOSITIONFROMPOINTCLOSE, x, y);
3553
// Set whether multiple selections can be made
3554
void wxScintilla::SetMultipleSelection(bool multipleSelection)
3556
SendMsg(SCI_SETMULTIPLESELECTION, multipleSelection, 0);
3559
// Whether multiple selections can be made
3560
bool wxScintilla::GetMultipleSelection() const
3562
return SendMsg(SCI_GETMULTIPLESELECTION, 0, 0) != 0;
3565
// Set whether typing can be performed into multiple selections
3566
void wxScintilla::SetAdditionalSelectionTyping(bool additionalSelectionTyping)
3568
SendMsg(SCI_SETADDITIONALSELECTIONTYPING, additionalSelectionTyping, 0);
3571
// Whether typing can be performed into multiple selections
3572
bool wxScintilla::GetAdditionalSelectionTyping() const
3574
return SendMsg(SCI_GETADDITIONALSELECTIONTYPING, 0, 0) != 0;
3577
// Set whether additional carets will blink
3578
void wxScintilla::SetAdditionalCaretsBlink(bool additionalCaretsBlink)
3580
SendMsg(SCI_SETADDITIONALCARETSBLINK, additionalCaretsBlink, 0);
3583
// Whether additional carets will blink
3584
bool wxScintilla::GetAdditionalCaretsBlink() const
3586
return SendMsg(SCI_GETADDITIONALCARETSBLINK, 0, 0) != 0;
3589
// Set whether additional carets are visible
3590
void wxScintilla::SetAdditionalCaretsVisible(bool additionalCaretsBlink)
3592
SendMsg(SCI_SETADDITIONALCARETSVISIBLE, additionalCaretsBlink, 0);
3595
// Whether additional carets are visible
3596
bool wxScintilla::GetAdditionalCaretsVisible() const
3598
return SendMsg(SCI_GETADDITIONALCARETSVISIBLE, 0, 0) != 0;
3601
// How many selections are there?
3602
int wxScintilla::GetSelections() const
3604
return SendMsg(SCI_GETSELECTIONS, 0, 0);
3607
// Clear selections to a single empty stream selection
3608
void wxScintilla::ClearSelections()
3610
SendMsg(SCI_CLEARSELECTIONS, 0, 0);
3613
// Set a simple selection
3614
int wxScintilla::SetSelectionInt(int caret, int anchor)
3616
return SendMsg(SCI_SETSELECTION, caret, anchor);
3620
int wxScintilla::AddSelection(int caret, int anchor)
3622
return SendMsg(SCI_ADDSELECTION, caret, anchor);
3625
// Set the main selection
3626
void wxScintilla::SetMainSelection(int selection)
3628
SendMsg(SCI_SETMAINSELECTION, selection, 0);
3631
// Which selection is the main selection
3632
int wxScintilla::GetMainSelection() const
3634
return SendMsg(SCI_GETMAINSELECTION, 0, 0);
3636
void wxScintilla::SetSelectionNCaret(int selection, int pos)
3638
SendMsg(SCI_SETSELECTIONNCARET, selection, pos);
3640
int wxScintilla::GetSelectionNCaret(int selection) const
3642
return SendMsg(SCI_GETSELECTIONNCARET, selection, 0);
3644
void wxScintilla::SetSelectionNAnchor(int selection, int posAnchor)
3646
SendMsg(SCI_SETSELECTIONNANCHOR, selection, posAnchor);
3648
int wxScintilla::GetSelectionNAnchor(int selection) const
3650
return SendMsg(SCI_GETSELECTIONNANCHOR, selection, 0);
3652
void wxScintilla::SetSelectionNCaretVirtualSpace(int selection, int space)
3654
SendMsg(SCI_SETSELECTIONNCARETVIRTUALSPACE, selection, space);
3656
int wxScintilla::GetSelectionNCaretVirtualSpace(int selection) const
3658
return SendMsg(SCI_GETSELECTIONNCARETVIRTUALSPACE, selection, 0);
3661
void wxScintilla::SetSelectionNAnchorVirtualSpace(int selection, int space)
3663
SendMsg(SCI_SETSELECTIONNANCHORVIRTUALSPACE, selection, space);
3665
int wxScintilla::GetSelectionNAnchorVirtualSpace(int selection) const
3667
return SendMsg(SCI_GETSELECTIONNANCHORVIRTUALSPACE, selection, 0);
3669
// Sets the position that starts the selection - this becomes the anchor.
3670
void wxScintilla::SetSelectionNStart(int selection, int pos)
3672
SendMsg(SCI_SETSELECTIONNSTART, selection, pos);
3675
// Returns the position at the start of the selection.
3676
int wxScintilla::GetSelectionNStart(int selection) const
3678
return SendMsg(SCI_GETSELECTIONNSTART, selection, 0);
3681
// Sets the position that ends the selection - this becomes the currentPosition.
3682
void wxScintilla::SetSelectionNEnd(int selection, int pos)
3684
SendMsg(SCI_SETSELECTIONNEND, selection, pos);
3687
// Returns the position at the end of the selection.
3688
int wxScintilla::GetSelectionNEnd(int selection) const
3690
return SendMsg(SCI_GETSELECTIONNEND, selection, 0);
3693
void wxScintilla::SetRectangularSelectionCaret(int pos)
3695
SendMsg(SCI_SETRECTANGULARSELECTIONCARET, pos, 0);
3698
int wxScintilla::GetRectangularSelectionCaret() const
3700
return SendMsg(SCI_GETRECTANGULARSELECTIONCARET, 0, 0);
3703
void wxScintilla::SetRectangularSelectionAnchor(int posAnchor)
3705
SendMsg(SCI_SETRECTANGULARSELECTIONANCHOR, posAnchor, 0);
3708
int wxScintilla::GetRectangularSelectionAnchor() const
3710
return SendMsg(SCI_GETRECTANGULARSELECTIONANCHOR, 0, 0);
3713
void wxScintilla::SetRectangularSelectionCaretVirtualSpace(int space)
3715
SendMsg(SCI_SETRECTANGULARSELECTIONCARETVIRTUALSPACE, space, 0);
3718
int wxScintilla::GetRectangularSelectionCaretVirtualSpace() const
3720
return SendMsg(SCI_GETRECTANGULARSELECTIONCARETVIRTUALSPACE, 0, 0);
3723
void wxScintilla::SetRectangularSelectionAnchorVirtualSpace(int space)
3725
SendMsg(SCI_SETRECTANGULARSELECTIONANCHORVIRTUALSPACE, space, 0);
3728
int wxScintilla::GetRectangularSelectionAnchorVirtualSpace() const
3730
return SendMsg(SCI_GETRECTANGULARSELECTIONANCHORVIRTUALSPACE, 0, 0);
3733
void wxScintilla::SetVirtualSpaceOptions(int virtualSpaceOptions)
3735
SendMsg(SCI_SETVIRTUALSPACEOPTIONS, virtualSpaceOptions, 0);
3738
int wxScintilla::GetVirtualSpaceOptions() const
3740
return SendMsg(SCI_GETVIRTUALSPACEOPTIONS, 0, 0);
3743
// On GTK+, allow selecting the modifier key to use for mouse-based
3744
// rectangular selection. Often the window manager requires Alt+Mouse Drag
3745
// for moving windows.
3746
// Valid values are SCMOD_CTRL(default), SCMOD_ALT, or SCMOD_SUPER.
3747
void wxScintilla::SetRectangularSelectionModifier(int modifier)
3749
SendMsg(SCI_SETRECTANGULARSELECTIONMODIFIER, modifier, 0);
3752
// Get the modifier key used for rectangular selection.
3753
int wxScintilla::GetRectangularSelectionModifier() const
3755
return SendMsg(SCI_GETRECTANGULARSELECTIONMODIFIER, 0, 0);
3758
// Set the foreground colour of additional selections.
3759
// Must have previously called SetSelFore with non-zero first argument for this to have an effect.
3760
void wxScintilla::SetAdditionalSelFore(const wxColour& fore)
3762
SendMsg(SCI_SETADDITIONALSELFORE, wxColourAsLong(fore), 0);
3765
// Set the background colour of additional selections.
3766
// Must have previously called SetSelBack with non-zero first argument for this to have an effect.
3767
void wxScintilla::SetAdditionalSelBack(const wxColour& back)
3769
SendMsg(SCI_SETADDITIONALSELBACK, wxColourAsLong(back), 0);
3772
// Set the alpha of the selection.
3773
void wxScintilla::SetAdditionalSelAlpha(int alpha)
3775
SendMsg(SCI_SETADDITIONALSELALPHA, alpha, 0);
3778
// Get the alpha of the selection.
3779
int wxScintilla::GetAdditionalSelAlpha() const
3781
return SendMsg(SCI_GETADDITIONALSELALPHA, 0, 0);
3784
// Set the foreground colour of additional carets.
3785
void wxScintilla::SetAdditionalCaretFore(const wxColour& fore)
3787
SendMsg(SCI_SETADDITIONALCARETFORE, wxColourAsLong(fore), 0);
3790
// Get the foreground colour of additional carets.
3791
wxColour wxScintilla::GetAdditionalCaretFore() const
3793
long c = SendMsg(SCI_GETADDITIONALCARETFORE, 0, 0);
3794
return wxColourFromLong(c);
3797
// Set the main selection to the next selection.
3798
void wxScintilla::RotateSelection()
3800
SendMsg(SCI_ROTATESELECTION, 0, 0);
3803
// Swap that caret and anchor of the main selection.
3804
void wxScintilla::SwapMainAnchorCaret()
3806
SendMsg(SCI_SWAPMAINANCHORCARET, 0, 0);
3809
wxSciFnDirect wxScintilla::GetDirectFunction()
3811
return (wxSciFnDirect)SendMsg(SCI_GETDIRECTFUNCTION , 0, 0);
3814
wxIntPtr wxScintilla::GetDirectPointer() const
3816
return (wxIntPtr)SendMsg(SCI_GETDIRECTPOINTER , 0, 0);
3819
wxUIntPtr wxScintilla::GetCharacterPointer() const
3821
return (wxUIntPtr)SendMsg(SCI_GETCHARACTERPOINTER , 0, 0);
3824
void wxScintilla::GrabSCIFocus()
3826
SendMsg(SCI_GRABFOCUS , 0, 0);
3829
void wxScintilla::LoadLexerLibrary(const wxString& path)
3831
SendMsg(SCI_LOADLEXERLIBRARY , 0, (sptr_t)(const char*)wx2sci(path));
3834
void wxScintilla::SetUsePalette(bool allowPaletteUse)
3836
SendMsg(SCI_SETUSEPALETTE ,allowPaletteUse, 0);
3839
bool wxScintilla::GetUsePalette()
3841
return SendMsg(SCI_GETUSEPALETTE , 0, 0) != 0;
2487
3845
// Start notifying the container of all key presses and commands.
2488
void wxScintilla::StartRecord () {
2489
SendMsg (SCI_STARTRECORD, 0, 0);
3846
void wxScintilla::StartRecord ()
3848
SendMsg(SCI_STARTRECORD, 0, 0);
2492
3851
// Stop notifying the container of all key presses and commands.
2493
void wxScintilla::StopRecord () {
2494
SendMsg (SCI_STOPRECORD, 0, 0);
3852
void wxScintilla::StopRecord ()
3854
SendMsg(SCI_STOPRECORD, 0, 0);
2497
3857
// Set the lexing language of the document.
2498
void wxScintilla::SetLexer (int lexer) {
2499
SendMsg (SCI_SETLEXER, lexer, 0);
3858
void wxScintilla::SetLexer (int lexer)
3860
SendMsg(SCI_SETLEXER, lexer, 0);
2502
3863
// Retrieve the lexing language of the document.
2503
int wxScintilla::GetLexer () {
2504
return SendMsg (SCI_GETLEXER, 0, 0);
3864
int wxScintilla::GetLexer () const
3866
return SendMsg(SCI_GETLEXER, 0, 0);
2507
3869
// Colourise a segment of the document using the current lexing language.
2508
void wxScintilla::Colourise (int startPos, int endPos) {
2509
SendMsg (SCI_COLOURISE, startPos, endPos);
3870
void wxScintilla::Colourise (int start, int end)
3872
SendMsg(SCI_COLOURISE, start, end);
2512
3875
// Set up a value that may be used by a lexer for some optional feature.
2513
void wxScintilla::SetProperty (const wxString& key, const wxString& value) {
2514
SendMsg (SCI_SETPROPERTY, (long)(const char*)wx2sci(key), (long)(const char*)wx2sci(value));
2517
// Retrieve a value that may be used by a lexer for some optional feature.
2518
wxString wxScintilla::GetProperty (const wxString& key) {
2519
wxMemoryBuffer mbuf(256); //? TODO: make size 256 variable
2520
char* buf = (char*)mbuf.GetWriteBuf(256+1);
2521
SendMsg (SCI_GETPROPERTY, (long)(const char*)wx2sci(key), (long)buf);
2522
mbuf.UngetWriteBuf(mbuf.GetBufSize());
2526
wxString wxScintilla::GetPropertyExpanded (const wxString& key) {
2527
wxMemoryBuffer mbuf(256); //? TODO: make size 256 variable
2528
char* buf = (char*)mbuf.GetWriteBuf(256+1);
2529
SendMsg (SCI_GETPROPERTYEXPANDED, (long)(const char*)wx2sci(key), (long)buf);
2530
mbuf.UngetWriteBuf(mbuf.GetBufSize());
2534
int wxScintilla::GetPropertyInt (const wxString& key) {
2535
return SendMsg (SCI_GETPROPERTYINT, (long)(const char*)wx2sci(key), 0);
2538
// Retrieve the number of bits the current lexer needs for styling.
2539
int wxScintilla::GetStyleBitsNeeded () {
2540
return SendMsg (SCI_GETSTYLEBITSNEEDED, 0, 0);
3876
void wxScintilla::SetProperty (const wxString& key, const wxString& value)
3878
SendMsg(SCI_SETPROPERTY, (sptr_t)(const char*)wx2sci(key), (sptr_t)(const char*)wx2sci(value));
2543
3881
// Set up the key words used by the lexer.
2544
void wxScintilla::SetKeyWords (int keywordSet, const wxString& keyWords) {
2545
SendMsg (SCI_SETKEYWORDS, keywordSet, (long)(const char*)wx2sci(keyWords));
3882
void wxScintilla::SetKeyWords(int keywordSet, const wxString& keyWords)
3884
SendMsg(SCI_SETKEYWORDS, keywordSet, (sptr_t)(const char*)wx2sci(keyWords));
2548
3887
// Set the lexing language of the document based on string name.
2549
void wxScintilla::SetLexerLanguage (const wxString& language) {
2550
SendMsg (SCI_SETLEXERLANGUAGE, 0, (long)(const char*)wx2sci(language));
3888
void wxScintilla::SetLexerLanguage(const wxString& language)
3890
SendMsg(SCI_SETLEXERLANGUAGE, 0, (sptr_t)(const char*)wx2sci(language));
3893
// Retrieve a 'property' value previously set with SetProperty.
3894
wxString wxScintilla::GetProperty (const wxString& key)
3896
int len = SendMsg(SCI_GETPROPERTY, (sptr_t)(const char*)wx2sci(key), 0);
3897
if (!len) return wxEmptyString;
3899
wxMemoryBuffer mbuf(len+1);
3900
char* buf = (char*)mbuf.GetWriteBuf(len+1);
3901
SendMsg(SCI_GETPROPERTY, (uptr_t)(const char*)wx2sci(key), (sptr_t)buf);
3902
mbuf.UngetWriteBuf(len);
3907
// Retrieve a 'property' value previously set with SetProperty,
3908
// with '$()' variable replacement on returned buffer.
3909
wxString wxScintilla::GetPropertyExpanded (const wxString& key)
3911
int len = SendMsg(SCI_GETPROPERTYEXPANDED, (uptr_t)(const char*)wx2sci(key), 0);
3912
if (!len) return wxEmptyString;
3914
wxMemoryBuffer mbuf(len+1);
3915
char* buf = (char*)mbuf.GetWriteBuf(len+1);
3916
SendMsg(SCI_GETPROPERTYEXPANDED, (uptr_t)(const char*)wx2sci(key), (uptr_t)buf);
3917
mbuf.UngetWriteBuf(len);
3922
// Retrieve a 'property' value previously set with SetProperty,
3923
// interpreted as an int AFTER any '$()' variable replacement.
3924
int wxScintilla::GetPropertyInt (const wxString& key) const
3926
return SendMsg(SCI_GETPROPERTYINT, (sptr_t)(const char*)wx2sci(key), 0);
3929
// Retrieve the number of bits the current lexer needs for styling.
3930
int wxScintilla::GetStyleBitsNeeded () const
3932
return SendMsg(SCI_GETSTYLEBITSNEEDED, 0, 0);
3935
// Retrieve the name of the lexer.
3936
wxString wxScintilla::GetLexerLanguage() const
3940
// determine the lexers language string length
3941
len = SendMsg(SCI_GETLEXERLANGUAGE, 0, 0);
3942
if (!len) return wxEmptyString;
3944
wxMemoryBuffer mbuf(len+2);
3945
char* buf = (char*)mbuf.GetWriteBuf(len+1);
3946
SendMsg(SCI_GETLEXERLANGUAGE, 0, (sptr_t)buf);
3947
mbuf.UngetWriteBuf(len);
2553
3952
// END of generated section