wxMaxima
Loading...
Searching...
No Matches
Functions
MaximaMenuSync.cpp File Reference

Implements the table that keeps menu check marks in sync with Maxima's variables. More...

#include "MaximaMenuSync.h"
#include "EventIDs.h"
#include <algorithm>
Include dependency graph for MaximaMenuSync.cpp:

Functions

const std::vector< MaximaMenuSyncRow > & MaximaMenuSyncRows ()
 The variable-to-menu-items table itself.
 
bool SyncMenusToMaximaVariable (wxMenuBar *menubar, const wxString &variable, const wxString &value)
 Update the menu check marks that mirror one Maxima variable.
 

Detailed Description

Implements the table that keeps menu check marks in sync with Maxima's variables.

Function Documentation

◆ MaximaMenuSyncRows()

const std::vector< MaximaMenuSyncRow > & MaximaMenuSyncRows ( )

The variable-to-menu-items table itself.

Built on first use so the dynamically-allocated menu ids in EventIDs are guaranteed to exist, whatever the translation units' initialization order.

◆ SyncMenusToMaximaVariable()

bool SyncMenusToMaximaVariable ( wxMenuBar *  menubar,
const wxString &  variable,
const wxString &  value 
)

Update the menu check marks that mirror one Maxima variable.

Looks the variable up in MaximaMenuSyncRows() and applies its row to the items in menubar (missing items are skipped, so a menu that only exists conditionally cannot make this fail).

Returns
true if the variable has a row in the table (whether or not any check mark changed), false if it is not menu-synced.