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>
43#include <wx/propdlg.h>
44#include <wx/generic/propdlg.h>
45#include <wx/spinctrl.h>
46#include <wx/notebook.h>
48#include <wx/imaglist.h>
49#include <wx/bookctrl.h>
50#include <wx/artprov.h>
51#include <unordered_map>
53#include <wx/hyperlink.h>
55#ifndef CONFIGDIALOGUE_H
56#define CONFIGDIALOGUE_H
60#include "../Configuration.h"
71 checkbox_strikethrough,
116 const int mMinPanelWidth = 500;
117 const int mMinPanelHeight = 500;
133 GCL_MULTIPROCESS_MEMORY_POOL,
138 std::unique_ptr<
struct wxm_NSVGrasterizer, decltype(std::free)*> m_svgRast{
nullptr, std::free};
140 std::unique_ptr<Configuration> m_configuration;
143 typedef std::unordered_map <wxString, wxString, wxStringHash> StringHash;
144 typedef std::unordered_map <wxString, long, wxStringHash> Languages;
146 Languages m_languages;
151 class ExamplePanel :
public wxPanel
155 ExamplePanel(wxWindow *parent,
int id, wxPoint pos, wxSize size) : wxPanel(parent, id, pos, size)
156 { Bind(wxEVT_PAINT, &ConfigDialogue::ExamplePanel::OnPaint,
this); };
159 void SetStyle(
const Style &style)
170 void OnPaint(wxPaintEvent &event);
181 void SetCheckboxValues();
187 wxWindow *CreateClipboardPanel();
188 wxWindow *CreateAiChatPanel();
191 wxWindow *CreatePrintPanel();
194 wxWindow *CreateRevertToDefaultsPanel();
196#if wxUSE_ACCESSIBILITY
198 wxWindow *CreateAccessibilityPanel();
201 wxCheckBox *m_screenReaderMathML;
204 wxCheckBox *m_copyBitmap, *m_copyMathML, *m_copyMathMLHTML, *m_copyRTF, *m_copySVG;
205#if wxUSE_ENH_METAFILE
206 wxCheckBox *m_copyEMF;
210 wxWindow *CreateWorksheetPanel();
213 wxWindow *CreateOptionsPanel();
216 wxWindow *CreateExportPanel();
219 wxWindow *CreateStylePanel();
222 wxWindow *CreateMaximaPanel();
225 wxWindow *CreateStartupPanel();
228 wxGrid *m_maximaEnvVariables;
229 void OnImport(wxCommandEvent& event);
230 static void CopyConfig(wxConfigBase *src, wxConfigBase *dst, wxString dir = wxS(
"/"));
231 void OnReloadAll(wxCommandEvent& event);
232 void OnReloadStyles(wxCommandEvent& event);
233 void OnResetAllToDefaults(wxCommandEvent& event);
234 void OnExportAll(wxCommandEvent& event);
235 void OnResetStyles(wxCommandEvent& event);
236 void OnChangeMaximaEnvVar(wxGridEvent& event);
237 void OnMaximaEnvRightClick(wxGridEvent& event);
238 void OnMouseMotion_MaximaEnv(wxMouseEvent &event);
239 void OnNewEnvMenu(wxCommandEvent &event);
240 void OnClickMaximaEnvVal(
int row);
241 void OnChangeMaximaCellClick(wxGridEvent& event);
249 StringHash m_maximaEnvDoc;
254 wxRadioButton *m_autodetectHelpBrowser;
255 wxRadioButton *m_noAutodetectHelpBrowser;
256 wxRadioButton *m_internalHelpBrowser;
257 wxCheckBox *m_singlePageManual;
258 wxRadioButton *m_maximaUsesInternalHelp;
259 wxRadioButton *m_maximaUsesHtmlHelp;
260 wxRadioButton *m_maximaUsesWxmaximaHelp;
265 wxRadioButton *m_useGnuplot;
266 wxRadioButton *m_useWgnuplot;
282 wxTextCtrl *m_documentclass;
283 wxTextCtrl *m_documentclassOptions;
284 wxTextCtrl *m_texPreamble;
285 wxCheckBox *m_autoSave;
286 wxButton *m_wxMathMLBrowse;
287 wxTextCtrl *m_additionalParameters;
288 wxTextCtrl *m_mathJaxURL;
289 wxChoice *m_language;
290 wxTextCtrl *m_symbolPaneAdditionalChars;
291 wxCheckBox *m_abortOnError;
292 wxCheckBox *m_offerKnownAnswers;
293 wxCheckBox *m_restartOnReEvaluation;
294 wxCheckBox *m_wrapLatexMath;
295 wxCheckBox *m_usesvg;
296 wxCheckBox *m_antialiasLines;
297 wxSpinCtrlDouble *m_defaultFramerate;
298 wxSpinCtrl *m_defaultPlotWidth;
299 wxSpinCtrl *m_defaultPlotHeight;
300 wxSpinCtrl *m_displayedDigits;
301 wxSpinCtrl *m_printMargin_Top;
302 wxSpinCtrl *m_printMargin_Bot;
303 wxSpinCtrl *m_printMargin_Left;
304 wxSpinCtrl *m_printMargin_Right;
305 wxRadioButton *m_displayNDigits;
306 wxRadioButton *m_displayAllDigits;
307 wxRadioButton *m_linebreaksInLongNums;
308 wxSpinCtrl *m_maxClipbrdBitmapMegabytes;
315 wxCheckBox *m_printBrackets;
316 wxChoice *m_exportWithMathJAX;
317 wxCheckBox *m_matchParens;
318 wxCheckBox *m_showMatchingParens;
319 wxChoice *m_showLength;
320 wxChoice *m_autosubscript;
321 wxRadioBox *m_layoutStrategy;
322 wxRadioButton *m_enterEvaluates;
323 wxRadioButton *m_ctrlEnterEvaluates;
324 wxCheckBox *m_numpadEnterEvaluates;
325 wxCheckBox *m_saveImgFileName;
326 wxCheckBox *m_saveUntitled;
327 wxCheckBox *m_openHCaret;
328 wxCheckBox *m_insertAns;
329 wxCheckBox *m_autoIndent;
330 wxCheckBox *m_cursorJump;
331 wxCheckBox *m_hideBrackets;
335 wxCheckBox *m_overlayScrollbars;
337 wxCheckBox *m_indentMaths;
338 wxChoice *m_autoWrap;
339 wxSpinCtrl *m_labelWidth;
340 wxSpinCtrl *m_recentItems;
341 wxSpinCtrl *m_bitmapScale;
342 wxSpinCtrlDouble *m_printScale;
343 wxCheckBox *m_fixReorderedIndices;
344 wxCheckBox *m_incrementalSearch;
345 wxCheckBox *m_notifyIfIdle;
346 wxCheckBox *m_findDialogDockable;
347 wxCheckBox *m_mcpServerEnabled;
348 wxSpinCtrl *m_mcpServerPort;
368 std::vector<AiProviderUiRecord> m_aiProviderRecords;
374 wxChoice *m_aiChatProviderChoice;
379 wxStaticText *m_aiBaseUrlLabel;
383 wxStaticText *m_aiShapeLabel;
384 wxChoice *m_aiShapeChoice;
385 wxTextCtrl *m_aiKeyCtrl;
386 wxTextCtrl *m_aiModelCtrl;
387 wxHyperlinkCtrl *m_aiApiKeyLink;
388 wxHyperlinkCtrl *m_aiModelListLink;
392 void OnAiProviderChoice(wxCommandEvent &event);
393 void OnAiRemoveCustomProvider(wxCommandEvent &event);
411 wxChoice *m_showUserDefinedLabels;
412 wxButton *m_getStyleFont;
415 wxListBox *m_styleFor;
418 wxCheckBox *m_boldCB;
419 wxCheckBox *m_italicCB;
420 wxCheckBox *m_slantedCB;
421 wxCheckBox *m_strikethroughCB;
422 wxCheckBox *m_underlinedCB;
423 wxCheckBox *m_fixedFontInTC;
424 wxCheckBox *m_unixCopy;
425 wxCheckBox *m_changeAsterisk;
426 wxCheckBox *m_hidemultiplicationSign;
427 wxCheckBox *m_latin2Greek;
428 wxCheckBox *m_useUnicodeMaths;
429 wxCheckBox *m_keepPercentWithSpecials;
430 wxBookCtrlBase *m_notebook;
431 wxButton *m_saveStyle, *m_loadStyle;
432 wxSpinCtrl *m_defaultPort;
433 ExamplePanel *m_examplePanel;
434 wxSpinCtrl *m_maxGnuplotMegabytes;
435 wxSpinCtrl *m_autosaveMinutes;
436 wxSpinCtrl *m_maxLayoutTime;
437 wxTextCtrl *m_autoMathJaxURL;
438 int m_maximaEmvRightClickRow = 0;
444 void OnClose(wxCloseEvent &event);
446 void OnwxMathMLBrowse(wxCommandEvent &event);
448 void OnIdle(wxIdleEvent &event);
466 void LoadSave(wxCommandEvent &event);
477#if wxCHECK_VERSION(3, 1, 6)
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:71
AiProviderKind
Which AI service to talk to. Persisted as a plain int in Configuration; keep existing values stable a...
Definition: AiProvider.h:58
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:235
This file defines the class Worksheet.
A dialog that shows the program's license.
Definition: BinaryNameCtrl.h:40
The configuration dialog.
Definition: ConfigDialogue.h:88
void StashAiProviderUiIntoRecord()
Copies the on-screen key/model/(baseUrl/shape for Custom) fields back into m_aiProviderRecords[m_aiAc...
Definition: ConfigDialogue.cpp:2136
int m_mathFontSize
The size of the maths font.
Definition: ConfigDialogue.h:474
void OnCheckbox(wxCommandEvent &event)
Called if one of the checkboxes for bold, italic or underlined is toggled.
Definition: ConfigDialogue.cpp:3104
bool AddCustomAiProviderDialog()
Opens a small modal to create a new custom provider (name/shape/ baseUrl/model); on success appends i...
Definition: ConfigDialogue.cpp:2239
wxRadioButton * m_noAutodetectMathJaX
The radio button that is set if m_autodetectMathJaX is unset.
Definition: ConfigDialogue.h:264
wxCheckBox * m_exportContainsWXMX
A checkbox that asks if all newlines in text cells have to be passed to HTML.
Definition: ConfigDialogue.h:314
void LoadAiProviderRecordIntoUi(int index)
The inverse: populates the shared detail box from m_aiProviderRecords[index], showing/hiding the Cust...
Definition: ConfigDialogue.cpp:2154
std::unique_ptr< wxImageList > m_imageList
A list containing the pictograms for the tabs.
Definition: ConfigDialogue.h:480
void OnStyleToEditChanged(wxCommandEvent &event)
Called if the user changes the style that is to be edited.
Definition: ConfigDialogue.cpp:2670
wxRadioButton * m_autodetectMathJaX
Autodetect the mathJaX location?
Definition: ConfigDialogue.h:262
wxRadioButton * m_autodetectMaxima
Autodetect the maxima location?
Definition: ConfigDialogue.h:251
void OnChangeWarning(wxCommandEvent &event)
A message dialog that appears if a change cannot be applied now.
Definition: ConfigDialogue.cpp:3121
void UpdateExample()
Sets the style example's style on style changes.
Definition: ConfigDialogue.cpp:3127
int m_aiActiveProviderRecordIndex
Index into m_aiProviderRecords of whichever one m_aiKeyCtrl/ m_aiModelCtrl/... currently display,...
Definition: ConfigDialogue.h:373
wxStaticBoxSizer * m_aiProviderDetailBox
One reusable box showing whichever provider is currently selected, rather than all of them stacked at...
Definition: ConfigDialogue.h:378
int m_fontSize
The size of the text font.
Definition: ConfigDialogue.h:472
wxCheckBox * m_usePartialForDiff
A checkbox that asks if TeX should use the \partial symbol for representing diff()
Definition: ConfigDialogue.h:312
void WriteSettings()
Stores the settings from the configuration dialog.
Definition: ConfigDialogue.cpp:2698
wxStaticText * m_mp
The text "Maxima Program" that can change color.
Definition: ConfigDialogue.h:248
wxColourPickerCtrl * m_styleColor
An example rectangle with the font color.
Definition: ConfigDialogue.h:417
wxChoice * m_appearanceChoice
Light / Dark / Follow-system selector (also picks which set the editor edits).
Definition: ConfigDialogue.h:414
void OnClose(wxCloseEvent &event)
Is called when the configuration dialog is closed.
Definition: ConfigDialogue.cpp:2687
wxString m_wxStartupFileName
The name of wxMaxima's startup file.
Definition: ConfigDialogue.h:246
wxTextCtrl * m_aiBaseUrlCtrl
Editable only for a Custom record; shows (read-only, via Disable()) the fixed URL for a built-in one,...
Definition: ConfigDialogue.h:382
wxTextCtrl * m_startupCommands
A textbox containing maxima's startup commands.
Definition: ConfigDialogue.h:277
void OnChangeStyle(wxCommandEvent &event)
Called if a new item type that is to be styled is selected.
Definition: ConfigDialogue.cpp:2968
TextStyle GetSelectedStyle() const
Get the style currently selected in the m_styleFor control.
Definition: ConfigDialogue.cpp:2499
void UsesvgChanged(wxCommandEvent &event)
Is called when the path to the maxima binary was changed.
Definition: ConfigDialogue.cpp:356
wxString m_startupFileName
The name of maxima's startup file.
Definition: ConfigDialogue.h:244
wxRadioButton * m_noAutodetectMaxima
The radio button that is set if m_autodetectMaxima is unset.
Definition: ConfigDialogue.h:253
wxTextCtrl * m_wxStartupCommands
A textbox containing wxMaxima's startup commands.
Definition: ConfigDialogue.h:279
htmlExportFormats
The export formats we support for HTML equations.
Definition: ConfigDialogue.h:98
wxButton * m_aiRemoveCustomProviderButton
Shown only for a Custom record; deletes it (and its stored API key) outright rather than just clearin...
Definition: ConfigDialogue.h:391
void RebuildAiProviderChoice(int selectIndex)
Rebuilds m_aiChatProviderChoice's items from m_aiProviderRecords (plus the fixed "None (disabled)" an...
Definition: ConfigDialogue.cpp:2123
~ConfigDialogue()
The destructor.
Definition: ConfigDialogue.cpp:344
void OnChangeFontFamily(wxCommandEvent &event)
Called if the font family is changed.
Definition: ConfigDialogue.cpp:2942
wxCheckBox * m_TeXExponentsAfterSubscript
A checkbox that asks if TeX should put the exponents above or after the subscripts.
Definition: ConfigDialogue.h:310
void OnAppearanceChanged(wxCommandEvent &event)
Light / Dark / Follow-system appearance changed: re-point the style editor.
Definition: ConfigDialogue.cpp:2676
void OnTabChange(wxBookCtrlEvent &event)
Called if the currently active dialogue sheet is changed.
Definition: ConfigDialogue.cpp:3147
void OnChangeColor(wxColourPickerEvent &event)
Called if the color of an item has been changed.
Definition: ConfigDialogue.cpp:2960
void LoadSave(wxCommandEvent &event)
A "export the configuration" dialog.
Definition: ConfigDialogue.cpp:3153
Text Style Definition.
Definition: TextStyle.h:67
The canvas that contains the spreadsheet the whole program is about.
Definition: Worksheet.h:116
One entry per configurable provider – the four built-ins (in fixed order) plus any custom ones – kept...
Definition: ConfigDialogue.h:353
wxString customId
Only set when kind == AiProviderKind::Custom; matches AiCustomProviderConfig::id.
Definition: ConfigDialogue.h:357
AiProviderShape shape
Meaningful only when kind == Custom – a built-in's shape/URL are implied by its kind and never shown ...
Definition: ConfigDialogue.h:363
wxString displayName
Shown in m_aiChatProviderChoice; AiProviderKindName(kind) for a built-in, user-chosen for a custom on...
Definition: ConfigDialogue.h:360