wxMaxima
EditorCell.h
Go to the documentation of this file.
1 // -*- mode: c++; c-file-style: "linux"; c-basic-offset: 2; indent-tabs-mode: nil -*-
2 //
3 // Copyright (C) 2006-2015 Andrej Vodopivec <andrej.vodopivec@gmail.com>
4 // (C) 2012 Doug Ilijev <doug.ilijev@gmail.com>
5 // (C) 2014-2015 Gunter Königsmann <wxMaxima@physikbuch.de>
6 //
7 // This program is free software; you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation; either version 2 of the License, or
10 // (at your option) any later version.
11 //
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
16 //
17 //
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the Free Software
20 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 //
22 // SPDX-License-Identifier: GPL-2.0+
23 
24 #ifndef EDITORCELL_H
25 #define EDITORCELL_H
26 
27 #include "Cell.h"
28 #include "FontAttribs.h"
29 #include "MaximaTokenizer.h"
30 #include <vector>
31 #include <list>
32 
57 class EditorCell final : public Cell
58 {
59 private:
60  #if wxUSE_ACCESSIBILITY
61  wxAccStatus GetDescription(int childId, wxString *description) const override;
62  wxAccStatus GetFocus (int *childId, Cell **child) const override;
63  wxAccStatus GetDefaultAction(int childId, wxString *actionName) const override;
64  wxAccStatus GetValue (int childId, wxString *strValue) const override;
65  wxAccStatus GetRole (int childId, wxAccRole *role) const override;
66  #endif
67 
68 public:
70  EditorCell(GroupCell *group, Configuration **config, const wxString &text = {});
71  EditorCell(GroupCell *group, const EditorCell &cell);
72 // std::unique_ptr<Cell> Copy(GroupCell *group) const override;
73  const CellTypeInfo &GetInfo() override;
74  std::unique_ptr<Cell> Copy(GroupCell *group) const override;
75 
77  EditorCell *GetPrevious() const { return dynamic_cast<EditorCell*>(Cell::GetPrevious()); }
79  EditorCell *GetNext() const { return dynamic_cast<EditorCell*>(Cell::GetNext()); }
80 
82  void InsertEscCommand(const wxString &txt) {
83  InsertText(InterpretEscapeString(txt));
84  }
85 
87  wxString GetFullCommandUnderCursor();
88 
90  void AddDrawParameter(wxString param);
91 
93  void AutoAnswer(bool autoAnswer){m_autoAnswer = autoAnswer;}
94 
99  void SearchStartedHere(int index) const;
101  void SearchStartedHere() const;
103  void MouseSelectionStartedHere() const;
105  void KeyboardSelectionStartedHere() const;
106 
108  const auto &GetWordList() const { return m_wordList; }
109 
116  static wxString TabExpand(const wxString &input, long posInLine);
117 
119  static wxString EscapeHTMLChars(wxString input);
120 
122  static wxString PrependNBSP(wxString input);
123 
124  void Recalculate(AFontSize fontsize) override;
125 
126  virtual void Draw(wxPoint point) override;
127 
129  wxString ToHTML() const;
130  wxString ToMatlab() const override;
137  wxString ToMatlab(bool dontLimitToSelection) const;
140  wxString ToRTF() const override;
141  wxString ToString() const override;
142  wxString ToString(bool dontLimitToSelection) const;
144  wxString ToTeX() const override;
146  wxString ToXML() const override;
147 
149  void SetFont();
150 
152  void SetForeground();
153 
158  void SetValue(const wxString &text) override;
159 
164  const wxString &GetValue() const override { return m_text; }
165 
174  void StyleText();
176  void StyleTextCode();
177  void StyleTextTexts();
178 
179  void Reset();
180 
182  void ProcessEvent(wxKeyEvent &event) override;
183 
189  void ActivateCursor();
190 
192  void DeactivateCursor();
193 
195  size_t BeginningOfLine(long pos) const;
196 
198  size_t EndOfLine(long pos);
199 
201  bool AddEnding() override;
202 
204  void PositionToXY(int position, unsigned int *x, unsigned int *y);
205 
207  int XYToPosition(int x, int y);
208 
210  wxPoint PositionToPoint(int pos = -1) override;
211 
213  void SelectPointText(wxPoint point) override;
214 
216  void SelectRectText(wxPoint one, wxPoint two) override;
217 
219  wxString SelectWordUnderCaret(bool selectParens = true, bool toRight = true,
220  bool includeDoubleQuotes = false);
221 
223  bool IsPointInSelection(wxPoint point);
224 
225  bool CopyToClipboard() const override;
226 
227  bool CutToClipboard() override;
228 
229  void PasteFromClipboard(bool primary = false) override;
230 
232  int GetSelectionStart() const
233  { return m_selectionStart; }
234 
236  int GetSelectionEnd() const
237  { return m_selectionEnd; }
238 
240  void SelectAll() override
241  {
242  m_selectionStart = 0;
243  m_selectionEnd = m_positionOfCaret = m_text.Length();
244  }
245 
247  bool AllSelected() const
248  {
249  return (m_selectionStart == 0) && (m_selectionEnd == (long) m_text.Length());
250  }
251 
253  void SelectNone()
254  {
255  m_selectionStart = m_selectionEnd = 0;
256  }
257 
259  bool SelectionActive() const
260  {
261  return (m_selectionStart >= 0) && (m_selectionEnd >= 0);
262  }
263 
264  bool CanCopy() const override
265  {
266  return m_selectionStart != -1;
267  }
268 
269  bool FindMatchingQuotes();
270 
271  void FindMatchingParens();
272 
273  int GetLineWidth(unsigned int line, int pos);
274 
276  bool IsDirty() const override
277  {
278  return m_isDirty;
279  }
280 
282  void SwitchCaretDisplay() override
283  {
284  m_displayCaret = !m_displayCaret;
285  }
286 
287  void SetFocus(bool focus) override
288  {
289  m_hasFocus = focus;
290  }
291 
292  void SetFirstLineOnly(bool show = true)
293  {
294  if (m_firstLineOnly != show)
295  {
296  m_width = m_height = -1;
297  m_firstLineOnly = show;
298  }
299  // Style the text anew.
300  StyleText();
301  }
302 
303  bool IsActive() const override;
304 
306  bool CaretAtStart() const
307  { return m_positionOfCaret == 0; }
308 
310  void CaretToStart();
311 
313  bool CaretAtEnd() const
314  { return m_positionOfCaret == (long) m_text.Length(); }
315 
317  void CaretToEnd();
318 
320  void CaretToPosition(int pos);
321 
323  bool CanUndo() const;
324 
326  void Undo();
327 
329  bool CanRedo() const;
330 
332  void Redo();
333 
335  void SaveValue();
336 
343  wxString DivideAtCaret();
344 
345  void CommentSelection();
346 
347  void ClearUndo();
348 
350  bool ContainsChanges() const
351  { return m_containsChanges; }
352 
354  void ContainsChanges(bool changes)
355  { m_containsChanges = m_containsChangesCheck = changes; }
356 
357  bool CheckChanges();
358 
361  int ReplaceAll(wxString oldString, const wxString &newString, bool ignoreCase);
362 
373  bool FindNext(wxString str, const bool &down, const bool &ignoreCase);
374 
375  bool IsSelectionChanged() const { return m_selectionChanged; }
376 
377  void SetSelection(int start, int end);
378 
379  void GetSelection(int *start, int *end) const
380  {
381  *start = m_selectionStart;
382  *end = m_selectionEnd;
383  }
384 
397  bool ReplaceSelection(const wxString &oldStr, const wxString &newString,
398  bool keepSelected = false, bool ignoreCase = false,
399  bool replaceMaximaString = false);
400 
402  wxString GetSelectionString() const;
403 
405  wxString GetWordUnderCaret();
406 
408  wxString GetCurrentCommand();
409 
411  void ClearSelection();
412 
414  void SetErrorIndex(int index){m_errorIndex = index;}
415 
416  bool ErrorIndexSet() const {return m_errorIndex >= 0;}
417 
418  void GotoError(){SetCaretPosition(m_errorIndex);ActivateCursor();}
419 
421  void ProcessNewline(bool keepCursorAtStartOfLine = true);
422 
424  int GetCaretPosition() const
425  { return m_positionOfCaret; }
426 
429 
431  void SetCaretPosition(int pos)
432  { m_positionOfCaret = pos;
433  if(m_positionOfCaret < -1)
434  m_positionOfCaret = -1;
435  if(m_positionOfCaret > (signed long)m_text.Length())
436  m_positionOfCaret = m_text.Length();
437  }
438 
439  bool FindNextTemplate(bool left = false);
440 
441  void InsertText(wxString text);
442 
443  wxString TextInFrontOfSelection() const
444  {
445  return GetValue().Mid(1, m_selectionStart);
446  }
447 
450  {
451  SetSelection(m_lastSelectionStart, 0);
452  }
453 
454  void SetType(CellType type) override;
455  void SetStyle(TextStyle style) override;
456 
457  bool NeedsRecalculation(AFontSize fontSize) const override;
458 
461  {
462  SetSelection(m_lastSelectionStart, m_text.Length());
463  }
464 
466  const MaximaTokenizer::TokenList &GetTokens() const {return m_tokens;}
467 
468 private:
470  bool IsZoomFactorChanged() const;
472  double m_lastZoomFactor = -1;
483  class StyledText
484  {
485  private:
487  wxString m_text;
489  wxString m_indentChar;
491  int m_width = -1;
493  int m_indentPixels = 0;
495  TextStyle m_style = TS_DEFAULT;
497  bool m_styleThisText = false;
498  public:
500  StyledText(TextStyle style, const wxString &text)
501  : m_text(text), m_style(style), m_styleThisText(true) {}
502 
504  explicit StyledText(const wxString &text, int indentPixels = 0,
505  const wxString &indentChar = {})
506  : m_text(text), m_indentChar(indentChar), m_indentPixels(indentPixels) {}
507 
508  void SetWidth(int width){m_width = width;}
509  void ResetSize(){SetWidth(-1);}
510  int GetWidth() const {return m_width;}
511  bool SizeKnown() const {return GetWidth() >= 0;}
513  const wxString &GetText() const { return m_text; }
515  void SetText(const wxString &text) { m_text = text; }
517  void SetIndentation(int indentPixels, const wxString &indentString = {})
518  {
519  m_indentPixels = indentPixels;
520  m_indentChar = indentString;
521  }
523  int GetIndentPixels() const { return m_indentPixels; }
524  const wxString &GetIndentChar() const { return m_indentChar; }
527  TextStyle GetStyle() const { return m_style; }
528  // Has an individual text style been set for this text portion?
529  bool IsStyleSet() const { return m_styleThisText; }
530  };
531 
532 #if defined __WXOSX__
533  bool HandleCtrlCommand(wxKeyEvent &ev);
534 #endif
535  bool HandleSpecialKey(wxKeyEvent &event);
536  bool HandleOrdinaryKey(wxKeyEvent &event);
537 
538  void FontsChanged() override
539  {
540  ResetSize();
541  ResetData();
542  m_widths.clear();
543  }
544 
551  void HandleSoftLineBreaks_Code(StyledText *&lastSpace, int &lineWidth, const wxString &token, unsigned int charInCell,
552  wxString &text, const size_t &lastSpacePos, int &indentationPixels);
553 
559  int GetIndentDepth(wxString text, int positionOfCaret);
560 
567  wxString InterpretEscapeString(const wxString &txt) const;
568 
570  void MarkSelection(long start, long end, TextStyle style);
571 
573  wxSize GetTextSize(const wxString &text);
574 
575  struct HistoryEntry // 64 bytes
576  {
577  wxString text;
578  int caretPosition = -1;
579  int selStart = -1;
580  int selEnd = -1;
581  HistoryEntry() = default;
582  HistoryEntry(const wxString &text, int caretPosition, int selStart, int selEnd) :
583  text(text), caretPosition(caretPosition), selStart(selStart), selEnd(selEnd) {}
584  };
586  void SetState(const HistoryEntry &state);
588  void AppendStateToHistory();
589 
590 //** Large fields
591 //**
592  WX_DECLARE_STRING_HASH_MAP(wxSize, StringHash);
594  StringHash m_widths;
595 
597  std::vector<wxString> m_wordList;
598 
600  MaximaTokenizer::TokenList m_tokens;
601 
602  wxString m_text;
603  std::vector<StyledText> m_styledText;
604 
605  std::vector<HistoryEntry> m_history;
606 
607 //** 8/4 bytes
608 //**
609  AFontName m_fontName;
610  CellPointers *const m_cellPointers = GetCellPointers();
611 
612 //** 4 bytes
613 //**
614  int m_errorIndex = 1;
615  unsigned int m_numberOfLines = 1;
617  int m_historyPosition = -1;
618 
626  long m_selectionStart = -1;
634  long m_selectionEnd = -1;
635  long m_oldSelectionStart = -1;
636  long m_oldSelectionEnd = -1;
637  long m_lastSelectionStart = -1;
638 
639  int m_charHeight = 12;
640  int m_paren1 = -1, m_paren2 = -1;
641 
643  int m_positionOfCaret = 0;
646  int m_caretColumn = -1;
647 
648 //** 2 bytes
649 //**
650  AFontStyle m_fontStyle;
651  AFontWeight m_fontWeight;
652 
653 //** Bitfield objects (2 bytes)
654 //**
655  void InitBitFields()
656  { // Keep the initialization order below same as the order
657  // of bit fields in this class!
658  m_autoAnswer = false;
659  m_containsChanges = false;
660  m_containsChangesCheck = false;
661  m_displayCaret = false;
662  m_firstLineOnly = false;
663  m_hasFocus = false;
664  m_isDirty = false;
665  m_saveValue = false;
666  m_selectionChanged = false;
667  m_underlined = false;
668  }
669 
671  bool m_autoAnswer : 1 /* InitBitFields */;
673  bool m_containsChanges : 1 /* InitBitFields */;
674  bool m_containsChangesCheck : 1 /* InitBitFields */;
675  bool m_displayCaret : 1 /* InitBitFields */;
676  bool m_firstLineOnly : 1 /* InitBitFields */;
677  bool m_hasFocus : 1 /* InitBitFields */;
678  bool m_isDirty : 1 /* InitBitFields */;
679  bool m_saveValue :1 /* InitBitFields */;
681  bool m_selectionChanged : 1 /* InitBitFields */;
683  bool m_underlined : 1 /* InitBitFields */;
684 };
685 
686 #endif // EDITORCELL_H
EditorCell::CaretToStart
void CaretToStart()
Move the cursor to the start of this cell.
Definition: EditorCell.cpp:4203
EditorCell::ActivateCursor
void ActivateCursor()
Definition: EditorCell.cpp:2597
EditorCell::CanUndo
bool CanUndo() const
True, if there is undo information for this cell.
Definition: EditorCell.cpp:3283
EditorCell::StyleTextCode
void StyleTextCode()
Definition: EditorCell.cpp:3395
EditorCell::XYToPosition
int XYToPosition(int x, int y)
Determines which index the char at the position "x chars left, y chars down" is at.
Definition: EditorCell.cpp:2688
Cell.h
EditorCell::ConvertNumToUNicodeChar
void ConvertNumToUNicodeChar()
Convert a number to unicode chars.
Definition: EditorCell.cpp:574
EditorCell::AllSelected
bool AllSelected() const
Does the selection currently span the whole cell?
Definition: EditorCell.h:247
EditorCell::CanRedo
bool CanRedo() const
True, if a redo can be done for this cell.
Definition: EditorCell.cpp:3311
EditorCell::GetInfo
const CellTypeInfo & GetInfo() override
Returns the information about this cell's type.
EditorCell::EscapeHTMLChars
static wxString EscapeHTMLChars(wxString input)
Escape all chars that cannot be used in HTML otherwise.
Definition: EditorCell.cpp:54
EditorCell::SetFont
void SetFont()
Set the currently used font to the one that matches this cell's formatting.
Definition: EditorCell.cpp:1026
TextStyle
TextStyle
Definition: TextStyle.h:307
EditorCell::CaretToEnd
void CaretToEnd()
Move the cursor to the end of this cell.
Definition: EditorCell.cpp:4196
EditorCell::Recalculate
void Recalculate(AFontSize fontsize) override
Definition: EditorCell.cpp:620
EditorCell::CaretToPosition
void CaretToPosition(int pos)
Move the cursor to a certain position in the cell.
Definition: EditorCell.cpp:4210
EditorCell::ToMatlab
wxString ToMatlab() const override
Convert this cell to its Matlab representation.
Definition: EditorCell.cpp:303
EditorCell::ReplaceAll
int ReplaceAll(wxString oldString, const wxString &newString, bool ignoreCase)
Definition: EditorCell.cpp:3887
EditorCell::Undo
void Undo()
Issue an undo command.
Definition: EditorCell.cpp:3288
EditorCell::FindNext
bool FindNext(wxString str, const bool &down, const bool &ignoreCase)
Definition: EditorCell.cpp:3940
EditorCell::GetValue
const wxString & GetValue() const override
Definition: EditorCell.h:164
Cell::ResetData
void ResetData()
Mark all cached size information as "to be calculated".
Definition: Cell.cpp:1010
EditorCell::GetCaretPosition
int GetCaretPosition() const
Get the cursor's current position inside the cell.
Definition: EditorCell.h:424
EditorCell::GetSelectionString
wxString GetSelectionString() const
Convert the current selection to a string.
Definition: EditorCell.cpp:4109
EditorCell::NeedsRecalculation
bool NeedsRecalculation(AFontSize fontSize) const override
True, if something that affects the cell size has changed.
Definition: EditorCell.cpp:615
EnumWrapper< wxFontStyle, int16_t, wxFONTSTYLE_NORMAL >
Cell::GetLineWidth
int GetLineWidth() const
Definition: Cell.cpp:282
EditorCell::ToString
wxString ToString() const override
Returns the cell's representation as a string.
Definition: EditorCell.cpp:279
EditorCell::SetForeground
void SetForeground()
Sets the current color to this cell's foreground color.
Definition: EditorCell.cpp:1084
EditorCell::SwitchCaretDisplay
void SwitchCaretDisplay() override
Toggles the visibility of the cursor which is used to make it blink.
Definition: EditorCell.h:282
EditorCell::BeginningOfLine
size_t BeginningOfLine(long pos) const
Return the index of the 1st char of the line containing the letter pos.
Definition: EditorCell.cpp:1218
AFontName
Definition: TextStyle.h:54
EditorCell::GetFullCommandUnderCursor
wxString GetFullCommandUnderCursor()
Get the whole maxima command that is currently under the cursor (including all arguments)
Definition: EditorCell.cpp:194
EditorCell::SearchStartedHere
void SearchStartedHere() const
Remember that this is the cell the search was started in.
Definition: EditorCell.cpp:176
EditorCell::DeactivateCursor
void DeactivateCursor()
Deactivate the blinking cursor in the EditorCell it is in.
Definition: EditorCell.cpp:2586
EditorCell::Copy
std::unique_ptr< Cell > Copy(GroupCell *group) const override
EditorCell::GetCurrentCommand
wxString GetCurrentCommand()
Get the command the cursor is in the arguments for.
Definition: EditorCell.cpp:1091
EditorCell::ContainsChanges
void ContainsChanges(bool changes)
Set the information if this cell needs to be re-evaluated by maxima.
Definition: EditorCell.h:354
EditorCell::EndOfLine
size_t EndOfLine(long pos)
Return the index of the last char of the line containing the letter #pos,.
Definition: EditorCell.cpp:1239
EditorCell::ProcessEvent
void ProcessEvent(wxKeyEvent &event) override
Decide what to do if the user pressed a key when this cell was selected.
Definition: EditorCell.cpp:1312
EditorCell::SelectRectText
void SelectRectText(wxPoint one, wxPoint two) override
Selects the text between the screen coordinates one and two.
Definition: EditorCell.cpp:2857
MaximaTokenizer.h
EditorCell::ReturnToSelectionFromBot
void ReturnToSelectionFromBot()
Return to the selection after the cell has been left downwards.
Definition: EditorCell.h:460
EditorCell::TabExpand
static wxString TabExpand(const wxString &input, long posInLine)
Definition: EditorCell.cpp:1166
EditorCell::ReturnToSelectionFromTop
void ReturnToSelectionFromTop()
Return to the selection after the cell has been left upwards.
Definition: EditorCell.h:449
EditorCell::GetTokens
const MaximaTokenizer::TokenList & GetTokens() const
Get the list of commands, parenthesis, strings and whitespaces in a code cell.
Definition: EditorCell.h:466
EditorCell::SelectPointText
void SelectPointText(wxPoint point) override
Sets the cursor to the screen coordinate point.
Definition: EditorCell.cpp:2738
EditorCell::PositionToPoint
wxPoint PositionToPoint(int pos=-1) override
The screen coordinates of the cursor.
Definition: EditorCell.cpp:2713
EditorCell::SetValue
void SetValue(const wxString &text) override
Definition: EditorCell.cpp:3804
EditorCell::PositionToXY
void PositionToXY(int position, unsigned int *x, unsigned int *y)
Determines which line and column the pos'th char is at.
Definition: EditorCell.cpp:2664
EditorCell::GetWordUnderCaret
wxString GetWordUnderCaret()
The word the cursor currently is at.
Definition: EditorCell.cpp:3009
Cell
Definition: Cell.h:139
EditorCell::EditorCell
EditorCell(GroupCell *group, Configuration **config, const wxString &text={})
The constructor.
Definition: EditorCell.cpp:41
EditorCell::InsertEscCommand
void InsertEscCommand(const wxString &txt)
Insert the symbol that corresponds to the ESC command txt.
Definition: EditorCell.h:82
EditorCell::SelectionActive
bool SelectionActive() const
Is there any text selected right now?
Definition: EditorCell.h:259
EditorCell
Definition: EditorCell.h:57
Cell::GetNext
Cell * GetNext() const
Get the next cell in the list.
Definition: Cell.h:624
EditorCell::Redo
void Redo()
Issu a redo command.
Definition: EditorCell.cpp:3318
EditorCell::SelectWordUnderCaret
wxString SelectWordUnderCaret(bool selectParens=true, bool toRight=true, bool includeDoubleQuotes=false)
Selects the word the cursor is currently at.
Definition: EditorCell.cpp:3058
CellPointers
Definition: CellPointers.h:44
EditorCell::ToTeX
wxString ToTeX() const override
Convert the current cell to LaTeX code.
Definition: EditorCell.cpp:389
AFontSize
Definition: FontAttribs.h:97
Cell::GetWidth
int GetWidth() const
Definition: Cell.h:331
EditorCell::MouseSelectionStartedHere
void MouseSelectionStartedHere() const
Remember that this is the cell the mouse selection was started in.
Definition: EditorCell.cpp:182
EditorCell::PrependNBSP
static wxString PrependNBSP(wxString input)
Convert all but the first of a row of multiple spaces to non-breakable.
Definition: EditorCell.cpp:233
EditorCell::ToHTML
wxString ToHTML() const
Convert the current cell to HTML code.
Definition: EditorCell.cpp:691
CellType
CellType
Definition: Cell.h:63
EditorCell::SetType
void SetType(CellType type) override
Sets the text style according to the type.
Definition: EditorCell.cpp:1014
Cell::m_height
int m_height
The height of this cell.
Definition: Cell.h:871
EditorCell::ReplaceSelection
bool ReplaceSelection(const wxString &oldStr, const wxString &newString, bool keepSelected=false, bool ignoreCase=false, bool replaceMaximaString=false)
Definition: EditorCell.cpp:4047
EditorCell::GetSelectionEnd
int GetSelectionEnd() const
Get the character position the selection has been ended with.
Definition: EditorCell.h:236
EditorCell::ToXML
wxString ToXML() const override
Convert the current cell to XML code for inclusion in a .wxmx file.
Definition: EditorCell.cpp:525
Cell::m_width
int m_width
The width of this cell; is recalculated by RecalculateHeight.
Definition: Cell.h:873
EditorCell::DivideAtCaret
wxString DivideAtCaret()
Definition: EditorCell.cpp:2928
EditorCell::StyleText
void StyleText()
Definition: EditorCell.cpp:3780
EditorCell::IsPointInSelection
bool IsPointInSelection(wxPoint point)
Is the point point inside the currently selected text?
Definition: EditorCell.cpp:2874
EditorCell::GetSelectionStart
int GetSelectionStart() const
Get the character position the selection has been started with.
Definition: EditorCell.h:232
EditorCell::AddDrawParameter
void AddDrawParameter(wxString param)
Add a new parameter to a draw- or similar command including the comma, if needed.
Definition: EditorCell.cpp:67
Configuration
Definition: Configuration.h:83
EditorCell::ProcessNewline
void ProcessNewline(bool keepCursorAtStartOfLine=true)
Start a new line and optionally auto-indent it.
Definition: EditorCell.cpp:1514
EditorCell::SaveValue
void SaveValue()
Save the current contents of this cell in the undo buffer.
Definition: EditorCell.cpp:3338
EditorCell::SetErrorIndex
void SetErrorIndex(int index)
Sets the index the error is at.
Definition: EditorCell.h:414
EditorCell::AutoAnswer
void AutoAnswer(bool autoAnswer)
May this Editor Cell contain the answer to a question?
Definition: EditorCell.h:93
EditorCell::SetCaretPosition
void SetCaretPosition(int pos)
Set the cursor's current position inside the cell.
Definition: EditorCell.h:431
EditorCell::FindMatchingQuotes
bool FindMatchingQuotes()
Definition: EditorCell.cpp:2447
Cell::ResetSize
void ResetSize()
Mark the cached height and width information as "to be calculated".
Definition: Cell.cpp:1034
EditorCell::AddEnding
bool AddEnding() override
Adds a ";" to the end of the last command in this cell in case that it doesn't end in $ or ;.
Definition: EditorCell.cpp:2617
GroupCell
Definition: GroupCell.h:68
EditorCell::ToRTF
wxString ToRTF() const override
Convert the current cell to RTF code.
Definition: EditorCell.cpp:327
EditorCell::KeyboardSelectionStartedHere
void KeyboardSelectionStartedHere() const
Remember that this is the cell the keyboard selection was started in.
Definition: EditorCell.cpp:188
EditorCell::SetStyle
void SetStyle(TextStyle style) override
Sets the TextStyle of this cell.
Definition: EditorCell.cpp:1020
CellTypeInfo
A class that carries information about the type of a cell.
Definition: Cell.h:90
EditorCell::ClearSelection
void ClearSelection()
Unselect everything.
Definition: EditorCell.cpp:4117
EditorCell::CaretAtEnd
bool CaretAtEnd() const
Is the cursor at the end of this cell?
Definition: EditorCell.h:313
EditorCell::CaretAtStart
bool CaretAtStart() const
Is the cursor at the start of this cell?
Definition: EditorCell.h:306
EditorCell::IsDirty
bool IsDirty() const override
true, if this cell's width has to be recalculated.
Definition: EditorCell.h:276
EditorCell::GetPrevious
EditorCell * GetPrevious() const
Get the previous EditorCell in the list.
Definition: EditorCell.h:77
EditorCell::GetWordList
const auto & GetWordList() const
A list of words that might be applicable to the autocomplete function.
Definition: EditorCell.h:108
EditorCell::SelectNone
void SelectNone()
Unselect everything.
Definition: EditorCell.h:253
EditorCell::ContainsChanges
bool ContainsChanges() const
Query if this cell needs to be re-evaluated by maxima.
Definition: EditorCell.h:350
EditorCell::SelectAll
void SelectAll() override
Select the whole text contained in this Cell.
Definition: EditorCell.h:240
EditorCell::GetNext
EditorCell * GetNext() const
Get the next EditorCell in the list.
Definition: EditorCell.h:79