wxMaxima
Loading...
Searching...
No Matches
GreekSidebar.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) 2004-2015 Andrej Vodopivec <andrej.vodopivec@gmail.com>
4// (C) 2012 Doug Ilijev <doug.ilijev@gmail.com>
5// (C) 2014-2015 Gunter Königsmann <wxMaxima@physikbuch.de>
6//
7// This program is free software; you can redistribute it and/or modify
8// it under the terms of the GNU General Public License as published by
9// the Free Software Foundation; either version 2 of the License, or
10// (at your option) any later version.
11//
12// This program is distributed in the hope that it will be useful,
13// but WITHOUT ANY WARRANTY; without even the implied warranty of
14// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15// GNU General Public License for more details.
16//
17//
18// You should have received a copy of the GNU General Public License
19// along with this program; if not, write to the Free Software
20// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21//
22// SPDX-License-Identifier: GPL-2.0+
23
30#ifndef GREEKSIDEBAR_H_
31#define GREEKSIDEBAR_H_
32
33#include "precomp.h"
34#include <array>
35#include <wx/wx.h>
36#include "EventIDs.h"
37#include <wx/sizer.h>
38#include <wx/panel.h>
39#include "CharButton.h"
40#include "ButtonWrapSizer.h"
41#include <list>
42#include <vector>
43
44class GreekSidebar : public wxScrolled<wxPanel>
45{
46 public:
48 enum class Condition { None, Show_mu, ShowLatinLookalikes };
51 Condition condition;
52 Definition(wchar_t sym, const wxString &descr,
53 Condition cond = Condition::None)
54 : CharButton::Definition{sym, descr}, condition(cond) {}
55 };
57 static const std::vector<Definition> &LowercaseDefinitions();
59 static const std::vector<Definition> &UppercaseDefinitions();
60
61 GreekSidebar(wxWindow *parent, Configuration *configuration, wxWindow *worksheet,
62 int ID = wxID_ANY);
68 void UpdateVirtualSize();
69 protected:
70 void UpdateSymbols();
71 void OnMouseRightDown(wxMouseEvent &event);
72 void OnMenu(wxCommandEvent &event);
73 void OnSize(wxSizeEvent &event);
74 private:
75 wxPanel *m_upperCasePanel;
76 wxPanel *m_lowerCasePanel;
77 Configuration *m_configuration;
78 Buttonwrapsizer *m_lowercaseSizer;
79 Buttonwrapsizer *m_uppercaseSizer;
80 wxWindow *m_worksheet;
83 wxSize m_lastVirtualSize = wxDefaultSize;
85 wxString m_contextMenuSymbol;
86};
87
88
89#endif // GREEKSIDEBAR_H_
This file contains the definition of the class Buttonwrapsizer that allows to select arbitrary unicod...
This file contains the definition of the class Charbutton that allows to select arbitrary unicode sym...
This file declares the class EventIDs that contains unique IDs for many events wxMaxima needs.
This class generates a pane containing the last commands that were issued.
Definition: ButtonWrapSizer.h:40
The configuration storage for the current worksheet.
Definition: Configuration.h:102
Definition: GreekSidebar.h:45
static const std::vector< Definition > & UppercaseDefinitions()
The uppercase letters, whether they are currently shown or not.
Definition: GreekSidebar.cpp:173
Condition
When a letter is shown.
Definition: GreekSidebar.h:48
void UpdateVirtualSize()
Re-wrap the buttons and grow the virtual height to fit the wrapped rows.
Definition: GreekSidebar.cpp:72
static const std::vector< Definition > & LowercaseDefinitions()
The lowercase letters, whether they are currently shown or not.
Definition: GreekSidebar.cpp:143
Definition: CellPointers.h:36
A definition of this button, used to construct it.
Definition: CharButton.h:45
A letter of the sidebar.
Definition: GreekSidebar.h:50