 |
wxMaxima
|
Go to the documentation of this file.
33 #include "stx/optional.hpp"
36 #include <wx/xml/xml.h>
37 #include <wx/aui/aui.h>
38 #include <wx/textfile.h>
39 #include <wx/fdrepdlg.h>
43 #include "CellPointers.h"
89 WX_DECLARE_STRING_HASH_MAP(wxString, HelpFileAnchors);
93 wxString m_maximaVersion;
95 wxString m_maximaDocDir;
97 bool m_updateControls =
true;
107 bool m_dontSkipScrollEvent;
109 double m_zoomAtGestureStart;
111 bool m_scrollToTopOfCell;
117 wxRegion m_rectToRefresh;
133 bool m_redrawRequested;
137 static wxDataFormat m_wxmFormat;
139 static wxDataFormat m_mathmlFormat;
141 static wxDataFormat m_mathmlFormat2;
143 static wxDataFormat m_rtfFormat;
145 static wxDataFormat m_rtfFormat2;
149 class MathMLDataObject :
public wxCustomDataObject
152 explicit MathMLDataObject(
const wxString &data);
157 wxCharBuffer m_databuf;
161 class wxmDataObject :
public wxCustomDataObject
164 explicit wxmDataObject(wxString data);
169 wxCharBuffer m_databuf;
172 class MathMLDataObject2 :
public wxCustomDataObject
175 explicit MathMLDataObject2(wxString data);
180 wxCharBuffer m_databuf;
185 class RtfDataObject :
public wxCustomDataObject
188 explicit RtfDataObject(wxString data);
193 wxCharBuffer m_databuf;
196 class RtfDataObject2 :
public wxCustomDataObject
199 explicit RtfDataObject2(wxString data);
204 wxCharBuffer m_databuf;
240 TreeUndoAction(
GroupCell *start,
const wxString &oldText) :
241 m_start(start), m_oldText(oldText)
243 wxASSERT_MSG(start, _(
"Bug: Trying to record a cell contents change for undo without a cell."));
246 m_start(start), m_newCellsEnd(end)
248 wxASSERT_MSG(start, _(
"Bug: Trying to record a cell contents change for undo without a cell."));
251 m_start(start), m_newCellsEnd(end), m_oldCells(oldCells)
260 bool m_partOfAtomicAction =
false;
273 const wxString m_oldText;
281 GroupCell *
const m_newCellsEnd =
nullptr;
290 std::unique_ptr<GroupCell> m_oldCells;
294 using UndoActions = std::list<TreeUndoAction>;
297 UndoActions treeUndoActions;
300 UndoActions treeRedoActions;
303 wxString m_treeUndo_ActiveCellOldText;
306 void TreeUndo_ClearRedoActionList();
309 void TreeUndo_ClearUndoActionList();
312 void TreeUndo_DiscardAction(UndoActions *actionList);
315 void TreeUndo_AppendAction(UndoActions *actionList)
317 if(!actionList->empty())
318 actionList->front().m_partOfAtomicAction =
true;
322 void TreeUndo_AppendAction(){TreeUndo_AppendAction(&treeUndoActions);}
331 void TreeUndo_LimitUndoBuffer();
338 bool TreeUndo(UndoActions *sourcelist, UndoActions *undoForThisOperation);
343 bool TreeUndoTextChange(UndoActions *sourcelist, UndoActions *undoForThisOperation);
347 bool TreeUndoCellDeletion(UndoActions *sourcelist, UndoActions *undoForThisOperation);
351 bool TreeUndoCellAddition(UndoActions *sourcelist, UndoActions *undoForThisOperation);
355 {
return TreeUndo(&treeUndoActions, &treeRedoActions); }
359 {
return TreeUndo(&treeRedoActions, &treeUndoActions); }
362 bool CanTreeUndo()
const;
365 bool CanTreeRedo()
const;
369 void TreeUndo_CellEntered();
373 void TreeUndo_CellLeft();
383 void TreeUndo_MarkCellsAsAdded(
GroupCell *start,
GroupCell *end, UndoActions *undoBuffer);
394 bool m_scrolledAwayFromEvaluation;
403 wxString EscapeHTMLChars(wxString input);
406 wxString PrependNBSP(wxString input);
412 CLICK_TYPE_GROUP_SELECTION,
413 CLICK_TYPE_INPUT_SELECTION,
414 CLICK_TYPE_INPUT_LABEL_SELECTION,
415 CLICK_TYPE_OUTPUT_SELECTION
426 void AddLineToFile(wxTextFile &output,
const wxString &s);
429 std::unique_ptr<Cell> CopySelection(
bool asData =
false)
const;
439 std::unique_ptr<Cell> CopySelection(
Cell *start,
Cell *end,
bool asData =
false)
const;
442 void GetMaxPoint(
int *width,
int *height);
445 void OnTimer(wxTimerEvent &event);
451 bool m_autoSaveIntervalExpired;
453 #if wxCHECK_VERSION(3,1,1)
454 void OnZoom(wxZoomGestureEvent &event);
458 void OnMouseExit(wxMouseEvent &event);
460 void OnMouseEnter(wxMouseEvent &event);
467 void OnPaint(wxPaintEvent &event);
469 void OnSize(wxSizeEvent &event);
471 void OnMouseRightDown(wxMouseEvent &event);
473 void OnSidebarKey(wxCommandEvent &event);
475 void OnMouseLeftUp(wxMouseEvent &event);
478 void OnMouseCaptureLost(wxMouseCaptureLostEvent &event);
480 void OnMouseLeftDown(wxMouseEvent &event);
482 void OnMouseLeftInGcCell(wxMouseEvent &event,
GroupCell *clickedInGc);
484 void OnMouseLeftInGcLeft(wxMouseEvent &event,
GroupCell *clickedInGC);
486 void OnMouseLeftInGc(wxMouseEvent &event,
GroupCell *clickedInGC);
488 void OnMouseMotion(wxMouseEvent &event);
491 void OnDoubleClick(wxMouseEvent &event);
494 void OnCharInActive(wxKeyEvent &event);
497 void OnCharNoActive(wxKeyEvent &event);
500 void SelectEditable(
EditorCell *editor,
bool up);
508 void SelectWithChar(
int ccode);
524 void ClickNDrag(wxPoint down, wxPoint up);
527 void SelectGroupCells(wxPoint down, wxPoint up);
531 void OnEraseBackground(wxEraseEvent& WXUNUSED(event))
534 void CheckUnixCopy();
536 void OnMouseMiddleUp(wxMouseEvent &event);
538 bool IsLesserGCType(
int type,
int comparedTo);
547 void OnComplete(wxCommandEvent &event);
553 void EraseBackground(wxEraseEvent &event);
556 wxPoint m_leftDownPosition;
559 wxPoint m_mousePoint;
585 bool m_followEvaluation;
589 std::unique_ptr<GroupCell> m_tree;
592 int m_clickType_selectionStart;
595 bool m_blinkDisplayCaret;
597 bool m_hCaretBlinkVisible;
601 wxTimer m_caretTimer;
604 wxArrayString m_completions;
605 bool m_autocompleteTemplates;
609 wxString GetMaximaHelpFile();
610 void SetMaximaVersion(wxString version){m_maximaVersion = version;}
611 wxString GetMaximaVersion(){
return m_maximaVersion;}
614 {
return !m_tree || (!m_tree->GetNext() && m_tree->GetEditable()->GetValue().Length()<=1); }
618 if(m_autocompletePopup != NULL)
619 m_autocompletePopup->Destroy();
627 void OnChar(wxKeyEvent &event);
654 void SetNotification(
const wxString &message,
int flags = wxICON_INFORMATION);
680 int IndexSearchStartedAt()
683 CellPointers &GetCellPointers() {
return m_cellPointers; }
718 m_redrawStart = NULL;
719 m_redrawRequested =
false;
761 {
return m_redrawRequested ||
m_mouseMotionWas || m_rectToRefresh.IsEmpty(); }
818 void TreeUndo_ClearBuffers();
831 popid_copy_animation,
836 popid_add_watch_label,
837 popid_special_constant_percent,
838 popid_changeasterisk,
859 popid_labels_disable,
861 popid_labels_useronly,
862 popid_labels_autogenerated,
876 popid_digits_all_linebreak,
881 popid_animation_save,
882 popid_animation_start,
884 popid_evaluate_section,
888 popid_insert_section,
889 popid_insert_subsection,
890 popid_insert_subsubsection,
891 popid_insert_heading5,
892 popid_insert_heading6,
894 popid_never_autoanswer,
898 popid_maxsizechooser,
899 popid_resolutionchooser,
911 popid_hide_tooltipMarker,
912 popid_hide_tooltipMarkerForThisMessage
917 wxPoint pos = wxDefaultPosition, wxSize size = wxDefaultSize);
929 std::unique_ptr<GroupCell>
CopyTree()
const;
943 UndoActions *undoBuffer);
957 void InsertLine(std::unique_ptr<Cell> &&newCell,
bool forceNewLine =
false);
963 bool RecalculateIfNeeded();
979 void ResetInputPrompts();
981 bool CanCopy(
bool fromActive =
false)
989 {
return m_cellPointers.
m_activeCell || m_hCaretActive; }
1016 UndoActions *undoBuffer
1035 void DeleteSelection();
1064 void Animate(
bool run =
true);
1070 void SetLastQuestion(
const wxString &lastQuestion){m_lastQuestion = lastQuestion;}
1071 wxString GetLastQuestion(){
return m_lastQuestion;}
1076 void PasteFromClipboard();
1084 bool Copy(
bool astext =
false);
1116 #if wxUSE_ENH_METAFILE
1124 wxSize CopyToFile(
const wxString &file);
1126 wxSize CopyToFile(
const wxString &file,
Cell *start,
Cell *end,
bool asData =
false,
double scale = 1);
1128 void CalculateReorderedCellIndices(
GroupCell *tree,
int &cellIndex, std::vector<int> &cellMap);
1141 ExportToMAC(wxTextFile &output,
GroupCell *tree,
bool wxm,
const std::vector<int> &cellMap,
bool fixReorderedIndices);
1151 bool ExportToWXMX(
const wxString &file,
bool markAsSaved =
true);
1169 GroupCell *GetTree()
const {
return m_tree.get(); }
1170 std::unique_ptr<GroupCell> *GetTreeAddress() {
return &m_tree; }
1199 bool ActivatePrevInput() {
return ActivateInput(-1); }
1200 bool ActivateNextInput() {
return ActivateInput(+1); }
1201 wxString GetStatusText()
const{
return m_statusText;}
1202 bool StatusTextChangedHas(){
1203 bool retval = (m_statusTextHas != m_statusTextHas_old) ||
1204 (m_statusText != m_statusText_old);
1205 m_statusText_old = m_statusText;
1206 m_statusTextHas_old = m_statusTextHas;
1209 bool StatusTextHas(){
return m_statusTextHas;}
1211 template <
class T_SRC,
class T_DEST>
1212 inline std::unique_ptr<T_DEST> unique_cast(std::unique_ptr<T_SRC> &&src)
1214 if (!src)
return std::unique_ptr<T_DEST>();
1216 T_DEST *dest_ptr = &
dynamic_cast<T_DEST &
>(*src.get());
1219 return std::move(std::unique_ptr<T_DEST>(dest_ptr));
1221 wxString m_statusText;
1222 wxString m_statusText_old;
1223 bool m_statusTextHas =
false;
1224 bool m_statusTextHas_old =
false;
1225 void StatusText(wxString text){m_statusText = text;m_statusTextHas =
true;}
1226 void UnsetStatusText(){m_statusTextHas =
false;}
1227 bool ActivateInput(
int direction);
1234 m_scrollToCaret =
true;
1246 m_cellPointers.ScrollToCell(cell);
1247 m_scrollToTopOfCell = scrollToTop;
1248 m_scrollToCaret =
false;
1343 void UndoInsideCell();
1351 void RedoInsideCell();
1366 {
return m_followEvaluation; }
1373 void ScrolledAwayFromEvaluation(
bool ScrolledAway);
1375 bool ScrolledAwayFromEvaluation()
1376 {
return m_scrolledAwayFromEvaluation; }
1383 void SetSaved(
bool saved)
1384 {
if(m_saved != saved) m_updateControls =
true;m_saved = saved;}
1386 void OutputChanged()
1392 void RemoveAllOutput();
1407 void AddDocumentToEvaluationQueue();
1448 void SetZoomFactor(
double newzoom,
bool recalc =
true);
1450 void CommentSelection();
1484 bool FindIncremental(
const wxString &str,
bool down,
bool ignoreCase);
1490 bool FindNext(
const wxString &str,
bool down,
bool ignoreCase,
bool warn =
true);
1496 void Replace(
const wxString &oldString,
const wxString &newString,
bool ignoreCase);
1502 int ReplaceAll(
const wxString &oldString,
const wxString &newString,
bool ignoreCase);
1504 wxString GetInputAboveCaret();
1506 wxString GetOutputAboveCaret();
1530 void SetActiveCellText(
const wxString &text);
1532 bool InsertText(
const wxString &text);
1534 void OpenNextOrCreateCell();
1573 void SetMaximaDocDir(wxString dir)
1575 m_maximaDocDir = dir;
1612 bool isValid()
const
1613 {
return pos <
input.length(); }
1616 inline wxChar operator*()
const
1617 {
return input[pos]; }
1628 #if wxUSE_ACCESSIBILITY
1629 class AccessibilityInfo:
public wxAccessible
1632 AccessibilityInfo(wxWindow *parent,
Worksheet *worksheet);
1633 wxAccStatus GetChildCount (
int *childCount);
1634 wxAccStatus GetChild (
int childId, wxAccessible **child);
1635 wxAccStatus GetDefaultAction(
int childId, wxString *actionName);
1636 wxAccStatus GetParent (wxAccessible ** parent);
1638 wxAccStatus GetLocation (wxRect &rect,
int elementId);
1639 wxAccStatus HitTest (
const wxPoint &pt,
1640 int *childId, wxAccessible **childObject);
1641 wxAccStatus GetDescription(
int childId, wxString *description);
1648 wxString m_lastQuestion;
1649 int m_virtualWidth_Last;
1650 int m_virtualHeight_Last;
1653 virtual wxSize DoGetBestClientSize()
const;
1654 #if wxUSE_ACCESSIBILITY
1655 AccessibilityInfo *m_accessibilityInfo;
1657 void UpdateConfigurationClientSize();
1670 inline Worksheet *Cell::GetWorksheet()
const
1672 wxWindow *worksheet = (*m_configuration)->GetWorkSheet();
1673 wxASSERT(worksheet != NULL);
1674 return static_cast<Worksheet*
>(worksheet);
1678 { m_workSheet =
dynamic_cast<Worksheet*
>(workSheet); }
1680 #endif // WORKSHEET_H
CellPtr< EditorCell > m_cellMouseSelectionStartedIn
The EditorCell the mouse selection has started in.
Definition: CellPointers.h:95
void SetSelection(Cell *sel)
Select the cell sel.
Definition: Worksheet.h:1190
void FoldAll()
Definition: Worksheet.cpp:1244
PopIds
Definition: Worksheet.h:822
wxArrayString m_replacementsForCurrentWord
Suggestions for how the word that was right-clicked on could continue.
Definition: Worksheet.h:1603
bool m_scrollToCell
Is scrolling to a cell scheduled?
Definition: CellPointers.h:194
bool FindNext(const wxString &str, bool down, bool ignoreCase, bool warn=true)
Definition: Worksheet.cpp:8022
bool ExportToWXMX(const wxString &file, bool markAsSaved=true)
Definition: Worksheet.cpp:6359
bool m_questionPrompt
true = the last reply from maxima was a question
Definition: Worksheet.h:1557
void AddSymbol(wxString fun, autoCompletionType type=command)
Manually add an autocompletable symbol to our symbols lists.
Definition: Autocomplete.cpp:517
void DeleteRegion(GroupCell *start, GroupCell *end, UndoActions *undoBuffer)
Definition: Worksheet.cpp:2971
Variablespane * m_variablesPane
The panel the user can display variable contents in.
Definition: Worksheet.h:1595
wxString GetString(bool lb=false)
Definition: Worksheet.cpp:2437
void Replace(const wxString &oldString, const wxString &newString, bool ignoreCase)
Definition: Worksheet.cpp:8189
EditorCell * GetActiveCell() const
Get the currently active EditorCell.
Definition: Worksheet.h:668
Configuration * m_configuration
Definition: Worksheet.h:663
void ScrollToStart()
Scroll to the start of the worksheet.
Definition: Worksheet.h:782
@ MC_TYPE_GROUP
A group cells that bundles several individual cells together.
Definition: Cell.h:82
void InsertLine(std::unique_ptr< Cell > &&newCell, bool forceNewLine=false)
Definition: Worksheet.cpp:871
Definition: TextCell.h:36
void ClearDocument()
Definition: Worksheet.cpp:1095
void RequestRedraw(GroupCell *start=NULL)
Definition: Worksheet.cpp:385
HelpFileAnchors m_helpFileAnchors
All anchors for keywords maxima's helpfile contains.
Definition: Worksheet.h:1601
void AddSymbol(const wxString &fun, AutoComplete::autoCompletionType type=AutoComplete::command)
Add a symbol to the autocompletion list.
Definition: Worksheet.h:1523
void SetCellStyle(GroupCell *group, GroupType style)
Change the style of a cell.
Definition: Worksheet.cpp:2945
CellPtr< EditorCell > m_activeCell
Which EditCell the blinking cursor is in?
Definition: CellPointers.h:103
wxBitmap m_memory
A memory we can manually buffer the contents of the area that is to be redrawn in.
Definition: Worksheet.h:1652
bool Copy(bool astext=false)
Definition: Worksheet.cpp:2457
void QuestionPending(bool pending)
Definition: Worksheet.h:1570
void UpdateTableOfContents()
Definition: Worksheet.h:698
bool CopyBitmap()
Copy a bitmap of the current selection to the clipboard.
Definition: Worksheet.cpp:4520
GroupCell * GetWorkingGroup(bool resortToLast=false) const
Definition: Worksheet.cpp:838
void CloseAutoCompletePopup()
Close the autocompletion pop-up if it is currently open.
Definition: Worksheet.h:616
bool GCContainsCurrentQuestion(GroupCell *cell)
Does the GroupCell cell points to contain the question currently asked by maxima?
Definition: Worksheet.cpp:3310
Definition: TableOfContents.h:50
bool CanMergeSelection() const
Definition: Worksheet.cpp:7110
std::unique_ptr< std::thread > m_helpfileanchorsThread
The thread the help file anchors are compiled in.
Definition: Worksheet.h:770
bool SectioningMoveIn()
Make this chapter/section/... a section/subsection/... changing its subheadings, too.
Definition: Worksheet.cpp:8493
A simple FIFO queue with manual removal of elements.
Definition: EvaluationQueue.h:41
void AddSymbols(wxString xml)
Add a xml-encoded list of symbols to the autocompletion list.
Definition: Worksheet.h:1527
void UpdateConfig()
Re-read the configuration.
Definition: Worksheet.h:767
void SetNotification(const wxString &message, int flags=wxICON_INFORMATION)
Definition: Worksheet.cpp:4149
void OnScrollChanged(wxScrollEvent &ev)
Definition: Worksheet.cpp:7937
bool CanDeleteSelection() const
Is it possible to delete the currently selected cells?
Definition: Worksheet.cpp:2803
void ForceRedraw()
Redraw the window now and mark any pending redraw request as "handled".
Definition: Worksheet.h:753
GroupCell * m_recalculateStart
Where to start recalculation. NULL = No recalculation needed.
Definition: Worksheet.h:1659
void ShowHCaret()
Activates the horizontal cursor.
Definition: Worksheet.cpp:7812
TableOfContents * m_tableOfContents
The table of contents pane.
Definition: Worksheet.h:1537
void SetHCaret(GroupCell *where)
Definition: Worksheet.cpp:7777
void DestroyTree()
Clear the whole worksheet.
Definition: Worksheet.cpp:4505
bool FollowEvaluation() const
Query if we want to automatically scroll to the cell that is currently evaluated.
Definition: Worksheet.h:1365
void QuestionAnswered()
Mark the current question from maxima as "answered"..
Definition: Worksheet.cpp:3315
bool CutToClipboard()
Add the currently selected cells to the clipboard and delete them.
Definition: Worksheet.cpp:7423
bool CanEdit()
Definition: Worksheet.cpp:6710
int ReplaceAll(const wxString &oldString, const wxString &newString, bool ignoreCase)
Definition: Worksheet.cpp:8207
wxTimer m_keyboardInactiveTimer
The timer that tells us when the keyboard is inactive so an autosave isn't disrupting.
Definition: Worksheet.h:923
bool CopyAnimation()
Copy the current animation to the clipboard.
Definition: Worksheet.cpp:4529
wxString m_currentFile
The name of the currently-opened file.
Definition: Worksheet.h:773
bool FindIncremental(const wxString &str, bool down, bool ignoreCase)
Definition: Worksheet.cpp:8011
int m_indexSearchStartedAt
Which cursor position incremental search has started at?
Definition: CellPointers.h:101
wxString RTFStart() const
The start of a RTF document.
Definition: Worksheet.cpp:8741
bool RedrawIfRequested()
Definition: Worksheet.cpp:244
void RecalculateForce()
Schedule a full recalculation of the worksheet.
Definition: Worksheet.cpp:1082
GroupCell * ToggleFold(GroupCell *which)
Fold or unfold a cell.
Definition: Worksheet.cpp:1205
FindReplaceDialog * m_findDialog
The find-and-replace-dialog.
Definition: Worksheet.h:788
@ popid_comment_selection
Definition: Worksheet.h:828
int m_pointer_x
The x position of the mouse pointer.
Definition: Worksheet.h:1661
void AddToEvaluationQueue(GroupCell *cell)
Adds a group cell to the evaluation queue marking its contents as "outdated".
Definition: Worksheet.cpp:6811
Definition: VariablesPane.h:40
Cell * GetSelectionStart() const
Definition: Worksheet.h:1176
void AddSelectionToEvaluationQueue()
Schedule all cells in the selection to be evaluated.
Definition: Worksheet.cpp:6870
void Animate(bool run=true)
Starts playing the animation of a cell generated with the with_slider_* commands.
Definition: Worksheet.cpp:7731
int GetCellIndex(Cell *cell) const
Returns the index in (i...) or (o...)
Definition: Worksheet.cpp:4698
Worksheet *& m_observer
The reference to a pointer that observes this object's lifetime.
Definition: Worksheet.h:691
bool ExportToHTML(const wxString &file)
Definition: Worksheet.cpp:4799
void ScheduleScrollToCell(Cell *cell, bool scrollToTop=true)
Schedules scrolling to a given cell.
Definition: Worksheet.h:1244
void SelectAll()
Select the whole document.
Definition: Worksheet.cpp:7595
bool CopyMatlab()
Copy a Matlab representation of the current selection to the clipboard.
Definition: Worksheet.cpp:2627
void ScrollToCaret()
Request to scroll to the cursor as soon as wxMaxima is idle.
Definition: Worksheet.h:1231
void Evaluate()
Definition: Worksheet.cpp:3173
void CompileHelpFileAnchors()
Collect all keyword anchors in the help file.
Definition: Worksheet.cpp:5918
wxString RTFEnd() const
The end of a RTF document.
Definition: Worksheet.cpp:8785
void AddCellToEvaluationQueue(GroupCell *gc)
Schedule this cell for evaluation.
Definition: Worksheet.cpp:6914
GroupCell * FirstVisibleGC()
The first groupCell that is currently visible.
Definition: Worksheet.cpp:2162
void AddDocumentTillHereToEvaluationQueue()
Schedule all cells stopping with the one the caret is in for evaluation.
Definition: Worksheet.cpp:6891
void SetDefaultHCaret()
Definition: Worksheet.cpp:7766
void AddRestToEvaluationQueue()
Add all cells below the cursor to the evaluation queue.
Definition: Worksheet.cpp:6849
CellPtr< Cell > m_selectionStart
Definition: CellPointers.h:147
void AddSymbols(wxString xml)
Interprets the XML autocompletable symbol list maxima can send us.
Definition: Autocomplete.cpp:63
GroupType
All types a GroupCell can be of.
Definition: GroupCell.h:38
@ MC_TYPE_SLIDE
An animation created by the with_slider_* maxima commands.
Definition: Cell.h:81
bool m_mouseMotionWas
Was there a mouse motion we didn't react to until now?
Definition: Worksheet.h:1665
void MarkRefreshAsDone()
Request the worksheet to be redrawn.
Definition: Worksheet.h:716
Definition: Worksheet.h:1605
void UpdateScrollPos()
Execute all collected scroll events in one go.
Definition: Worksheet.cpp:3331
bool CopyText()
Copy a textual representation of the current selection to the clipboard.
Definition: Worksheet.cpp:2695
void CodeCellVisibilityChanged()
To be called after enabling or disabling the visibility of code cells.
Definition: Worksheet.cpp:5719
bool RedrawRequested() const
Is a Redraw requested?
Definition: Worksheet.h:760
void OnFollow()
Called when the "Scroll to currently evaluated" button is pressed.
Definition: Worksheet.cpp:8661
CellType GetType() const
Definition: Cell.h:364
void OnKillFocus(wxFocusEvent &event)
What to do if the worksheet looses the input focus.
Definition: Worksheet.cpp:7691
bool LoadBuiltInManualAnchors()
Load the help file anchors from the built-in list.
Definition: Worksheet.cpp:5880
CellPtr< Cell > m_selectionEnd
Definition: CellPointers.h:168
void FoldOccurred()
Definition: Worksheet.cpp:1191
bool IsSelectionInWorkingGroup()
Is the selection in the current working group?
Definition: Worksheet.cpp:7740
Worksheet(wxWindow *parent, int id, Worksheet *&observer, wxPoint pos=wxDefaultPosition, wxSize size=wxDefaultSize)
The constructor.
Definition: Worksheet.cpp:78
void ExportToMAC(wxTextFile &output, GroupCell *tree, bool wxm, const std::vector< int > &cellMap, bool fixReorderedIndices)
Definition: Worksheet.cpp:6223
bool CanRedoInsideCell() const
Definition: Worksheet.cpp:7837
bool UpdateControlsNeeded()
Is an update of the worksheet controls needed?
Definition: Worksheet.h:91
GroupCell * InsertGroupCells(std::unique_ptr< GroupCell > &&cells, GroupCell *where, UndoActions *undoBuffer)
Definition: Worksheet.cpp:719
void SaveManualAnchorsToCache()
Save the list of help file anchors to the cache.
Definition: Worksheet.cpp:6003
const wxString & input
Definition: Worksheet.h:1625
Definition: EditorCell.h:57
Definition: CellPointers.h:44
GroupCell * GetGroup() const
Returns the group cell this cell belongs to.
Definition: Cell.cpp:212
CellPtr< TextCell > m_currentTextCell
The textcell the text maxima is sending us was ending in.
Definition: CellPointers.h:111
void OnMouseWheel(wxMouseEvent &event)
Definition: Worksheet.cpp:2202
Cell * GetSelectionEnd() const
Definition: Worksheet.h:1183
GroupCell * GetHCaret()
The cell the horizontal cursor is above. NULL means at the start of the document.
Definition: Worksheet.cpp:7748
bool CopyMathML()
Copy the MathML representation of the current selection to the clipboard.
Definition: Worksheet.cpp:2599
bool SectioningMoveOut()
Make this section/subsection/... a chapter/section/... changing its subheadings, too.
Definition: Worksheet.cpp:8538
void ShowPoint(wxPoint point)
Definition: Worksheet.cpp:7369
void DeleteCurrentCell()
Definition: Worksheet.cpp:2825
~Worksheet()
The destructor.
Definition: Worksheet.cpp:418
CellType
Definition: Cell.h:63
bool CanDeleteRegion(GroupCell *start, GroupCell *end) const
Is it possible to delete the cells between start and end?
Definition: Worksheet.cpp:2842
void ScrollToCellIfNeeded()
Scrolls to the cell given by ScheduleScrollToCell; Is called once we have time to do so.
Definition: Worksheet.cpp:6948
void AddEntireDocumentToEvaluationQueue()
Schedule all cells in the document for evaluation.
Definition: Worksheet.cpp:6828
bool HCaretActive() const
Is the vertically-drawn cursor active?
Definition: Worksheet.h:797
Definition: FindReplaceDialog.h:40
bool ScrollToCaretIfNeeded()
Scrolls to the cursor, if requested.
Definition: Worksheet.cpp:8155
bool CopyCells()
Copy the selection to the clipboard as it would appear in a .wxm file.
Definition: Worksheet.cpp:2726
void WindowActive(bool active)
Is this window active?
Definition: Worksheet.h:647
void OnThumbtrack(wxScrollWinEvent &ev)
Definition: Worksheet.cpp:7949
void ScrollToError()
Unfold the cell that produced the error, if necessary and, if requested, scroll to it.
Definition: Worksheet.cpp:806
void SetWorkSheet(wxWindow *workSheet)
Set the worksheet this configuration storage is valid for.
Definition: Worksheet.h:1677
CellPtr< EditorCell > m_cellSearchStartedIn
The EditorCell the search was started in.
Definition: CellPointers.h:99
void NumberSections()
Renumber all sections.
Definition: Worksheet.cpp:1130
void OnActivate(wxActivateEvent &event)
Is called if this element looses or gets the focus.
Definition: Worksheet.cpp:7771
void OpenQuestionCaret(const wxString &txt={})
Definition: Worksheet.cpp:3050
void ClearSelection()
Clear the selection - make it empty, i.e. no selection.
Definition: Worksheet.h:1187
void SelectGroupCell(GroupCell *cell)
Set this cell as the currently selected one.
Definition: Worksheet.cpp:8643
bool CopyTeX()
Copy the TeX representation of the current selection to the clipboard.
Definition: Worksheet.cpp:2657
bool m_inPopupMenu
Is there an active popup menu?
Definition: Worksheet.h:1667
void OnChar(wxKeyEvent &event)
Definition: Worksheet.cpp:4172
Definition: Autocomplete.h:53
autoCompletionType
All types of things we can autocomplete.
Definition: Autocomplete.h:61
bool m_scheduleUpdateToc
Definition: Worksheet.h:794
void StepAnimation(int change=1)
Definition: Worksheet.cpp:4362
Definition: Configuration.h:83
void OpenHCaret(const wxString &txt={})
Place the cursor into a new cell where the horizontal cursor is.
Definition: Worksheet.h:1323
bool PointVisibleIs(wxPoint point)
Is the point currently visible on the worksheet?
Definition: Worksheet.cpp:7348
void SetAnswer(const wxString &answer)
Remember the answer to the LastQuestion().
Definition: Worksheet.cpp:3038
bool CaretVisibleIs()
Is the caret (hcaret or vcaret) currently visible on the worksheet?
Definition: Worksheet.cpp:8121
stx::optional< Notification > m_notificationMessage
A error notification message.
Definition: Worksheet.h:645
bool IsActiveInLast()
Is the editor active in the last cell of the worksheet?
Definition: Worksheet.h:1295
bool ExportToTeX(const wxString &file)
export to a LaTeX file
Definition: Worksheet.cpp:5733
GroupCell * GetInsertGroup() const
The group that the line's cells will belong to - used by InsertLine.
Definition: Worksheet.cpp:861
void UnfoldAll()
Definition: Worksheet.cpp:1256
bool LoadManualAnchorsFromCache()
Load the result from the last CompileHelpFileAnchors from the disk cache.
Definition: Worksheet.cpp:5892
Definition: Worksheet.h:86
int m_pointer_y
The y position of the mouse pointer.
Definition: Worksheet.h:1663
bool LoadManualAnchorsFromXML(wxXmlDocument xmlDocument, bool checkManualVersion=true)
Load the help file anchors from an wxXmlDocument.
Definition: Worksheet.cpp:6076
EditorCell * KeyboardSelectionStart() const
Tells us which cell the keyboard selection has started in.
Definition: Worksheet.h:671
void OnSetFocus(wxFocusEvent &event)
What to do if the worksheet is in the input focus.
Definition: Worksheet.cpp:7679
wxString ConvertSelectionToMathML()
Convert the current selection to MathML.
Definition: Worksheet.cpp:2545
void Recalculate(Cell *start)
Schedule a recalculation of the worksheet starting with the cell start.
Definition: Worksheet.cpp:990
void SetActiveCell(EditorCell *cell, bool callRefresh=true)
Definition: Worksheet.cpp:7262
Definition: GroupCell.h:68
bool CopySVG()
Copy a svg of the current selection to the clipboard.
Definition: Worksheet.cpp:4538
CellPtr< EditorCell > m_cellKeyboardSelectionStartedIn
The EditorCell the keyboard selection has started in.
Definition: CellPointers.h:97
bool Autocomplete(AutoComplete::autoCompletionType type=AutoComplete::command)
Definition: Worksheet.cpp:8241
void SetWorkingGroup(GroupCell *group)
Sets the cell maxima currently works on. NULL if there isn't such a cell.
Definition: CellPointers.cpp:93
bool CanUndoInsideCell() const
Definition: Worksheet.cpp:7820
ToolBar * m_mainToolBar
The toolbar of the main window: We need to access it and therefore have it defined here.
Definition: Worksheet.h:1543
GroupCell * ToggleFoldAll(GroupCell *which)
Definition: Worksheet.cpp:1228
A list of editor cells containing error messages.
Definition: CellPointers.h:69
bool IsEmpty() const
Is this worksheet empty?
Definition: Worksheet.h:613
void AddSectionToEvaluationQueue(GroupCell *start)
Adds a chapter, a section or a subsection to the evaluation queue.
Definition: Worksheet.cpp:6839
GroupCell * GetLastCell()
Returns the last cell of the worksheet.
Definition: Worksheet.h:1299
std::unique_ptr< GroupCell > CopyTree() const
Copies the worksheet's entire contents.
Definition: Worksheet.cpp:4515
wxBitmap ConvertSelectionToBitmap()
Convert the current selection to a bitmap.
AutoComplete m_autocomplete
The storage for the autocompletion feature.
Definition: Worksheet.h:665
bool IsSelected(CellType type)
Does the selection start with a cell of the type "type".
Definition: Worksheet.cpp:7721
bool HasCellsSelected() const
Is at least one entire cell selected?
Definition: Worksheet.h:1001
wxString UnicodeToMaxima(wxString s)
Definition: Worksheet.cpp:6163
bool CopyRTF()
Copy a rtf version of the current selection to the clipboard.
Definition: Worksheet.cpp:4556
bool CanAnimate()
Does it make sense to enable the "Play" button and the slider now?
Definition: Worksheet.h:1052
EvaluationQueue m_evaluationQueue
The list of cells that have to be evaluated.
Definition: Worksheet.h:1431
bool QuestionPending()
Definition: Worksheet.h:1563
void ClearNotification()
Clears the notification message from SetNotification.
Definition: Worksheet.cpp:4144
void OnKeyDown(wxKeyEvent &event)
Definition: Worksheet.cpp:3182
ErrorList m_errorList
The list of cells maxima has complained about errors in.
Definition: CellPointers.h:93