void BeginMouseSelection(object sender, MouseEventArgs e) { _mouseDown = true; if(!_shiftDown) { _bpiStart = new BytePositionInfo(_hexBox._bytePos, _hexBox._byteCharacterPos); _hexBox.ReleaseSelection(); } else { UpdateMouseSelection(this, e); } }
void UpdateMouseSelection(object sender, MouseEventArgs e) { if(!_mouseDown) return; _bpi = GetBytePositionInfo(new Point(e.X, e.Y)); long selEnd = _bpi.Index; long realselStart; long realselLength; if(selEnd < _bpiStart.Index) { realselStart = selEnd; realselLength = _bpiStart.Index - selEnd; } else if(selEnd > _bpiStart.Index) { realselStart = _bpiStart.Index; realselLength = selEnd - realselStart; } else { realselStart = _hexBox._bytePos; realselLength = 0; } if(realselStart != _hexBox._bytePos || realselLength != _hexBox._selectionLength) { _hexBox.InternalSelect(realselStart, realselLength); } }
protected virtual bool PreProcessWmKeyDown_ShiftShiftKey(ref Message m) { if(_mouseDown) return true; if(_shiftDown) return true; _shiftDown = true; if(_hexBox._selectionLength > 0) return true; _bpiStart = new BytePositionInfo(_hexBox._bytePos, _hexBox._byteCharacterPos); return true; }