![]() |
wxMaxima
|
#include <GroupCell.h>
Public Member Functions | |
GroupCell (Configuration **config, GroupType groupType, const wxString &initString={}) | |
GroupCell (GroupCell const &cell) | |
GroupCell (GroupCell *group, const GroupCell &cell) | |
std::unique_ptr< Cell > | Copy () const |
std::unique_ptr< Cell > | Copy (GroupCell *group) const override |
const CellTypeInfo & | GetInfo () override |
Returns the information about this cell's type. | |
std::unique_ptr< GroupCell > | CopyList () const |
GroupCell * | first () const |
GroupCell * | last () const |
const wxString & | GetAnswer (int answer) const |
const wxString & | GetAnswer (const wxString &question) const |
bool | ContainsSavedAnswers () |
Does this GroupCell know the answer to any of maxima's questions? | |
bool | AutoAnswer () const |
Does this GroupCell save the answer to a question? | |
void | SetAutoAnswer (bool autoAnswer) |
void | MarkNeedsRecalculate () |
void | SetAnswer (const wxString &question, const wxString &answer) |
Add a new answer to the cell. | |
int | GetInnerCellCount () const override |
The number of inner cells - for use by the iterators. | |
Cell * | GetInnerCell (int index) const override |
GroupCell * | GetLastWorkingGroup () const |
void | CellUnderPointer (GroupCell *cell) |
const wxString & | GetToolTip (wxPoint point) const override |
GroupType | GetGroupType () const |
void | SetGroupType (GroupType type) |
Range | GetInnerCellsInRect (const wxRect &rect) const override |
Select the cells inside this cell described by the rectangle rect. | |
Range | GetCellsInOutput () const |
Range | GetCellsInOutputRect (const wxRect &rect, wxPoint one, wxPoint two) const |
bool | SetEditableContent (const wxString &text) |
void | AppendOutput (std::unique_ptr< Cell > &&cell) |
void | RemoveOutput () |
AFontSize | EditorFontSize () const |
void | UpdateConfusableCharWarnings () |
GroupCells warn if they contain both greek and latin lookalike chars. | |
wxString | ToTeX (wxString imgDir, wxString filename, int *imgCounter) const |
wxString | ToRTF () const override |
wxString | ToTeXCodeCell (wxString imgDir, wxString filename, int *imgCounter) const |
wxString | ToTeX () const override |
Convert this cell to its LaTeX representation. | |
wxString | ToXML () const override |
Convert this cell to a representation fit for saving in a .wxmx file. | |
void | Hide (bool hide) override |
void | SwitchHide () |
wxRect | HideRect () |
void | SetInput (std::unique_ptr< Cell > &&input) |
void | SetOutput (std::unique_ptr< Cell > &&output) |
void | AppendInput (std::unique_ptr< Cell > &&cell) |
GroupCell * | GetPrevious () const |
Get the previous GroupCell in the list. | |
GroupCell * | GetNext () const |
Get the next GroupCell in the list. | |
Cell * | GetPrompt () const |
EditorCell * | GetEditable () const |
Cell * | GetLabel () const |
Cell * | GetOutput () const |
wxRect | GetOutputRect () const |
Determine which rectangle is occupied by this GroupCell. | |
void | Recalculate (AFontSize WXUNUSED(fontsize)) override |
void | Recalculate () |
wxPoint | CalculateInputPosition () |
void | RecalculateInput () |
Recalculate the height of the input part of the cell. | |
wxRect | GetRect (bool all=false) const override |
void | RecalculateOutput () |
bool | BreakUpCells (Cell *cell) |
bool | UnBreakUpCells (Cell *cell) |
Undo a BreakUpCells. | |
void | BreakLines () |
Break this cell into lines. | |
void | ResetInputLabel () |
void | ResetInputLabelList () |
Call ResetInputLabel() on all cells in the list of cells this GroupCell starts with. | |
bool | IsMainInput (Cell *active) const |
bool | IsHeading () const |
bool | SectioningCanMoveIn () const |
Can this chapter/section/... converted to a 'smaller' cell, e.g. section->subsection, paragraph->subparagraph, ...? | |
bool | SectioningCanMoveOut () const |
Can this chapter/section/... converted to a 'larger' cell, e.g. subsection->section, subparagraph->paragraph, ...? | |
GroupCell * | SectioningUnitGetEndOf () const |
Get the end of this section/subsection/... | |
void | Number (int §ion, int &subsection, int &subsubsection, int &heading5, int &heading6, int &image) const |
Return this cell's section- or image number. | |
void | Draw (wxPoint point) override |
bool | AddEnding () override |
void | DrawBracket () |
Draw the bracket of this cell. | |
bool | Empty () const |
Is this list of cells empty? | |
bool | Contains (GroupCell *cell) const |
Does this tree contain the cell "cell"? | |
wxString | ToString () const override |
A textual representation of this cell. | |
void | InEvaluationQueue (bool inQueue) |
Is this cell part of the evaluation Queue? | |
void | LastInEvaluationQueue (bool last) |
Is this cell the last cell in the evaluation Queue? | |
void | OnSize () |
Called on MathCtrl resize. | |
void | InputHeightChanged () |
Reset the data when the input size changes. | |
WX_DECLARE_STRING_HASH_MAP (wxString, StringHash) | |
void | UpdateYPosition () |
Recalculate the cell's y position using the position and height of the last one. | |
void | UpdateOutputPositions () |
void | UpdateYPositionList () |
bool | GetSuppressTooltipMarker () const |
void | SetSuppressTooltipMarker (bool suppress) |
bool | IsFoldable () const |
folding and unfolding More... | |
GroupCell * | GetHiddenTree () const |
Get the tree of cells that got hidden by folding this cell. | |
bool | HideTree (std::unique_ptr< GroupCell > &&tree) |
std::unique_ptr< GroupCell > | UnhideTree () |
Unfold the current cell. | |
bool | RevealHidden () |
void | SetHiddenTreeParent (GroupCell *parent) |
Set the parent cell of hidden cells. More... | |
GroupCell * | Fold () |
GroupCell * | Unfold () |
GroupCell * | FoldAll () |
GroupCell * | UnfoldAll () |
bool | IsLesserGCType (GroupType comparedTo) const |
![]() | |
Cell (GroupCell *group, Configuration **config) | |
int | Scale_Px (double px) const |
AFontSize | Scale_Px (AFontSize size) const |
virtual | ~Cell () |
Delete this list of cells. | |
int | CellsInListRecursive () const |
How many cells does this cell contain? More... | |
wxRect | CropToUpdateRegion (wxRect rect) const |
The part of the rectangle rect that is in the region that is currently drawn. | |
bool | InUpdateRegion () const |
Is this cell inside the region that is currently drawn? | |
bool | SoftLineBreak (bool breakLine=true) |
Do we want this cell to start with a linebreak? | |
bool | BreakLineHere () const |
Are we allowed to break a line here? | |
bool | HasHardLineBreak () const |
Does this cell begin with a manual linebreak? | |
virtual bool | BreakUp () |
bool | ContainsRect (const wxRect &sm, bool all=true) const |
bool | ContainsPoint (wxPoint point) const |
virtual void | ClearCache () |
void | ClearCacheList () |
void | SetConfigurationList (Configuration **config) |
virtual void | SetConfiguration (Configuration **config) |
Configuration * | GetConfiguration () |
void | Draw () |
void | DrawList (wxPoint point) |
void | DrawList () |
virtual void | DrawBoundingBox (wxDC &WXUNUSED(dc), bool all=false) |
bool | DrawThisCell (wxPoint point) |
bool | DrawThisCell () |
void | ForceBreakLine (bool force=true) |
int | GetHeight () const |
int | GetWidth () const |
int | GetCenter () const |
bool | HasValidSize () const |
Is the size valid and not pending a recalculation? | |
bool | HasStaleSize () const |
Is the size valid, whether a recalculation is pending or not? | |
bool | HasValidPosition () const |
Is the position valid? | |
int | GetDrop () const |
CellType | GetType () const |
int | GetMaxDrop () const |
int | GetCenterList () const |
int | GetHeightList () const |
int | GetFullWidth () const |
How many pixels is this list of cells wide, if we don't break it into lines? | |
int | GetLineWidth () const |
int | GetCurrentX () const |
int | GetCurrentY () const |
virtual wxString | GetDiffPart () const |
virtual void | Recalculate (AFontSize fontsize) |
void | RecalculateList (AFontSize fontsize) |
void | FontsChangedList () |
Tell a whole list of cells that their fonts have changed. | |
void | ClearNeedsToRecalculateWidths () |
void | ResetData () |
Mark all cached size information as "to be calculated". More... | |
void | ResetDataList () |
void | ResetSize () |
Mark the cached height and width information as "to be calculated". | |
void | ResetCellListSizes () |
Mark the line and cell list widths and heights as "to be calculated". | |
void | ResetCellListSizesList () |
Mark the line and cell list widths and heights as "to be calculated". | |
void | SetZeroSize () |
void | ResetSizeList () |
Mark the cached height information of the whole list of cells as "to be calculated". | |
void | SetBigSkip (bool skip) |
bool | HasBigSkip () const |
virtual void | SetType (CellType type) |
Sets the text style according to the type. | |
TextStyle | GetStyle () const |
void | SetPen (double lineWidth=1.0) const |
Sets the drawing pen to the cell's default foreground color. | |
void | SetBrush () const |
Sets the fill brush to the cell's default foreground color. | |
wxColour | GetForegroundColor () const |
void | SetHighlight (bool highlight) |
Mark this cell as highlighted (e.G. being in a maxima box) | |
bool | GetHighlight () const |
Is this cell highlighted (e.G. inside a maxima box) | |
virtual void | SetExponentFlag () |
virtual void | SetValue (const wxString &WXUNUSED(text)) |
virtual const wxString & | GetValue () const |
Cell * | first () const |
Get the first cell in this list of cells. | |
Cell * | last () const |
Get the last cell in this list of cells. | |
Range | GetCellsInRect (const wxRect &rect) const |
Range | GetListCellsInRect (const wxRect &rect) const |
virtual bool | IsOperator () const |
Is this cell an operator? | |
bool | IsCompound () const |
Do we have an operator in this line - draw () in frac... | |
virtual bool | IsShortNum () const |
GroupCell * | GetGroup () const |
Returns the group cell this cell belongs to. | |
virtual wxString | ListToString () const |
Returns the list's representation as a string. | |
wxString | VariablesAndFunctionsList () const |
virtual wxString | ListToMatlab () const |
Convert this list to its LaTeX representation. | |
virtual wxString | ListToTeX () const |
Convert this list to its LaTeX representation. | |
virtual wxString | ListToXML () const |
Convert this list to a representation fit for saving in a .wxmx file. | |
virtual wxString | ListToMathML (bool startofline=false) const |
Convert this list to a MathML representation. | |
virtual wxString | ListToOMML (bool startofline=false) const |
Convert this list to an OMML representation. | |
virtual wxString | ListToRTF (bool startofline=false) const |
Convert this list to an RTF representation. | |
virtual wxString | ToOMML () const |
virtual wxString | ToMatlab () const |
Convert this cell to its Matlab representation. | |
virtual wxString | ToMathML () const |
Convert this cell to a representation fit for saving in a .wxmx file. | |
virtual void | Unbreak () |
virtual void | UnbreakList () |
Cell * | GetPrevious () const |
Cell * | GetNext () const |
Get the next cell in the list. | |
Cell * | GetNextToDraw () const |
virtual void | SetNextToDraw (Cell *next) |
template<typename T , typename Del , typename std::enable_if< std::is_base_of< Cell, T >::value, bool >::type = true> | |
void | SetNextToDraw (const std::unique_ptr< T, Del > &ptr) |
bool | IsComment () const |
bool | IsHidden () const |
bool | IsEditable (bool input=false) const |
virtual bool | CanPopOut () const |
Can this cell be popped out interactively in gnuplot? | |
virtual wxString | GnuplotSource () const |
virtual void | ProcessEvent (wxKeyEvent &WXUNUSED(event)) |
Processes a key event. | |
virtual void | SelectPointText (wxPoint point) |
virtual void | SelectRectText (wxPoint one, wxPoint two) |
virtual void | PasteFromClipboard (bool primary=false) |
virtual bool | CopyToClipboard () const |
virtual bool | CutToClipboard () |
virtual void | SelectAll () |
virtual bool | CanCopy () const |
virtual wxPoint | PositionToPoint (int WXUNUSED(pos)=-1) |
virtual bool | IsDirty () const |
virtual void | SwitchCaretDisplay () |
virtual void | SetFocus (bool WXUNUSED(focus)) |
void | SetForeground () |
Sets the foreground color. | |
virtual bool | IsActive () const |
virtual void | SetStyle (TextStyle style) |
Sets the TextStyle of this cell. | |
bool | IsMath () const |
Is this cell possibly output of maxima? | |
virtual int | GetImageBorderWidth () const |
0 for ordinary cells, 1 for slide shows and diagrams displayed with a 1-pixel border | |
void | CopyCommonData (const Cell &cell) |
Copy common data (used when copying a cell) | |
std::unique_ptr< Cell > | CopyList (GroupCell *group) const |
Return a copy of the list of cells beginning with this one. | |
void | ClearToolTip () |
Remove this cell's tooltip. | |
void | SetToolTip (wxString &&toolTip) |
Set the tooltip to a given temporary string - the cell will move from it. | |
void | SetToolTip (const wxString *tooltip) |
void | AddToolTip (const wxString &tip) |
Add another tooltip to this cell. | |
virtual void | SetCurrentPoint (wxPoint point) |
Tells this cell where it is placed on the worksheet. | |
void | SetCurrentPoint (int x, int y) |
Tells this cell where it is placed on the worksheet. | |
wxPoint | GetCurrentPoint () const |
Where is this cell placed on the worksheet? | |
bool | IsBrokenIntoLines () const |
bool | GetSuppressMultiplicationDot () const |
void | SetSuppressMultiplicationDot (bool val) |
bool | GetHidableMultSign () const |
Whether this is a hidable multiplication sign. | |
void | SetHidableMultSign (bool val) |
virtual void | SetAltCopyText (const wxString &text) |
virtual const wxString & | GetAltCopyText () const |
Get the text set using SetAltCopyText - may be empty. | |
const wxString & | GetLocalToolTip () const |
![]() | |
bool | IsNull () const |
bool | HasControlBlock () const |
bool | HasOneCellPtr () const |
Static Public Member Functions | |
static wxString | ToTeXImage (Cell *tmp, wxString imgDir, wxString filename, int *imgCounter) |
static wxString | TexEscapeOutputCell (wxString Input) |
![]() | |
static wxString | OMML2RTF (wxXmlNode *node) |
Converts an OMML tag to the corresponding RTF snippet. | |
static wxString | OMML2RTF (wxString ommltext) |
Converts OMML math to RTF math. | |
static wxString | RTFescape (wxString, bool MarkDown=false) |
Escape a string for RTF. | |
static wxString | XMLescape (wxString) |
Escape a string for XML. | |
static std::unique_ptr< Cell > | CopyList (GroupCell *group, const Cell *cell) |
Return a copy of the given list of cells. | |
static std::unique_ptr< Cell > | MakeVisiblyInvalidCell (GroupCell *group, Configuration **config) |
![]() | |
static size_t | GetLiveInstanceCount () |
static size_t | GetLiveControlBlockInstanceCount () |
Public Attributes | |
StringHash | m_knownAnswers |
A list of answers provided by the user. | |
Protected Member Functions | |
bool | NeedsRecalculation (AFontSize fontSize) const override |
True, if something that affects the cell size has changed. | |
int | GetInputIndent () |
int | GetLineIndent (Cell *cell) |
void | UpdateCellsInGroup () |
void | InitBitFields () |
![]() | |
void | BreakUpAndMark () |
Break up the internal cells of this cell, and mark it as broken up. | |
std::unique_ptr< Cell > | MakeVisiblyInvalidCell () const |
Worksheet * | GetWorksheet () const |
virtual void | FontsChanged () |
To be called if the font has changed. | |
CellPointers * | GetCellPointers () const |
void | InvalidateMaxDrop () |
Protected Attributes | |
wxRect | m_outputRect {-1, -1, 0, 0} |
CellPointers *const | m_cellPointers = GetCellPointers() |
std::unique_ptr< GroupCell > | m_hiddenTree |
here hidden (folded) tree of GCs is stored | |
GroupCell * | m_hiddenTreeParent = {} |
store linkage to the parent of the fold | |
std::unique_ptr< Cell > | m_inputLabel |
The input label of this cell. Is followed by the input of the cell. | |
std::unique_ptr< Cell > | m_output |
The maxima output this cell contains. | |
int | m_labelWidth_cached = 0 |
int | m_inputWidth |
int | m_inputHeight |
int16_t | m_cellsInGroup = 1 |
The number of cells the current group contains (-1, if no GroupCell) | |
int16_t | m_numberedAnswersCount = 0 |
AFontSize | m_mathFontSize |
GroupType | m_groupType = {} |
Which type this cell is of? | |
bool | m_autoAnswer: 1 |
Does this GroupCell automatically fill in the answer to questions? | |
bool | m_inEvaluationQueue: 1 |
bool | m_lastInEvaluationQueue: 1 |
bool | m_updateConfusableCharWarnings: 1 |
bool | m_suppressTooltipMarker: 1 |
Suppress the yellow ToolTip marker? | |
bool | m_cellsAppended: 1 |
![]() | |
wxPoint | m_currentPoint {-1, -1} |
CellPtr< GroupCell > | m_group |
CellPtr< Cell > | m_nextToDraw |
Configuration ** | m_configuration |
const wxString * | m_toolTip |
int | m_height = -1 |
The height of this cell. | |
int | m_width = -1 |
The width of this cell; is recalculated by RecalculateHeight. | |
int | m_center = -1 |
AFontSize | m_fontSize_Scaled = {} |
The font size is smaller in super- and subscripts. | |
CellType | m_type = MC_TYPE_DEFAULT |
TextStyle | m_textStyle = TS_DEFAULT |
Static Protected Attributes | |
static wxString | m_lookalikeChars |
A cell grouping input (and, if there is one, also the output) cell to a foldable item
Items where a list of groupcells can be folded include
This GroupCell stores the currently hidden cells in the GroupCell m_hiddenTree. This tree has the parent m_hiddenTreeParent.
232 bytes
|
overridevirtual |
Add a semicolon to a code cell, if needed.
Defined in GroupCell and EditorCell
Reimplemented from Cell.
bool GroupCell::BreakUpCells | ( | Cell * | cell | ) |
Attempt to split math objects that are wider than the screen into multiple lines.
true,if | this action has changed the height of cells. |
void GroupCell::CellUnderPointer | ( | GroupCell * | cell | ) |
Create a copy of this cell
This method is purely virtual, which means every child class has to define its own Copy() method.
Implements Cell.
|
overridevirtual |
Draw this GroupCell
Also assigns all output cells contained in this GroupCell a y coordinate.
Reimplemented from Cell.
GroupCell * GroupCell::Fold | ( | ) |
Fold this cell
GroupCell * GroupCell::FoldAll | ( | ) |
Fold all cells
|
inlineoverridevirtual |
Retrieve an inner cell with given index which must be less than GetInnerCellCount.
Reimplemented from Cell.
|
inline |
Returns the list of cells the output consists of, starting with the label.
See also GetOutput();
GroupCell * GroupCell::GetLastWorkingGroup | ( | ) | const |
|
inline |
Returns the list of cells the output consists of, starting after the label.
See also GetLabel()
|
overridevirtual |
Get the smallest rectangle this cell fits in
all |
|
Reimplemented from Cell.
|
overridevirtual |
Returns the tooltip for the element at the position point.
wxEmptyString means: No toolTip.
Reimplemented from Cell.
bool GroupCell::HideTree | ( | std::unique_ptr< GroupCell > && | tree | ) |
Fold the current cell
bool GroupCell::IsFoldable | ( | ) | const |
folding and unfolding
Is this cell foldable?
bool GroupCell::IsLesserGCType | ( | GroupType | comparedTo | ) | const |
Document structure: Can this cell type be part of the contents of comparedTo?
For example ordinary text cells can be part of a chapter and sections can be part of a chapter, too.
|
inlineoverride |
void GroupCell::RecalculateOutput | ( | ) |
Recalculate the height of the output part of the cell
void GroupCell::RemoveOutput | ( | ) |
Remove all output cells attached to this one
If called on an image cell it will not remove the image attached to it (even if the image technically is the first output cell attached to an image cell) but it will remove eventual error messages attached to the image.
void GroupCell::ResetInputLabel | ( | ) |
Reset the input label of the current cell.
Won't do nothing if the cell isn't a code cell and therefore isn't equipped with an input label.
bool GroupCell::RevealHidden | ( | ) |
Unfold all that is needed to make the current cell seen
Unfold a tree from the bottom up, when a hidden cell needs to be seen.
void GroupCell::SetHiddenTreeParent | ( | GroupCell * | parent | ) |
Set the parent cell of hidden cells.
For every cell in this GroupCell, set m_hiddenTreeParent to parent. This way, the field can be used to traverse up the tree no matter which child we are on. In other words, every child knows its parent node.
|
overridevirtual |
Returns the cell's representation as RTF.
If this method returns wxEmptyString this might mean that this cell is better handled in OMML.
Reimplemented from Cell.
wxString GroupCell::ToTeX | ( | wxString | imgDir, |
wxString | filename, | ||
int * | imgCounter | ||
) | const |
Convert the cell to TeX code
imgDir | The directory eventual images should be stored in |
filename | The base filename for all images |
imgCounter | The location of the counter that tells how many unique image filenames we have already generated. NULL means: This TeX export doesn't contain other GroupCells that can export images and therefore need to enumerate them. |
GroupCell * GroupCell::Unfold | ( | ) |
Unfold this cell
GroupCell * GroupCell::UnfoldAll | ( | ) |
Unfold all cells