Beispiel #1
0
        private void _textBoxValue_MouseEnter(object sender, EventArgs e)
        {
            var lockedStatus = CheckState.Unchecked;

            if (OffsetList.Any(o => GetIsLocked(o)))
            {
                if (OffsetList.All(o => GetIsLocked(o)))
                {
                    lockedStatus = CheckState.Checked;
                }
                else
                {
                    lockedStatus = CheckState.Indeterminate;
                }
            }

            _lastSelected = this;
            if (_watchVar.IsAngle)
            {
                (AngleMenu.Items["HexView"] as ToolStripMenuItem).Checked            = _watchVar.UseHex;
                (AngleMenu.Items["LockValue"] as ToolStripMenuItem).CheckState       = lockedStatus;
                (AngleMenu.Items["Highlight"] as ToolStripMenuItem).Checked          = _tablePanel.ShowBorder;
                (AngleDropDownMenu[0].DropDownItems[0] as ToolStripMenuItem).Checked = (_angleViewMode == AngleViewModeType.Recommended);
                (AngleDropDownMenu[0].DropDownItems[1] as ToolStripMenuItem).Checked = (_angleViewMode == AngleViewModeType.Unsigned);
                (AngleDropDownMenu[0].DropDownItems[2] as ToolStripMenuItem).Checked = (_angleViewMode == AngleViewModeType.Signed);
                (AngleDropDownMenu[0].DropDownItems[3] as ToolStripMenuItem).Checked = (_angleViewMode == AngleViewModeType.Degrees);
                (AngleDropDownMenu[0].DropDownItems[4] as ToolStripMenuItem).Checked = (_angleViewMode == AngleViewModeType.Radians);
                (AngleDropDownMenu[1] as ToolStripMenuItem).Checked = _angleTruncated;
            }
            else
            {
                (Menu.Items["HexView"] as ToolStripMenuItem).Checked      = _watchVar.UseHex;
                (Menu.Items["LockValue"] as ToolStripMenuItem).CheckState = lockedStatus;
                (Menu.Items["Highlight"] as ToolStripMenuItem).Checked    = _tablePanel.ShowBorder;
                ObjectDropDownMenu.ForEach(d => Menu.Items.Remove(d));
                if (_watchVar.IsObject)
                {
                    ObjectDropDownMenu.ForEach(d => Menu.Items.Add(d));
                }
            }
        }
Beispiel #2
0
        public void Update()
        {
            if (_watchVar.IsSpecial)
            {
                return;
            }

            ShowLockedImage(OffsetList.Any(o => GetIsLocked(o)), !OffsetList.All(o => GetIsLocked(o)));

            if (_editMode)
            {
                return;
            }

            _changedByUser = false;

            if (_watchVar.IsBool)
            {
                if (OffsetList.Any(o => _watchVar.GetBoolValue(o)))
                {
                    if (OffsetList.All(o => _watchVar.GetBoolValue(o)))
                    {
                        CheckBoxCheckState = CheckState.Checked;
                    }
                    else
                    {
                        CheckBoxCheckState = CheckState.Indeterminate;
                    }
                }
                else
                {
                    CheckBoxCheckState = CheckState.Unchecked;
                }
            }
            else
            {
                bool firstOffset = true;
                foreach (var offset in OffsetList)
                {
                    string newText = "";
                    if (_watchVar.IsAngle)
                    {
                        newText = _watchVar.GetAngleStringValue(offset, _angleViewMode, _angleTruncated);
                    }
                    else
                    {
                        newText = _watchVar.GetStringValue(offset);
                    }

                    if (firstOffset)
                    {
                        _textBoxValue.Text = newText;
                    }
                    else if (_textBoxValue.Text != newText)
                    {
                        _textBoxValue.Text = "";
                        continue;
                    }

                    firstOffset = false;
                }
            }

            _changedByUser = true;
        }