42#include <wx/xml/xml.h>
43#include <wx/aui/aui.h>
44#include <wx/textfile.h>
45#include <wx/fdrepdlg.h>
51#include "CellPointers.h"
56#include "cells/ImgCell.h"
57#include "cells/ImgCellBase.h"
60#include "cells/MatrCell.h"
67#include "MatrixScrollbars.h"
70#include "cells/TextCell.h"
128 { GetClientSize(width, height); }
130 {
int x, y; GetViewStart(&x, &y);
return y; }
132 { SetVirtualSize(width, height); }
135 {
const wxPoint p = GetPosition(); *x = p.x; *y = p.y; }
176 wxString m_maximaDocDir;
178 bool m_updateControls =
true;
180 bool m_scrollToCaret =
false;
182 int m_newxPosition = -1;
184 int m_newyPosition = -1;
186 double m_zoomAtGestureStart = 1.0;
188 bool m_scrollToTopOfCell =
false;
190 bool m_windowActive =
true;
192 wxRegion m_regionToRefresh;
201 bool m_fullRedrawRequested =
false;
207 bool RedrawStartBelowView()
const;
209 long m_stalePaints = 0;
213 static wxDataFormat m_wxmFormat;
219 static wxDataFormat m_xmlFormat;
221 static wxDataFormat m_mathmlFormat;
223 static wxDataFormat m_mathmlFormat2;
225 static wxDataFormat m_rtfFormat;
227 static wxDataFormat m_rtfFormat2;
231 static wxDataFormat m_rtfFormat3;
235 class MathMLDataObject :
public wxCustomDataObject
238 explicit MathMLDataObject(
const wxString &data);
243 wxCharBuffer m_databuf;
247 class wxmDataObject :
public wxCustomDataObject
250 explicit wxmDataObject(
const wxString &data);
255 wxCharBuffer m_databuf;
258 class MathMLDataObject2 :
public wxCustomDataObject
261 explicit MathMLDataObject2(
const wxString &data);
266 wxCharBuffer m_databuf;
271 class RtfDataObject :
public wxCustomDataObject
274 explicit RtfDataObject(
const wxString &data);
279 wxCharBuffer m_databuf;
282 class RtfDataObject2 :
public wxCustomDataObject
285 explicit RtfDataObject2(
const wxString &data);
290 wxCharBuffer m_databuf;
295 class RtfDataObject3 :
public wxCustomDataObject
298 explicit RtfDataObject3(
const wxString &data);
303 wxCharBuffer m_databuf;
307 bool m_hasFocus =
true;
311 long m_lastBottom = 0;
379 {
return TreeUndo(&GetTreeUndo().UndoStack(), &GetTreeUndo().RedoStack()); }
383 {
return TreeUndo(&GetTreeUndo().RedoStack(), &GetTreeUndo().UndoStack()); }
420 bool m_scrolledAwayFromEvaluation =
false;
427 CLICK_TYPE_GROUP_SELECTION,
428 CLICK_TYPE_INPUT_SELECTION,
429 CLICK_TYPE_INPUT_LABEL_SELECTION,
430 CLICK_TYPE_OUTPUT_SELECTION
446 std::unique_ptr<Cell>
CopySelection(
bool asData =
false)
const;
582 void OnTimer(wxTimerEvent &event);
585 void OnZoom(wxZoomGestureEvent &event);
587 void OnMouseExit(wxMouseEvent &event);
589 void OnMouseEnter(wxMouseEvent &event);
603 void OnPaint(wxPaintEvent &event);
618 void OnSize(wxSizeEvent &event);
620 void OnMouseRightDown(wxMouseEvent &event);
628 void OnSidebarKey(wxCommandEvent &event);
632 void OnMouseLeftUp(wxMouseEvent &event);
637 void OnMouseLeftDown(wxMouseEvent &event);
639 void OnMouseLeftInGcCell(wxMouseEvent &event,
GroupCell *clickedInGC);
641 void OnMouseLeftInGcLeft(wxMouseEvent &event,
GroupCell *clickedInGC);
643 void OnMouseLeftInGc(wxMouseEvent &event,
GroupCell *clickedInGC);
645 void OnMouseMotion(wxMouseEvent &event);
701 void SelectGroupCells(wxPoint down, wxPoint up);
710 static bool OpenLink(
const wxString &url);
734 void CheckUnixCopy();
736 void OnMouseMiddleUp(wxMouseEvent &event);
738 static bool IsLesserGCType(
int type,
int comparedTo);
757 wxPoint m_leftDownPosition;
760 wxPoint m_mousePoint;
771 bool m_leftDown =
false;
783 bool m_followEvaluation =
true;
784 bool m_mouseDrag =
false;
785 bool m_mouseOutside =
false;
791 int m_clickType = CLICK_TYPE_NONE;
801 int m_outputBatchDepth = 0;
807 std::vector<std::pair<CellPtr<GroupCell>,
bool>> m_outputBatchGroups;
812 void LayOutAppendedOutput(
GroupCell *cell,
bool async);
814 void FinishBatchedOutput();
823 bool m_blinkDisplayCaret =
true;
825 bool m_hCaretBlinkVisible =
true;
829 wxTimer m_caretTimer;
830 std::vector<wxString> m_completions;
831 bool m_autocompleteTemplates =
true;
837 {
return !GetTree() || (!GetTree()->
GetNext() && GetTree()->GetEditable()->
GetValue().Length() <= 1); }
841 if(m_autocompletePopup !=
nullptr)
842 m_autocompletePopup->Destroy();
850 void OnChar(wxKeyEvent &event);
871 std::optional<Notification> m_notificationMessage;
873 std::function<void(
bool)> m_attentionCallback;
883 void SetNotification(
const wxString &message,
int flags = wxICON_INFORMATION);
892 { m_attentionCallback = std::move(callback); }
902 static std::mutex m_drawDCLock;
915 mutable std::weak_ptr<ClipboardContents> m_clipboardContents;
932 void FocusFindDialogue()
963 int IndexSearchStartedAt()
const
1003 m_redrawStart =
nullptr;
1004 m_fullRedrawRequested =
false;
1116 bool CanUndo()
const;
1118 bool CanRedo()
const;
1128 void TreeUndo_ClearBuffers();
1140 wxPoint pos = wxDefaultPosition, wxSize size = wxDefaultSize,
1141 bool reactToEvents =
true);
1149 wxTimer m_keyboardInactiveTimer;
1156 std::unique_ptr<GroupCell>
CopyTree()
const;
1184 void InsertLine(std::unique_ptr<Cell> &&newCell,
bool forceNewLine =
false);
1202 m_worksheet->m_outputBatchDepth++;
1205 if (m_worksheet && (--m_worksheet->m_outputBatchDepth == 0))
1206 m_worksheet->FinishBatchedOutput();
1271 : m_worksheet(worksheet) {
1337 void ResetInputPrompts();
1339 bool CanCopy()
const
1372 bool CanPaste()
const
1419 void DeleteSelection();
1464 wxPoint m_matrixWheelRemainder;
1504 void Animate(
bool run =
true)
const;
1545#if defined(__UNIX__) && !defined(__APPLE__)
1558 bool Copy(
bool astext =
false)
const;
1620 static std::unique_ptr<wxDataObject>
1638#if wxUSE_ENH_METAFILE
1640 bool CopyEMF()
const;
1660 wxSize CopyToFile(
const wxString &file)
const;
1662 wxSize CopyToFile(
const wxString &file,
Cell *start,
Cell *end,
bool asData =
false,
double scale = 1)
const;
1709 wxString
GetString(
bool lb =
false)
const;
1747 bool ActivatePrevInput() {
return ActivateInput(-1); }
1748 bool ActivateNextInput() {
return ActivateInput(+1); }
1749 wxString GetStatusText()
const {
return m_statusText;}
1750 bool StatusTextChangedHas() {
1751 bool retval = (m_statusTextHas != m_statusTextHas_old) ||
1752 (m_statusText != m_statusText_old);
1753 m_statusText_old = m_statusText;
1754 m_statusTextHas_old = m_statusTextHas;
1757 bool StatusTextHas()
const {
return m_statusTextHas;}
1764 void UpdateOutputSelectionString();
1776 wxTimer m_displayTimeoutTimer;
1778 template <
class T_SRC,
class T_DEST>
1779 inline std::unique_ptr<T_DEST> unique_cast(std::unique_ptr<T_SRC> &&src)
1781 if (!src)
return std::unique_ptr<T_DEST>();
1783 T_DEST *dest_ptr = &
dynamic_cast<T_DEST &
>(*src.get());
1785 (void) src.release();
1786 return std::unique_ptr<T_DEST>(dest_ptr);
1788 wxString m_statusText;
1789 wxString m_statusText_old;
1790 bool m_statusTextHas =
false;
1791 bool m_statusTextHas_old =
false;
1792 void StatusText(
const wxString &text){m_statusText = text; m_statusTextHas =
true;}
1793 void UnsetStatusText(){m_statusTextHas =
false;}
1794 bool ActivateInput(
int direction);
1801 m_scrollToCaret =
true;
1814 m_scrollToTopOfCell = scrollToTop;
1815 m_scrollToCaret =
false;
1921 void UndoInsideCell();
1929 void RedoInsideCell();
1944 {
return m_followEvaluation; }
1951 void ScrolledAwayFromEvaluation(
bool ScrolledAway);
1953 bool ScrolledAwayFromEvaluation()
const
1954 {
return m_scrolledAwayFromEvaluation; }
1958 bool IsSaved()
const
1961 void SetSaved(
bool saved)
1964 void OutputChanged()
1990 void AddDocumentToEvaluationQueue();
2035 void SetZoomFactor(
double newzoom);
2037 void CommentSelection();
2044 void OnScrollEvent(wxScrollWinEvent &ev);
2045 void CheckIfActiveCellScrolledOut();
2057 bool FindIncremental(
const wxString &str,
bool down,
bool ignoreCase,
bool searchInInput =
true,
bool searchInOutput =
true);
2058 bool FindIncremental_RegEx(
const wxString &str,
bool down,
bool searchInInput =
true,
bool searchInOutput =
true);
2078 bool FindNext(
const wxString &str,
bool down,
bool ignoreCase,
bool searchInInput =
true,
bool searchInOutput =
true,
bool warn =
true);
2079 bool FindNext_Regex(
const wxString &str,
const bool &down,
bool searchInInput =
true,
bool searchInOutput =
true,
bool warn =
true);
2085 void Replace(
const wxString &oldString,
const wxString &newString,
bool ignoreCase);
2086 void Replace_RegEx(
const wxString &oldString,
const wxString &newString);
2092 int ReplaceAll(
const wxString &oldString,
const wxString &newString,
bool ignoreCase,
bool searchInInput =
true,
bool searchInOutput =
true);
2093 int ReplaceAll_RegEx(
const wxString &oldString,
const wxString &newString,
bool searchInInput =
true,
bool searchInOutput =
true);
2119 wxString GetInputAboveCaret();
2121 wxString GetOutputAboveCaret();
2130 { m_autocomplete.
AddSymbol(fun, type); }
2139 void SetActiveCellText(
const wxString &text);
2141 bool InsertText(
const wxString &text);
2143 void OpenNextOrCreateCell();
2176 void SetMaximaDocDir(
const wxString &dir)
2178 m_maximaDocDir = dir;
2180 const wxString &GetMaximaDocDir()
const {
return m_maximaDocDir; }
2198 void UpdateScrollPos();
2209 wxString GetHelpfileAnchorName(
const wxString &keyword)
2210 {
return m_maximaManual.GetHelpfileAnchorName(keyword);}
2211 wxString GetHelpfileURL(
const wxString &keyword)
2212 {
return m_maximaManual.GetHelpfileURL(keyword);}
2216#if wxUSE_ACCESSIBILITY
2217 int GetAccessibilityId(
Cell *cell)
const;
2220#if wxUSE_ACCESSIBILITY
2221 class AccessibilityInfo:
public wxAccessible
2224 AccessibilityInfo(wxWindow *parent,
Worksheet *worksheet);
2225 wxAccStatus GetName (
int childId, wxString *name);
2226 wxAccStatus GetChildCount (
int *childCount);
2227 wxAccStatus GetChild (
int childId, wxAccessible **child);
2228 wxAccStatus GetDefaultAction(
int childId, wxString *actionName);
2229 wxAccStatus GetParent (wxAccessible ** parent);
2230 wxAccStatus GetFocus (
int *childId, wxAccessible **child);
2231 wxAccStatus GetLocation (wxRect &rect,
int elementId);
2232 wxAccStatus HitTest (
const wxPoint &pt,
2233 int *childId, wxAccessible **childObject);
2234 wxAccStatus GetDescription(
int childId, wxString *description);
2235 wxAccStatus GetRole(
int childId, wxAccRole *role);
2236 wxAccStatus GetState(
int childId,
long *state);
2238 wxWindow *m_parent =
nullptr;
2241 class CaretAccessibilityInfo :
public wxAccessible {
2243 CaretAccessibilityInfo(AccessibilityInfo* parent,
Worksheet* worksheet)
2244 : wxAccessible(worksheet->GetTargetWindow()), m_parent(parent), m_worksheet(worksheet) {}
2246 wxAccStatus GetName(
int childId, wxString *name)
override;
2247 wxAccStatus GetDescription(
int WXUNUSED(childId), wxString *description)
override;
2248 wxAccStatus GetParent(wxAccessible **parent)
override;
2249 wxAccStatus GetChildCount(
int *childCount)
override;
2250 wxAccStatus GetChild(
int childId, wxAccessible **child)
override;
2251 wxAccStatus GetRole(
int childId, wxAccRole *role)
override;
2253 AccessibilityInfo* m_parent;
2256 CaretAccessibilityInfo* m_caretAccessible =
nullptr;
2264 class SelectionAccessibilityInfo :
public wxAccessible {
2266 SelectionAccessibilityInfo(AccessibilityInfo* parent,
Worksheet* worksheet)
2267 : wxAccessible(worksheet->GetTargetWindow()), m_parent(parent), m_worksheet(worksheet) {}
2269 wxAccStatus GetName(
int childId, wxString *name)
override;
2270 wxAccStatus GetParent(wxAccessible **parent)
override;
2271 wxAccStatus GetChildCount(
int *childCount)
override;
2272 wxAccStatus GetChild(
int childId, wxAccessible **child)
override;
2273 wxAccStatus GetRole(
int childId, wxAccRole *role)
override;
2274 wxAccStatus GetState(
int childId,
long *state)
override;
2276 AccessibilityInfo* m_parent;
2279 SelectionAccessibilityInfo* m_selectionAccessible =
nullptr;
2281 int SelectionChildId()
const;
2284 static bool HasOutputSelection(
const Worksheet *worksheet);
2288 MaximaManual *GetMaximaManual() {
return &m_maximaManual;}
2290 void FocusTextControl();
2301 wxSize DoGetBestClientSize()
const override;
2302#if wxUSE_ACCESSIBILITY
2303 AccessibilityInfo *m_accessibilityInfo =
nullptr;
2316 static wxString
LinkToolTip(
const wxString &link);
2325wxDECLARE_EVENT(TOC_UPDATE_NEEDED_EVENT, wxCommandEvent);
This file declares the class AnimationCell.
This file declares the class AutoComplete.
The definition of the base class of all cells the worksheet consists of.
CellType
The supported types of math cells.
Definition: Cell.h:64
@ MC_TYPE_GROUP
A group cells that bundles several individual cells together.
Definition: Cell.h:82
Clipboard formats that are only rendered once a program asks for them (GH #2030).
This file contains the definition of the class EditorCell.
This file declares the class EventIDs that contains unique IDs for many events wxMaxima needs.
This file defines the class FindReplaceDialog.
This file defines the class GroupCell that bundles input and output in the worksheet.
GroupType
All types a GroupCell can be of.
Definition: GroupCell.h:43
This file declares the class MaximaManual.
This file defines the class Notification.
The output of a cell as a tree the keyboard can walk through (GH #2382).
Declares PdfExport, which writes a worksheet to a tagged (accessible) PDF.
The definition of the class RecentDocuments that provides a recent files mechanism that is extensible...
std::uint8_t Format
The formatting of one character: a combination of the flags below.
Definition: TextFormat.h:68
std::list< TreeUndoAction > UndoActions
The type of the list of tree actions that can be undone.
Definition: TreeUndoAction.h:141
Declares TreeUndoManager: the owner of the cell-tree undo/redo state.
The file that contains the "variables" sidepane.
Turns mouse wheel rotation into whole wheel steps.
The worksheet's "between the cells" cursor (the horizontally drawn caret).
The narrow "something in the document changed" surface a WorksheetDocument needs to poke its view.
The document half of the worksheet: the state and commands that describe the edited document itself,...
The worksheet's layout engine: scheduling, the recalculation walk and the virtual-size update,...
The worksheet's search engine.
Definition: AnimationCell.h:46
Definition: Autocomplete.h:61
autoCompletionType
All types of things we can autocomplete.
Definition: Autocomplete.h:68
void AddSymbols(wxString xml)
Interprets the XML autocompletable symbol list maxima can send us.
Definition: Autocomplete.cpp:136
void AddSymbol(wxString fun, autoCompletionType type=command)
Manually add an autocompletable symbol to our symbols lists.
Definition: Autocomplete.cpp:728
A weak non-owning pointer that becomes null whenever the observed object is destroyed.
Definition: CellPtr.h:539
The base class all cell types the worksheet can consist of are derived from.
Definition: Cell.h:148
GroupCell * GetGroup() const
Returns the group cell this cell belongs to.
Definition: Cell.cpp:290
CellType GetType() const
Returns the type of this cell.
Definition: Cell.h:579
The configuration storage for the current worksheet.
Definition: Configuration.h:102
void ReadConfig()
Read the config from the wxConfig object.
Definition: Configuration.cpp:633
A list of editor cells containing error messages.
Definition: CellPointers.h:58
The document-model half of the cell-pointer registry.
Definition: CellPointers.h:54
TextCell * GetCurrentTextCell() const
The text cell the text maxima is currently sending us is being appended to.
Definition: CellPointers.cpp:133
const CellPtr< Cell > & GetSelectionStart() const
The first cell of the currently selected range of cells, or null. Returned by reference so callers ke...
Definition: CellPointers.h:97
const CellPtr< Cell > & GetSelectionEnd() const
The last cell of the currently selected range of cells, or null.
Definition: CellPointers.h:99
void SetCurrentTextCell(TextCell *cell)
Set the text cell maxima's incoming text is being appended to (may be null).
Definition: CellPointers.cpp:137
bool HasCellsSelected() const
Are any whole cells (as opposed to text inside an editor) selected?
Definition: CellPointers.h:92
void SetWorkingGroup(GroupCell *group)
Sets the cell maxima currently works on. nullptr if there isn't such a cell.
Definition: CellPointers.cpp:145
ErrorList & GetErrorList()
The list of cells maxima has complained about errors in.
Definition: CellPointers.h:244
EditorCell * GetActiveCell() const
The editor cell the blinking text cursor is in, or null.
Definition: CellPointers.cpp:141
This class defines what the user sees as input cell.
Definition: EditorCell.h:67
const wxString & GetValue() const override
Returns the text contained in this cell.
Definition: EditorCell.h:237
bool CanCopy() const override
Select Can we copy the editable text of this cell?
Definition: EditorCell.h:535
A simple FIFO queue with manual removal of elements.
Definition: EvaluationQueue.h:44
The find+replace dialog.
Definition: FindReplaceDialog.h:42
The find+replace pane.
Definition: FindReplacePane.h:47
A cell grouping input (and, if there is one, also the output) cell to a foldable item.
Definition: GroupCell.h:88
GroupCell * GetNext() const
Get the next GroupCell in the list.
Definition: GroupCell.h:305
Definition: ImgCellBase.h:44
A Cell that displays a matrix.
Definition: MatrCell.h:107
Definition: MaximaManual.h:59
void LoadHelpFileAnchors(const wxString &docdir, const wxString &maximaVersion)
Search maxima's help file for command and variable names.
Definition: MaximaManual.cpp:548
A class that maintains a list of recent documents.
Definition: RecentDocuments.h:42
A Text cell.
Definition: TextCell.h:40
Owns the cell-tree undo/redo stacks and the active-cell snapshot.
Definition: TreeUndoManager.h:51
void ClearUndoActionList()
Clear the list of actions that can be undone.
Definition: TreeUndoManager.h:94
void ClearRedoActionList()
Clear the list of actions that can be redone.
Definition: TreeUndoManager.h:87
static void AppendAction(UndoActions *actionList)
Mark the newest action of the list as part of the following atomic action.
Definition: TreeUndoManager.h:77
The view/interaction half of the cell-pointer registry.
Definition: CellPointers.h:341
const CellPtr< EditorCell > & MouseSelectionStart() const
The EditorCell a mouse selection was started in, or null.
Definition: CellPointers.h:368
int IndexSearchStartedAt() const
The cursor position an incremental search was started at (-1 = none).
Definition: CellPointers.h:356
const CellPtr< EditorCell > & KeyboardSelectionStart() const
The EditorCell a keyboard selection was started in, or null.
Definition: CellPointers.h:377
const CellPtr< EditorCell > & SearchStart() const
The EditorCell an incremental search was started in, or null.
Definition: CellPointers.h:354
void SetScrollToCellScheduled(bool scheduled)
Schedule (or cancel) scrolling to CellToScrollTo().
Definition: CellPointers.h:351
The between-the-cells cursor: active flag, position, selection anchors.
Definition: WorksheetCursor.h:49
void Deactivate()
Deactivate; the position is kept for a later re-activation.
Definition: WorksheetCursor.h:56
bool IsActive() const
Is this (rather than the in-cell text cursor) the active cursor?
Definition: WorksheetCursor.h:52
The view notifications a WorksheetDocument emits when it edits itself.
Definition: WorksheetDocumentView.h:50
The view-independent state and commands of an edited worksheet document.
Definition: WorksheetDocument.h:61
bool CanMergeSelection() const
Can the current selection (of more than one cell) be merged into one?
Definition: WorksheetDocument.cpp:361
CellPtr< GroupCell > & LastCache() const
The cached pointer to the document's last GroupCell (<0 = unknown).
Definition: WorksheetDocument.h:93
bool CanRedoInsideCell() const
Can the active cell's own (intra-cell) redo be invoked right now?
Definition: WorksheetDocument.cpp:390
void SetSaved(bool saved)
Record whether the document is in its saved state.
Definition: WorksheetDocument.cpp:34
void FoldAll()
Recursively folds every foldable cell in the document.
Definition: WorksheetDocument.cpp:317
void UnfoldAll()
Recursively unfolds every folded cell in the document.
Definition: WorksheetDocument.cpp:326
bool QuestionPending() const
Is Maxima currently waiting for an answer to a question?
Definition: WorksheetDocument.h:215
bool CanUndoInsideCell() const
Can the active cell's own (intra-cell) undo be invoked right now?
Definition: WorksheetDocument.cpp:386
bool IsSaved() const
True while the document has no unsaved changes.
Definition: WorksheetDocument.h:226
void SetCurrentFile(const wxString &file)
Record the file this document is associated with.
Definition: WorksheetDocument.h:205
EvaluationQueue & GetEvaluationQueue()
The list of cells scheduled to be sent to Maxima for evaluation.
Definition: WorksheetDocument.h:64
GroupCell * Unfold(GroupCell *which)
Unfold which; see GroupCell::Unfold(). Mirrors Fold().
Definition: WorksheetDocument.cpp:277
bool IsSelectionInWorkingGroup() const
Is the selection start inside the group Maxima is currently evaluating?
Definition: WorksheetDocument.cpp:381
DocumentCellPointers & GetCellPointers()
The document-model half of the cell-pointer registry (selection, the active/answer/current-text cell,...
Definition: WorksheetDocument.h:221
bool IsSelected(CellType type) const
Is the selection exactly one cell of the given type?
Definition: WorksheetDocument.cpp:374
GroupCell * ToggleFold(GroupCell *which)
Fold or unfold which, whichever it currently isn't; see GroupCell::Fold()/Unfold().
Definition: WorksheetDocument.cpp:292
TreeUndoManager & GetTreeUndo()
The document's undo/redo history of tree-structure edits.
Definition: WorksheetDocument.h:69
const wxString & GetCurrentFile() const
The file this document was last loaded from / saved to (empty if none).
Definition: WorksheetDocument.h:203
std::unique_ptr< GroupCell > & TreeOwner()
Mutable access to the owning pointer of the cell tree.
Definition: WorksheetDocument.h:87
const wxString & GetLastQuestion() const
The text of the Maxima question the user is currently being asked.
Definition: WorksheetDocument.h:208
bool CanDeleteSelection() const
Can the current selection be deleted right now (see CanRemoveCells())?
Definition: WorksheetDocument.cpp:353
bool CanEdit() const
Is exactly one cell selected, and does it directly follow Maxima's own input prompt (as opposed to be...
Definition: WorksheetDocument.cpp:335
void SetQuestionPending(bool pending)
Record whether Maxima is waiting for an answer to a question.
Definition: WorksheetDocument.h:217
WorksheetCursor & GetCursor()
The between-cells cursor (the h-caret) and its group-level selection.
Definition: WorksheetDocument.h:74
GroupCell * GetTree() const
The first GroupCell of the document (null when the document is empty).
Definition: WorksheetDocument.h:79
void SetLastQuestion(const wxString &lastQuestion)
Remember the text of the question Maxima is currently asking.
Definition: WorksheetDocument.h:210
GroupCell * ToggleFoldAll(GroupCell *which)
Like ToggleFold(), but folds/unfolds which's whole subtree.
Definition: WorksheetDocument.cpp:299
void OutputChanged()
Note that a cell's output changed.
Definition: WorksheetDocument.h:241
GroupCell * Fold(GroupCell *which)
Fold which; see GroupCell::Fold().
Definition: WorksheetDocument.cpp:262
The layout/recalculation engine of a worksheet.
Definition: WorksheetLayout.h:54
void RequestFullRecalculation()
Schedule a recalculation of the whole worksheet.
Definition: WorksheetLayout.cpp:330
void RequestAdjustSize()
Flag the virtual (scroll) size as needing re-adjustment.
Definition: WorksheetLayout.h:143
void RequestRecalculation(Cell *start)
Schedule a recalculation of the worksheet starting with the cell start.
Definition: WorksheetLayout.cpp:272
void GetMaxPoint(int *width, int *height)
Get the coordinates of the bottom right point of the worksheet.
Definition: WorksheetLayout.cpp:352
void UpdateConfigurationClientSize()
Inform the configuration about the view's current client size.
Definition: WorksheetLayout.cpp:339
int GetLastCellsVisited() const
GroupCells walked by the most recent RecalculateIfNeeded() pass (visited includes cheap reposition-on...
Definition: WorksheetLayout.h:231
void AdjustSize()
Adjust the virtual size and scrollbars to the document's extent.
Definition: WorksheetLayout.cpp:398
bool RecalculateIfNeeded(bool timeout=false, long timeSliceMs=50)
Perform the scheduled recalculation, if one is pending.
Definition: WorksheetLayout.cpp:41
The narrow view surface the worksheet's layout pipeline needs.
Definition: WorksheetSizeMath.h:239
Scoped SetAsyncOutputTarget(), so an early return or a throw while appending can't leave every subseq...
Definition: Worksheet.h:1268
Lays out the output of all lines appended in this scope once, at its end.
Definition: Worksheet.h:1198
The canvas that contains the spreadsheet the whole program is about.
Definition: Worksheet.h:123
void OnContextMenuKey(wxContextMenuEvent &event)
Opens the right-click menu for the selection from the keyboard (GH #2382)
Definition: Worksheet.cpp:1470
static constexpr bool HasPrimarySelection()
Does this platform have a primary selection?
Definition: Worksheet.h:1544
bool IsActiveInLast() const
Is the editor active in the last cell of the worksheet?
Definition: Worksheet.h:1862
bool RenderClipboardContents()
Replace this worksheet's lazily rendered clipboard data by data that no longer needs the worksheet (G...
Definition: Worksheet.cpp:3149
GroupCell * ToggleFold(GroupCell *which)
Fold or unfold a cell.
Definition: Worksheet.h:2026
void OnTimer(wxTimerEvent &event)
Is executed if a timer associated with Worksheet has expired.
Definition: Worksheet.cpp:4525
void ClearSelection()
Clear the selection - make it empty, i.e. no selection.
Definition: Worksheet.h:1729
void RequestRedraw(GroupCell *start=nullptr)
Request the worksheet to be redrawn.
Definition: Worksheet.cpp:544
bool CanMergeSelection() const
Can we merge the selected cells into one?
Definition: Worksheet.h:1114
bool IsSelectionInWorkingGroup() const
Is the selection in the current working group?
Definition: Worksheet.h:1872
void InsertSymbol(const wxString &symbol)
Types a symbol from a sidebar button or a symbol's keyboard shortcut.
Definition: Worksheet.cpp:313
int GetLastCellsRecalculated() const
How many cells the last layout pass truly recalculated. See WorksheetLayout.
Definition: Worksheet.h:1329
void SetViewScrollRate(int rate) override
Set the scroll granularity (device pixels per scroll unit) on both axes.
Definition: Worksheet.h:133
ImgCellBase * GetSelectedImgCellBase() const
Returns the selected cell - or nullptr, if the selection isn't image nor animation.
Definition: Worksheet.h:1476
MatrCell * GetSelectedScrollingMatrix() const
The scrolling matrix the selection lies in, or nullptr (GH #2479)
Definition: Worksheet.cpp:1872
void KeepCursorStillOnScreen()
Keep the cursor where it is on screen while a cell's output changes.
Definition: Worksheet.cpp:1168
wxString RTFStart() const
The start of a RTF document.
Definition: Worksheet.cpp:7517
int m_pointer_x
The x position of the mouse pointer.
Definition: Worksheet.h:2306
void SetDefaultHCaret()
Set the HCaret to its default location, at the end of the document.
Definition: Worksheet.cpp:6273
bool CanDeleteRegion(GroupCell *start, const GroupCell *end) const
Is it possible to delete the cells between start and end?
Definition: Worksheet.cpp:3194
void AddSectionToEvaluationQueue(GroupCell *start)
Adds a chapter, a section or a subsection to the evaluation queue.
Definition: Worksheet.cpp:5312
void AddSymbols(const wxString &xml)
Add a xml-encoded list of symbols to the autocompletion list.
Definition: Worksheet.h:2133
void SelectOutputRect(GroupCell *group, wxPoint down, wxPoint up)
Select what a rectangle dragged across a cell's output covers.
Definition: Worksheet.cpp:2131
bool CutToClipboard()
Add the currently selected cells to the clipboard and delete them.
Definition: Worksheet.cpp:5889
void SelectOutputItem(const OutputNavigation::Item &item)
Select a node of the output tree, scroll to it and announce it.
Definition: Worksheet.cpp:2230
void GetViewPosition(int *x, int *y) const override
The view's position within its parent, in device pixels (wxWindow::GetPosition).
Definition: Worksheet.h:134
WorksheetDocument m_document
The view-independent document state (file, current question, ...) that Worksheet's document accessors...
Definition: Worksheet.h:2294
FindReplacePane * m_findPane
The dockable find-and-replace sidebar (GH #2249), set once by wxMaximaFrame at startup and never dest...
Definition: Worksheet.h:1102
std::optional< std::size_t > SelectedOutputResult() const
Which result of its cell's output is selected, if exactly one is.
Definition: Worksheet.cpp:2197
std::unique_ptr< wxDataObject > CreateCellsDataObject() const
Build the multi-format clipboard object for a whole-cell selection.
Definition: Worksheet.cpp:3011
GroupCell * GetInsertGroup() const
The group that the line's cells will belong to - used by InsertLine.
Definition: Worksheet.cpp:1076
void OnCharNoActive(wxKeyEvent &event)
Key pressed and no cell was active.
Definition: Worksheet.cpp:4031
bool QuestionPending() const
Does maxima wait for the answer of a question?
Definition: Worksheet.h:2166
void AddEntireDocumentToEvaluationQueue()
Schedule all cells in the document for evaluation.
Definition: Worksheet.cpp:5303
WorksheetLayout::ScrollAnchor GetScrollAnchor() const
Where the cursor is, as the layout engine's scroll compensation needs it.
Definition: Worksheet.cpp:1160
static wxString CellsToMathML(const Cell *cells)
A MathML document showing a list of cells, nicely indented.
Definition: Worksheet.cpp:2744
bool CopyCSV() const
Copy the selected matrix, or block of one, to the clipboard as CSV.
Definition: Worksheet.cpp:2824
GroupCell * FirstVisibleGC()
The first groupCell that is currently visible.
Definition: Worksheet.cpp:1744
static std::unique_ptr< wxDataObject > CreateIndependentDataObject(const ClipboardContents &contents)
The data RenderClipboardContents() puts on the clipboard.
Definition: Worksheet.cpp:3116
bool HasTextFormat(TextFormat::Format flag) const
Is this character format on where the cursor is? (For the toolbar.)
Definition: Worksheet.cpp:6349
bool NavigateOutput(int keyCode, bool shift)
Walk through the parts of the selected output with the keyboard.
Definition: Worksheet.cpp:2318
bool CanFormatText() const
Is the cursor in a cell whose text can be formatted?
Definition: Worksheet.cpp:6354
void SetAsyncOutputTarget(GroupCell *cell)
Routes output to one specific cell instead of the one being evaluated.
Definition: Worksheet.h:1261
void UpdateConfigurationClientSize()
Inform the configuration about the current client size.
Definition: Worksheet.h:1741
int ReplaceAll(const wxString &oldString, const wxString &newString, bool ignoreCase, bool searchInInput=true, bool searchInOutput=true)
Replace all occurrences of a string.
Definition: Worksheet.cpp:6772
void LoadHelpFileAnchors(const wxString &docdir, const wxString &maximaVersion)
Tries to parse maxima's manual in order to find out which anchors it contains.
Definition: Worksheet.h:2207
bool ExportToHTML(const wxString &file)
Export the file to an html document.
Definition: Worksheet.cpp:4919
void OpenHCaret(const wxString &txt={})
Place the cursor into a new cell where the horizontal cursor is.
Definition: Worksheet.h:1890
void NotifyAdjustSizeNeeded() override
The scrollable size will need re-adjusting once cell positions settle.
Definition: Worksheet.h:163
void ApplyOverlayScrollbarsSetting()
Apply the configuration's OverlayScrollbars() choice to this window.
Definition: Worksheet.cpp:572
TextCell * GetSelectedTextCell() const
Returns the selected cell - or nullptr, if the selection isn't a text cell.
Definition: Worksheet.h:1484
void SetAttentionCallback(std::function< void(bool)> callback)
Is called with true when a notification is raised and with false once it is cleared,...
Definition: Worksheet.h:891
void ScrollToError()
Unfold the cell that produced the error, if necessary and, if requested, scroll to it.
Definition: Worksheet.cpp:998
bool HCaretActive() const
Is the vertically-drawn cursor active?
Definition: Worksheet.h:1105
void OnEraseBackground(wxEraseEvent &WXUNUSED(event))
Cannot be static as it is called using a function pointer to an object.
Definition: Worksheet.h:731
void ClearDocument()
Empties the current document.
Definition: Worksheet.cpp:1300
~Worksheet() override
The destructor.
Definition: Worksheet.cpp:597
wxString RTFEnd() const
The end of a RTF document.
Definition: Worksheet.cpp:7521
ViewCellPointers m_viewCellPointers
The transient view-state half of the cell-pointer registry (hover, selection anchors,...
Definition: Worksheet.h:2298
void UpdateTableOfContents()
Update the table of contents.
Definition: Worksheet.cpp:7920
void RemoveAllOutput()
Remove all output cells from the whole worksheet.
Definition: Worksheet.cpp:6373
Cell * GetSelectionEnd() const
Return the last of the currently selected cells.
Definition: Worksheet.h:1725
void QuestionPending(bool pending)
Does maxima currently wait for the answer of a question?
Definition: Worksheet.h:2173
void ClickNDrag(wxPoint down, wxPoint up)
Select the rectangle surrounded by down and up.
Definition: Worksheet.cpp:2064
FindReplacePane * GetActiveFindPane() const
Whichever find/replace UI is actually in use right now: the dockable sidebar (GH #2249) if Configurat...
Definition: Worksheet.cpp:6578
DocumentCellPointers & GetDocumentCellPointers()
The document-model half of the cell-pointer registry (owned by m_document).
Definition: Worksheet.h:967
const wxString & GetCurrentFile() const
The name of the currently-opened file.
Definition: Worksheet.h:1066
void SetCurrentFile(const wxString &file)
Set the name of the currently-opened file.
Definition: Worksheet.h:1068
RecentDocuments & UnsavedDocuments()
The list of unsaved (autosaved) documents offered for recovery.
Definition: Worksheet.h:167
static bool OpenLink(const wxString &url)
Opens a link from a text cell in the user's web browser (GH #2396).
Definition: Worksheet.cpp:1942
bool CopyHTML() const
Copy a self-contained HTML version (inline CSS, base64-embedded images – see WorksheetExport::Selecti...
Definition: Worksheet.cpp:4726
void DeleteCurrentCell()
Delete the currently active cell - or the cell above this one.
Definition: Worksheet.cpp:3179
AutoComplete & GetAutocomplete()
The storage for the autocompletion feature.
Definition: Worksheet.h:943
AnimationCell * GetSelectedAnimation() const
Returns the selected cell - or nullptr, if the selection isn't an animation.
Definition: Worksheet.h:1436
void Replace(const wxString &oldString, const wxString &newString, bool ignoreCase)
Replace the current occurrence of a string.
Definition: Worksheet.cpp:6738
bool CopyMatlab() const
Copy a Matlab representation of the current selection to the clipboard.
Definition: Worksheet.cpp:2885
bool CopyText() const
Copy a textual representation of the current selection to the clipboard.
Definition: Worksheet.cpp:2962
wxString GetLinkAt(wxPoint point)
The link drawn at a point in worksheet coordinates, or "".
Definition: Worksheet.cpp:1967
bool StepOutputResult(int keyCode)
Move between results with the Up or Down key while no editor is active.
Definition: Worksheet.cpp:2260
bool m_inPopupMenu
Is there an active popup menu?
Definition: Worksheet.h:2322
EvaluationQueue & GetEvaluationQueue()
The list of cells that have to be evaluated.
Definition: Worksheet.h:2014
bool PasteMathAsMaxima()
Paste LaTeX or MathML maths from the clipboard as a Maxima command.
Definition: Worksheet.cpp:5916
void Animate(bool run=true) const
Animate the current slide show.
Definition: Worksheet.cpp:6250
static GroupCell * StartOfSectioningUnit(GroupCell *start)
Finds the start of the current chapter/section/...
Definition: Worksheet.cpp:3588
bool CopyRTF() const
Copy a rtf version of the current selection to the clipboard.
Definition: Worksheet.cpp:4670
void UpdateConfig()
Re-read the configuration.
Definition: Worksheet.h:1048
int m_pointer_y
The y position of the mouse pointer.
Definition: Worksheet.h:2308
MatrixScrollbars & GetMatrixScrollbars()
The native scrollbars of matrices shown in a scrolling viewport.
Definition: Worksheet.h:931
std::size_t ForgetKnownAnswers()
Forget the answers to Maxima's questions remembered by some cells (GH #1018)
Definition: Worksheet.cpp:6856
bool Copy(bool astext=false) const
Copy the current selection to the clipboard.
Definition: Worksheet.cpp:2546
bool CopyAnimation() const
Copy the current animation to the clipboard.
Definition: Worksheet.cpp:4648
const wxString UnicodeToMaxima(wxString s) const
Make a few unicode characters interpretable by maxima.
Definition: Worksheet.h:1086
void StepAnimation(int change=1)
Set the slide of the currently selected animation or advance it by one step.
Definition: Worksheet.cpp:4499
GroupCell * Unfold(GroupCell *which)
Unfold a cell (see WorksheetDocument::Unfold())
Definition: Worksheet.h:2023
void SelectEditable(EditorCell *editor, bool up)
Is called when a hCursor is active and we have a WXK_UP/WXK_DOWN event.
Definition: Worksheet.cpp:4000
void SetAnswer(const wxString &answer)
Handling questions from and answers for maxima.
Definition: Worksheet.cpp:3307
bool CanCopyCSV() const
Is the selection a matrix, or a block of one, that "Copy as CSV" can copy?
Definition: Worksheet.cpp:2801
wxString m_contextMenuLink
The link the last context menu was opened on, see GetContextMenuLink().
Definition: Worksheet.h:2320
ViewCellPointers & GetViewCellPointers()
The transient view-state half of the cell-pointer registry (owned here).
Definition: Worksheet.h:970
void OnChar(wxKeyEvent &event)
Key for a printable character pressed.
Definition: Worksheet.cpp:4385
bool ScrollSelectedMatrix(const wxMouseEvent &event)
Lets a mouse wheel event scroll the selected scrolling matrix (GH #2479)
Definition: Worksheet.cpp:1893
void SelectWithChar(int ccode)
Handle selecting text using the keyboard Is called when the all of the following is true:
Definition: Worksheet.cpp:3863
void AddSelectionToEvaluationQueue()
Schedule all cells in the selection to be evaluated.
Definition: Worksheet.cpp:5341
bool HasCellsSelected() const
Is at least one entire cell selected?
Definition: Worksheet.h:1385
bool ScrollAnchorVisible()
Is the cursor on screen?
Definition: Worksheet.cpp:1185
long GetStalePaintCount() const
How many paints drew for another scroll position than the one they ended with.
Definition: Worksheet.h:156
std::optional< Notification > & GetNotification()
The error notification message, if any.
Definition: Worksheet.h:868
void OnSetFocus(wxFocusEvent &event)
What to do if the worksheet is in the input focus.
Definition: Worksheet.cpp:6212
void SetNotification(const wxString &message, int flags=wxICON_INFORMATION)
Inform the user that something happened in a non-active window.
Definition: Worksheet.cpp:4372
bool ExportToPDF(const wxString &file, const PdfExport::Options &options=PdfExport::Options())
Export to a tagged PDF file, see PdfExport.
Definition: Worksheet.cpp:4948
bool IsSelected(CellType type) const
Does the selection start with a cell of the type "type".
Definition: Worksheet.h:1851
GroupCell * GetAsyncOutputTarget() const
The cell async output is currently being routed to, if any.
Definition: Worksheet.h:1263
void ScheduleScrollToCell(Cell *cell, bool scrollToTop=true)
Schedules scrolling to a given cell.
Definition: Worksheet.h:1811
int GetViewScrollUnitY() const override
The current vertical scroll position, in scroll units (not pixels).
Definition: Worksheet.h:129
GroupCell * InsertGroupCells(std::unique_ptr< GroupCell > &&cells, GroupCell *where, UndoActions *undoBuffer)
Insert group cells into the worksheet.
Definition: Worksheet.cpp:978
void AddDocumentTillHereToEvaluationQueue()
Schedule all cells stopping with the one the caret is in for evaluation.
Definition: Worksheet.cpp:5357
void OnComplete(wxCommandEvent &event)
Is called if an action from the autocomplete menu is selected.
Definition: Worksheet.cpp:7257
bool CanAnimate() const
Does it make sense to enable the "Play" button and the slider now?
Definition: Worksheet.h:1492
bool RecalculateIfNeeded(bool timeout=false, long timeSliceMs=50)
Actually recalculate the worksheet.
Definition: Worksheet.h:1300
bool m_mouseMotionWas
Was there a mouse motion we didn't react to until now?
Definition: Worksheet.h:2310
void SelectAll()
Select the whole document.
Definition: Worksheet.cpp:6135
void DeactivateHCaret()
Hides the horizontal cursor, e.g. in a worksheet nothing can be inserted into.
Definition: Worksheet.h:1107
void OnKillFocus(wxFocusEvent &event)
What to do if the worksheet looses the input focus.
Definition: Worksheet.cpp:6224
void InsertLine(std::unique_ptr< Cell > &&newCell, bool forceNewLine=false)
Add a new line to the output cell of the working group.
Definition: Worksheet.cpp:1093
void ClearNotification()
Clears the notification message from SetNotification.
Definition: Worksheet.cpp:4362
void OnPaint(wxPaintEvent &event)
Is called by wxWidgets when it wants to redraw the worksheet or a part of it.
Definition: Worksheet.cpp:643
void OnFollow()
Called when the "Scroll to currently evaluated" button is pressed.
Definition: Worksheet.cpp:7441
void PrepareDrawGC(wxDC &dc) const
All that has need to be done before drawing a GroupCell in a DC.
Definition: Worksheet.cpp:833
void OnCharInActive(wxKeyEvent &event)
Key pressed inside a cell.
Definition: Worksheet.cpp:3632
Cell * GetSelectionStart() const
Return the first of the currently selected cells.
Definition: Worksheet.h:1718
void FoldOccurred()
Call when a fold action was detected, to update the state in response to a fold occurring.
Definition: Worksheet.cpp:1388
void OnMouseCaptureLost(wxMouseCaptureLostEvent &event)
Is called if we loose the mouse connection whilst selecting text/cells.
Definition: Worksheet.cpp:7525
wxTimer & KeyboardInactiveTimer()
The timer that tells us when the keyboard is inactive so an autosave isn't disrupting.
Definition: Worksheet.h:1147
ClickType
An enum for all classes of items one can click on.
Definition: Worksheet.h:425
ImgCell * GetSelectedImgCell() const
Returns the selected cell - or nullptr, if the selection isn't an image.
Definition: Worksheet.h:1468
Cell * FindCellByUUID(const wxString &uuid)
Find a cell by its UUID.
Definition: Worksheet.cpp:5405
void EraseBackground(wxEraseEvent &event)
Is called if wxWidgets wants to erase the worksheet's background.
Definition: Worksheet.cpp:335
bool StepSelectedMatrixBlock(int keyCode)
Grow or shrink the selected block of a matrix's entries (GH #2370)
Definition: Worksheet.cpp:2451
bool CanDeleteSelection() const
Is it possible to delete the currently selected cells?
Definition: Worksheet.h:1427
ToolBar * m_mainToolBar
The toolbar of the main window: We need to access it and therefore have it defined here.
Definition: Worksheet.h:2149
bool CaretVisibleIs()
Is the caret (hcaret or vcaret) currently visible on the worksheet?
Definition: Worksheet.cpp:6674
EditorCell * GetActiveCell() const
Get the currently active EditorCell.
Definition: Worksheet.h:951
bool UpdateControlsNeeded()
Is an update of the worksheet controls needed?
Definition: Worksheet.h:172
bool CopyCells() const
Copy the selection to the clipboard as it would appear in a .wxm file.
Definition: Worksheet.cpp:2995
bool OpenQuestionCaret(const wxString &txt={})
Move the cursor to the question maxima currently asks and if needed add a cell for user input.
Definition: Worksheet.cpp:3322
bool FindIncremental(const wxString &str, bool down, bool ignoreCase, bool searchInInput=true, bool searchInOutput=true)
Do an incremental search from the cursor or the point the last search started at.
Definition: Worksheet.cpp:6515
GroupCell * GetLastCell()
Returns the last cell of the worksheet.
Definition: Worksheet.h:1866
GroupCell * GetHCaret()
The cell the horizontal cursor is above. nullptr means at the start of the document.
Definition: Worksheet.cpp:6256
wxString ConvertSelectionToMathML() const
Convert the current selection to MathML.
Definition: Worksheet.cpp:2733
bool CanUndoInsideCell() const
Is it possible to issue an undo in the currently selected cell?
Definition: Worksheet.h:1908
void PasteFromClipboard(bool primary=false)
Paste into the worksheet.
Definition: Worksheet.cpp:5978
void SetHCaret(GroupCell *where)
Set the HCaret at the location of the given Cell.
Definition: Worksheet.cpp:6283
bool CanRedoInsideCell() const
Is it possible to issue an undo in the currently selected cell?
Definition: Worksheet.h:1927
bool GCContainsCurrentQuestion(const GroupCell *cell)
Does the GroupCell cell points to contain the question currently asked by maxima?
Definition: Worksheet.cpp:3560
const wxString & GetContextMenuLink() const
The link the last context menu was opened on, or an empty string.
Definition: Worksheet.h:723
bool WillAutoAnswer() const
Execute all collected scroll events in one go.
Definition: Worksheet.cpp:3315
void ToggleTextFormat(TextFormat::Format flag)
Switch a character format (bold, ...) of the active text cell on or off.
Definition: Worksheet.cpp:6332
bool IsEmpty() const
Is this worksheet empty?
Definition: Worksheet.h:836
void NumberSections() const
Renumber all sections.
Definition: Worksheet.cpp:1333
std::optional< OutputNavigation::Item > SelectedOutputItem() const
The selected part of an output, as a node of OutputNavigation's tree.
Definition: Worksheet.cpp:2217
void SetViewVirtualSize(int width, int height) override
Set the scrollable (virtual) area, in device pixels.
Definition: Worksheet.h:131
static wxString SelectionRTFBody(const Cell *cells, bool matrixEntries)
The RTF for a copy of the selection, without RTFStart() and RTFEnd()
Definition: Worksheet.cpp:2507
void OnKeyDown(wxKeyEvent &event)
A special key has been pressed.
Definition: Worksheet.cpp:3447
GroupCell * FindGroupCellByUUID(const wxString &uuid) const
Finds a GroupCell by its UUID, or nullptr if no cell has that UUID.
Definition: Worksheet.cpp:1058
EditorCell * KeyboardSelectionStart() const
Tells us which cell the keyboard selection has started in.
Definition: Worksheet.h:954
void SetSelection(Cell *sel)
Select the cell sel.
Definition: Worksheet.h:1732
void AddCellToEvaluationQueue(GroupCell *gc)
Schedule this cell for evaluation.
Definition: Worksheet.cpp:5375
void SetCellStyle(GroupCell *group, GroupType style)
Change the style of a cell.
Definition: Worksheet.cpp:3236
bool Autocomplete(AutoComplete::autoCompletionType type=AutoComplete::command)
Definition: Worksheet.cpp:7004
wxString SelectionToCSV() const
The selected matrix, or selected block of one, as CSV (GH #2364)
Definition: Worksheet.cpp:2815
wxBitmap m_memory
A memory we can manually buffer the contents of the area that is to be redrawn in.
Definition: Worksheet.h:2300
void LoadSymbols()
Compile a list of known autocompletion symbols.
Definition: Worksheet.cpp:4958
void SelectGroupCell(GroupCell *cell)
Set this cell as the currently selected one.
Definition: Worksheet.cpp:7427
void AddSymbols(const wxXmlDocument &xml)
Add a xml-encoded list of symbols to the autocompletion list.
Definition: Worksheet.h:2136
void ShowPoint(wxPoint point)
Scrolls to a point on the worksheet.
Definition: Worksheet.cpp:5840
void WindowActive(bool active)
Is this window active?
Definition: Worksheet.h:876
bool ExportToTeX(const wxString &file)
export to a LaTeX file
Definition: Worksheet.cpp:4941
void AdjustSize()
Adjust the virtual size and scrollbars; see WorksheetLayout::AdjustSize().
Definition: Worksheet.h:728
void ScrollViewToUnitY(int unitY) override
Scroll without showing any frame in between (the scroll compensation)
Definition: Worksheet.h:148
void ShowHCaret()
Activates the horizontal cursor.
Definition: Worksheet.cpp:6315
bool SelectWholeCellsFromOutput(int ccode)
Shift+Up/Down with something inside a cell's output selected.
Definition: Worksheet.cpp:3960
TimerIDs
An enum of individual IDs for all timers this class handles.
Definition: Worksheet.h:435
static wxString LinkToolTip(const wxString &link)
The tooltip for the pointer being over link: its address and how to open it.
Definition: Worksheet.cpp:1951
void CodeCellVisibilityChanged()
To be called after enabling or disabling the visibility of code cells.
Definition: Worksheet.cpp:4929
void UpdateLinkCursor(bool overLink)
Shows the hand cursor while the pointer is over a link and Ctrl is held.
Definition: Worksheet.cpp:1959
void ScrollToCaret()
Request to scroll to the cursor as soon as wxMaxima is idle.
Definition: Worksheet.h:1798
bool OpenMatrixViewerAt(wxPoint position)
Opens a MatrixViewer if there is a partially shown matrix at this point.
Definition: Worksheet.cpp:5223
wxString LinkUnderPointer()
The link a text cell or the output draws under the mouse pointer, or "".
Definition: Worksheet.cpp:1978
void MarkRefreshAsDone()
Handle redrawing the worksheet or of parts of it.
Definition: Worksheet.h:1001
bool CopyMathML() const
Copy the MathML representation of the current selection to the clipboard.
Definition: Worksheet.cpp:2858
bool CopyBitmap() const
Copy a bitmap of the current selection to the clipboard.
Definition: Worksheet.cpp:4642
bool CanCopyAsMathML() const
Would "Copy as MathML" of the current selection produce actual math?
Definition: Worksheet.cpp:2839
void GetViewClientSize(int *width, int *height) const override
The visible client area, in device pixels.
Definition: Worksheet.h:127
GroupCell * Fold(GroupCell *which)
Fold a cell (see WorksheetDocument::Fold())
Definition: Worksheet.h:2020
bool PointVisibleIs(wxPoint point)
Is the point currently visible on the worksheet?
Definition: Worksheet.cpp:5819
std::unique_ptr< Cell > CopySelection(bool asData=false) const
Copy the currently selected cells.
Definition: Worksheet.cpp:4839
bool EnterOutputFromInput()
Down at the end of a cell's input: select the output's first result.
Definition: Worksheet.cpp:2304
GroupCell * GetLastCellInWorksheet() const
Returns a pointer to the last cell of this worksheet.
Definition: Worksheet.cpp:2059
void ScrollToStart()
Scroll to the start of the worksheet.
Definition: Worksheet.h:1092
void NotifyRecalculation(GroupCell *start) override
Schedule a re-layout of the document starting at start (null = all).
Definition: Worksheet.h:160
void SetContextMenuLink(const wxString &link)
Remembers the link the context menu is being opened on.
Definition: Worksheet.h:725
void AddSymbol(const wxString &fun, AutoComplete::autoCompletionType type=AutoComplete::command)
Add a symbol to the autocompletion list.
Definition: Worksheet.h:2129
bool CanEdit() const
We can edit the input if the we have the whole input in selection!
Definition: Worksheet.h:1745
bool FindNext(const wxString &str, bool down, bool ignoreCase, bool searchInInput=true, bool searchInOutput=true, bool warn=true)
Find the next occurrence of a string.
Definition: Worksheet.cpp:6608
bool MatrixEntriesSelected() const
Are the entries of a matrix selected, rather than the matrix? (GH #959)
Definition: Worksheet.cpp:2503
bool SectioningMoveIn(GroupCell *parent)
Make this chapter/section/... a section/subsection/... changing its subheadings, too.
Definition: Worksheet.cpp:7294
wxBitmap ConvertSelectionToBitmap() const
Convert the current selection to a bitmap.
bool RedrawIfRequested()
Redraw the worksheet if RequestRedraw() has been called.
Definition: Worksheet.cpp:347
bool ExportToMAC(const wxString &file)
Export the file to a text file maxima's load command can read.
Definition: Worksheet.cpp:5118
wxString SelectionToSelfContainedHTML() const
What CopyHTML() puts on the clipboard, without touching the clipboard.
Definition: Worksheet.cpp:4708
void OnZoom(wxZoomGestureEvent &event)
Handle pinch-to-zoom-events using the gesture interface.
Definition: Worksheet.cpp:4488
bool m_linkCursorShown
Does the worksheet currently show the hand cursor for a link?
Definition: Worksheet.h:2314
void SetActiveCell(EditorCell *cell)
Mark an editor cell as the active one.
Definition: Worksheet.cpp:5735
FindReplaceDialog * m_findDialog
The find-and-replace-dialog.
Definition: Worksheet.h:1098
void DrawGroupCell(wxDC &dc, wxDC &adc, GroupCell &cell)
Draws a groupcell on the DC.
Definition: Worksheet.cpp:899
void QuestionAnswered()
Mark the current question from maxima as "answered"..
Definition: Worksheet.cpp:3564
void DeleteRegion(GroupCell *start, GroupCell *end, UndoActions *undoBuffer)
Definition: Worksheet.cpp:3271
void SelectOutputResult(GroupCell *group, std::size_t index)
Select one result of a cell's output, scroll to it and announce it.
Definition: Worksheet.cpp:2209
bool ScrollToCaretIfNeeded()
Scrolls to the cursor, if requested.
Definition: Worksheet.cpp:6708
void NotifyRedraw(GroupCell *start) override
Schedule a redraw of the document starting at start (null = all).
Definition: Worksheet.h:162
std::unique_ptr< GroupCell > CopyTree() const
Copies the worksheet's entire contents.
Definition: Worksheet.cpp:4638
GroupCell * EndOfSectioningUnit(GroupCell *start)
Finds the end of the current chapter/section/...
Definition: Worksheet.cpp:3605
std::vector< wxString > m_replacementsForCurrentWord
Suggestions for how the word that was right-clicked on could continue.
Definition: Worksheet.h:2215
int ExportSelectionOutputToDir(const wxString &dir, bool svg)
Write each selected group cell's output to an image file in a folder.
Definition: Worksheet.cpp:4784
void ForceRedraw()
Redraw the window now and mark any pending redraw request as "handled".
Definition: Worksheet.h:1038
bool CopyTeX() const
Copy the TeX representation of the current selection to the clipboard.
Definition: Worksheet.cpp:2917
void AddRestToEvaluationQueue()
Add all cells below the cursor to the evaluation queue.
Definition: Worksheet.cpp:5321
bool m_pointerCmdDown
Was Ctrl (Cmd on macOS) held during the last mouse motion?
Definition: Worksheet.h:2312
void ScrollToCellIfNeeded()
Scrolls to the cell given by ScheduleScrollToCell; Is called once we have time to do so.
Definition: Worksheet.cpp:5427
static wxString CSVDelimiter()
What separates the values "Copy as CSV" writes.
Definition: Worksheet.cpp:2809
void DrawGroupCell_UsingBitmap(wxDC *dc, GroupCell *cell)
Draws a groupcell in a bitmap and then blits it onto the DC.
Definition: Worksheet.cpp:848
void GetMaxPoint(int *width, int *height)
Get the coordinates of the bottom right point of the worksheet.
Definition: Worksheet.h:579
void OnMouseWheel(wxMouseEvent &event)
Called if the mouse wheel sents events.
Definition: Worksheet.cpp:1778
void RequestRecalculation()
Schedule a recalculation of the whole worksheet.
Definition: Worksheet.h:1324
void CloseAutoCompletePopup()
Close the autocompletion pop-up if it is currently open.
Definition: Worksheet.h:839
bool SectioningMoveOut(GroupCell *parent)
Make this section/subsection/... a chapter/section/... changing its subheadings, too.
Definition: Worksheet.cpp:7336
bool FollowEvaluation() const
Query if we want to automatically scroll to the cell that is currently evaluated.
Definition: Worksheet.h:1943
void DestroyTree()
Clear the whole worksheet.
Definition: Worksheet.cpp:4629
wxString GetString(bool lb=false) const
Convert the current selection to a string.
Definition: Worksheet.cpp:2522
void NotifySavedStateChanged() override
The document's saved-state flipped; refresh the controls that show it.
Definition: Worksheet.h:164
int GetLastCellsVisited() const
How many cells the last layout pass visited. See WorksheetLayout.
Definition: Worksheet.h:1327
std::unique_ptr< wxDataObject > CreateSelectionDataObject() const
Build the multi-format clipboard object for a non-cell selection.
Definition: Worksheet.cpp:2628
GroupCell * GetWorkingGroup(bool resortToLast=false) const
Returns the cell maxima currently works on.
Definition: Worksheet.cpp:1036
bool CopySVG() const
Copy a svg of the current selection to the clipboard.
Definition: Worksheet.cpp:4656
void Evaluate()
Trigger the evaluation of the current cell(s)
Definition: Worksheet.cpp:3438
void OnScrollChanged(wxScrollEvent &ev)
Called if the user is using the scrollbar for scrolling through the document.
Definition: Worksheet.cpp:6441
void OnDoubleClick(wxMouseEvent &event)
Is called on double click on a cell.
Definition: Worksheet.cpp:5194
void OnActivate(wxActivateEvent &event)
Is called if this element looses or gets the focus.
Definition: Worksheet.cpp:6275
void AddToEvaluationQueue(GroupCell *cell)
Adds a group cell to the evaluation queue marking its contents as "outdated".
Definition: Worksheet.cpp:5296
std::unique_ptr< MatrCell > CopySelectedMatrixBlock() const
The selected sub-matrix, as a new matrix, or null (GH #2345)
Definition: Worksheet.cpp:2493
void RequestRecalculation(Cell *start)
Schedule a recalculation of the worksheet starting with the cell start.
Definition: Worksheet.h:1313
void AnonymizeCodeCells()
Anonymize the code cells in the current selection for a bug report (GH #1339).
Definition: Worksheet.cpp:6880
Definition: WheelSteps.h:40
bool CanTreeRedo() const
Can we redo a tree operation?
Definition: Worksheet.cpp:5546
void TreeUndo_CellEntered()
The cursor has entered one cell => save the value to see if it has changed.
Definition: Worksheet.cpp:3227
void TreeUndo_AppendAction()
Add another action to this undo action.
Definition: Worksheet.h:351
bool TreeUndoTextChange(UndoActions *sourcelist, UndoActions *undoForThisOperation)
Undo a text change.
Definition: Worksheet.cpp:5640
bool TreeUndo()
Undo a tree operation.
Definition: Worksheet.h:378
void TreeUndo_ClearRedoActionList()
Clear the list of actions for which an undo can be undone.
Definition: Worksheet.h:345
bool CanTreeUndo() const
Can we undo a tree operation?
Definition: Worksheet.cpp:5542
void TreeUndo_CellLeft()
The cursor is about to leave the current cell => Store the change if the value has changed.
Definition: Worksheet.cpp:3212
void TreeUndo_ClearUndoActionList()
Clear the list of actions for which undo can undo.
Definition: Worksheet.h:348
bool TreeUndoCellAddition(UndoActions *sourcelist, UndoActions *undoForThisOperation)
Undo adding cells.
Definition: Worksheet.cpp:5574
bool TreeUndoCellDeletion(UndoActions *sourcelist, UndoActions *undoForThisOperation)
Undo a call deletion.
Definition: Worksheet.cpp:5561
bool TreeRedo()
Redo an undone tree operation.
Definition: Worksheet.h:382
void TreeUndo_MarkCellsAsAdded(GroupCell *start, GroupCell *end, UndoActions *undoBuffer)
Remember that these cells were just added so this addition can be undone.
Definition: Worksheet.cpp:3203
bool TreeUndoFold(UndoActions *sourcelist, UndoActions *undoForThisOperation)
Undo a fold or unfold (GH #266)
Definition: Worksheet.cpp:5609
Everything one copy operation puts on the clipboard.
Definition: ClipboardContents.h:153
One node of the tree: a run of sibling cells, or one entry of a matrix.
Definition: OutputNavigation.h:73
What goes into the PDF besides the worksheet.
Definition: PdfExport.h:66
Where a search starts: a group plus what the cursor is doing there.
Definition: WorksheetSearch.h:113
A search match: the group it is in and the matching part.
Definition: WorksheetSearch.h:97
Definition: gen_corpora.c:58