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);
64 void InsertCharFromRow(int row);
67 void OnGridKey(wxKeyEvent &event);
69 void OnDClick(wxGridEvent &event);
71 void OnRightClick(wxGridEvent &event);
73 void OnChangeAttempt(wxGridEvent &event);
74
75private:
76 bool m_initialized;
77 long m_charRightClickedOn = 0;
78 wxWindow *m_worksheet;
79 wxGrid *m_grid;
80 RegexCtrl *m_regex;
81};
82
84class SidebarKeyEvent: public wxCommandEvent
85{
86public:
87 explicit SidebarKeyEvent(int id = 0)
88 : wxCommandEvent(id) { }
89
90 explicit SidebarKeyEvent(const SidebarKeyEvent& event)
91 : wxCommandEvent(event) {}
92};
93
95class SymboladdEvent: public wxCommandEvent
96{
97public:
98 explicit SymboladdEvent(int id = 0)
99 : wxCommandEvent(id) { }
100
101 explicit SymboladdEvent(const SymboladdEvent& event)
102 : wxCommandEvent(event) {}
103};
104
105wxDECLARE_EVENT(SIDEBARKEYEVENT, SidebarKeyEvent);
106wxDECLARE_EVENT(SYMBOLADDEVENT, SymboladdEvent);
107
108#endif // UNICODESIDEBAR_H
The configuration storage for the current worksheet.
Definition: Configuration.h:97
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:85
An event that can be issued by UnicodeSidebar and tells the symbols sidebar to add a symbol.
Definition: UnicodeSidebar.h:96
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:124
void OnDClick(wxGridEvent &event)
Is called if the control is double-clicked at.
Definition: UnicodeSidebar.cpp:85
void OnGridKey(wxKeyEvent &event)
Keyboard handler that lets Enter insert the selected character, so the sidebar is usable without a mo...
Definition: UnicodeSidebar.cpp:89
void InsertCharFromRow(int row)
Insert the character of the given grid row into the worksheet (shared by the mouse double-click and t...
Definition: UnicodeSidebar.cpp:74
void OnRightClick(wxGridEvent &event)
Is called if the control is right-clicked at.
Definition: UnicodeSidebar.cpp:100
void OnRegExEvent(wxCommandEvent &ev)
Is called if the RegEx changes.
Definition: UnicodeSidebar.cpp:183
void OnSize(wxSizeEvent &event)
Is called if the control is resized.
Definition: UnicodeSidebar.cpp:141
void OnMenu(wxCommandEvent &event)
Is called if a menu item is selected.
Definition: UnicodeSidebar.cpp:112
void UpdateDisplay()
Update the display after the regex has changed.
Definition: UnicodeSidebar.cpp:126
void OnPaint(wxPaintEvent &event)
Is called if a paint command is issued.
Definition: UnicodeSidebar.cpp:150