wxMaxima
Loading...
Searching...
No Matches
Functions
WorksheetContextMenu.h File Reference

The worksheet's right-click context menu. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void PopulateWorksheetContextMenu (Worksheet &worksheet, wxMenu &popupMenu, int downx, int downy, bool clickInSelection)
 Appends the context-menu items matching the worksheet's current state.
 

Detailed Description

The worksheet's right-click context menu.

Building the menu is a pure function of the worksheet's current state (what is selected, which cell is active, where the click landed): it appends items to a wxMenu and does not show it. That makes it testable headlessly and keeps the ~800 lines of menu construction out of the Worksheet class; the mouse handling around it (hit testing, mouse capture, actually popping up the menu) stays in Worksheet::OnMouseRightDown.

Function Documentation

◆ PopulateWorksheetContextMenu()

void PopulateWorksheetContextMenu ( Worksheet worksheet,
wxMenu &  popupMenu,
int  downx,
int  downy,
bool  clickInSelection 
)

Appends the context-menu items matching the worksheet's current state.

Parameters
worksheetThe worksheet whose state (selection, active cell, ...) decides which items appear. Its m_replacementsForCurrentWord is refilled with the spelling suggestions the menu offers.
popupMenuThe menu to append to; the caller shows it if any items were appended.
downx,downyThe click position in unscrolled worksheet coordinates.
clickInSelectionWhether the click landed inside the selection.