sim: BL0942 object with controller (sends BL0942 packets); not finished yet; also fix Text edit cursor

This commit is contained in:
openshwprojects
2022-12-07 01:10:23 +01:00
parent d7911fd4c9
commit 1ad2e00a7c
16 changed files with 229 additions and 10 deletions

View File

@@ -31,6 +31,9 @@ class CShape *CShape::findShapeByName_r(const char *name) {
class CJunction *CShape::asJunction() {
return dynamic_cast<CJunction*>(this);
}
class CText *CShape::asText() {
return dynamic_cast<CText*>(this);
}
void CShape::snapToGrid() {
Coord n = roundToGrid(getPosition());
setPosition(n);
@@ -134,8 +137,10 @@ class CShape* CShape::addRect(int x, int y, int w, int h) {
addShape(n);
return n;
}
class CShape* CShape::addText(int x, int y, const char *s) {
class CShape* CShape::addText(int x, int y, const char *s, bool bDeepText, bool bAllowNewLine) {
CText *n = new CText(x, y, s);
n->setDeepText(bDeepText);
n->setAllowNewLine(bAllowNewLine);
addShape(n);
return n;
}