Kaydet (Commit) 68c1f757 authored tarafından Ivan Timofeev's avatar Ivan Timofeev

visual formula editor: implement selection by mouse

üst 558b5ea3
......@@ -103,6 +103,7 @@ public:
// Window
virtual void MouseButtonDown(const MouseEvent &rMEvt);
virtual void MouseMove(const MouseEvent &rMEvt);
virtual void GetFocus();
virtual void LoseFocus();
......
......@@ -182,9 +182,7 @@ void SmGraphicWindow::MouseButtonDown(const MouseEvent& rMEvt)
return;
if (IsInlineEditEnabled()) {
// if it was clicked inside the formula then get the appropriate node
if (pTree->OrientedDist(aPos) <= 0)
pViewShell->GetDoc()->GetCursor().MoveTo(this, aPos, !rMEvt.IsShift());
pViewShell->GetDoc()->GetCursor().MoveTo(this, aPos, !rMEvt.IsShift());
return;
}
const SmNode *pNode = 0;
......@@ -214,6 +212,22 @@ void SmGraphicWindow::MouseButtonDown(const MouseEvent& rMEvt)
}
}
void SmGraphicWindow::MouseMove(const MouseEvent &rMEvt)
{
ScrollableWindow::MouseMove(rMEvt);
if (rMEvt.IsLeft() && IsInlineEditEnabled())
{
Point aPos(PixelToLogic(rMEvt.GetPosPixel()) - GetFormulaDrawPos());
pViewShell->GetDoc()->GetCursor().MoveTo(this, aPos, false);
CaretBlinkStop();
SetIsCursorVisible(true);
CaretBlinkStart();
RepaintViewShellDoc();
}
}
bool SmGraphicWindow::IsInlineEditEnabled() const
{
return pViewShell->IsInlineEditEnabled();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment