wxMaxima
Loading...
Searching...
No Matches
Data Structures | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
CharButton Class Reference

This class generates a pane containing the last commands that were issued. More...

#include <CharButton.h>

Inheritance diagram for CharButton:
[legend]
Collaboration diagram for CharButton:
[legend]

Data Structures

struct  Definition
 A definition of this button, used to construct it. More...
 

Public Member Functions

 CharButton (wxWindow *parent, wxWindow *worksheet, Configuration *config, const Definition &def, bool forceShow=false)
 A flat, compact button for the greek and the symbols pane.
 
wxWindow * GetTextObject () const
 
const wxString & GetSymbol () const
 The symbol this button enters.
 
void UpdateToolTip ()
 Shows the symbol's keyboard shortcut, if it has one, in the tooltip.
 
void ActivateButton ()
 Emit this button's symbol to the worksheet – the button's action, shared by the mouse handler and the accessibility "Press" default action.
 
void UpdateMinSize ()
 Sets the min size the button needs to show its symbol.
 

Static Public Member Functions

static CharButton * FromEventObject (wxObject *object)
 The button a mouse event in a sidebar happened on, or nullptr.
 
static bool EditShortcut (wxWindow *parent, Configuration *configuration, const wxString &symbol)
 Asks for the keyboard shortcut that types symbol and stores it.
 
static wxString AppendShortcutMenuItem (wxMenu *menu, const wxMouseEvent &event)
 Adds the "Keyboard shortcut for..." entry to a sidebar's context menu.
 

Protected Member Functions

void CharButtonPressed (wxMouseEvent &event)
 
void OnSize (wxSizeEvent &event)
 
void OnIdleEvent (wxIdleEvent &event)
 
void MouseOverPanel (wxMouseEvent &event)
 
void MouseOverText (wxMouseEvent &event)
 
void MouseLeftPanel (wxMouseEvent &event)
 
void MouseLeftText (wxMouseEvent &event)
 
void MouseOverTextIs (bool mouseOver=true)
 
void MouseOverPanelIs (bool mouseOver=true)
 

Protected Attributes

wxString m_symbol
 
Configuration * m_configuration
 
wxString m_description
 
wxString m_toolTipBase
 The tooltip without the keyboard shortcut.
 
wxString m_toolTip
 The tooltip as last set.
 

Detailed Description

This class generates a pane containing the last commands that were issued.

Constructor & Destructor Documentation

◆ CharButton()

CharButton::CharButton ( wxWindow *  parent,
wxWindow *  worksheet,
Configuration *  config,
const Definition &  def,
bool  forceShow = false 
)

A flat, compact button for the greek and the symbols pane.

Parameters
parentThe parent panel/window
worksheetThe worksheet this button sends char events to
defThe definition of the button

Member Function Documentation

◆ AppendShortcutMenuItem()

wxString CharButton::AppendShortcutMenuItem ( wxMenu *  menu,
const wxMouseEvent &  event 
)
static

Adds the "Keyboard shortcut for..." entry to a sidebar's context menu.

if the right click that opens it was on a button. Returns the symbol of that button, which the sidebar keeps until the entry is chosen, or an empty string.

◆ EditShortcut()

bool CharButton::EditShortcut ( wxWindow *  parent,
Configuration *  configuration,
const wxString &  symbol 
)
static

Asks for the keyboard shortcut that types symbol and stores it.

Returns whether the shortcut changed.

◆ FromEventObject()

CharButton * CharButton::FromEventObject ( wxObject *  object)
static

The button a mouse event in a sidebar happened on, or nullptr.

The event may come from the button or from the text inside it.

◆ UpdateMinSize()

void CharButton::UpdateMinSize ( )

Sets the min size the button needs to show its symbol.

Called from the constructor, so the size is known before the button ever receives a size event, and again on every size event, in case the font or the scale factor has changed since.

◆ UpdateToolTip()

void CharButton::UpdateToolTip ( )

Shows the symbol's keyboard shortcut, if it has one, in the tooltip.

Also runs whenever the mouse enters the button, so the tooltip is never behind a shortcut changed elsewhere.


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