wxMaxima
Loading...
Searching...
No Matches
UnicodeSidebar.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
28#include "precomp.h"
29#include "RegexCtrl.h"
30#include <wx/wx.h>
31#include <wx/grid.h>
32
33#ifndef UNICODESIDEBAR_H
34#define UNICODESIDEBAR_H
35
39class UnicodeSidebar : public wxPanel
40{
41public:
43 UnicodeSidebar(wxWindow *parent, wxWindow *worksheet, Configuration *cfg);
44
45 /* The destructor
46
47 */
49
51 void OnRegExEvent(wxCommandEvent &ev);
53 void UpdateDisplay();
54
55protected:
57 void OnMenu(wxCommandEvent &event);
59 void OnPaint(wxPaintEvent &event);
61 void OnSize(wxSizeEvent &event);
63 void OnDClick(wxGridEvent &event);
65 void OnRightClick(wxGridEvent &event);
67 void OnChangeAttempt(wxGridEvent &event);
68
69private:
70 bool m_initialized;
71 long m_charRightClickedOn = 0;
72 wxWindow *m_worksheet;
73 wxGrid *m_grid;
74 RegexCtrl *m_regex;
75};
76
78class SidebarKeyEvent: public wxCommandEvent
79{
80public:
81 explicit SidebarKeyEvent(int id = 0)
82 : wxCommandEvent(id) { }
83
84 explicit SidebarKeyEvent(const SidebarKeyEvent& event)
85 : wxCommandEvent(event) {}
86};
87
89class SymboladdEvent: public wxCommandEvent
90{
91public:
92 explicit SymboladdEvent(int id = 0)
93 : wxCommandEvent(id) { }
94
95 explicit SymboladdEvent(const SymboladdEvent& event)
96 : wxCommandEvent(event) {}
97};
98
99wxDECLARE_EVENT(SIDEBARKEYEVENT, SidebarKeyEvent);
100wxDECLARE_EVENT(SYMBOLADDEVENT, SymboladdEvent);
101
102#endif // UNICODESIDEBAR_H
The configuration storage for the current worksheet.
Definition: Configuration.h:85
A BTextCtrl that allows to input a regex.
Definition: RegexCtrl.h:36
An event that simulates a keypress and can be issued by UnicodeSidebar.
Definition: UnicodeSidebar.h:79
An event that can be issued by UnicodeSidebar and tells the symbols sidebar to add a symbol.
Definition: UnicodeSidebar.h:90
This class generates a pane containing the last commands that were issued.
Definition: UnicodeSidebar.h:40
void OnChangeAttempt(wxGridEvent &event)
Is called if the user tries to edit the control's text.
Definition: UnicodeSidebar.cpp:115
void OnDClick(wxGridEvent &event)
Is called if the control is double-clicked at.
Definition: UnicodeSidebar.cpp:79
void OnRightClick(wxGridEvent &event)
Is called if the control is right-clicked at.
Definition: UnicodeSidebar.cpp:90
void OnRegExEvent(wxCommandEvent &ev)
Is called if the RegEx changes.
Definition: UnicodeSidebar.cpp:174
void OnSize(wxSizeEvent &event)
Is called if the control is resized.
Definition: UnicodeSidebar.cpp:132
void OnMenu(wxCommandEvent &event)
Is called if a menu item is selected.
Definition: UnicodeSidebar.cpp:103
void UpdateDisplay()
Update the display after the regex has changed.
Definition: UnicodeSidebar.cpp:117
void OnPaint(wxPaintEvent &event)
Is called if a paint command is issued.
Definition: UnicodeSidebar.cpp:141