public AngleDataContainer(string name, AngleViewModeType angleViewMode = AngleViewModeType.Unsigned) { _specialName = name; _angleViewMode = angleViewMode; this._nameLabel = new Label(); this._nameLabel.Size = new Size(210, 20); this._nameLabel.Text = name; this._nameLabel.Margin = new Padding(3, 3, 3, 3); this._textBoxValue = new TextBox(); this._textBoxValue.ReadOnly = true; this._textBoxValue.BorderStyle = BorderStyle.None; this._textBoxValue.TextAlign = HorizontalAlignment.Right; this._textBoxValue.Width = 200; this._textBoxValue.Margin = new Padding(6, 3, 6, 3); this._textBoxValue.ContextMenuStrip = AngleMenu; this._textBoxValue.MouseEnter += _textBoxValue_MouseEnter; this._tablePanel = new BorderedTableLayoutPanel(); this._tablePanel.Size = new Size(230, _nameLabel.Height + 2); this._tablePanel.CellBorderStyle = TableLayoutPanelCellBorderStyle.Single; this._tablePanel.RowCount = 1; this._tablePanel.ColumnCount = 2; this._tablePanel.RowStyles.Clear(); this._tablePanel.RowStyles.Add(new RowStyle(SizeType.Absolute, _nameLabel.Height + 3)); this._tablePanel.ColumnStyles.Clear(); this._tablePanel.Margin = new Padding(0); this._tablePanel.Padding = new Padding(0); this._tablePanel.ShowBorder = false; this._tablePanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 120)); this._tablePanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 110)); this._tablePanel.Controls.Add(_nameLabel, 0, 0); this._tablePanel.Controls.Add(this._textBoxValue, 1, 0); AngleMenu.ItemClicked += OnMenuStripClick; AngleDropDownMenu[0].DropDownItemClicked += AngleDropDownMenu_DropDownItemClicked; AngleDropDownMenu[1].Click += TruncateAngleMenu_ItemClicked; AngleDropDownMenu[2].Click += AngleDataContainer_Click; }
public DataContainer(string name) { _specialName = name; this._nameLabel = new Label(); this._nameLabel.Size = new Size(210, 20); this._nameLabel.Text = name; this._nameLabel.Margin = new Padding(3, 3, 3, 3); this._textBoxValue = new TextBox(); this._textBoxValue.ReadOnly = true; this._textBoxValue.BorderStyle = BorderStyle.None; this._textBoxValue.TextAlign = HorizontalAlignment.Right; this._textBoxValue.Width = 200; this._textBoxValue.Margin = new Padding(6, 3, 6, 3); this._textBoxValue.ContextMenuStrip = DataContainer.Menu; this._textBoxValue.MouseEnter += (sender, e) => { _lastSelected = this; (Menu.Items["Highlight"] as ToolStripMenuItem).Checked = _tablePanel.ShowBorder; }; this._tablePanel = new BorderedTableLayoutPanel(); this._tablePanel.Size = new Size(230, _nameLabel.Height + 2); this._tablePanel.CellBorderStyle = TableLayoutPanelCellBorderStyle.Single; this._tablePanel.RowCount = 1; this._tablePanel.ColumnCount = 2; this._tablePanel.RowStyles.Clear(); this._tablePanel.RowStyles.Add(new RowStyle(SizeType.Absolute, _nameLabel.Height + 3)); this._tablePanel.ColumnStyles.Clear(); this._tablePanel.Margin = new Padding(0); this._tablePanel.Padding = new Padding(0); this._tablePanel.ShowBorder = false; this._tablePanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 120)); this._tablePanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 110)); this._tablePanel.Controls.Add(_nameLabel, 0, 0); this._tablePanel.Controls.Add(this._textBoxValue, 1, 0); Menu.ItemClicked += Menu_ItemClicked; }
private void CreateControls() { this._nameLabel = new Label(); this._nameLabel.Size = new Size(210, 20); //TODO check this this._nameLabel.Text = _watchVar.Name; this._nameLabel.Margin = new Padding(3, 3, 3, 3); this._nameLabel.Click += _nameLabel_Click; this._nameLabel.ImageAlign = ContentAlignment.MiddleRight; this._nameLabel.MouseHover += (sender, e) => { if (!_watchVar.HasAdditiveOffset) { AddressToolTip.SetToolTip(this._nameLabel, String.Format("0x{0:X8} [{2} + 0x{1:X8}]", _watchVar.GetRamAddress(), _watchVar.GetProcessAddress(), Config.Stream.ProcessName)); } else { AddressToolTip.SetToolTip(this._nameLabel, String.Format("0x{1:X8} + 0x{0:X8} = 0x{2:X8} [{4} + 0x{3:X8}]", _watchVar.GetRamAddress(0, false), OffsetList[0], _watchVar.GetRamAddress(OffsetList[0]), _watchVar.GetProcessAddress(OffsetList[0]), Config.Stream.ProcessName)); } }; if (_watchVar.IsBool) { this._checkBoxBool = new CheckBox(); this._checkBoxBool.CheckAlign = ContentAlignment.MiddleRight; this._checkBoxBool.CheckState = CheckState.Unchecked; this._checkBoxBool.CheckedChanged += OnEdited; this._checkBoxBool.MouseEnter += (sender, e) => { _lastSelected = this; (CheckMenu.Items["Highlight"] as ToolStripMenuItem).Checked = _tablePanel.ShowBorder; }; this._checkBoxBool.ContextMenuStrip = WatchVariableControl.CheckMenu; } else { this._textBoxValue = new TextBox(); this._textBoxValue.ReadOnly = true; this._textBoxValue.BorderStyle = BorderStyle.None; this._textBoxValue.TextAlign = HorizontalAlignment.Right; this._textBoxValue.Width = 200; this._textBoxValue.Margin = new Padding(6, 3, 6, 3); this._textBoxValue.TextChanged += OnEdited; this._textBoxValue.ContextMenuStrip = _watchVar.IsAngle ? WatchVariableControl.AngleMenu : WatchVariableControl.Menu; this._textBoxValue.KeyDown += OnTextValueKeyDown; this._textBoxValue.MouseEnter += _textBoxValue_MouseEnter; this._textBoxValue.DoubleClick += _textBoxValue_DoubleClick; this._textBoxValue.Leave += (sender, e) => { EditMode = false; }; if (_watchVar.IsAngle) { WatchVariableControl.AngleMenu.ItemClicked += OnMenuStripClick; WatchVariableControl.AngleDropDownMenu[0].DropDownItemClicked += AngleDropDownMenu_DropDownItemClicked; WatchVariableControl.AngleDropDownMenu[1].Click += TruncateAngleMenu_ItemClicked; } else { WatchVariableControl.Menu.ItemClicked += OnMenuStripClick; } } this._tablePanel = new BorderedTableLayoutPanel(); this._tablePanel.Size = new Size(230, _nameLabel.Height + 2); this._tablePanel.CellBorderStyle = TableLayoutPanelCellBorderStyle.Single; this._tablePanel.RowCount = 1; this._tablePanel.ColumnCount = 2; this._tablePanel.RowStyles.Clear(); this._tablePanel.RowStyles.Add(new RowStyle(SizeType.Absolute, _nameLabel.Height + 3)); this._tablePanel.ColumnStyles.Clear(); this._tablePanel.Margin = new Padding(0); this._tablePanel.Padding = new Padding(0); this._tablePanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 120)); this._tablePanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 110)); this._tablePanel.ShowBorder = false; this._tablePanel.Controls.Add(_nameLabel, 0, 0); this._tablePanel.Controls.Add(_watchVar.IsBool ? this._checkBoxBool as Control : this._textBoxValue, 1, 0); }