private void AddContextMenuStripItems() { _itemHighlight = new ToolStripMenuItem("Highlight"); _itemHighlight.Click += (sender, e) => _watchVarControl.ToggleHighlighted(); _itemHighlight.Checked = _watchVarControl.Highlighted; _itemLock = new ToolStripMenuItem("Lock"); _itemLock.Click += (sender, e) => ToggleLocked(null, _watchVarControl.FixedAddressListGetter()); ToolStripMenuItem itemCopyUnrounded = new ToolStripMenuItem("Copy"); itemCopyUnrounded.Click += (sender, e) => { Clipboard.SetText(GetValue(false, true, _watchVarControl.FixedAddressListGetter()).ToString()); _watchVarControl.FlashColor(WatchVariableControl.COPY_COLOR); }; ToolStripMenuItem itemPaste = new ToolStripMenuItem("Paste"); itemPaste.Click += (sender, e) => Paste(); _contextMenuStrip.AddToBeginningList(_itemHighlight); _contextMenuStrip.AddToBeginningList(_itemLock); _contextMenuStrip.AddToBeginningList(itemCopyUnrounded); _contextMenuStrip.AddToBeginningList(itemPaste); }
private void AddContextMenuStripItems() { _itemHighlight = new ToolStripMenuItem("Highlight"); _itemHighlight.Click += (sender, e) => ToggleHighlighted(); _itemHighlight.Checked = _watchVarControl.ShowBorder; _itemLock = new ToolStripMenuItem("Lock"); _itemLock.Click += (sender, e) => ToggleLocked(_watchVarControl.FixedAddressList); _itemRemoveAllLocks = new ToolStripMenuItem("Remove All Locks"); _itemRemoveAllLocks.Click += (sender, e) => { WatchVariableLockManager.RemoveAllLocks(); }; ToolStripMenuItem itemCopyUnrounded = new ToolStripMenuItem("Copy"); itemCopyUnrounded.Click += (sender, e) => { Clipboard.SetText(GetStringValue(false)); }; ToolStripMenuItem itemPaste = new ToolStripMenuItem("Paste"); itemPaste.Click += (sender, e) => { bool success = SetStringValue(Clipboard.GetText()); if (!success) { _watchVarControl.FlashColor(WatchVariableControl.FAILURE_COLOR); } }; _contextMenuStrip.AddToBeginningList(_itemHighlight); _contextMenuStrip.AddToBeginningList(_itemLock); _contextMenuStrip.AddToBeginningList(_itemRemoveAllLocks); _contextMenuStrip.AddToBeginningList(itemCopyUnrounded); _contextMenuStrip.AddToBeginningList(itemPaste); }
public void NotifyOfReordering(WatchVariableControl watchVarControl) { if (_reorderingWatchVarControl == null) { _reorderingWatchVarControl = watchVarControl; _reorderingWatchVarControl.FlashColor(WatchVariableControl.REORDER_START_COLOR); } else if (watchVarControl == _reorderingWatchVarControl) { _reorderingWatchVarControl.FlashColor(WatchVariableControl.REORDER_RESET_COLOR); _reorderingWatchVarControl = null; } else { int newIndex = Controls.IndexOf(watchVarControl); Controls.SetChildIndex(_reorderingWatchVarControl, newIndex); _reorderingWatchVarControl.FlashColor(WatchVariableControl.REORDER_END_COLOR); _reorderingWatchVarControl = null; } }