Files
Upsilon/apps/code/helpers.cpp
Arthur Camouseigt 8f97a332f6 [Python] Modified the paste effect in script and shell area
When a formula is pasted in a script or in the shell, some symbols are
replaced by their equivalent in python :
x turns into *
^ turns into **
√ turns into sqrt
etc
Change-Id: If6f2a22d4f3c148c2655e0892023b0e28058a9a6
2020-11-04 15:32:59 +01:00

21 lines
430 B
C++

#include "helpers.h"
#include <escher/clipboard.h>
namespace Code {
namespace Helpers {
const char * PythonTextForEvent(Ion::Events::Event event) {
for (size_t i=0; i<NumberOfPythonTextPairs; i++) {
UTF8Helper::TextPair pair = PythonTextPairs[i];
if (event.text() == pair.firstString()) {
return pair.secondString();
}
if (event == Ion::Events::XNT) {
return "x";
}
}
return nullptr;
}
}
}