public Options(DebugView view) : base(view) { #region Widget Creation _window = new Window(5, 5, 30, 5, "Options"); _window.Visible = false; View.Desktop.Add(_window); var timeScaleLabel = new Label(1, 1, 13, 1, "TimeScale %:"); _window.Add(timeScaleLabel); _timeScaleText = new NumericTextBox(14, 1, 13); _timeScaleText.Minimum = 0; _timeScaleText.Maximum = 200; _timeScaleText.Changed += () => Program.TimeScale = _timeScaleText.Value / 100f; _window.Add(_timeScaleText); #endregion }
public Memory(DebugView view) : base(view) { #region Widget Creation _window = new Window(15, 15, 81, 41, "Memory"); _window.Visible = false; View.Desktop.Add(_window); _editor = new HexEditor(1, 1, 77, 36, 16); _window.Add(_editor); _offset = new Label(1, 38, 26, 1, ""); _window.Add(_offset); var byteLabel = new Label(40, 38, 4, 1, "B"); _window.Add(byteLabel); _byteText = new NumericTextBox(42, 38, 10); _byteText.Minimum = sbyte.MinValue; _byteText.Maximum = sbyte.MaxValue; _byteText.Changed += () => { if (_editor.Buffer == null) return; try { var byteOffset = _editor.SelectedOffset / 2; _editor.Buffer.WriteSByte(byteOffset, (sbyte)_byteText.Value); } catch { } }; _window.Add(_byteText); var wordLabel = new Label(53, 38, 0, 1, "W"); _window.Add(wordLabel); _wordText = new NumericTextBox(55, 38, 10); _wordText.Minimum = short.MinValue; _wordText.Maximum = short.MaxValue; _wordText.Changed += () => { if (_editor.Buffer == null) return; try { var byteOffset = _editor.SelectedOffset / 2; _editor.Buffer.WriteShort(byteOffset, (short)_wordText.Value); } catch { } }; _window.Add(_wordText); var dwordLabel = new Label(66, 38, 0, 1, "D"); _window.Add(dwordLabel); _dwordText = new NumericTextBox(68, 38, 10); _dwordText.Minimum = int.MinValue; _dwordText.Maximum = int.MaxValue; _dwordText.Changed += () => { if (_editor.Buffer == null) return; try { var byteOffset = _editor.SelectedOffset / 2; _editor.Buffer.WriteInt(byteOffset, _dwordText.Value); } catch { } }; _window.Add(_dwordText); #endregion }