NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
variableviewer.hpp
Go to the documentation of this file.
1/*****************************************************************************
2 NumeRe: Framework fuer Numerische Rechnungen
3 Copyright (C) 2019 Erik Haenel et al.
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 3 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 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17******************************************************************************/
18
19
20#ifndef VARIABLEVIEWER_HPP
21#define VARIABLEVIEWER_HPP
22
23#include "../controls/treelistctrl.h"
24//#include <wx/treelist.h>
25#include <map>
26#include <vector>
27#include <string>
28
29class NumeReWindow;
30
31class VariableViewer : public wxcode::wxTreeListCtrl
32{
33 private:
35 std::vector<std::string> vLastVarSet;
38 wxTreeItemId numRoot;
39 wxTreeItemId stringRoot;
40 wxTreeItemId tableRoot;
41 wxTreeItemId clusterRoot;
42 wxTreeItemId argumentRoot;
43 wxTreeItemId globalRoot;
44 wxTreeItemId selectedID;
45
47
48 bool checkPresence(const std::string& sVar);
49 bool checkSpecialVals(const std::string& sVar);
50 wxTreeItemId AppendVariable(wxTreeItemId rootNode, std::string sVar);
51 void ClearTree();
52 void HandleDebugActions(const std::vector<std::string>& vVarList);
53 wxString GetInternalName(wxTreeItemId id);
54
55 void OnMenuEvent(wxCommandEvent& event);
56
57 void OnNewTable();
58 void OnShowTable(const wxString& table, const wxString& tableDisplayName);
59 void OnEditTable(const wxString& table);
60 void OnRenameTable(const wxString& table);
61 void OnRemoveTable(const wxString& table);
62 void OnSaveTable(const wxString& table);
63 void OnSaveasTable(const wxString& table);
64 void OnCopyValue(const wxString& value);
65
66
67 public:
68 VariableViewer(wxWindow* parent, NumeReWindow* mainWin, int fieldsize = 300, bool debugMode = false);
69
70 void ExpandAll();
71 void OnRightClick(wxTreeEvent& event);
72 void OnDoubleClick(wxTreeEvent& event);
73
74 void setDebuggerMode(bool mode = true);
75 void UpdateVariables(const std::vector<std::string>& vVarList, size_t nNumerics, size_t nStrings, size_t nTables, size_t nClusters, size_t nArguments = 0, size_t nGlobals = 0);
76
78};
79
80
81#endif // VARIABLEVIEWER_HPP
82
This class is the actual NumeRe main frame. The application's logic is implemented here.
Definition: NumeReWindow.h:177
VariableViewer(wxWindow *parent, NumeReWindow *mainWin, int fieldsize=300, bool debugMode=false)
Constructor.
void OnSaveTable(const wxString &table)
This member function saves the selected table.
void setDebuggerMode(bool mode=true)
This member function creates or removes unneeded tree root items and handles the debugger mode.
void OnEditTable(const wxString &table)
This member function displays the selected table for editing.
wxTreeItemId tableRoot
void OnRightClick(wxTreeEvent &event)
This member function creates the pop-up menu in the var viewer case (it does nothing in debugger mode...
void UpdateVariables(const std::vector< std::string > &vVarList, size_t nNumerics, size_t nStrings, size_t nTables, size_t nClusters, size_t nArguments=0, size_t nGlobals=0)
This member function is used to update the variable list, which is displayed by this control.
void OnRemoveTable(const wxString &table)
This member function removes the selected table.
wxTreeItemId clusterRoot
NumeReWindow * mainWindow
wxTreeItemId numRoot
void OnRenameTable(const wxString &table)
This member function displays a text entry dialog to choose a new name for the selected table.
void ExpandAll()
This member function expands all nodes, which contain child nodes.
wxTreeItemId stringRoot
bool bExpandedState[6]
wxString GetInternalName(wxTreeItemId id)
Returns the internal variable name of the selected variable.
void ClearTree()
A simple helper function to clean the tree.
void OnSaveasTable(const wxString &table)
This member function displays a text entry dialog to choose the file name for the selected table,...
bool checkSpecialVals(const std::string &sVar)
This member functions checks for special variable names, to highlight them (not used in debug mode).
bool checkPresence(const std::string &sVar)
This member function checks, whether a variable was already part of the previous variable set (only u...
void OnCopyValue(const wxString &value)
Copies the selected text to the clip board.
wxTreeItemId AppendVariable(wxTreeItemId rootNode, std::string sVar)
This member function splits the passed variable at tabulator characters and adds its contents to the ...
wxTreeItemId argumentRoot
void OnNewTable()
This member function displays a text entry dialog to enter the new table names and sends the correspo...
void OnDoubleClick(wxTreeEvent &event)
This event handler displays the selected table.
wxTreeItemId selectedID
std::vector< std::string > vLastVarSet
void HandleDebugActions(const std::vector< std::string > &vVarList)
This member function handles every task, which is specific to the debug mode after a variable update.
wxTreeItemId globalRoot
void OnMenuEvent(wxCommandEvent &event)
This member function handles the menu events created from the popup menu and redirects the control to...
void OnShowTable(const wxString &table, const wxString &tableDisplayName)
This member function displays the selected table.