NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
VariableViewer Class Reference

#include <variableviewer.hpp>

Inheritance diagram for VariableViewer:
Collaboration diagram for VariableViewer:

Public Member Functions

 VariableViewer (wxWindow *parent, NumeReWindow *mainWin, int fieldsize=300, bool debugMode=false)
 Constructor. More...
 
void ExpandAll ()
 This member function expands all nodes, which contain child nodes. More...
 
void OnRightClick (wxTreeEvent &event)
 This member function creates the pop-up menu in the var viewer case (it does nothing in debugger mode and also nothing for non-tables). More...
 
void OnDoubleClick (wxTreeEvent &event)
 This event handler displays the selected table. More...
 
void setDebuggerMode (bool mode=true)
 This member function creates or removes unneeded tree root items and handles the debugger mode. More...
 
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. More...
 
 DECLARE_EVENT_TABLE ()
 

Private Member Functions

bool checkPresence (const std::string &sVar)
 This member function checks, whether a variable was already part of the previous variable set (only used in debug mode). More...
 
bool checkSpecialVals (const std::string &sVar)
 This member functions checks for special variable names, to highlight them (not used in debug mode). More...
 
wxTreeItemId AppendVariable (wxTreeItemId rootNode, std::string sVar)
 This member function splits the passed variable at tabulator characters and adds its contents to the current tree item. It will also create the tooltip for this item. More...
 
void ClearTree ()
 A simple helper function to clean the tree. More...
 
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. More...
 
wxString GetInternalName (wxTreeItemId id)
 Returns the internal variable name of the selected variable. More...
 
void OnMenuEvent (wxCommandEvent &event)
 This member function handles the menu events created from the popup menu and redirects the control to the corresponding functions. More...
 
void OnNewTable ()
 This member function displays a text entry dialog to enter the new table names and sends the corresponding command to the kernel. More...
 
void OnShowTable (const wxString &table, const wxString &tableDisplayName)
 This member function displays the selected table. More...
 
void OnEditTable (const wxString &table)
 This member function displays the selected table for editing. More...
 
void OnRenameTable (const wxString &table)
 This member function displays a text entry dialog to choose a new name for the selected table. More...
 
void OnRemoveTable (const wxString &table)
 This member function removes the selected table. More...
 
void OnSaveTable (const wxString &table)
 This member function saves the selected table. More...
 
void OnSaveasTable (const wxString &table)
 This member function displays a text entry dialog to choose the file name for the selected table, which is then used to create a save file containing the table data. More...
 
void OnCopyValue (const wxString &value)
 Copies the selected text to the clip board. More...
 

Private Attributes

bool debuggerMode
 
std::vector< std::string > vLastVarSet
 
int nDataFieldSize
 
bool bExpandedState [6]
 
wxTreeItemId numRoot
 
wxTreeItemId stringRoot
 
wxTreeItemId tableRoot
 
wxTreeItemId clusterRoot
 
wxTreeItemId argumentRoot
 
wxTreeItemId globalRoot
 
wxTreeItemId selectedID
 
NumeReWindowmainWindow
 

Detailed Description

Definition at line 31 of file variableviewer.hpp.

Constructor & Destructor Documentation

◆ VariableViewer()

VariableViewer::VariableViewer ( wxWindow *  parent,
NumeReWindow mainWin,
int  fieldsize = 300,
bool  debugMode = false 
)

Constructor.

Parameters
parentwxWindow*
mainWinNumeReWindow*
fieldsizeint
debugModebool

Definition at line 63 of file variableviewer.cpp.

References _guilang, Language::get(), and VALUECOLUMN.

Here is the call graph for this function:

Member Function Documentation

◆ AppendVariable()

wxTreeItemId VariableViewer::AppendVariable ( wxTreeItemId  rootNode,
std::string  sVar 
)
private

This member function splits the passed variable at tabulator characters and adds its contents to the current tree item. It will also create the tooltip for this item.

Parameters
rootNodewxTreeItemId
sVarstd::string
Returns
wxTreeItemId

Definition at line 175 of file variableviewer.cpp.

References CLASSCOLUMN, debuggerMode, DIMCOLUMN, SIZECOLUMN, and VALUECOLUMN.

Referenced by UpdateVariables().

◆ checkPresence()

bool VariableViewer::checkPresence ( const std::string &  sVar)
private

This member function checks, whether a variable was already part of the previous variable set (only used in debug mode).

Parameters
sVarconst std::string&
Returns
bool

Definition at line 114 of file variableviewer.cpp.

References vLastVarSet.

Referenced by UpdateVariables().

◆ checkSpecialVals()

bool VariableViewer::checkSpecialVals ( const std::string &  sVar)
private

This member functions checks for special variable names, to highlight them (not used in debug mode).

Parameters
sVarconst std::string&
Returns
bool

Definition at line 135 of file variableviewer.cpp.

Referenced by UpdateVariables().

◆ ClearTree()

void VariableViewer::ClearTree ( )
private

