53 void SetValue(
const wxString &text)
override;
59 void Draw(wxDC *dc, wxDC *antialiassingDC)
override;
60 const wxFont &GetFont(
AFontSize fontsize)
const {
64 void SetFont(wxDC *dc,
AFontSize fontsize)
const;
76 wxString
ToOMML()
const override;
77 wxString
ToRTF()
const override;
79 const wxString GetDisplayedString()
const override {
return m_displayedText;}
80 wxString
ToTeX()
const override;
81 wxString
ToXML()
const override;
87 wxString GetGreekStringTeX()
const;
89 wxString GetSymbolTeX()
const;
91 wxString GetGreekStringUnicode()
const;
93 wxString GetSymbolUnicode(
bool keepPercent)
const;
123 wxString
GetLinkAt(wxPoint point)
override;
155 wxRect
CharacterRect(std::size_t from, std::size_t to)
const;
167 mutable wxString m_altCopyText;
178 std::vector<wxm::UrlSpan>
LinkSpans()
const;
197 wxCoord y,
bool draw)
const;
212 template <
typename RunFunc>
void WalkTextRuns(wxDC *dc, wxCoord x, RunFunc &&
func)
const;
222 enum TextIndex : int8_t
235 TextIndex index = cellText;
237 textSize(textSize), fontSize(fontSize), index(index) {}
241 wxSize CalculateTextSize(wxDC *dc,
const wxString &text, TextCell::TextIndex
const index)
const;
243 static wxRegEx m_unescapeRegEx;
244 static wxRegEx m_roundingErrorRegEx1;
245 static wxRegEx m_roundingErrorRegEx2;
246 static wxRegEx m_roundingErrorRegEx3;
247 static wxRegEx m_roundingErrorRegEx4;
255 mutable std::vector<SizeEntry> m_sizeCache;
The definition of the base class of all cells the worksheet consists of.
CellType
The supported types of math cells.
Definition: Cell.h:64
TextStyle
All text styles known to wxMaxima.
Definition: TextStyle.h:230
Finds the web links in a piece of plain text (GH #2396).
A Type-Safe Fixed-Point Font Size.
Definition: FontAttribs.h:99
A class that carries information about the type of a cell.
Definition: Cell.h:93
The base class all cell types the worksheet can consist of are derived from.
Definition: Cell.h:148
Configuration * m_configuration
A pointer to the configuration responsible for this worksheet.
Definition: Cell.h:1249
virtual void SetCurrentPoint(wxPoint point) const
Pass 2: Arrangement.
Definition: Cell.cpp:532
const TextStyle & GetTextStyle() const
Get the text style.
Definition: Cell.h:713
The configuration storage for the current worksheet.
Definition: Configuration.h:102
const Style * GetStyle(TextStyle textStyle) const
Get the text Style for a given text style identifier.
Definition: Configuration.h:1301
A cell grouping input (and, if there is one, also the output) cell to a foldable item.
Definition: GroupCell.h:88
const wxFont & GetFont(AFontSize fontSize) const
Returns the font associated with this style, but with the size fontSize.
Definition: TextStyle.cpp:348
A Text cell.
Definition: TextCell.h:40
const CellTypeInfo & GetInfo() override
Returns the information about this cell's type.
wxCoord DigitGroupGapWidth() const
The width of one digit-group gap at this cell's font size.
Definition: TextCell.cpp:659
wxCoord LeftPadding() const
The space left of the text: none if we continue the cell before us.
Definition: TextCell.cpp:125
bool m_textContinuation
Does this cell continue the text of the cell before it? See SetTextContinuation().
Definition: TextCell.h:268
void SetCurrentPoint(wxPoint point) const override
Pass 2: Arrangement.
Definition: TextCell.cpp:143
wxRect CharacterRect(std::size_t from, std::size_t to) const
Where the characters [from, to) are drawn.
Definition: TextCell.cpp:546
void SetStyle(TextStyle style) override
Sets the TextStyle of this cell.
Definition: TextCell.cpp:147
std::vector< wxm::UrlSpan > LinkSpans() const
The links in m_displayedText.
Definition: TextCell.cpp:440
wxString ToTeX() const override
Convert this cell to its LaTeX representation.
Definition: TextCell.cpp:847
wxString m_text
The text we keep inside this cell.
Definition: TextCell.h:252
bool m_dontEscapeOpeningParenthesis
Is an ending "(" of a function name the opening parenthesis of the function?
Definition: TextCell.h:262
void UpdateToolTip()
Update the tooltip for this cell.
Definition: TextCell.cpp:164
wxString GetLinkAt(wxPoint point) override
The link drawn at point, if any (GH #2396).
Definition: TextCell.cpp:467
wxCoord RightPadding() const
The space right of the text: none if the next cell continues our text.
Definition: TextCell.cpp:133
bool IsOperator() const override
Is this cell an operator?
Definition: TextCell.cpp:707
wxString ToMathML() const override
Convert this cell to a representation fit for saving in a .wxmx file.
Definition: TextCell.cpp:1297
const wxString & GetAltCopyText() const override
Get the text set using SetAltCopyText - may be empty.
Definition: TextCell.h:215
virtual void UpdateDisplayedText() const
The text we actually display depends on many factors, unfortunately.
Definition: TextCell.cpp:395
const wxString & GetValue() const override
Gets the text this text cell contains.
Definition: TextCell.h:85
void SetType(CellType type) override
Sets the text style according to the type.
Definition: TextCell.cpp:159
wxString ToMatlab() const override
Convert this cell to its Matlab representation.
Definition: TextCell.cpp:778
void Draw(wxDC *dc, wxDC *antialiassingDC) override
Pass 3 (Paint): Renders the cell using pre-calculated coordinates.
Definition: TextCell.cpp:610
wxString ToOMML() const override
Returns the cell's representation as OMML.
Definition: TextCell.cpp:1391
wxString m_displayedText
The text we display: We might want to convert some characters or do similar things.
Definition: TextCell.h:254
bool IsShortNum() const override
True if this cell represents a short number.
Definition: TextCell.cpp:1564
void DontEscapeOpeningParenthesis()
Calling this function signals that the "(" this cell ends in isn't part of the function name.
Definition: TextCell.h:72
wxCoord GetWidthAtLineBreak() const override
The width this cell would have if it were at a line break.
Definition: TextCell.cpp:689
wxCoord CharacterX(std::size_t index) const
The x coordinate of a position between two characters.
Definition: TextCell.cpp:503
wxCoord DrawGroupedDigits(wxDC *dc, const wxString &text, wxCoord x, wxCoord y, bool draw) const
Draws text, the first text.Length() characters of m_displayedText, with the digit-group gaps that fal...
Definition: TextCell.cpp:665
wxString ToXML() const override
Convert this cell to a representation fit for saving in a .wxmx file.
Definition: TextCell.cpp:1523
void Recalculate(const AFontSize fontsize) const override
Recalculate the size of the cell and the difference between top and center.
Definition: TextCell.cpp:564
wxString GetXMLFlags() const override
Returns the XML flags this cell needs in wxMathML.
Definition: TextCell.cpp:1499
wxString CharactersToString(std::size_t from, std::size_t to) const
The characters [from, to) as text to copy.
Definition: TextCell.cpp:554
bool m_promptTooltip
Default to a special tooltip for prompts?
Definition: TextCell.h:264
std::unique_ptr< Cell > Copy(GroupCell *group) const override
Create a copy of this cell.
void UpdateDigitGroupGaps() const
Recomputes m_digitGroupGaps for m_displayedText (GH #192).
Definition: TextCell.cpp:649
void SetTextContinuation(bool continuation)
Mark this cell as the continuation of the text in the cell before it.
Definition: TextCell.cpp:118
std::vector< size_t > m_digitGroupGaps
Where in m_displayedText Draw() leaves a gap between two digit groups.
Definition: TextCell.h:204
wxCoord m_widthAtLineBreak
The width this cell has if it is at a line break, see GetWidthAtLineBreak()
Definition: TextCell.h:257
void FontsChanged() const override
To be called if the font has changed.
Definition: TextCell.h:217
wxString ToRTF() const override
Returns the cell's representation as RTF.
Definition: TextCell.cpp:1468
void WalkTextRuns(wxDC *dc, wxCoord x, RunFunc &&func) const
Walks m_displayedText as Draw() paints it: plain runs and links.
Definition: TextCell.cpp:449
wxString ToString() const override
Returns the cell's representation as a string.
Definition: TextCell.cpp:717
bool AllowsCharacterSelection() const
Can a drag select only some of this cell's characters?
Definition: TextCell.cpp:488
void SetValue(const wxString &text) override
Set the text contained in this cell.
Definition: TextCell.cpp:374
std::size_t DisplayedLength() const
The length of the displayed text: the position after its last character.
Definition: TextCell.h:141
bool IsTextContinuation() const override
Does this cell continue the line of text the cell before it holds?
Definition: TextCell.h:114
void SetAltCopyText(const wxString &text) override
What should end up if placing this cell on the clipboard?
Definition: TextCell.h:99
bool m_hasLinks
Does m_displayedText contain a link? Keeps Draw() a single DrawText() if not.
Definition: TextCell.h:266
std::size_t CharacterIndexAt(wxCoord x) const
The position between two characters nearest to x.
Definition: TextCell.cpp:530
void func()
function in group 1
Definition: group.cpp:13
Definition: TextCell.h:232