Represents a position in the HexBox control
Example #1
0
            void BeginMouseSelection(object sender, MouseEventArgs e)
            {
                _mouseDown = true;

                if(!_shiftDown)
                {
                    _bpiStart = new BytePositionInfo(_hexBox._bytePos, _hexBox._byteCharacterPos);
                    _hexBox.ReleaseSelection();
                }
                else
                {
                    UpdateMouseSelection(this, e);
                }
            }
Example #2
0
            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);
                }
            }
Example #3
0
            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;
            }