Start working on multi-line selection for console

Unfortunately UITextEdit is really bad in terms of performance. It
cannot be used as overlying widget (just like in terminal). On the other
hand we could optimize it by rewriting (unfortunately) the whole widget.

There still is a lot of things to do, but for now it is possible to
select several lines of text and copy it using CTRL + C. In order to
make text copyable in context menu it will be required to override
onMousePress (return true).
This commit is contained in:
Konrad Kuśnierz
2015-06-02 19:16:41 +02:00
parent 34e2fa1d49
commit f35c939fc3
2 changed files with 65 additions and 5 deletions

View File

@@ -796,7 +796,6 @@ bool UITextEdit::onMousePress(const Point& mousePos, Fw::MouseButton button)
}
return true;
}
return false;
}
@@ -807,6 +806,9 @@ bool UITextEdit::onMouseRelease(const Point& mousePos, Fw::MouseButton button)
bool UITextEdit::onMouseMove(const Point& mousePos, const Point& mouseMoved)
{
if(UIWidget::onMouseMove(mousePos, mouseMoved))
return true;
if(m_selectable && isPressed()) {
int pos = getTextPos(mousePos);
if(pos >= 0) {
@@ -815,7 +817,7 @@ bool UITextEdit::onMouseMove(const Point& mousePos, const Point& mouseMoved)
}
return true;
}
return UIWidget::onMouseMove(mousePos, mouseMoved);
return false;
}
bool UITextEdit::onDoubleClick(const Point& mousePos)