A simple helper function to clean the tree.

Returns
void

Definition at line 225 of file variableviewer.cpp.

References argumentRoot, bExpandedState, clusterRoot, globalRoot, numRoot, stringRoot, and tableRoot.

Referenced by UpdateVariables().

◆ DECLARE_EVENT_TABLE()

VariableViewer::DECLARE_EVENT_TABLE ( )

◆ ExpandAll()

void VariableViewer::ExpandAll ( )

This member function expands all nodes, which contain child nodes.

Returns
void

Definition at line 514 of file variableviewer.cpp.

References argumentRoot, bExpandedState, clusterRoot, globalRoot, numRoot, stringRoot, and tableRoot.

Referenced by UpdateVariables().

◆ GetInternalName()

wxString VariableViewer::GetInternalName ( wxTreeItemId  id)
private

Returns the internal variable name of the selected variable.

Parameters
idwxTreeItemId
Returns
wxString

Definition at line 288 of file variableviewer.cpp.

Referenced by OnDoubleClick(), and OnMenuEvent().

◆ HandleDebugActions()

void VariableViewer::HandleDebugActions ( const std::vector< std::string > &  vVarList)
private

This member function handles every task, which is specific to the debug mode after a variable update.

Parameters
vVarListconst std::vector<std::string>&
Returns
void

Definition at line 271 of file variableviewer.cpp.

References debuggerMode, and vLastVarSet.

Referenced by UpdateVariables().

◆ OnCopyValue()

void VariableViewer::OnCopyValue ( const wxString &  value)
private

Copies the selected text to the clip board.

Parameters
valueconst wxString&
Returns
void

Definition at line 497 of file variableviewer.cpp.

Referenced by OnMenuEvent().

◆ OnDoubleClick()

void VariableViewer::OnDoubleClick ( wxTreeEvent &  event)

This event handler displays the selected table.

Parameters
eventwxTreeEvent&
Returns
void

Definition at line 607 of file variableviewer.cpp.

References argumentRoot, clusterRoot, debuggerMode, GetInternalName(), globalRoot, OnShowTable(), and tableRoot.

Here is the call graph for this function:

◆ OnEditTable()

void VariableViewer::OnEditTable ( const wxString &  table)
private

This member function displays the selected table for editing.

Parameters
tableconst wxString&
Returns
void

Definition at line 414 of file variableviewer.cpp.

References mainWindow, and NumeReWindow::pass_command().

Referenced by OnMenuEvent().

Here is the call graph for this function:

◆ OnMenuEvent()

void VariableViewer::OnMenuEvent ( wxCommandEvent &  event)
private

This member function handles the menu events created from the popup menu and redirects the control to the corresponding functions.

Parameters
eventwxCommandEvent&
Returns
void

Definition at line 304 of file variableviewer.cpp.

References GetInternalName(), ID_VARVIEWER_COPYVALUE, ID_VARVIEWER_EDIT, ID_VARVIEWER_NEW, ID_VARVIEWER_REMOVE, ID_VARVIEWER_RENAME, ID_VARVIEWER_SAVE, ID_VARVIEWER_SAVEAS, ID_VARVIEWER_SHOW, OnCopyValue(), OnEditTable(), OnNewTable(), OnRemoveTable(), OnRenameTable(), OnSaveasTable(), OnSaveTable(), OnShowTable(), selectedID, and VALUECOLUMN.

Here is the call graph for this function:

◆ OnNewTable()

void VariableViewer::OnNewTable ( )
private

This member function displays a text entry dialog to enter the new table names and sends the corresponding command to the kernel.

Returns
void

Definition at line 343 of file variableviewer.cpp.

References _guilang, Language::get(), mainWindow, and NumeReWindow::pass_command().

Referenced by OnMenuEvent().

Here is the call graph for this function:

◆ OnRemoveTable()

void VariableViewer::OnRemoveTable ( const wxString &  table)
private

This member function removes the selected table.

Parameters
tableconst wxString&
Returns
void

Definition at line 448 of file variableviewer.cpp.

References mainWindow, and NumeReWindow::pass_command().

Referenced by OnMenuEvent().

Here is the call graph for this function:

◆ OnRenameTable()

void VariableViewer::OnRenameTable ( const wxString &  table)
private

This member function displays a text entry dialog to choose a new name for the selected table.

Parameters
tableconst wxString&
Returns
void

Definition at line 429 of file variableviewer.cpp.

References _guilang, Language::get(), mainWindow, and NumeReWindow::pass_command().

Referenced by OnMenuEvent().

Here is the call graph for this function:

◆ OnRightClick()

void VariableViewer::OnRightClick ( wxTreeEvent &  event)

This member function creates the pop-up menu in the var viewer case (it does nothing in debugger mode and also nothing for non-tables).

Parameters
eventwxTreeEvent&
Returns
void

Definition at line 546 of file variableviewer.cpp.

