Copyright and License information Home
__ A B C D E F G H I L M P R S T U V W
Summary:
Tabs are used to add uniform spacing in a line of text; sometimes the length between tabs is variable, but in the context of the STC they are uniform. You use SetTabWidth to set the tab spacing, which defaults to 8 when a Document is created (when the STC is instantiated or you use CreateDocument).
By the way, it's important to note that the tab-related settings are maintained on a document-by-document basis. If you create a new document you need to change any tab-related settings that you want to maintain in the new document.
Very often a tab is actually implemented with a number of spaces rather than a tab character. You can choose how you want to implement a tab with SetUseTabs.
Indentation is related to tabs, but they're not exactly the same. In languages like Python (yeah!), the white space at the beginning of each line is used as part of the syntax of the language, and in most other languages programmers will use indentation to make a program easier to read.
The STC can be programmed so that it will give special handling to tab and backspace keypresses which occur when the caret is in the the leading white space of a line. This is done using SetTabIndents and SetBackSpaceUnIndents, respectively. When these special modes are active, a tab indents to the next indent position instead of inserting a tab (or group of spaces) and and backspace unindents the line instead of performing an addition. You use SetIndent to set the number of spaces comprising each indent level. You use SetLineIndentation and GetLineIndentation to deal with indentation on a line-by-line basis.
Indentation guides are thin vertical lines that appear only in whitespace areas. They appear at column intervals set by SetLineIndentation and are useful to help you line up lengthy indented sections of code. Use SetIndentationGuides to turn this mode on and off. You can use wxSTC_STYLE_INDENTGUIDE (37) to change the default foreground and background colors of these guides. See Styling.
If you're using brace highlighting with a language that uses braces as part of syntax, you can cause the indent guide for that brace level to be highlighted. Use SetHighlightGuide to activate this feature.
Return the state of the backspace unindents mode. This is 1 if a backspace keypress within an indentation area will cause an unindent, or 0 if not.
topReturn the highlight guide column.
topReturn indentation size.
topReturns 1 if indentation guides are visible or 0 if not.
topRetrieve an integer with the number of columns that a line specified by the integer parameter lineis indented.
topRetrieve an integer with the position before the first non indentation character on a line specified by the integer parameter line.
topDoes a tab pressed when caret is within indentation indent? Returns 1 if it will or 0 if not.
topReturns an integer with the visible size of a tab.
topReturns 1 if tabs will be used in indentation. Returns 0 if a combination of tabs and spaces is used instead.
topSetBackSpaceUnIndents(bsUnIndents)
The integer parameter bsUnIndents controls whether a backspace pressed when caret is within indentation unindents (1) or deletes a character (0). Returns None.
topUse this method if you want to highlight the indentation guide at a particular column (an integer). The style wxSTC_STYLE_BRACELIGHT (34) is used to determine the colors of the highlight. When you want to turn off the highlighting you use this method again with column = 0. Returns None.
topThe integer parameter indentSize sets the number of spaces used for one level of indentation. Spaces have the width of a space character in wxSTC_STYLE_DEFAULT. Returns None.
topThe integer parameter show will turn indentation guides on if 1 or off if 0. Returns None.
topSetLineIndentation(line,indentSize)
Change the indentation of a line to a number of columns indentSize. line and indentSize are integers. Returns None.
topIf the integer parameter tabIndents is 1, then a tab pressed when caret is within indentation indents; if tabIndents is 0 then a tab inserts a tab or spaces as set by SetUseTabs. Returns None.
topThe integer parameter tabWidth sets the visible size of a tab to be a multiple of the width of a space character in wxSTC_STYLE_DEFAULT. Returns None.
topIndentation will only use space characters if useTabs is 0, if useTabs is 1 it will use a combination of tabs and spaces. Returns None.
top