wxMaxima
Loading...
Searching...
No Matches
MaximaMenuSync.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) 2026 Gunter Königsmann <wxMaxima@physikbuch.de>
4//
5// This program is free software; you can redistribute it and/or modify
6// it under the terms of the GNU General Public License as published by
7// the Free Software Foundation; either version 2 of the License, or
8// (at your option) any later version.
9//
10// This program is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU General Public License for more details.
14//
15//
16// You should have received a copy of the GNU General Public License
17// along with this program; if not, write to the Free Software
18// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19//
20// SPDX-License-Identifier: GPL-2.0+
21
37#ifndef MAXIMAMENUSYNC_H
38#define MAXIMAMENUSYNC_H
39
40#include "precomp.h"
41#include <wx/menu.h>
42#include <wx/string.h>
43#include <cstdint>
44#include <vector>
45
49{
51 wxString m_value;
54};
55
59{
60 enum class Kind : std::int8_t {
69 };
71 wxString m_variable;
75 std::vector<MaximaMenuSyncEntry> m_entries;
81 int m_enableId = wxID_NONE;
82};
83
89const std::vector<MaximaMenuSyncRow> &MaximaMenuSyncRows();
90
100bool SyncMenusToMaximaVariable(wxMenuBar *menubar, const wxString &variable,
101 const wxString &value);
102
103#endif // MAXIMAMENUSYNC_H
bool SyncMenusToMaximaVariable(wxMenuBar *menubar, const wxString &variable, const wxString &value)
Update the menu check marks that mirror one Maxima variable.
Definition: MaximaMenuSync.cpp:85
const std::vector< MaximaMenuSyncRow > & MaximaMenuSyncRows()
The variable-to-menu-items table itself.
Definition: MaximaMenuSync.cpp:31
One menu item a Maxima variable value maps to.
Definition: MaximaMenuSync.h:49
int m_menuId
The id of the menu item to check when the value matches.
Definition: MaximaMenuSync.h:53
wxString m_value
The variable value (or value suffix) that selects this menu item.
Definition: MaximaMenuSync.h:51
How the check marks of one Maxima variable's menu items follow its value.
Definition: MaximaMenuSync.h:59
int m_enableId
A menu item to enable whenever any value arrives, or wxID_NONE.
Definition: MaximaMenuSync.h:81
wxString m_variable
The name of the Maxima variable this row watches.
Definition: MaximaMenuSync.h:71
Kind
Definition: MaximaMenuSync.h:60
@ RadioFromValue
Radio items: check the entry whose value equals the variable's value.
@ UncheckedIfEqual
A check item: checked exactly if the value differs from the entry's value.
@ CheckedIfEqual
A check item: checked exactly if the value equals the entry's value.
@ RadioFromSuffix
Radio items: check the entry whose value the variable's value ends in.
Kind m_kind
How to match the variable's value against the entries.
Definition: MaximaMenuSync.h:73
std::vector< MaximaMenuSyncEntry > m_entries
Which menu item(s) the value selects between.
Definition: MaximaMenuSync.h:75