wxMaxima
Loading...
Searching...
No Matches
Data Structures | Functions
WizardCatalog.h File Reference

The standard wizards of wxMaxima's menus, described as data. More...

#include <wx/string.h>
#include <wx/defs.h>
#include <optional>
#include <vector>
Include dependency graph for WizardCatalog.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  wxm::WizardField
 One field of a standard wizard. More...
 
struct  wxm::WizardSpec
 Everything the generic wizard needs to know about one menu command. More...
 
struct  wxm::WizardContext
 What a wizard's command depends on besides its fields. More...
 

Functions

WizardField wxm::Field (const wxString &label, const wxString &defaultValue, const wxString &tooltip={})
 A field that starts with the given default value.
 
WizardField wxm::SelectionField (const wxString &label, const wxString &tooltip={})
 A field that starts with the expression the wizard is applied to.
 
std::vector< WizardSpec > wxm::WizardCatalog (const WizardContext &context={})
 All standard wizards.
 
std::optional< WizardSpec > wxm::FindWizard (wxWindowID id, const WizardContext &context={})
 The standard wizard id opens, if there is one.
 
std::vector< WizardField > wxm::FieldsWithSelection (const WizardSpec &spec, const wxString &selection)
 spec's fields with selection filled into the ones that take it
 

Detailed Description

The standard wizards of wxMaxima's menus, described as data.

Most menu entries open the generic wizard (GenWizPanel): a few labelled fields and a command rule like "taylor(#1#,#2#,#3#,#4#);", in which #n# is replaced by the n-th field. Each of them used to need its own branch in a menu handler that passed up to 33 positional arguments, plus a Bind() in wxMaxima.cpp – and a forgotten Bind() left a menu entry that silently did nothing ("Dito, and evaluate the result" in the Calculus menu did, until this catalog bound it).

A wizard of that kind is now one WizardSpec in WizardCatalog(), and wxMaxima binds every ID the catalog names to one handler. Wizards that need more than text fields (checkboxes, choices, grids, file pickers) still have classes of their own.

This file needs no GUI, so test_WizardCatalog can check every entry.

Function Documentation

◆ FieldsWithSelection()

std::vector< wxm::WizardField > wxm::FieldsWithSelection ( const WizardSpec &  spec,
const wxString &  selection 
)

spec's fields with selection filled into the ones that take it

GenWizPanel gets only plain default values.

◆ WizardCatalog()

std::vector< wxm::WizardSpec > wxm::WizardCatalog ( const WizardContext &  context = {})

All standard wizards.

Built anew on every call, rather than once at static initialization, so that _() translates into the language wxMaxima runs in. The strings are the same msgids the menu handlers used before, so moving a wizard here leaves its translations intact.