wxMaxima
Loading...
Searching...
No Matches
WizardCatalog.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
41#ifndef WIZARDCATALOG_H
42#define WIZARDCATALOG_H
43
44#include <wx/string.h>
45#include <wx/defs.h>
46#include <optional>
47#include <vector>
48
49namespace wxm {
50
52 struct WizardField {
54 wxString label = {};
56 wxString defaultValue = {};
58 wxString tooltip = {};
65 bool takesSelection = false;
66 };
67
69 inline WizardField Field(const wxString &label, const wxString &defaultValue,
70 const wxString &tooltip = {}) {
71 return {label, defaultValue, tooltip, false};
72 }
73
75 inline WizardField SelectionField(const wxString &label,
76 const wxString &tooltip = {}) {
77 return {label, wxString(), tooltip, true};
78 }
79
87 struct WizardSpec {
89 std::vector<wxWindowID> ids = {};
91 wxString title = {};
93 wxString description = {};
95 wxString descriptionTooltip = {};
97 wxString rule = {};
99 std::vector<WizardField> fields = {};
100 };
101
105 bool fourierLoaded = false;
110 wxString integralSign = wxS("\u222B");
111 };
112
120 std::vector<WizardSpec> WizardCatalog(const WizardContext &context = {});
121
123 std::optional<WizardSpec> FindWizard(wxWindowID id,
124 const WizardContext &context = {});
125
130 std::vector<WizardField> FieldsWithSelection(const WizardSpec &spec,
131 const wxString &selection);
132}
133
134#endif // WIZARDCATALOG_H
WizardField Field(const wxString &label, const wxString &defaultValue, const wxString &tooltip={})
A field that starts with the given default value.
Definition: WizardCatalog.h:69
std::vector< WizardField > FieldsWithSelection(const WizardSpec &spec, const wxString &selection)
spec's fields with selection filled into the ones that take it
Definition: WizardCatalog.cpp:1096
std::vector< WizardSpec > WizardCatalog(const WizardContext &context={})
All standard wizards.
Definition: WizardCatalog.cpp:43
WizardField SelectionField(const wxString &label, const wxString &tooltip={})
A field that starts with the expression the wizard is applied to.
Definition: WizardCatalog.h:75
What a wizard's command depends on besides its fields.
Definition: WizardCatalog.h:103
bool fourierLoaded
Whether Maxima has loaded the "fourie" package already.
Definition: WizardCatalog.h:105
wxString integralSign
What the titles of the numerical integration wizards start with.
Definition: WizardCatalog.h:110
One field of a standard wizard.
Definition: WizardCatalog.h:52
wxString defaultValue
What the field contains when the wizard opens.
Definition: WizardCatalog.h:56
wxString tooltip
The field's tooltip; may be empty.
Definition: WizardCatalog.h:58
wxString label
The text in front of the field.
Definition: WizardCatalog.h:54
bool takesSelection
Whether the field starts with the expression the wizard is applied to.
Definition: WizardCatalog.h:65
Everything the generic wizard needs to know about one menu command.
Definition: WizardCatalog.h:87
wxString rule
The Maxima command, with #n# standing for the n-th field.
Definition: WizardCatalog.h:97
std::vector< WizardField > fields
The fields, at most GenWizPanel's 10.
Definition: WizardCatalog.h:99
wxString descriptionTooltip
The tooltip of the "Description" tab; may be empty.
Definition: WizardCatalog.h:95
wxString title
The wizard's caption.
Definition: WizardCatalog.h:91
std::vector< wxWindowID > ids
The menu entries and sidebar buttons that open this wizard.
Definition: WizardCatalog.h:89
wxString description
The text of the wizard's "Description" tab; may be empty.
Definition: WizardCatalog.h:93