wxMaxima
Loading...
Searching...
No Matches
CharButton.h
Go to the documentation of this file.
1// -*- mode: c++; c-file-style: "linux"; c-basic-offset: 2; indent-tabs-mode: nil -*-
2//
3// Copyright (C) 2009-2015 Andrej Vodopivec <andrej.vodopivec@gmail.com>
4// (C) 2014-2015 Gunter Königsmann <wxMaxima@physikbuch.de>
5//
6// This program is free software; you can redistribute it and/or modify
7// it under the terms of the GNU General Public License as published by
8// the Free Software Foundation; either version 2 of the License, or
9// (at your option) any later version.
10//
11// This program is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14// GNU General Public License for more details.
15//
16//
17// You should have received a copy of the GNU General Public License
18// along with this program; if not, write to the Free Software
19// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20//
21// SPDX-License-Identifier: GPL-2.0+
22
23#ifndef CHARBUTTON_H
24#define CHARBUTTON_H
25
31#include "precomp.h"
32#include "StringUtils.h"
33#include "Configuration.h"
34#include <wx/panel.h>
35#include <wx/stattext.h>
36
40class CharButton : public wxPanel
41{
42public:
45 {
46 wchar_t symbol = {};
47 const wxString description = wxm::emptyString;
48 bool matchesMaximaCommand = false;
49 };
50
57 CharButton(wxWindow *parent, wxWindow *worksheet, Configuration *config,
58 const Definition &def,
59 bool forceShow = false);
60 wxWindow *GetTextObject() const { return m_buttonText; }
61protected:
62 wchar_t m_char;
63 Configuration *m_configuration;
64 void CharButtonPressed(wxCommandEvent &event);
65 void OnSize(wxSizeEvent &event);
66 void OnIdleEvent(wxIdleEvent &event);
67 void MouseOverPanel(wxMouseEvent &event);
68 void MouseOverText(wxMouseEvent &event);
69 void MouseLeftPanel(wxMouseEvent &event);
70 void MouseLeftText(wxMouseEvent &event);
71protected:
72 void MouseOverTextIs(bool mouseOver = true);
73 void MouseOverPanelIs(bool mouseOver = true);
74 wxString m_description;
75
76private:
77 bool m_mouseOverPanel = false;
78 bool m_mouseOverText = false;
79 bool m_backgroundColorChangeNeeded = false;
80 wxStaticText *m_buttonText;
81 wxWindow *m_worksheet;
82};
83
84#endif // CHARBUTTON_H
This class generates a pane containing the last commands that were issued.
Definition: CharButton.h:41
The configuration storage for the current worksheet.
Definition: Configuration.h:85
A definition of this button, used to construct it.
Definition: CharButton.h:45
wchar_t symbol
The unicode symbol.
Definition: CharButton.h:46
bool matchesMaximaCommand
Whether this symbol is automatically translated into a maxima command/operator.
Definition: CharButton.h:48
const wxString description
The help text for the symbol.
Definition: CharButton.h:47