wxMaxima
Loading...
Searching...
No Matches
Data Structures | Macros | Functions
test_EditorCellLinks.cpp File Reference

Tests for links in text cells, in code cells' comments and in Maxima's output (GH #2396). More...

#include <wx/app.h>
#include <wx/bitmap.h>
#include <wx/dcmemory.h>
#include <wx/log.h>
#include "CellPointers.h"
#include "Configuration.h"
#include "cells/EditorCell.h"
#include "cells/GroupCell.h"
#include "cells/TextCell.h"
#include "MathParser.h"
#include <memory>
#include <catch2/catch.hpp>
Include dependency graph for test_EditorCellLinks.cpp:

Data Structures

class  TestApp
 

Functions

 SCENARIO ("A link in a text cell is found under the pointer")
 
 SCENARIO ("A link in a code cell's comment is found under the pointer")
 
 SCENARIO ("The LaTeX export writes a text cell's links as \\url{}")
 
 SCENARIO ("A link Maxima prints is found under the pointer")
 
 wxDECLARE_APP (TestApp)
 
int main (int argc, char **argv)
 

Detailed Description

Tests for links in text cells, in code cells' comments and in Maxima's output (GH #2396).

A link in a text cell becomes a text snippet of its own, which Draw() paints in the link color and GetLinkAt() hit-tests – both through the same walk over the snippets, WalkDrawnSnippets(). These tests pin GetLinkAt() against PositionToPoint(), an independent source for where each character is drawn: if the two ever disagree, a Ctrl+click would open a link the pointer isn't on, or miss one it is.

Links in the output are TextCells parsed from the XML wxMathML.lisp sends, through the real MathParser; they are checked against the cell's own rectangle, whose parts left and right of the link are known to be plain text.

Windowless: real GroupCell/EditorCell against a memory-DC Configuration, no Worksheet, no wxFrame – the test_EditorCellTabs pattern.