📄 stc.cpp
字号:
void wxStyledTextCtrl::HideSelection(bool normal) {
SendMsg(2163, normal, 0);
}
// Retrieve the line containing a position.
int wxStyledTextCtrl::LineFromPosition(int pos) {
return SendMsg(2166, pos, 0);
}
// Retrieve the position at the start of a line.
int wxStyledTextCtrl::PositionFromLine(int line) {
return SendMsg(2167, line, 0);
}
// Scroll horizontally and vertically.
void wxStyledTextCtrl::LineScroll(int columns, int lines) {
SendMsg(2168, columns, lines);
}
// Ensure the caret is visible.
void wxStyledTextCtrl::EnsureCaretVisible() {
SendMsg(2169, 0, 0);
}
// Replace the selected text with the argument text.
void wxStyledTextCtrl::ReplaceSelection(const wxString& text) {
SendMsg(2170, 0, (long)(const char*)wx2stc(text));
}
// Set to read only or read write.
void wxStyledTextCtrl::SetReadOnly(bool readOnly) {
SendMsg(2171, readOnly, 0);
}
// Will a paste succeed?
bool wxStyledTextCtrl::CanPaste() {
return SendMsg(2173, 0, 0) != 0;
}
// Are there any undoable actions in the undo history?
bool wxStyledTextCtrl::CanUndo() {
return SendMsg(2174, 0, 0) != 0;
}
// Delete the undo history.
void wxStyledTextCtrl::EmptyUndoBuffer() {
SendMsg(2175, 0, 0);
}
// Undo one action in the undo history.
void wxStyledTextCtrl::Undo() {
SendMsg(2176, 0, 0);
}
// Cut the selection to the clipboard.
void wxStyledTextCtrl::Cut() {
SendMsg(2177, 0, 0);
}
// Copy the selection to the clipboard.
void wxStyledTextCtrl::Copy() {
SendMsg(2178, 0, 0);
}
// Paste the contents of the clipboard into the document replacing the selection.
void wxStyledTextCtrl::Paste() {
SendMsg(2179, 0, 0);
}
// Clear the selection.
void wxStyledTextCtrl::Clear() {
SendMsg(2180, 0, 0);
}
// Replace the contents of the document with the argument text.
void wxStyledTextCtrl::SetText(const wxString& text) {
SendMsg(2181, 0, (long)(const char*)wx2stc(text));
}
// Retrieve all the text in the document.
wxString wxStyledTextCtrl::GetText() {
int len = GetTextLength();
wxMemoryBuffer mbuf(len+1); // leave room for the null...
char* buf = (char*)mbuf.GetWriteBuf(len+1);
SendMsg(2182, len+1, (long)buf);
mbuf.UngetWriteBuf(len);
mbuf.AppendByte(0);
return stc2wx(buf);
}
// Retrieve the number of characters in the document.
int wxStyledTextCtrl::GetTextLength() {
return SendMsg(2183, 0, 0);
}
// Set to overtype (true) or insert mode.
void wxStyledTextCtrl::SetOvertype(bool overtype) {
SendMsg(2186, overtype, 0);
}
// Returns true if overtype mode is active otherwise false is returned.
bool wxStyledTextCtrl::GetOvertype() {
return SendMsg(2187, 0, 0) != 0;
}
// Set the width of the insert mode caret.
void wxStyledTextCtrl::SetCaretWidth(int pixelWidth) {
SendMsg(2188, pixelWidth, 0);
}
// Returns the width of the insert mode caret.
int wxStyledTextCtrl::GetCaretWidth() {
return SendMsg(2189, 0, 0);
}
// Sets the position that starts the target which is used for updating the
// document without affecting the scroll position.
void wxStyledTextCtrl::SetTargetStart(int pos) {
SendMsg(2190, pos, 0);
}
// Get the position that starts the target.
int wxStyledTextCtrl::GetTargetStart() {
return SendMsg(2191, 0, 0);
}
// Sets the position that ends the target which is used for updating the
// document without affecting the scroll position.
void wxStyledTextCtrl::SetTargetEnd(int pos) {
SendMsg(2192, pos, 0);
}
// Get the position that ends the target.
int wxStyledTextCtrl::GetTargetEnd() {
return SendMsg(2193, 0, 0);
}
// Replace the target text with the argument text.
// Text is counted so it can contain NULs.
// Returns the length of the replacement text.
int wxStyledTextCtrl::ReplaceTarget(const wxString& text) {
wxWX2MBbuf buf = (wxWX2MBbuf)wx2stc(text);
return SendMsg(2194, strlen(buf), (long)(const char*)buf);
}
// Replace the target text with the argument text after \d processing.
// Text is counted so it can contain NULs.
// Looks for \d where d is between 1 and 9 and replaces these with the strings
// matched in the last search operation which were surrounded by \( and \).
// Returns the length of the replacement text including any change
// caused by processing the \d patterns.
int wxStyledTextCtrl::ReplaceTargetRE(const wxString& text) {
wxWX2MBbuf buf = (wxWX2MBbuf)wx2stc(text);
return SendMsg(2195, strlen(buf), (long)(const char*)buf);
}
// Search for a counted string in the target and set the target to the found
// range. Text is counted so it can contain NULs.
// Returns length of range or -1 for failure in which case target is not moved.
int wxStyledTextCtrl::SearchInTarget(const wxString& text) {
wxWX2MBbuf buf = (wxWX2MBbuf)wx2stc(text);
return SendMsg(2197, strlen(buf), (long)(const char*)buf);
}
// Set the search flags used by SearchInTarget.
void wxStyledTextCtrl::SetSearchFlags(int flags) {
SendMsg(2198, flags, 0);
}
// Get the search flags used by SearchInTarget.
int wxStyledTextCtrl::GetSearchFlags() {
return SendMsg(2199, 0, 0);
}
// Show a call tip containing a definition near position pos.
void wxStyledTextCtrl::CallTipShow(int pos, const wxString& definition) {
SendMsg(2200, pos, (long)(const char*)wx2stc(definition));
}
// Remove the call tip from the screen.
void wxStyledTextCtrl::CallTipCancel() {
SendMsg(2201, 0, 0);
}
// Is there an active call tip?
bool wxStyledTextCtrl::CallTipActive() {
return SendMsg(2202, 0, 0) != 0;
}
// Retrieve the position where the caret was before displaying the call tip.
int wxStyledTextCtrl::CallTipPosAtStart() {
return SendMsg(2203, 0, 0);
}
// Highlight a segment of the definition.
void wxStyledTextCtrl::CallTipSetHighlight(int start, int end) {
SendMsg(2204, start, end);
}
// Set the background colour for the call tip.
void wxStyledTextCtrl::CallTipSetBackground(const wxColour& back) {
SendMsg(2205, wxColourAsLong(back), 0);
}
// Set the foreground colour for the call tip.
void wxStyledTextCtrl::CallTipSetForeground(const wxColour& fore) {
SendMsg(2206, wxColourAsLong(fore), 0);
}
// Set the foreground colour for the highlighted part of the call tip.
void wxStyledTextCtrl::CallTipSetForegroundHighlight(const wxColour& fore) {
SendMsg(2207, wxColourAsLong(fore), 0);
}
// Enable use of STYLE_CALLTIP and set call tip tab size in pixels.
void wxStyledTextCtrl::CallTipUseStyle(int tabSize) {
SendMsg(2212, tabSize, 0);
}
// Find the display line of a document line taking hidden lines into account.
int wxStyledTextCtrl::VisibleFromDocLine(int line) {
return SendMsg(2220, line, 0);
}
// Find the document line of a display line taking hidden lines into account.
int wxStyledTextCtrl::DocLineFromVisible(int lineDisplay) {
return SendMsg(2221, lineDisplay, 0);
}
// The number of display lines needed to wrap a document line
int wxStyledTextCtrl::WrapCount(int line) {
return SendMsg(2235, line, 0);
}
// Set the fold level of a line.
// This encodes an integer level along with flags indicating whether the
// line is a header and whether it is effectively white space.
void wxStyledTextCtrl::SetFoldLevel(int line, int level) {
SendMsg(2222, line, level);
}
// Retrieve the fold level of a line.
int wxStyledTextCtrl::GetFoldLevel(int line) {
return SendMsg(2223, line, 0);
}
// Find the last child line of a header line.
int wxStyledTextCtrl::GetLastChild(int line, int level) {
return SendMsg(2224, line, level);
}
// Find the parent line of a child line.
int wxStyledTextCtrl::GetFoldParent(int line) {
return SendMsg(2225, line, 0);
}
// Make a range of lines visible.
void wxStyledTextCtrl::ShowLines(int lineStart, int lineEnd) {
SendMsg(2226, lineStart, lineEnd);
}
// Make a range of lines invisible.
void wxStyledTextCtrl::HideLines(int lineStart, int lineEnd) {
SendMsg(2227, lineStart, lineEnd);
}
// Is a line visible?
bool wxStyledTextCtrl::GetLineVisible(int line) {
return SendMsg(2228, line, 0) != 0;
}
// Show the children of a header line.
void wxStyledTextCtrl::SetFoldExpanded(int line, bool expanded) {
SendMsg(2229, line, expanded);
}
// Is a header line expanded?
bool wxStyledTextCtrl::GetFoldExpanded(int line) {
return SendMsg(2230, line, 0) != 0;
}
// Switch a header line between expanded and contracted.
void wxStyledTextCtrl::ToggleFold(int line) {
SendMsg(2231, line, 0);
}
// Ensure a particular line is visible by expanding any header line hiding it.
void wxStyledTextCtrl::EnsureVisible(int line) {
SendMsg(2232, line, 0);
}
// Set some style options for folding.
void wxStyledTextCtrl::SetFoldFlags(int flags) {
SendMsg(2233, flags, 0);
}
// Ensure a particular line is visible by expanding any header line hiding it.
// Use the currently set visibility policy to determine which range to display.
void wxStyledTextCtrl::EnsureVisibleEnforcePolicy(int line) {
SendMsg(2234, line, 0);
}
// Sets whether a tab pressed when caret is within indentation indents.
void wxStyledTextCtrl::SetTabIndents(bool tabIndents) {
SendMsg(2260, tabIndents, 0);
}
// Does a tab pressed when caret is within indentation indent?
bool wxStyledTextCtrl::GetTabIndents() {
return SendMsg(2261, 0, 0) != 0;
}
// Sets whether a backspace pressed when caret is within indentation unindents.
void wxStyledTextCtrl::SetBackSpaceUnIndents(bool bsUnIndents) {
SendMsg(2262, bsUnIndents, 0);
}
// Does a backspace pressed when caret is within indentation unindent?
bool wxStyledTextCtrl::GetBackSpaceUnIndents() {
return SendMsg(2263, 0, 0) != 0;
}
// Sets the time the mouse must sit still to generate a mouse dwell event.
void wxStyledTextCtrl::SetMouseDwellTime(int periodMilliseconds) {
SendMsg(2264, periodMilliseconds, 0);
}
// Retrieve the time the mouse must sit still to generate a mouse dwell event.
int wxStyledTextCtrl::GetMouseDwellTime() {
return SendMsg(2265, 0, 0);
}
// Get position of start of word.
int wxStyledTextCtrl::WordStartPosition(int pos, bool onlyWordCharacters) {
return SendMsg(2266, pos, onlyWordCharacters);
}
// Get position of end of word.
int wxStyledTextCtrl::WordEndPosition(int pos, bool onlyWordCharacters) {
return SendMsg(2267, pos, onlyWordCharacters);
}
// Sets whether text is word wrapped.
void wxStyledTextCtrl::SetWrapMode(int mode) {
SendMsg(2268, mode, 0);
}
// Retrieve whether text is word wrapped.
int wxStyledTextCtrl::GetWrapMode() {
return SendMsg(2269, 0, 0);
}
// Set the display mode of visual flags for wrapped lines.
void wxStyledTextCtrl::SetWrapVisualFlags(int wrapVisualFlags) {
SendMsg(2460, wrapVisualFlags, 0);
}
// Retrive the display mode of visual flags for wrapped lines.
int wxStyledTextCtrl::GetWrapVisualFlags() {
return SendMsg(2461, 0, 0);
}
// Set the location of visual flags for wrapped lines.
void wxStyledTextCtrl::SetWrapVisualFlagsLocation(int wrapVisualFlagsLocation) {
SendMsg(2462, wrapVisualFlagsLocation, 0);
}
// Retrive the location of visual flags for wrapped lines.
int wxStyledTextCtrl::GetWrapVisualFlagsLocation() {
return SendMsg(2463, 0, 0);
}
// Set the start indent for wrapped lines.
void wxStyledTextCtrl::SetWrapStartIndent(int indent) {
SendMsg(2464, indent, 0);
}
// Retrive the start indent for wrapped lines.
int wxStyledTextCtrl::GetWrapStartIndent() {
return SendMsg(2465, 0, 0);
}
// Sets the degree of caching of layout information.
void wxStyledTextCtrl::SetLayoutCache(int mode) {
SendMsg(2272, mode, 0);
}
// Retrieve the degree of caching of layout information.
int wxStyledTextCtrl::GetLayoutCache() {
return SendMsg(2273, 0, 0);
}
// Sets the document width assumed for scrolling.
void wxStyledTextCtrl::SetScrollWidth(int pixelWidth) {
SendMsg(2274, pixelWidth, 0);
}
// Retrieve the document width assumed for scrolling.
int wxStyledTextCtrl::GetScrollWidth() {
return SendMsg(2275, 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 wxStyledTextCtrl::TextWidth(int style, const wxString& text) {
return SendMsg(2276, style, (long)(const char*)wx2stc(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.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -