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
51 enum class Topic {
53 labels,
62 count
63 };
64
66 std::unique_ptr<GroupCell> tree;
68 std::array<GroupCell *, static_cast<size_t>(Topic::count)> headings{};
71
72 GroupCell *HeadingFor(Topic topic) const {
73 return headings[static_cast<size_t>(topic)];
74 }
75
77 static constexpr int MatrixSize = 40;
78
80 static WorksheetPreview Make(Configuration *config);
81
87 static wxString MatrixXml();
88
93 static wxString ExpandedBinomialXml(int power, int sign);
94
96 static wxString Factorial200();
97};
98
99} // namespace wxm
100
101#endif // WORKSHEETPREVIEW_H
@ count
Not a check: the number of checks.
The configuration storage for the current worksheet.
Definition: Configuration.h:102
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:49
static wxString MatrixXml()
What Maxima sends for genmatrix(lambda([i,j],100*i+j),n,n), n = MatrixSize.
Definition: WorksheetPreview.cpp:36
Topic
What part of the preview a setting affects.
Definition: WorksheetPreview.h:51
@ oversizedMatrix
A matrix too large for the window.
@ labels
Labels, the label width, indenting maths and multiplication signs.
@ fractions
A small fraction and one too wide for the window: the layout strategy.
@ 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:66
std::array< GroupCell *, static_cast< size_t >(Topic::count)> headings
The text cell each topic starts with; owned by tree.
Definition: WorksheetPreview.h:68
static WorksheetPreview Make(Configuration *config)
Builds the preview's cells with this configuration.
Definition: WorksheetPreview.cpp:88
GroupCell * matrixGroup
The code cell whose output is the oversized matrix; owned by tree.
Definition: WorksheetPreview.h:70
static constexpr int MatrixSize
The oversized matrix has this many rows and as many columns.
Definition: WorksheetPreview.h:77
static wxString Factorial200()
The decimal digits of 200!, a number long enough to be shortened by default.
Definition: WorksheetPreview.cpp:68
static wxString ExpandedBinomialXml(int power, int sign)
What Maxima sends for (x+sign)^power, expanded.
Definition: WorksheetPreview.cpp:47