References _guilang, debuggerMode, Language::get(), ID_VARVIEWER_COPYVALUE, ID_VARVIEWER_EDIT, ID_VARVIEWER_NEW, ID_VARVIEWER_REMOVE, ID_VARVIEWER_RENAME, ID_VARVIEWER_SAVE, ID_VARVIEWER_SAVEAS, ID_VARVIEWER_SHOW, selectedID, and tableRoot.

Here is the call graph for this function:

◆ OnSaveasTable()

void VariableViewer::OnSaveasTable ( const wxString &  table)
private

This member function displays a text entry dialog to choose the file name for the selected table, which is then used to create a save file containing the table data.

Parameters
tableconst wxString&
Returns
void

Definition at line 478 of file variableviewer.cpp.

References _guilang, Language::get(), mainWindow, and NumeReWindow::pass_command().

Referenced by OnMenuEvent().

Here is the call graph for this function:

◆ OnSaveTable()

void VariableViewer::OnSaveTable ( const wxString &  table)
private

This member function saves the selected table.

Parameters
tableconst wxString&
Returns
void

Definition at line 462 of file variableviewer.cpp.

References mainWindow, and NumeReWindow::pass_command().

Referenced by OnMenuEvent().

Here is the call graph for this function:

◆ OnShowTable()

void VariableViewer::OnShowTable ( const wxString &  table,
const wxString &  tableDisplayName 
)
private

This member function displays the selected table.

Parameters
tableconst wxString&
tableDisplayNameconst wxString&
Returns
void

Definition at line 400 of file variableviewer.cpp.

References mainWindow, and NumeReWindow::showTable().

Referenced by OnDoubleClick(), and OnMenuEvent().

Here is the call graph for this function:

◆ setDebuggerMode()

void VariableViewer::setDebuggerMode ( bool  mode = true)

This member function creates or removes unneeded tree root items and handles the debugger mode.

Parameters
modebool
Returns
void

Definition at line 640 of file variableviewer.cpp.

References _guilang, argumentRoot, CLASSCOLUMN, debuggerMode, Language::get(), NumeReWindow::getOptions(), Options::GetShowGlobalVariables(), Options::GetShowProcedureArguments(), globalRoot, and mainWindow.

Referenced by DebugViewer::updateSettings().

Here is the call graph for this function:

◆ UpdateVariables()

void VariableViewer::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.

Parameters
vVarListconst std::vector<std::string>&
nNumericssize_t
nStringssize_t
nTablessize_t
nClusterssize_t
nArgumentssize_t
nGlobalssize_t
Returns
void

Definition at line 692 of file variableviewer.cpp.

References AppendVariable(), argumentRoot, checkPresence(), checkSpecialVals(), ClearTree(), clusterRoot, debuggerMode, DIMCOLUMN, ExpandAll(), globalRoot, HandleDebugActions(), numRoot, stringRoot, tableRoot, and toString().

Referenced by DebugViewer::getInformationByStackId(), and NumeReWindow::UpdateVarViewer().

Here is the call graph for this function:

Member Data Documentation

◆ argumentRoot

wxTreeItemId VariableViewer::argumentRoot
private

◆ bExpandedState

bool VariableViewer::bExpandedState[6]
private

Definition at line 37 of file variableviewer.hpp.

Referenced by ClearTree(), and ExpandAll().

◆ clusterRoot

wxTreeItemId VariableViewer::clusterRoot
private

Definition at line 41 of file variableviewer.hpp.

Referenced by ClearTree(), ExpandAll(), OnDoubleClick(), and UpdateVariables().

◆ debuggerMode

bool VariableViewer::debuggerMode
private

◆ globalRoot

wxTreeItemId VariableViewer::globalRoot
private

◆ mainWindow

NumeReWindow* VariableViewer::mainWindow
private

◆ nDataFieldSize

int VariableViewer::nDataFieldSize
private

Definition at line 36 of file variableviewer.hpp.

◆ numRoot

wxTreeItemId VariableViewer::numRoot
private

Definition at line 38 of file variableviewer.hpp.

Referenced by ClearTree(), ExpandAll(), and UpdateVariables().

◆ selectedID

wxTreeItemId VariableViewer::selectedID
private

Definition at line 44 of file variableviewer.hpp.

Referenced by OnMenuEvent(), and OnRightClick().

◆ stringRoot

wxTreeItemId VariableViewer::stringRoot
private

Definition at line 39 of file variableviewer.hpp.

Referenced by ClearTree(), ExpandAll(), and UpdateVariables().

◆ tableRoot

wxTreeItemId VariableViewer::tableRoot
private

Definition at line 40 of file variableviewer.hpp.

Referenced by ClearTree(), ExpandAll(), OnDoubleClick(), OnRightClick(), and UpdateVariables().

◆ vLastVarSet

std::vector<std::string> VariableViewer::vLastVarSet
private

Definition at line 35 of file variableviewer.hpp.

Referenced by checkPresence(), and HandleDebugActions().


The documentation for this class was generated from the following files: