📄 wxscintilla.cpp
字号:
}// Retrieve the document width assumed for scrolling.int wxScintilla::GetScrollWidth() { return SendMsg (SCI_GETSCROLLWIDTH, 0, 0);}// Measure the pixel width of some text in a particular style.// NUL terminated text argument.// Does not handle tab or control characters.int wxScintilla::TextWidth (int style, const wxString& text) { return SendMsg (SCI_TEXTWIDTH, style, (long)(const char*)wx2sci(text));}// Sets the scroll range so that maximum scroll position has// the last line at the bottom of the view (default).// Setting this to false allows scrolling one page below the last line.void wxScintilla::SetEndAtLastLine (bool endAtLastLine) { SendMsg (SCI_SETENDATLASTLINE, endAtLastLine, 0);}// Retrieve whether the maximum scroll position has the last// line at the bottom of the view.bool wxScintilla::GetEndAtLastLine() { return SendMsg (SCI_GETENDATLASTLINE, 0, 0) != 0;}// Retrieve the height of a particular line of text in pixels.int wxScintilla::TextHeight (int line) { return SendMsg (SCI_TEXTHEIGHT, line, 0);}// Show or hide the vertical scroll bar.void wxScintilla::SetUseVerticalScrollBar (bool show) { SendMsg (SCI_SETVSCROLLBAR, show, 0);}// Is the vertical scroll bar visible?bool wxScintilla::GetUseVerticalScrollBar() { return SendMsg (SCI_GETVSCROLLBAR, 0, 0) != 0;}// Add text to the document at current position.void wxScintilla::AppendText (const wxString& text) { wxWX2MBbuf buf = (wxWX2MBbuf)wx2sci(text); SendMsg (SCI_APPENDTEXT, strlen(buf), (long)(const char*)buf);}// Append a string to the end of the document without changing the selection.void wxScintilla::AppendText (int length, const wxString& text) { SendMsg (SCI_APPENDTEXT, length, (long)(const char*)wx2sci(text));}// Is drawing done in two phases with backgrounds drawn before foregrounds?bool wxScintilla::GetTwoPhaseDraw() { return SendMsg (SCI_GETTWOPHASEDRAW, 0, 0) != 0;}// In twoPhaseDraw mode, drawing is performed in two phases, first the background// and then the foreground. This avoids chopping off characters that overlap the next run.void wxScintilla::SetTwoPhaseDraw (bool twoPhase) { SendMsg (SCI_SETTWOPHASEDRAW, twoPhase, 0);}// Make the target range start and end be the same as the selection range start and end.void wxScintilla::TargetFromSelection() { SendMsg (SCI_TARGETFROMSELECTION, 0, 0);}// Join the lines in the target.void wxScintilla::LinesJoin() { SendMsg (SCI_LINESJOIN, 0, 0);}// Split the lines in the target into lines that are less wide than pixel where possible.void wxScintilla::LinesSplit (int pixels) { SendMsg (SCI_LINESSPLIT, pixels, 0);}// Set the colours used as a chequerboard pattern in the fold marginvoid wxScintilla::SetFoldMarginColour (bool useSetting, const wxColour& back) { SendMsg (SCI_SETFOLDMARGINCOLOUR, useSetting, wxColourAsLong(back));}void wxScintilla::SetFoldMarginHiColour (bool useSetting, const wxColour& fore) { SendMsg (SCI_SETFOLDMARGINHICOLOUR, useSetting, wxColourAsLong(fore));}// Move caret down one line.void wxScintilla::LineDown() { SendMsg (SCI_LINEDOWN, 0, 0);}// Move caret down one line extending selection to new caret position.void wxScintilla::LineDownExtend() { SendMsg (SCI_LINEDOWNEXTEND, 0, 0);}// Move caret up one line.void wxScintilla::LineUp() { SendMsg (SCI_LINEUP, 0, 0);}// Move caret up one line extending selection to new caret position.void wxScintilla::LineUpExtend() { SendMsg (SCI_LINEUPEXTEND, 0, 0);}// Move caret left one character.void wxScintilla::CharLeft() { SendMsg (SCI_CHARLEFT, 0, 0);}// Move caret left one character extending selection to new caret position.void wxScintilla::CharLeftExtend() { SendMsg (SCI_CHARLEFTEXTEND, 0, 0);}// Move caret right one character.void wxScintilla::CharRight() { SendMsg (SCI_CHARRIGHT, 0, 0);}// Move caret right one character extending selection to new caret position.void wxScintilla::CharRightExtend() { SendMsg (SCI_CHARRIGHTEXTEND, 0, 0);}// Move caret left one word.void wxScintilla::WordLeft() { SendMsg (SCI_WORDLEFT, 0, 0);}// Move caret left one word extending selection to new caret position.void wxScintilla::WordLeftExtend() { SendMsg (SCI_WORDLEFTEXTEND, 0, 0);}// Move caret right one word.void wxScintilla::WordRight() { SendMsg (SCI_WORDRIGHT, 0, 0);}// Move caret right one word extending selection to new caret position.void wxScintilla::WordRightExtend() { SendMsg (SCI_WORDRIGHTEXTEND, 0, 0);}// Move caret to first position on line.void wxScintilla::Home() { SendMsg (SCI_HOME, 0, 0);}// Move caret to first position on line extending selection to new caret position.void wxScintilla::HomeExtend() { SendMsg (SCI_HOMEEXTEND, 0, 0);}// Move caret to last position on line.void wxScintilla::LineEnd() { SendMsg (SCI_LINEEND, 0, 0);}// Move caret to last position on line extending selection to new caret position.void wxScintilla::LineEndExtend() { SendMsg (SCI_LINEENDEXTEND, 0, 0);}// Move caret to first position in document.void wxScintilla::DocumentStart() { SendMsg (SCI_DOCUMENTSTART, 0, 0);}// Move caret to first position in document extending selection to new caret position.void wxScintilla::DocumentStartExtend() { SendMsg (SCI_DOCUMENTSTARTEXTEND, 0, 0);}// Move caret to last position in document.void wxScintilla::DocumentEnd() { SendMsg (SCI_DOCUMENTEND, 0, 0);}// Move caret to last position in document extending selection to new caret position.void wxScintilla::DocumentEndExtend() { SendMsg (SCI_DOCUMENTENDEXTEND, 0, 0);}// Move caret one page up.void wxScintilla::PageUp() { SendMsg (SCI_PAGEUP, 0, 0);}// Move caret one page up extending selection to new caret position.void wxScintilla::PageUpExtend() { SendMsg (SCI_PAGEUPEXTEND, 0, 0);}// Move caret one page down.void wxScintilla::PageDown() { SendMsg (SCI_PAGEDOWN, 0, 0);}// Move caret one page down extending selection to new caret position.void wxScintilla::PageDownExtend() { SendMsg (SCI_PAGEDOWNEXTEND, 0, 0);}// Switch from insert to overtype mode or the reverse.void wxScintilla::EditToggleOvertype() { SendMsg (SCI_EDITTOGGLEOVERTYPE, 0, 0);}// Cancel any modes such as call tip or auto-completion list display.void wxScintilla::Cancel() { SendMsg (SCI_CANCEL, 0, 0);}// Delete the selection or if no selection, the character before the caret.void wxScintilla::DeleteBack() { SendMsg (SCI_DELETEBACK, 0, 0);}// If selection is empty or all on one line replace the selection with a tab character.// If more than one line selected, indent the lines.void wxScintilla::Tab() { SendMsg (SCI_TAB, 0, 0);}// Dedent the selected lines.void wxScintilla::BackTab() { SendMsg (SCI_BACKTAB, 0, 0);}// Insert a new line, may use a CRLF, CR or LF depending on EOL mode.void wxScintilla::NewLine() { SendMsg (SCI_NEWLINE, 0, 0);}// Insert a Form Feed character.void wxScintilla::FormFeed() { SendMsg (SCI_FORMFEED, 0, 0);}// Move caret to before first visible character on line.// If already there move to first character on line.void wxScintilla::VCHome() { SendMsg (SCI_VCHOME, 0, 0);}// Like VCHome but extending selection to new caret position.void wxScintilla::VCHomeExtend() { SendMsg (SCI_VCHOMEEXTEND, 0, 0);}// Magnify the displayed text by increasing the sizes by 1 point.void wxScintilla::ZoomIn() { SendMsg (SCI_ZOOMIN, 0, 0);}// Make the displayed text smaller by decreasing the sizes by 1 point.void wxScintilla::ZoomOut() { SendMsg (SCI_ZOOMOUT, 0, 0);}// Delete the word to the left of the caret.void wxScintilla::DelWordLeft() { SendMsg (SCI_DELWORDLEFT, 0, 0);}// Delete the word to the right of the caret.void wxScintilla::DelWordRight() { SendMsg (SCI_DELWORDRIGHT, 0, 0);}// Cut the line containing the caret.void wxScintilla::LineCut() { SendMsg (SCI_LINECUT, 0, 0);}// Delete the line containing the caret.void wxScintilla::LineDelete() { SendMsg (SCI_LINEDELETE, 0, 0);}// Switch the current line with the previous.void wxScintilla::LineTranspose() { SendMsg (SCI_LINETRANSPOSE, 0, 0);}// Duplicate the current line.void wxScintilla::LineDuplicate() { SendMsg (SCI_LINEDUPLICATE, 0, 0);}// Transform the selection to lower case.void wxScintilla::LowerCase() { SendMsg (SCI_LOWERCASE, 0, 0);}// Transform the selection to upper case.void wxScintilla::UpperCase() { SendMsg (SCI_UPPERCASE, 0, 0);}// Scroll the document down, keeping the caret visible.void wxScintilla::LineScrollDown() { SendMsg (SCI_LINESCROLLDOWN, 0, 0);}// Scroll the document up, keeping the caret visible.void wxScintilla::LineScrollUp() { SendMsg (SCI_LINESCROLLUP, 0, 0);}// Delete the selection or if no selection, the character before the caret.// Will not delete the character before at the start of a line.void wxScintilla::DeleteBackNotLine() { SendMsg (SCI_DELETEBACKNOTLINE, 0, 0);}// Move caret to first position on display line.void wxScintilla::HomeDisplay() { SendMsg (SCI_HOMEDISPLAY, 0, 0);}// Move caret to first position on display line extending selection to// new caret position.void wxScintilla::HomeDisplayExtend() { SendMsg (SCI_HOMEDISPLAYEXTEND, 0, 0);}// Move caret to last position on display line.void wxScintilla::LineEndDisplay() { SendMsg (SCI_LINEENDDISPLAY, 0, 0);}// Move caret to last position on display line extending selection to new// caret position.void wxScintilla::LineEndDisplayExtend() { SendMsg (SCI_LINEENDDISPLAYEXTEND, 0, 0);}// These are like their namesakes Home(Extend)?, LineEnd(Extend)?, VCHome(Extend)?// except they behave differently when word-wrap is enabled:// They go first to the start / end of the display line, like (Home|LineEnd)Display// The difference is that, the cursor is already at the point, it goes on to the start// or end of the document line, as appropriate for (Home|LineEnd|VCHome)(Extend)?.void wxScintilla::HomeWrap() { SendMsg (SCI_HOMEWRAP, 0, 0);}void wxScintilla::HomeWrapExtend() { SendMsg (SCI_HOMEWRAPEXTEND, 0, 0);}void wxScintilla::LineEndWrap() { SendMsg (SCI_LINEENDWRAP, 0, 0);}void wxScintilla::LineEndWrapExtend() { SendMsg (SCI_LINEENDWRAPEXTEND, 0, 0);}void wxScintilla::VCHomeWrap() { SendMsg (SCI_VCHOMEWRAP, 0, 0);}void wxScintilla::VCHomeWrapExtend() { SendMsg (SCI_VCHOMEWRAPEXTEND, 0, 0);}// Copy the line containing the caret.void wxScintilla::LineCopy() { SendMsg (SCI_LINECOPY, 0, 0);}// Move the caret inside current view if it's not there already.void wxScintilla::MoveCaretInsideView() { SendMsg (SCI_MOVECARETINSIDEVIEW, 0, 0);}// How many characters are on a line, not including end of line characters?int wxScintilla::LineLength (int line) { return SendMsg (SCI_LINELENGTH, line, 0);}// Highlight the characters at two positions.void wxScintilla::BraceHighlight (int pos1, int pos2) { SendMsg (SCI_BRACEHIGHLIGHT, pos1, pos2);}// Highlight the character at a position indicating there is no matching brace.void wxScintilla::BraceBadLight (int pos) { SendMsg (SCI_BRACEBADLIGHT, pos, 0);}// Find the position of a matching brace or INVALID_POSITION if no match.int wxScintilla::BraceMatch (int pos) { return SendMsg (SCI_BRACEMATCH, pos, 0);}// Are the end of line characters visible?bool wxScintilla::GetViewEOL() { return SendMsg (SCI_GETVIEWEOL, 0, 0) != 0;}// Make the end of line characters visible or invisible.void wxScintilla::SetViewEOL (bool visible) { SendMsg (SCI_SETVIEWEOL, visible, 0);}// Retrieve a pointer to the document object.void* wxScintill
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -