wxMaxima
XmlInspector.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 // (C) 2015 Gunter Königsmann <wxMaxima@physikbuch.de>
4 //
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 2 of the License, or
8 // (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software
18 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 //
20 // SPDX-License-Identifier: GPL-2.0+
21 
27 #include "precomp.h"
28 #include <wx/wx.h>
29 #include <wx/richtext/richtextctrl.h>
30 #include <vector>
31 
32 #ifndef XMLINSPECTOR_H
33 #define XMLINSPECTOR_H
34 
39 class XmlInspector : public wxRichTextCtrl
40 {
41 public:
42  XmlInspector(wxWindow *parent, int id);
43 
46  ~XmlInspector();
47 
49  virtual void Clear();
50 
52  void Add_ToMaxima(wxString text);
54  void Add_FromMaxima(wxString text);
56  void UpdateContents();
58  bool UpdateNeeded(){return m_updateNeeded;}
59 private:
60  bool m_updateNeeded;
61  wxString m_fromMaxima;
62  wxString m_toMaxima;
63  bool m_clear;
64  enum xmlInspectorIDs
65  {
66  XmlInspector_ctrl_id = 4,
67  XmlInspector_regex_id
68  };
69  enum monitorState
70  {
71  clear,
72  fromMaxima,
73  toMaxima
74  };
75  monitorState m_state;
76 
77  wxChar m_lastChar;
78  int m_indentLevel;
79 
80  wxString IndentString(int level);
81 };
82 
83 #endif // XMLINSPECTOR_H
XmlInspector::UpdateNeeded
bool UpdateNeeded()
Do we need to update the XmlInspector's display?
Definition: XmlInspector.h:58
XmlInspector::~XmlInspector
~XmlInspector()
Definition: XmlInspector.cpp:51
XmlInspector::Add_ToMaxima
void Add_ToMaxima(wxString text)
Add some text we sent to maxima.
Definition: XmlInspector.cpp:171
XmlInspector::Add_FromMaxima
void Add_FromMaxima(wxString text)
Add some text we have received from maxima.
Definition: XmlInspector.cpp:183
XmlInspector::Clear
virtual void Clear()
Remove all text from the editor.
Definition: XmlInspector.cpp:55
XmlInspector
Definition: XmlInspector.h:39
XmlInspector::UpdateContents
void UpdateContents()
Actually draw the updates.
Definition: XmlInspector.cpp:63