wxMaxima
Loading...
Searching...
No Matches
Public Member Functions
EditorCell::StyledText Class Reference

A piece of styled text for syntax highlighting. More...

#include <EditorCell.h>

Public Member Functions

 StyledText (TextStyle style, const wxString &text)
 Defines a piece of styled text.
 
 StyledText (const wxString &text, TextStyle style, wxCoord indentPixels=0, const wxString &indentChar={})
 Defines a piece of text with the default style that possibly is indented.
 
void SetWidth (wxCoord width)
 
void ResetSize ()
 
wxCoord GetWidth () const
 
bool SizeKnown () const
 
const wxString & GetText () const
 Returns the piece of text.
 
void SetText (const wxString &text)
 Changes the piece of text kept in this token.
 
void SetIndentation (wxCoord indentPixels, const wxString &indentString={})
 Changes the indentation level of this token.
 
wxCoord GetIndentPixels () const
 By how many pixels do we need to indent this line due to a bullet list or similar?
 
const wxString & GetIndentChar () const
 
TextStyle GetTextStyle () const
 If IsStyleSet() is true this function returns the style of this text portion.
 
bool IsStyleSet () const
 
bool IsLink () const
 Is this text portion a link? Its text is then the link's address.
 
void SetLink ()
 Marks this text portion as a link.
 
TextFormat::Format GetFormat () const
 The character formatting all of this text portion has.
 
void SetFormat (TextFormat::Format format)
 Sets the character formatting of this text portion.
 
wxCoord GetYOffset () const
 See m_yOffset.
 
void SetYOffset (wxCoord yOffset)
 See m_yOffset.
 
const std::vector< size_t > & GetDigitGaps () const
 Where this text portion, a number in a code cell, gets the small gaps that separate its digit groups (GH #192).
 
void SetDigitGaps (std::vector< size_t > gaps)
 See GetDigitGaps()
 

Detailed Description

A piece of styled text for syntax highlighting.

A piece of styled text may be

Protected (not private): CodeEditorCell::ToRTF() serializes m_styledText snippet-by-snippet to keep the syntax highlighting.

Member Function Documentation

◆ GetDigitGaps()

const std::vector< size_t > & EditorCell::StyledText::GetDigitGaps ( ) const
inline

Where this text portion, a number in a code cell, gets the small gaps that separate its digit groups (GH #192).

Indices into GetText() before which a gap is drawn; empty for anything but a number, or if Configuration::DigitGrouping() is off. The width SetWidth() caches includes the gaps: unlike a tab's, it doesn't depend on where on the line the text portion starts.


The documentation for this class was generated from the following file: