Implemented selection using shift left click
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@51759 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -360,8 +360,6 @@ void wxRichTextCtrl::OnLeftClick(wxMouseEvent& event)
|
||||
m_dragging = true;
|
||||
CaptureMouse();
|
||||
|
||||
SelectNone();
|
||||
|
||||
bool caretAtLineStart = false;
|
||||
|
||||
if (hit & wxRICHTEXT_HITTEST_BEFORE)
|
||||
@@ -377,8 +375,24 @@ void wxRichTextCtrl::OnLeftClick(wxMouseEvent& event)
|
||||
position --;
|
||||
}
|
||||
|
||||
long oldCaretPos = m_caretPosition;
|
||||
|
||||
MoveCaret(position, caretAtLineStart);
|
||||
SetDefaultStyleToCursorStyle();
|
||||
|
||||
if (event.ShiftDown())
|
||||
{
|
||||
bool extendSel = false;
|
||||
if (m_selectionRange.GetStart() == -2)
|
||||
extendSel = ExtendSelection(oldCaretPos, m_caretPosition, wxRICHTEXT_SHIFT_DOWN);
|
||||
else
|
||||
extendSel = ExtendSelection(m_caretPosition, m_caretPosition, wxRICHTEXT_SHIFT_DOWN);
|
||||
|
||||
if (extendSel)
|
||||
Refresh(false);
|
||||
}
|
||||
else
|
||||
SelectNone();
|
||||
}
|
||||
|
||||
event.Skip();
|
||||
|
Reference in New Issue
Block a user