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"
67#ifdef WXM_USE_AI_TOOLS
79 checkbox_strikethrough,
124 const int mMinPanelWidth = 500;
125 const int mMinPanelHeight = 500;
141 GCL_MULTIPROCESS_MEMORY_POOL,
147 std::unique_ptr<Configuration> m_configuration;
164 std::unique_ptr<Configuration> m_worksheetPreviewConfiguration;
166 std::array<CellPtr<GroupCell>,
167 static_cast<size_t>(wxm::WorksheetPreview::Topic::count)> m_worksheetPreviewHeadings;
170 wxm::WorksheetPreview::Topic::labels;
172 void ApplySettingsToPreview();
180 using StringHash = std::unordered_map<wxString, wxString, wxStringHash>;
181 using Languages = std::unordered_map<wxString, long, wxStringHash>;
183 Languages m_languages;
188 class ExamplePanel :
public wxPanel
192 ExamplePanel(wxWindow *parent,
int id) : wxPanel(parent, id)
193 { Bind(wxEVT_PAINT, &ConfigDialogue::ExamplePanel::OnPaint,
this); };
196 void SetStyle(
const Style &style)
207 void OnPaint(wxPaintEvent &event);
218 void SetCheckboxValues();
223#ifdef WXM_USE_AI_TOOLS
224 wxWindow *CreateAiChatPanel();
228 wxWindow *CreatePrintPanel();
231 wxWindow *CreateRevertToDefaultsPanel();
236#if wxUSE_ACCESSIBILITY
238 wxWindow *CreateAccessibilityPanel();
241 wxCheckBox *m_screenReaderMathML;
246 wxWindow *CreateWorksheetPanel();
249 wxWindow *CreateOptionsPanel();
252 wxWindow *CreateExportPanel();
255 wxWindow *CreateStylePanel();
258 wxWindow *CreateMaximaPanel();
261 wxWindow *CreateStartupPanel();
264 wxGrid *m_maximaEnvVariables;
265 void OnImport(wxCommandEvent& event);
266 static void CopyConfig(wxConfigBase *src, wxConfigBase *dst, wxString dir = wxS(
"/"));
267 void OnReloadAll(wxCommandEvent& event);
268 void OnReloadStyles(wxCommandEvent& event);
269 void OnResetAllToDefaults(wxCommandEvent& event);
270 void OnExportAll(wxCommandEvent& event);
271 void OnResetStyles(wxCommandEvent& event);
272 void OnChangeMaximaEnvVar(wxGridEvent& event);
273 void OnMaximaEnvRightClick(wxGridEvent& event);
274 void OnMouseMotion_MaximaEnv(wxMouseEvent &event);
275 void OnNewEnvMenu(wxCommandEvent &event);
276 void OnClickMaximaEnvVal(
int row);
277 void OnChangeMaximaCellClick(wxGridEvent& event);
285 StringHash m_maximaEnvDoc;
290 wxRadioButton *m_autodetectHelpBrowser;
291 wxRadioButton *m_noAutodetectHelpBrowser;
292 wxRadioButton *m_internalHelpBrowser;
293 wxCheckBox *m_singlePageManual;
300 wxRadioButton *m_useGnuplot;
301 wxRadioButton *m_useWgnuplot;
317 wxTextCtrl *m_documentclass;
318 wxTextCtrl *m_documentclassOptions;
319 wxTextCtrl *m_texPreamble;
320 wxCheckBox *m_autoSave;
321 wxButton *m_wxMathMLBrowse;
322 wxTextCtrl *m_additionalParameters;
323 wxTextCtrl *m_mathJaxURL;
324 wxChoice *m_language;
325 wxTextCtrl *m_symbolPaneAdditionalChars;
326 wxCheckBox *m_abortOnError;
327 wxCheckBox *m_offerKnownAnswers;
328 wxCheckBox *m_restartOnReEvaluation;
329 wxCheckBox *m_wrapLatexMath;
330 wxCheckBox *m_usesvg;
331 wxCheckBox *m_antialiasLines;
332 wxSpinCtrlDouble *m_defaultFramerate;
333 wxSpinCtrl *m_defaultPlotWidth;
334 wxSpinCtrl *m_defaultPlotHeight;
335 wxSpinCtrl *m_displayedDigits;
336 wxSpinCtrl *m_printMargin_Top;
337 wxSpinCtrl *m_printMargin_Bot;
338 wxSpinCtrl *m_printMargin_Left;
339 wxSpinCtrl *m_printMargin_Right;
340 wxRadioButton *m_displayNDigits;
341 wxRadioButton *m_displayAllDigits;
342 wxRadioButton *m_linebreaksInLongNums;
355 wxCheckBox *m_printBrackets;
356 wxChoice *m_exportWithMathJAX;
357 wxCheckBox *m_matchParens;
358 wxCheckBox *m_showMatchingParens;
359 wxChoice *m_showLength;
360 wxChoice *m_autosubscript;
361 wxRadioBox *m_layoutStrategy;
366 wxRadioButton *m_enterEvaluates;
367 wxRadioButton *m_ctrlEnterEvaluates;
368 wxCheckBox *m_numpadEnterEvaluates;
369 wxCheckBox *m_saveImgFileName;
370 wxCheckBox *m_saveUntitled;
371 wxCheckBox *m_openHCaret;
372 wxCheckBox *m_insertAns;
373 wxCheckBox *m_autoIndent;
374 wxCheckBox *m_cursorJump;
377 wxCheckBox *m_hideBrackets;
381 wxCheckBox *m_overlayScrollbars;
383 wxCheckBox *m_indentMaths;
384 wxChoice *m_autoWrap;
385 wxSpinCtrl *m_labelWidth;
386 wxSpinCtrl *m_recentItems;
387 wxSpinCtrl *m_bitmapScale;
388 wxSpinCtrlDouble *m_printScale;
389 wxCheckBox *m_fixReorderedIndices;
390 wxCheckBox *m_incrementalSearch;
391 wxCheckBox *m_notifyIfIdle;
392 wxCheckBox *m_findDialogDockable;
393 wxCheckBox *m_mcpServerEnabled;
394 wxSpinCtrl *m_mcpServerPort;
395#ifdef WXM_USE_AI_TOOLS
400 struct AiProviderUiRecord {
407 wxString displayName;
421 bool forgetApiKey =
false;
427 std::vector<AiProviderUiRecord> m_aiProviderRecords;
432 int m_aiActiveProviderRecordIndex = -1;
443 wxChoice *m_aiChatProviderChoice;
447 wxStaticBoxSizer *m_aiProviderDetailBox;
448 wxStaticText *m_aiBaseUrlLabel;
451 wxTextCtrl *m_aiBaseUrlCtrl;
452 wxStaticText *m_aiShapeLabel;
453 wxChoice *m_aiShapeChoice;
457 wxStaticText *m_aiUsernameLabel;
458 wxTextCtrl *m_aiUsernameCtrl;
460 wxStaticText *m_aiKeyLabel;
461 wxTextCtrl *m_aiKeyCtrl;
469 wxComboBox *m_aiModelCtrl;
470 wxButton *m_aiRefreshModelsButton;
473 wxStaticText *m_aiModelFetchStatus;
481 std::shared_ptr<bool> m_aiUiAlive;
482 wxHyperlinkCtrl *m_aiApiKeyLink;
483 wxHyperlinkCtrl *m_aiModelListLink;
486 wxButton *m_aiRemoveCustomProviderButton;
488 wxButton *m_aiForgetKeyButton;
489 void OnAiForgetKey(wxCommandEvent &event);
491 void UpdateAiKeyHint(
const AiProviderUiRecord &rec);
493 static wxString AiApiKeyToUse(
const AiProviderUiRecord &rec);
497 void RelayoutAiChatPanel();
498 void OnAiProviderChoice(wxCommandEvent &event);
500 void OnAiUsernameChanged(wxCommandEvent &event);
503 void UpdateAiCredentialLabel();
504 void OnAiRemoveCustomProvider(wxCommandEvent &event);
505 void OnAiRefreshModels(wxCommandEvent &event);
516 void StartAiModelFetch();
520 void StashAiProviderUiIntoRecord();
524 void LoadAiProviderRecordIntoUi(
int index);
529 bool AddCustomAiProviderDialog();
533 void RebuildAiProviderChoice(
int selectIndex);
535 wxChoice *m_showUserDefinedLabels;
536 wxButton *m_getStyleFont;
539 wxListBox *m_styleFor;
542 wxCheckBox *m_boldCB;
543 wxCheckBox *m_italicCB;
544 wxCheckBox *m_slantedCB;
545 wxCheckBox *m_strikethroughCB;
546 wxCheckBox *m_underlinedCB;
547 wxCheckBox *m_fixedFontInTC;
548 wxCheckBox *m_unixCopy;
549 wxCheckBox *m_changeAsterisk;
550 wxCheckBox *m_hidemultiplicationSign;
551 wxCheckBox *m_latin2Greek;
552 wxCheckBox *m_keepPercentWithSpecials;
553 wxBookCtrlBase *m_notebook;
554 wxButton *m_saveStyle, *m_loadStyle;
555 wxSpinCtrl *m_defaultPort;
556 ExamplePanel *m_examplePanel;
557 wxSpinCtrl *m_maxGnuplotMegabytes;
558 wxSpinCtrl *m_autosaveMinutes;
559 wxSpinCtrl *m_maxLayoutTime;
560 wxTextCtrl *m_autoMathJaxURL;
561 int m_maximaEmvRightClickRow = 0;
567 void OnClose(wxCloseEvent &event);
569 void OnwxMathMLBrowse(wxCommandEvent &event);
571 void OnIdle(wxIdleEvent &event);
589 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.
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
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:96
int m_mathFontSize
The size of the maths font.
Definition: ConfigDialogue.h:608
void OnCheckbox(wxCommandEvent &event)
Called if one of the checkboxes for bold, italic or underlined is toggled.
Definition: ConfigDialogue.cpp:3513
wxCheckBox * m_digitGrouping
Separate the digit groups of numbers by a small gap? (GH #192)
Definition: ConfigDialogue.h:344
wxRadioButton * m_noAutodetectMathJaX
The radio button that is set if m_autodetectMathJaX is unset.
Definition: ConfigDialogue.h:299
wxCheckBox * m_exportContainsWXMX
A checkbox that asks if all newlines in text cells have to be passed to HTML.
Definition: ConfigDialogue.h:352
void OnStyleToEditChanged(wxCommandEvent &event)
Called if the user changes the style that is to be edited.
Definition: ConfigDialogue.cpp:3071
wxCheckBox * m_maximaHelpInConsole
Does Maxima answer ?, ?? and describe() on the console?
Definition: ConfigDialogue.h:295
wxRadioBox * m_oversizedMatrices
How to show a matrix too large for the window.
Definition: ConfigDialogue.h:363
wxRadioButton * m_autodetectMathJaX
Autodetect the mathJaX location?
Definition: ConfigDialogue.h:297
wxRadioButton * m_autodetectMaxima
Autodetect the maxima location?
Definition: ConfigDialogue.h:287
void OnChangeWarning(wxCommandEvent &event)
A message dialog that appears if a change cannot be applied now.
Definition: ConfigDialogue.cpp:3530
void UpdateExample()
Sets the style example's style on style changes.
Definition: ConfigDialogue.cpp:3536
wxSpinCtrl * m_digitGroupingMinDigits
How many digits a number needs before its digits are grouped.
Definition: ConfigDialogue.h:346
int m_fontSize
The size of the text font.
Definition: ConfigDialogue.h:606
wxCheckBox * m_htmlExportSelfContained
Embed images and the .wxmx into the exported .html file.
Definition: ConfigDialogue.h:354
wxCheckBox * m_usePartialForDiff
A checkbox that asks if TeX should use the \partial symbol for representing diff()
Definition: ConfigDialogue.h:350
void WriteSettings()
Stores the settings from the configuration dialog.
Definition: ConfigDialogue.cpp:3105
wxStaticText * m_mp
The text "Maxima Program" that can change color.
Definition: ConfigDialogue.h:284
wxColourPickerCtrl * m_styleColor
An example rectangle with the font color.
Definition: ConfigDialogue.h:541
wxVector< wxBitmapBundle > m_imageList
A list containing the pictograms for the tabs.
Definition: ConfigDialogue.h:611
wxChoice * m_appearanceChoice
Light / Dark / Follow-system selector (also picks which set the editor edits).
Definition: ConfigDialogue.h:538
void OnClose(wxCloseEvent &event)
Is called when the configuration dialog is closed.
Definition: ConfigDialogue.cpp:3094
wxCheckBox * m_arrowKeysSkipOutput
Up/Down skip over a cell's output instead of selecting it (GH #2382)
Definition: ConfigDialogue.h:376
wxString m_wxStartupFileName
The name of wxMaxima's startup file.
Definition: ConfigDialogue.h:282
TextStyle m_selectedStyle
The style the style editor's controls currently show and edit.
Definition: ConfigDialogue.h:603
wxRadioBox * m_imageBackdrop
What is drawn behind transparent parts of images.
Definition: ConfigDialogue.h:365
wxTextCtrl * m_startupCommands
A textbox containing maxima's startup commands.
Definition: ConfigDialogue.h:312
void OnChangeStyle(wxCommandEvent &event)
Called if a new item type that is to be styled is selected.
Definition: ConfigDialogue.cpp:3377
TextStyle GetSelectedStyle() const
Get the style currently being edited (see m_selectedStyle)
Definition: ConfigDialogue.cpp:2897
void UsesvgChanged(wxCommandEvent &event)
Is called when the path to the maxima binary was changed.
Definition: ConfigDialogue.cpp:386
wxString m_startupFileName
The name of maxima's startup file.
Definition: ConfigDialogue.h:280
wxRadioButton * m_noAutodetectMaxima
The radio button that is set if m_autodetectMaxima is unset.
Definition: ConfigDialogue.h:289
wxTextCtrl * m_wxStartupCommands
A textbox containing wxMaxima's startup commands.
Definition: ConfigDialogue.h:314
htmlExportFormats
The export formats we support for HTML equations.
Definition: ConfigDialogue.h:106
~ConfigDialogue()
The destructor.
Definition: ConfigDialogue.cpp:317
void OnChangeFontFamily(wxCommandEvent &event)
Called if the font family is changed.
Definition: ConfigDialogue.cpp:3351
wxCheckBox * m_TeXExponentsAfterSubscript
A checkbox that asks if TeX should put the exponents above or after the subscripts.
Definition: ConfigDialogue.h:348
void OnAppearanceChanged(wxCommandEvent &event)
Light / Dark / Follow-system appearance changed: re-point the style editor.
Definition: ConfigDialogue.cpp:3083
void OnTabChange(wxBookCtrlEvent &event)
Called if the currently active dialogue sheet is changed.
Definition: ConfigDialogue.cpp:3556
void OnChangeColor(wxColourPickerEvent &event)
Called if the color of an item has been changed.
Definition: ConfigDialogue.cpp:3369
void LoadSave(wxCommandEvent &event)
A "export the configuration" dialog.
Definition: ConfigDialogue.cpp:3562
Text Style Definition.
Definition: TextStyle.h:67
The canvas that contains the spreadsheet the whole program is about.
Definition: Worksheet.h:121
Topic
What part of the preview a setting affects.
Definition: WorksheetPreview.h:50