mirror of
https://github.com/edubart/otclient.git
synced 2025-10-16 12:34:55 +02:00
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:
@@ -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)
|
||||
|
Reference in New Issue
Block a user