wxMaxima
Loading...
Searching...
No Matches
Enumerations | Functions
ToolBarSections.h File Reference

The sections the main toolbar is made of, and the order they are shown in. More...

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

Go to the source code of this file.

Enumerations

enum class  ToolBarSections::Section {
  New , OpenSave , Print , UndoRedo ,
  Options , CopyPaste , SelectAll , Search ,
  MaximaControl , Evaluate , HideCode , CellStyle ,
  TextFormat , Animation , FlexibleSpace , Help
}
 A section of the main toolbar. More...
 

Functions

const std::vector< Section > & ToolBarSections::DefaultOrder ()
 All sections, in the order a new installation shows them in.
 
wxString ToolBarSections::Key (Section section)
 The name a section is stored under in the config file. Never translated.
 
wxString ToolBarSections::VisibilityConfigKey (Section section)
 The config key that says if a section is shown.
 
bool ToolBarSections::ShownByDefault (Section section)
 Is this section shown if the user never said otherwise?
 
std::vector< Section > ToolBarSections::ParseOrder (const wxString &stored)
 Turns a stored order into a complete one.
 
wxString ToolBarSections::OrderToString (const std::vector< Section > &order)
 The comma-separated list of Key()s ParseOrder() reads back.
 
bool ToolBarSections::SeparatorBetween (Section left, Section right)
 Does the toolbar need a separator between these two neighbouring sections?
 

Detailed Description

The sections the main toolbar is made of, and the order they are shown in.

The toolbar is built from a list of sections – groups of buttons that belong together, like "Open and Save" or the evaluation buttons – in an order the user can change in the configuration dialogue. Every section can also be hidden.

This file is pure bookkeeping, without any GUI and without the config file, so that it can be tested directly: what ToolBar::AddTools() does with it lives in ToolBar.cpp, and what the user sees of it in ConfigDialogue.cpp.

Enumeration Type Documentation

◆ Section

enum class ToolBarSections::Section
strong

A section of the main toolbar.

The numerical values are never stored anywhere (the config file holds Key()s instead), so new sections can be inserted at any position.

Enumerator
New 

The "New document" button.

OpenSave 

The "Open" and "Save" buttons.

Print 

The "Print" button.

UndoRedo 

The "Undo" and "Redo" buttons.

Options 

The button that opens the configuration dialogue.

CopyPaste 

"Cut", "Copy" and "Paste"

SelectAll 

The "Select all" button.

Search 

The "Find and replace" button.

MaximaControl 

"Restart Maxima", "Interrupt" and "Follow"

Evaluate 

The four evaluation buttons.

HideCode 

The "Hide code" button.

CellStyle 

The drop-down list that sets the type of the current cell.

TextFormat 

Bold, italic, underline and strikethrough for text cells.

Animation 

The animation start/stop button and the animation slider.

FlexibleSpace 

Empty space that pushes everything after it to the right.

Help 

The "Help" button.

Function Documentation

◆ ParseOrder()

std::vector< Section > ToolBarSections::ParseOrder ( const wxString &  stored)

Turns a stored order into a complete one.

Unknown names (from a newer wxMaxima, or a typo in a hand-edited config file) and duplicates are dropped. Sections the stored order doesn't mention (because it was written by a wxMaxima that didn't know them yet) are inserted after the section they follow in DefaultOrder(), so a new section shows up next to its neighbours instead of at the very end. The result therefore always contains every section exactly once.

Parameters
storedA comma-separated list of Key()s; empty means "the default".

◆ SeparatorBetween()

bool ToolBarSections::SeparatorBetween ( Section  left,
Section  right 
)

Does the toolbar need a separator between these two neighbouring sections?

Sections that belong together (New, Open/Save; Cut/Copy/Paste and Select all; the cell type and the text formatting and animation controls) aren't separated, which is how the toolbar always looked. Nothing is separated from the flexible space, which already separates.