|
wxMaxima
|
A window that shows a matrix the worksheet only shows part of (GH #2344) More...
#include <MatrixViewer.h>
Public Member Functions | |
| MatrixViewer (wxWindow *parent, const MatrCell &matrix, Configuration *config) | |
| Opens a viewer showing this matrix. | |
| Worksheet * | GetWorksheet () const |
| The worksheet the viewer shows the matrix in. | |
Static Public Member Functions | |
| static void | ConfigureForViewer (Configuration &config) |
| Makes a copy of the worksheet's configuration suitable for the viewer. | |
| static std::unique_ptr< GroupCell > | CopyForViewer (const MatrCell &matrix, Configuration *config) |
| A group cell whose output is a copy of this matrix. | |
| static MatrCell * | PartiallyShownMatrixAt (const GroupCell *group, wxPoint point) |
| The matrix a double-click at this point should open a viewer for. | |
A window that shows a matrix the worksheet only shows part of (GH #2344)
A matrix too large for the window is elided or scrolls (see MatrCell). Double-clicking one opens this viewer, which shows a copy of the whole matrix – every row and every column – in a worksheet of its own that scrolls as far as the matrix needs.
The viewer is independent of the matrix it was opened from: it takes a copy (through the matrix's XML, so the copy's cells belong to the viewer's own Configuration), so re-evaluating or deleting the original doesn't affect it, and several viewers can be open at once. It is read-only: its worksheet doesn't react to clicks or keys, so nothing can be typed into it or evaluated there.
The viewer's Configuration is a copy of the worksheet's, so the matrix looks the same as in the worksheet (fonts, colours, zoom), except that ConfigureForViewer() makes it show every matrix in full, whatever wx_matrix()'s oversized option asked for, and hides the input and the output label.
| MatrixViewer::MatrixViewer | ( | wxWindow * | parent, |
| const MatrCell & | matrix, | ||
| Configuration * | config | ||
| ) |
Opens a viewer showing this matrix.
| parent | The window the viewer belongs to; it closes with it. |
| matrix | The matrix to show. Only copied: the viewer keeps no reference to it. |
| config | The worksheet's configuration, which the viewer's own is copied from. |
|
static |
Makes a copy of the worksheet's configuration suitable for the viewer.
Shows every matrix in full – the configuration doesn't let a matrix ask for anything else, so a nested matrix or one made by wx_matrix(..., oversized=elide) is shown in full, too – and hides the code cell's (empty) input and the output label. Makes the configuration temporary, so none of that is written to the config file when it is destroyed.
Call it only once the viewer's worksheet exists: the worksheet's constructor reads the config file into the configuration, undoing anything set before.
|
static |
A group cell whose output is a copy of this matrix.
The copy is made through the matrix's XML, parsed with config, so every cell of it belongs to config – which a Cell::Copy() would not ensure. The output label is empty: the viewer shows only the matrix.
The matrix a double-click at this point should open a viewer for.
| group | The group cell that was double-clicked. |
| point | The point that was clicked, in worksheet (unscrolled) coordinates. |
Returns the outermost matrix at that point that the worksheet only shows part of (MatrCell::IsShownPartially()), or nullptr if there is none: a matrix that fits the window has nothing more to show.