Inheritance: System.ComponentModel.Component
Exemplo n.º 1
0
 /// <summary>
 ///   Initializes a new instance of a HexBox class.
 /// </summary>
 public HexBox()
 {
     Cursor = Cursors.IBeam;
     //_highlights = new List<HexboxHighlight>();
     _vScrollBar = new VScrollBar();
     _vScrollBar.Scroll += VScrollBarScroll;
     _vScrollBar.Cursor = Cursors.Default;
     _builtInContextMenu = new BuiltInContextMenu(this);
     base.BackColor = Color.White;
     base.Font = new Font("Courier New", 9F, FontStyle.Regular, GraphicsUnit.Point, ((0)));
     _stringFormat =
         new StringFormat(StringFormat.GenericTypographic)
         {
             FormatFlags = StringFormatFlags.MeasureTrailingSpaces
         };
     ActivateEmptyKeyInterpreter();
     SetStyle(ControlStyles.UserPaint, true);
     SetStyle(ControlStyles.DoubleBuffer, true);
     SetStyle(ControlStyles.AllPaintingInWmPaint, true);
     SetStyle(ControlStyles.ResizeRedraw, true);
     _thumbTrackTimer.Interval = 50;
     _thumbTrackTimer.Tick += PerformScrollThumbTrack;
 }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of a HexBox class.
        /// </summary>
        public HexBox()
        {
            this._vScrollBar = new VScrollBar();
            this._vScrollBar.Scroll += new ScrollEventHandler(_vScrollBar_Scroll);

            this._builtInContextMenu = new BuiltInContextMenu(this);

            BackColor = Color.White;
            Font = new Font("Courier New", 9F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0)));
            _stringFormat = new StringFormat(StringFormat.GenericTypographic);
            _stringFormat.FormatFlags = StringFormatFlags.MeasureTrailingSpaces;

            ActivateEmptyKeyInterpreter();

            SetStyle(ControlStyles.UserPaint, true);
            SetStyle(ControlStyles.DoubleBuffer, true);
            SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            SetStyle(ControlStyles.ResizeRedraw, true);

            _thumbTrackTimer.Interval = 50;
            _thumbTrackTimer.Tick += new EventHandler(PerformScrollThumbTrack);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of a HexBox class.
        /// </summary>
        public HexBox()
        {
            this._vScrollBar = new VScrollBar();
            this._vScrollBar.Scroll += new ScrollEventHandler(_vScrollBar_Scroll);

            this._builtInContextMenu = new BuiltInContextMenu(this);

            BackColor = Color.White;
            Font = new Font("Courier New", 9F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0)));
            _stringFormat = new StringFormat(StringFormat.GenericTypographic);

            // Removed the following line as it fixes weird font alignment bug on Windows 8, and doesn't seem to change display
            //_stringFormat.FormatFlags = StringFormatFlags.MeasureTrailingSpaces;

            ActivateEmptyKeyInterpreter();

            SetStyle(ControlStyles.UserPaint, true);
            SetStyle(ControlStyles.DoubleBuffer, true);
            SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            SetStyle(ControlStyles.ResizeRedraw, true);

            _thumbTrackTimer.Interval = 50;
            _thumbTrackTimer.Tick += new EventHandler(PerformScrollThumbTrack);

            if (IsRunningOnWindows())
            {
                _caretHandler = new NativeCaretHandler();
            }
            else
            {
                _caretHandler = new GDICaretHandler();
            }
            _annotations = new List<HexAnnotation>();
        }