20#ifndef TABLEVIEWER_HPP
21#define TABLEVIEWER_HPP
30#include "../../kernel/core/datamanagement/container.hpp"
31#include "../../kernel/core/datamanagement/table.hpp"
62 void OnChar(wxKeyEvent& event);
63 void OnEnter(wxMouseEvent& event);
101 TableViewer(wxWindow* parent, wxWindowID
id, wxStatusBar* statusbar,
TablePanel* parentPanel,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxWANTS_CHARS,
const wxString&
name = wxGridNameStr);
112 void OnMenu(wxCommandEvent& event);
This data container is a copy- efficient table to interchange data between Kernel and GUI.
Generic table panel, which also contains all meta UI elements.
This class is an adaption of the wxGrid class to present the tabular data in NumeRe's memory and enab...
void OnCellSelect(wxGridEvent &event)
This member function will highlight the cursor position in the grid and update the status bar corresp...
void deleteSelection()
This member function will delete the contents of the selected cells by setting them to NaN.
wxGridCellCoords CreateEmptyGridSpace(int rows, int headrows, int cols, bool useCursor=false)
This member function creates the needed space in the grid, which is needed to paste data.
double calculateMax(const wxGridCellCoordsContainer &coords)
This member function calculates the maximal value of the selected cells.
void applyConditionalCellColourScheme()
Apply a conditional cell colour scheme to the selected cells.
void replaceDecimalSign(wxString &text)
This member function replaces the german comma decimal sign with the dot used in anglo-american notat...
std::vector< int > m_currentColTypes
void SetData(NumeRe::Container< std::string > &_stringTable, const std::string &sName, const std::string &sIntName)
This member function is the data setter for string and cluster tables.
void copyContents()
This member function will copy the contents of the selected cells to the clipboard.
void UpdateColumnAlignment(int col)
Changes the alignment of a whole column to reflect its internal type.
void changeColType()
Enables the switching of the column types of the selected columns.
bool isEmptyCol(int col)
This member function will determine, whether the selected column is completely empty or not.
void OnLabelRightClick(wxGridEvent &event)
This member function displays the context menu for labels.
void createZeroElementTable()
This member function creates a zero- element table to visualize empty tables (or non-existent ones).
wxGridCellCoords m_lastRightClick
void saveTable(bool saveAs=false)
Saves the currently displayed table directly to the selected file.
int findLastElement(int nCol)
This member function will search the last non-empty cell in the selected column.
NumeRe::Table GetData()
This member function returns the internal NumeRe::Table from the data provider object.
mu::value_type calculateSum(const wxGridCellCoordsContainer &coords)
This member function calculates the sum of the selected cells.
void OnChar(wxKeyEvent &event)
This member function appends necessary columns or rows, if the user entered a character in the last c...
std::string m_displayName
void finalize()
Ensure that the editors are all closed.
double calculateMin(const wxGridCellCoordsContainer &coords)
This member function calculates the minimal value of the selected cells.
void SetDefaultSize(size_t rows=1, size_t cols=1) __attribute__((deprecated))
This member function creates an empty table of some size.
void OnMenu(wxCommandEvent &event)
This member function is the menu command event handler function. It will redirect the control to the ...
void layoutGrid()
This private member function will layout the initial grid after the data table was set.
bool isNumerical(const std::string &sCell)
This is a simple helper function to determine, whether the entered cell value is a numerical value.
wxGridCellCoords lastCursorPosition
TableViewer(wxWindow *parent, wxWindowID id, wxStatusBar *statusbar, TablePanel *parentPanel, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxWANTS_CHARS, const wxString &name=wxGridNameStr)
Constructor.
void removeElement(int id)
This member function processes the removing of cells, columns or rows.
@ ID_MENU_CHANGE_COL_TYPE
void OnCellChange(wxGridEvent &event)
This member function processes the values entered in the table and updates the frame after entering (...
wxStatusBar * m_statusBar
void SetTableReadOnly(bool isReadOnly=true)
This member function declares the table to be read-only and enables the context menu entries,...
void OnCellRangeSelect(wxGridRangeSelectEvent &event)
This member function will calculate the simple statistics if the user selected a range of cells in th...
void replaceTabSign(wxString &text)
This member function replaces the tabulator character with whitespaces.
mu::value_type calculateAvg(const wxGridCellCoordsContainer &coords)
This member function calculates the average of the selected cells.
void reloadTable()
Reloads the currently displayed table data from the kernel.
wxString copyCell(int row, int col)
This member function returns the contents of the selected cells and replaces whitespaces with undersc...
void updateFrame()
This member function is called every time the grid itself changes to draw the frame colours.
void OnCellRightClick(wxGridEvent &event)
This member function displays the context menu for cells.
void OnLabelDoubleClick(wxGridEvent &event)
This member function will autosize the columns, if the user double clicked on their labels.
wxString getSelectedValues()
Returns the values of all selected cells as a string list.
mu::value_type CellToCmplx(int row, int col)
Return the cell value as value_type.
void OnEnter(wxMouseEvent &event)
This member function is the event handler for entering this window. It will activate the focus and br...
std::vector< wxString > getLinesFromPaste(const wxString &data)
This member function transformes the data obtained by the clipboard into a table- like layout.
void createMenuBar()
Creates a menu bar in the top frame.
NumeRe::Table GetDataCopy()
This member function returns a safe copy of the internal NumeRe::Table.
TablePanel * m_parentPanel
wxString replaceCtrlChars(const wxString &sStr)
This member function is a simple helper to replace underscores with whitespaces.
void OnKeyDown(wxKeyEvent &event)
This member function tracks the entered keys and processes a keybord navigation.
wxGridCellCoordsArray selectedCells
void updateStatusBar(const wxGridCellCoordsContainer &coords, wxGridCellCoords *cursor=nullptr)
This member function updates the status bar of the enclosing ViewerFrame.
void insertElement(int id)
This member function processes the insertion of new empty cells, columns or rows.
void pasteContents(bool useCursor=false)
This member function handles the case that the user tries to paste text contents, which may be be con...
A class to simplify the access to different types of grid cell coords. Especially useful in the conte...
__attribute__((force_align_arg_pointer)) static Matrix calcEigenVectsAndValues(const Matrix &_mMatrix
This static function does the whole eigenvalues, eigenvectors and diagonalizing stuff.
MUP_BASETYPE value_type
The numeric datatype used by the parser.