32extern unsigned int view_refresh_svg_gz_len;
33extern unsigned char view_refresh_svg_gz[];
40#include <wx/hashmap.h>
41#include <wx/clrpicker.h>
44#include <wx/propdlg.h>
45#include <wx/generic/propdlg.h>
46#include <wx/spinctrl.h>
47#include <wx/notebook.h>
49#include <wx/imaglist.h>
50#include <wx/bookctrl.h>
51#include <wx/artprov.h>
52#include <unordered_map>
54#include <wx/hyperlink.h>
55#include <wx/scrolwin.h>
57#ifndef CONFIGDIALOGUE_H
58#define CONFIGDIALOGUE_H
60#include "BuildConfig.h"
64#include "../Configuration.h"
69#ifdef WXM_USE_AI_TOOLS
81 checkbox_strikethrough,
126 const int mMinPanelWidth = 500;
127 const int mMinPanelHeight = 500;
143 GCL_MULTIPROCESS_MEMORY_POOL,
149 std::unique_ptr<Configuration> m_configuration;
166 std::unique_ptr<Configuration> m_worksheetPreviewConfiguration;
168 std::array<CellPtr<GroupCell>,
169 static_cast<size_t>(wxm::WorksheetPreview::Topic::count)> m_worksheetPreviewHeadings;
172 wxm::WorksheetPreview::Topic::labels;
174 void ApplySettingsToPreview();
182 using StringHash = std::unordered_map<wxString, wxString, wxStringHash>;
184 std::vector<wxm::UiLanguage> m_languages;
189 class ExamplePanel :
public wxPanel
193 ExamplePanel(wxWindow *parent,
int id) : wxPanel(parent, id)
194 { Bind(wxEVT_PAINT, &ConfigDialogue::ExamplePanel::OnPaint,
this); };
197 void SetStyle(
const Style &style)
208 void OnPaint(wxPaintEvent &event);
219 void SetCheckboxValues();
231 wxWindow *CreateAiPanel();
232#ifdef WXM_USE_AI_TOOLS
234 void AddAiProviderControls(wxStaticBoxSizer *box);
238 wxWindow *CreatePrintPanel();
241 wxWindow *CreateRevertToDefaultsPanel();
246#if wxUSE_ACCESSIBILITY
248 wxWindow *CreateAccessibilityPanel();
251 wxCheckBox *m_screenReaderMathML;
256 wxWindow *CreateWorksheetPanel();
259 wxWindow *CreateOptionsPanel();
262 wxWindow *CreateExportPanel();
265 wxWindow *CreateStylePanel();
268 wxWindow *CreateMaximaPanel();
271 wxWindow *CreateStartupPanel();
274 wxGrid *m_maximaEnvVariables;
275 void OnImport(wxCommandEvent& event);
276 static void CopyConfig(wxConfigBase *src, wxConfigBase *dst,
const wxString& dir = wxS(
"/"));
277 void OnReloadAll(wxCommandEvent& event);
278 void OnReloadStyles(wxCommandEvent& event);
279 void OnResetAllToDefaults(wxCommandEvent& event);
280 void OnExportAll(wxCommandEvent& event);
281 void OnResetStyles(wxCommandEvent& event);
282 void OnChangeMaximaEnvVar(wxGridEvent& event);
283 void OnMaximaEnvRightClick(wxGridEvent& event);
284 void OnMouseMotion_MaximaEnv(wxMouseEvent &event);
285 void OnNewEnvMenu(wxCommandEvent &event);
286 void OnClickMaximaEnvVal(
int row);
287 void OnChangeMaximaCellClick(wxGridEvent& event);
295 StringHash m_maximaEnvDoc;
300 wxRadioButton *m_autodetectHelpBrowser;
301 wxRadioButton *m_noAutodetectHelpBrowser;
302 wxRadioButton *m_internalHelpBrowser;
303 wxCheckBox *m_singlePageManual;
310 wxRadioButton *m_useGnuplot;
311 wxRadioButton *m_useWgnuplot;
327 wxTextCtrl *m_documentclass;
328 wxTextCtrl *m_documentclassOptions;
329 wxTextCtrl *m_texPreamble;
330 wxCheckBox *m_autoSave;
331 wxButton *m_wxMathMLBrowse;
332 wxTextCtrl *m_additionalParameters;
333 wxTextCtrl *m_mathJaxURL;
334 wxChoice *m_language;
337 wxCheckBox *m_abortOnError;
338 wxCheckBox *m_offerKnownAnswers;
339 wxCheckBox *m_restartOnReEvaluation;
340 wxCheckBox *m_wrapLatexMath;
341 wxCheckBox *m_usesvg;
342 wxCheckBox *m_antialiasLines;
343 wxSpinCtrlDouble *m_defaultFramerate;
344 wxSpinCtrl *m_defaultPlotWidth;
345 wxSpinCtrl *m_defaultPlotHeight;
346 wxSpinCtrl *m_displayedDigits;
347 wxSpinCtrl *m_printMargin_Top;
348 wxSpinCtrl *m_printMargin_Bot;
349 wxSpinCtrl *m_printMargin_Left;
350 wxSpinCtrl *m_printMargin_Right;
351 wxRadioButton *m_displayNDigits;
352 wxRadioButton *m_displayAllDigits;
353 wxRadioButton *m_linebreaksInLongNums;
366 wxCheckBox *m_printBrackets;
367 wxChoice *m_exportWithMathJAX;
368 wxCheckBox *m_matchParens;
369 wxCheckBox *m_showMatchingParens;
370 wxChoice *m_showLength;
371 wxChoice *m_autosubscript;
372 wxRadioBox *m_layoutStrategy;
377 wxRadioButton *m_enterEvaluates;
378 wxRadioButton *m_ctrlEnterEvaluates;
379 wxCheckBox *m_numpadEnterEvaluates;
380 wxCheckBox *m_saveImgFileName;
381 wxCheckBox *m_saveUntitled;
382 wxCheckBox *m_openHCaret;
383 wxCheckBox *m_insertAns;
384 wxCheckBox *m_autoIndent;
385 wxCheckBox *m_cursorJump;
388 wxCheckBox *m_hideBrackets;
392 wxCheckBox *m_overlayScrollbars;
394 wxCheckBox *m_indentMaths;
395 wxChoice *m_autoWrap;
396 wxSpinCtrl *m_labelWidth;
397 wxSpinCtrl *m_recentItems;
398 wxSpinCtrl *m_bitmapScale;
399 wxSpinCtrlDouble *m_printScale;
400 wxCheckBox *m_fixReorderedIndices;
401 wxCheckBox *m_incrementalSearch;
402 wxCheckBox *m_notifyIfIdle;
403 wxCheckBox *m_findDialogDockable;
404 wxCheckBox *m_mcpServerEnabled;
405 wxSpinCtrl *m_mcpServerPort;
406#ifdef WXM_USE_AI_TOOLS
411 struct AiProviderUiRecord {
418 wxString displayName;
432 bool forgetApiKey =
false;
438 std::vector<AiProviderUiRecord> m_aiProviderRecords;
443 int m_aiActiveProviderRecordIndex = -1;
454 wxChoice *m_aiChatProviderChoice;
458 wxStaticBoxSizer *m_aiProviderDetailBox;
459 wxStaticText *m_aiBaseUrlLabel;
462 wxTextCtrl *m_aiBaseUrlCtrl;
463 wxStaticText *m_aiShapeLabel;
464 wxChoice *m_aiShapeChoice;
468 wxStaticText *m_aiUsernameLabel;
469 wxTextCtrl *m_aiUsernameCtrl;
471 wxStaticText *m_aiKeyLabel;
472 wxTextCtrl *m_aiKeyCtrl;
480 wxComboBox *m_aiModelCtrl;
481 wxButton *m_aiRefreshModelsButton;
484 wxStaticText *m_aiModelFetchStatus;
492 std::shared_ptr<bool> m_aiUiAlive;
493 wxHyperlinkCtrl *m_aiApiKeyLink;
494 wxHyperlinkCtrl *m_aiModelListLink;
497 wxButton *m_aiRemoveCustomProviderButton;
499 wxButton *m_aiForgetKeyButton;
500 void OnAiForgetKey(wxCommandEvent &event);
502 void UpdateAiKeyHint(
const AiProviderUiRecord &rec);
504 static wxString AiApiKeyToUse(
const AiProviderUiRecord &rec);
508 void RelayoutAiChatPanel();
509 void OnAiProviderChoice(wxCommandEvent &event);
511 void OnAiUsernameChanged(wxCommandEvent &event);
514 void UpdateAiCredentialLabel();
515 void OnAiRemoveCustomProvider(wxCommandEvent &event);
516 void OnAiRefreshModels(wxCommandEvent &event);
527 void StartAiModelFetch();
531 void StashAiProviderUiIntoRecord();
535 void LoadAiProviderRecordIntoUi(
int index);
540 bool AddCustomAiProviderDialog();
544 void RebuildAiProviderChoice(
int selectIndex);
546 wxChoice *m_showUserDefinedLabels;
547 wxButton *m_getStyleFont;
550 wxListBox *m_styleFor;
553 wxCheckBox *m_boldCB;
554 wxCheckBox *m_italicCB;
555 wxCheckBox *m_slantedCB;
556 wxCheckBox *m_strikethroughCB;
557 wxCheckBox *m_underlinedCB;
558 wxCheckBox *m_fixedFontInTC;
559 wxCheckBox *m_unixCopy;
560 wxCheckBox *m_changeAsterisk;
561 wxCheckBox *m_hidemultiplicationSign;
562 wxCheckBox *m_latin2Greek;
563 wxCheckBox *m_keepPercentWithSpecials;
564 wxBookCtrlBase *m_notebook;
565 wxButton *m_saveStyle, *m_loadStyle;
566 wxSpinCtrl *m_defaultPort;
567 ExamplePanel *m_examplePanel;
568 wxSpinCtrl *m_maxGnuplotMegabytes;
569 wxSpinCtrl *m_autosaveMinutes;
570 wxSpinCtrl *m_maxLayoutTime;
571 wxTextCtrl *m_autoMathJaxURL;
572 int m_maximaEmvRightClickRow = 0;
578 void OnClose(wxCloseEvent &event);
580 void OnwxMathMLBrowse(wxCommandEvent &event);
582 void OnIdle(wxIdleEvent &event);
600 void LoadSave(wxCommandEvent &event);
Talks to one of a handful of external AI chat APIs for the AI chat sidebar (AiChatSidebar).
AiProviderShape
Which request/response wire format a provider uses. The four built-in AiProviderKinds each hardcode o...
Definition: AiProvider.h:86
AiProviderKind
Which AI service to talk to. Persisted as a plain int in Configuration; keep existing values stable a...
Definition: AiProvider.h:70
This file declares all the wizards the draw sidepane needs.
The configuration dialogue's list of extra symbols and symbol shortcuts.
This file declares everything needed for the text style system used to style all the elements on the ...
TextStyle
All text styles known to wxMaxima.
Definition: TextStyle.h:230
The languages wxMaxima's user interface can be switched to (GH #849).
Declares the sample worksheet the configuration dialog's "Worksheet" tab shows to preview what its di...
This file defines the class Worksheet.
A dialog that shows the program's license.
Definition: BinaryNameCtrl.h:40
The configuration dialog.
Definition: ConfigDialogue.h:98
int m_mathFontSize
The size of the maths font.
Definition: ConfigDialogue.h:619
void OnCheckbox(wxCommandEvent &event)
Called if one of the checkboxes for bold, italic or underlined is toggled.
Definition: ConfigDialogue.cpp:3489
wxCheckBox * m_digitGrouping
Separate the digit groups of numbers by a small gap? (GH #192)
Definition: ConfigDialogue.h:355
wxRadioButton * m_noAutodetectMathJaX
The radio button that is set if m_autodetectMathJaX is unset.
Definition: ConfigDialogue.h:309
wxCheckBox * m_exportContainsWXMX
A checkbox that asks if all newlines in text cells have to be passed to HTML.
Definition: ConfigDialogue.h:363
void OnStyleToEditChanged(wxCommandEvent &event)
Called if the user changes the style that is to be edited.
Definition: ConfigDialogue.cpp:3051
wxCheckBox * m_maximaHelpInConsole
Does Maxima answer ?, ?? and describe() on the console?
Definition: ConfigDialogue.h:305
wxRadioBox * m_oversizedMatrices
How to show a matrix too large for the window.
Definition: ConfigDialogue.h:374
wxRadioButton * m_autodetectMathJaX
Autodetect the mathJaX location?
Definition: ConfigDialogue.h:307
wxRadioButton * m_autodetectMaxima
Autodetect the maxima location?
Definition: ConfigDialogue.h:297
void OnChangeWarning(wxCommandEvent &event)
A message dialog that appears if a change cannot be applied now.
Definition: ConfigDialogue.cpp:3506
void UpdateExample()
Sets the style example's style on style changes.
Definition: ConfigDialogue.cpp:3512
wxSpinCtrl * m_digitGroupingMinDigits
How many digits a number needs before its digits are grouped.
Definition: ConfigDialogue.h:357
int m_fontSize
The size of the text font.
Definition: ConfigDialogue.h:617
wxCheckBox * m_htmlExportSelfContained
Embed images and the .wxmx into the exported .html file.
Definition: ConfigDialogue.h:365
wxCheckBox * m_usePartialForDiff
A checkbox that asks if TeX should use the \partial symbol for representing diff()
Definition: ConfigDialogue.h:361
void WriteSettings()
Stores the settings from the configuration dialog.
Definition: ConfigDialogue.cpp:3085
wxStaticText * m_mp
The text "Maxima Program" that can change color.
Definition: ConfigDialogue.h:294
wxColourPickerCtrl * m_styleColor
An example rectangle with the font color.
Definition: ConfigDialogue.h:552
wxVector< wxBitmapBundle > m_imageList
A list containing the pictograms for the tabs.
Definition: ConfigDialogue.h:622
wxChoice * m_appearanceChoice
Light / Dark / Follow-system selector (also picks which set the editor edits).
Definition: ConfigDialogue.h:549
void OnClose(wxCloseEvent &event)
Is called when the configuration dialog is closed.
Definition: ConfigDialogue.cpp:3074
wxCheckBox * m_arrowKeysSkipOutput
Up/Down skip over a cell's output instead of selecting it (GH #2382)
Definition: ConfigDialogue.h:387
~ConfigDialogue() override
The destructor.
Definition: ConfigDialogue.cpp:264
wxString m_wxStartupFileName
The name of wxMaxima's startup file.
Definition: ConfigDialogue.h:292
TextStyle m_selectedStyle
The style the style editor's controls currently show and edit.
Definition: ConfigDialogue.h:614
wxRadioBox * m_imageBackdrop
What is drawn behind transparent parts of images.
Definition: ConfigDialogue.h:376
SymbolShortcutsPanel * m_symbolShortcuts
The extra symbols and every symbol's keyboard shortcut.
Definition: ConfigDialogue.h:336
wxTextCtrl * m_startupCommands
A textbox containing maxima's startup commands.
Definition: ConfigDialogue.h:322
void OnChangeStyle(wxCommandEvent &event)
Called if a new item type that is to be styled is selected.
Definition: ConfigDialogue.cpp:3353
TextStyle GetSelectedStyle() const
Get the style currently being edited (see m_selectedStyle)
Definition: ConfigDialogue.cpp:2877
void UsesvgChanged(wxCommandEvent &event)
Is called when the path to the maxima binary was changed.
Definition: ConfigDialogue.cpp:336
wxString m_startupFileName
The name of maxima's startup file.
Definition: ConfigDialogue.h:290
wxRadioButton * m_noAutodetectMaxima
The radio button that is set if m_autodetectMaxima is unset.
Definition: ConfigDialogue.h:299
wxTextCtrl * m_wxStartupCommands
A textbox containing wxMaxima's startup commands.
Definition: ConfigDialogue.h:324
htmlExportFormats
The export formats we support for HTML equations.
Definition: ConfigDialogue.h:108
void OnChangeFontFamily(wxCommandEvent &event)
Called if the font family is changed.
Definition: ConfigDialogue.cpp:3327
wxCheckBox * m_TeXExponentsAfterSubscript
A checkbox that asks if TeX should put the exponents above or after the subscripts.
Definition: ConfigDialogue.h:359
void OnAppearanceChanged(wxCommandEvent &event)
Light / Dark / Follow-system appearance changed: re-point the style editor.
Definition: ConfigDialogue.cpp:3063
void OnTabChange(wxBookCtrlEvent &event)
Called if the currently active dialogue sheet is changed.
Definition: ConfigDialogue.cpp:3533
void OnChangeColor(wxColourPickerEvent &event)
Called if the color of an item has been changed.
Definition: ConfigDialogue.cpp:3345
void LoadSave(wxCommandEvent &event)
A "export the configuration" dialog.
Definition: ConfigDialogue.cpp:3539
Text Style Definition.
Definition: TextStyle.h:67
The extra symbols of the Symbols sidebar, and the keyboard shortcuts of every symbol (GH #2578).
Definition: SymbolShortcutsPanel.h:50
The canvas that contains the spreadsheet the whole program is about.
Definition: Worksheet.h:122
Topic
What part of the preview a setting affects.
Definition: WorksheetPreview.h:51