wxMaxima
Loading...
Searching...
No Matches
WorksheetPreview.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// Copyright (C) 2026 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#ifndef WORKSHEETPREVIEW_H
28#define WORKSHEETPREVIEW_H
29
30#include <array>
31#include <memory>
32#include <wx/string.h>
33
34class Configuration;
35class GroupCell;
36
37namespace wxm {
38
50 enum class Topic {
52 labels,
59 count
60 };
61
63 std::unique_ptr<GroupCell> tree;
65 std::array<GroupCell *, static_cast<size_t>(Topic::count)> headings{};
68
69 GroupCell *HeadingFor(Topic topic) const {
70 return headings[static_cast<size_t>(topic)];
71 }
72
74 static constexpr int MatrixSize = 40;
75
77 static WorksheetPreview Make(Configuration *config);
78
84 static wxString MatrixXml();
85
87 static wxString Factorial200();
88};
89
90} // namespace wxm
91
92#endif // WORKSHEETPREVIEW_H
The configuration storage for the current worksheet.
Definition: Configuration.h:101
A cell grouping input (and, if there is one, also the output) cell to a foldable item.
Definition: GroupCell.h:88
The sample worksheet of the configuration dialog's "Worksheet" tab.
Definition: WorksheetPreview.h:48
static wxString MatrixXml()
What Maxima sends for genmatrix(lambda([i,j],100*i+j),n,n), n = MatrixSize.
Definition: WorksheetPreview.cpp:35
Topic
What part of the preview a setting affects.
Definition: WorksheetPreview.h:50
@ oversizedMatrix
A matrix too large for the window.
@ labels
Labels, the label width, indenting maths and multiplication signs.
@ longNumbers
200!, as long a number as the digit settings need
@ specialSymbols
e, i and pi with or without their percent sign, and a Greek letter
std::unique_ptr< GroupCell > tree
The preview's cells, to hand to Worksheet::InsertGroupCells()
Definition: WorksheetPreview.h:63
std::array< GroupCell *, static_cast< size_t >(Topic::count)> headings
The text cell each topic starts with; owned by tree.
Definition: WorksheetPreview.h:65
static WorksheetPreview Make(Configuration *config)
Builds the preview's cells with this configuration.
Definition: WorksheetPreview.cpp:66
GroupCell * matrixGroup
The code cell whose output is the oversized matrix; owned by tree.
Definition: WorksheetPreview.h:67
static constexpr int MatrixSize
The oversized matrix has this many rows and as many columns.
Definition: WorksheetPreview.h:74
static wxString Factorial200()
The decimal digits of 200!, a number long enough to be shortened by default.
Definition: WorksheetPreview.cpp:46