wxMaxima
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Data Fields | Protected Member Functions | Static Protected Attributes
ToolBar Class Reference
Inheritance diagram for ToolBar:
[legend]
Collaboration diagram for ToolBar:
[legend]

Public Types

enum  AnimationStartStopState { Running , Stopped , Inactive }
 All states the "start/stop animation" toolbar button can be in. More...
 
enum  Event {
  plot_slider_id = 5500 , tb_interrupt , tb_follow , tb_eval ,
  tb_eval_all , tb_evaltillhere , tb_evaluate_rest , tb_animation_startStop ,
  tb_animation_start , tb_animation_stop , tb_hideCode , tb_changeStyle ,
  menu_restart_id , tb_bold , tb_italic , tb_underline ,
  tb_strikethrough , tb_superscript , tb_subscript
}
 A list of all events the Toolbar can receive. More...
 

Public Member Functions

 ToolBar (wxWindow *parent)
 
void EnableTool (int toolId, bool state)
 Enable or disable a tool, and repaint the toolbar if that changed anything.
 
void SetToolBitmap (int toolId, const wxBitmapBundle &bitmap)
 Change a tool's icon, and repaint the toolbar so the change shows at once (wxAuiToolBar::SetToolBitmap() doesn't repaint either, see EnableTool())
 
void ShowUserInputBitmap ()
 Show that user input is needed for maxima to continue.
 
void ShowFollowBitmap ()
 Stop showing that user input is needed for maxima to continue.
 
void AnimationButtonState (AnimationStartStopState state)
 
void CanUndo (bool value)
 
void CanRedo (bool value)
 
void CanCopy (bool value)
 
void CanCut (bool value)
 
void CanSave (bool value)
 
void CanPrint (bool value)
 
void CanEvalTillHere (bool value)
 
void CanEvalThisCell (bool value)
 
void TextFormatState (bool value, TextFormat::Format active)
 Enable the character formatting buttons (only in a text cell)
 
void WorksheetEmpty (bool value)
 
void UpdateSlider (AnimationCell *cell)
 Updates the slider to match the Slide Show cell.
 
int GetIdealHeight ()
 
void AddTools ()
 Remove all ools and then add all tools that are requested/fit in the toolbar/...
 
GroupType GetCellType ()
 Get the cell style for new cells.
 
void SetCellStyle (GroupType style)
 Set the cell style to show for the current cell.
 
void UnsetCellStyle ()
 Called if there is no cell to show the style for.
 
void SetDefaultCellStyle (GroupType style)
 Set the default cell style for new cells.
 
void SetDefaultCellStyle ()
 The current style is the new style for new cells.
 
void UpdateBitmaps ()
 Update the bitmaps on ppi changes.
 
wxBitmap GetEvalAllBitmap (wxSize siz)
 
wxBitmap GetEvalBitmap (wxSize siz)
 
wxBitmap GetPreferencesBitmap (wxSize siz)
 
wxBitmap GetSelectAllBitmap (wxSize siz)
 
wxBitmap GetRestartBitmap (wxSize siz)
 
wxBitmap GetInterruptBitmap (wxSize siz)
 
wxBitmap GetEvalTillHereBitmap (wxSize siz)
 
wxBitmap GetEvalRestBitmap (wxSize siz)
 
wxSize GetOptimalBitmapSize ()
 
wxSize GetPPI ()
 

Static Public Member Functions

static int SectionMenuId (ToolBarSections::Section section)
 The id of a section's entry in the toolbar's context menu.
 
static bool ShowSection (ToolBarSections::Section section)
 Is a toolbar section shown? See ToolBarSections.
 
static void ShowSection (ToolBarSections::Section section, bool show)
 Show or hide a toolbar section. Takes effect on the next AddTools().
 
static std::vector< ToolBarSections::Section > SectionOrder ()
 The order the toolbar sections are shown in, from the config.
 
static void SectionOrder (const std::vector< ToolBarSections::Section > &order)
 Store the order of the toolbar sections. Takes effect on the next AddTools().
 
static wxString SectionName (ToolBarSections::Section section)
 The (translated) name of a toolbar section, as the user sees it.
 

Data Fields

wxSlider * m_plotSlider = nullptr
 The slider for animations.
 
wxBitmap m_undoIcon
 
wxBitmap m_redoIcon
 
wxBitmap m_followIcon
 
wxBitmap m_needsInformationIcon
 
wxBitmap m_PlayButton
 
wxBitmap m_StopButton
 

Protected Member Functions

void AddSection (ToolBarSections::Section section)
 Add the tools of one section of the toolbar.
 
void OnSize (wxSizeEvent &event)
 
void OnMouseRightDown (wxMouseEvent &event)
 
void OnMenu (wxCommandEvent &event)
 

Static Protected Attributes

static constexpr int section_menu_first = 6000
 The first id of the sections' entries in the context menu.
 

Member Enumeration Documentation

◆ AnimationStartStopState

All states the "start/stop animation" toolbar button can be in.

Enumerator
Running 

The animation is running.

Stopped 

The animation is stopped.

Inactive 

No animation is currently running.

◆ Event

A list of all events the Toolbar can receive.

Enumerator
tb_bold 

The character formatting buttons for text cells (GH #492)

Member Function Documentation

◆ EnableTool()

void ToolBar::EnableTool ( int  toolId,
bool  state 
)
inline

Enable or disable a tool, and repaint the toolbar if that changed anything.

wxAuiToolBar::EnableTool() only flips a flag in the tool's state: unlike wxToolBar it neither refreshes nor repaints, so the button kept showing its old state until something else happened to repaint the toolbar - typically the mouse pointer entering it and triggering the hover highlight. This was most visible on the "return to the cell being evaluated" button, which is enabled from a scroll handler while the pointer is over the worksheet. The base class' method isn't virtual, so this hides it rather than overriding it: every caller in wxMaxima goes through a ToolBar pointer and therefore reaches this one.

◆ SectionMenuId()

static int ToolBar::SectionMenuId ( ToolBarSections::Section  section)
inlinestatic

The id of a section's entry in the toolbar's context menu.

The ids are only used in that menu, so they needn't be distinct from the tools' own ids.

◆ TextFormatState()

void ToolBar::TextFormatState ( bool  value,
TextFormat::Format  active 
)

Enable the character formatting buttons (only in a text cell)

Parameters
valueCan the text the cursor is in be formatted?
activeThe formats that are on where the cursor is (TextFormat::Bold, ...). Shown as the buttons being pressed.

The documentation for this class was generated from the following files: