예제 #1
0
파일: RamWatch.cs 프로젝트: lenalia/BizHawk
 private void WatchListView_VirtualItemsSelectionRangeChanged(object sender, ListViewVirtualItemsSelectionRangeChangedEventArgs e)
 {
     PokeAddressToolBarItem.Enabled       =
         FreezeAddressToolBarItem.Enabled =
             SelectedIndices.Any() &&
             SelectedWatches.All(w => w.Domain.CanPoke());
 }
예제 #2
0
파일: RamWatch.cs 프로젝트: lenalia/BizHawk
        public void LoadWatchFile(FileInfo file, bool append)
        {
            if (file != null)
            {
                var result = true;
                if (_watches.Changes)
                {
                    result = AskSaveChanges();
                }

                if (result)
                {
                    _watches.Load(file.FullName, append);
                    WatchListView.ItemCount = _watches.Count;
                    UpdateWatchCount();
                    Global.Config.RecentWatches.Add(_watches.CurrentFileName);
                    UpdateStatusBar();

                    PokeAddressToolBarItem.Enabled       =
                        FreezeAddressToolBarItem.Enabled =
                            SelectedIndices.Any() &&
                            SelectedWatches.All(w => w.Domain.CanPoke());
                }
            }
        }
예제 #3
0
파일: RamWatch.cs 프로젝트: jokm1/BizHawk
        private void NewWatchList(bool suppressAsk)
        {
            var result = true;

            if (_watches.Changes)
            {
                result = AskSaveChanges();
            }

            if (result || suppressAsk)
            {
                _watches.Clear();
                WatchListView.RowCount = _watches.Count;
                GeneralUpdate();
                UpdateWatchCount();
                UpdateStatusBar();
                _sortReverse  = false;
                _sortedColumn = "";

                PokeAddressToolBarItem.Enabled       =
                    FreezeAddressToolBarItem.Enabled =
                        SelectedIndices.Any() &&
                        SelectedWatches.All(w => w.Domain.Writable);
            }
        }
예제 #4
0
파일: RamWatch.cs 프로젝트: lenalia/BizHawk
        private void WatchListView_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (WatchListView.SelectAllInProgress)
            {
                return;
            }

            PokeAddressToolBarItem.Enabled       =
                FreezeAddressToolBarItem.Enabled =
                    SelectedIndices.Any() &&
                    SelectedWatches.All(w => w.Domain.CanPoke());
        }
예제 #5
0
        private void ListViewContextMenu_Opening(object sender, CancelEventArgs e)
        {
            var indexes = WatchListView.SelectedIndices;

            EditContextMenuItem.Visible                   =
                RemoveContextMenuItem.Visible             =
                    DuplicateContextMenuItem.Visible      =
                        PokeContextMenuItem.Visible       =
                            FreezeContextMenuItem.Visible =
                                Separator4.Visible        =
                                    ReadBreakpointContextMenuItem.Visible      =
                                        WriteBreakpointContextMenuItem.Visible =
                                            Separator6.Visible =
                                                InsertSeperatorContextMenuItem.Visible            =
                                                    MoveUpContextMenuItem.Visible                 =
                                                        MoveDownContextMenuItem.Visible           =
                                                            MoveTopContextMenuItem.Visible        =
                                                                MoveBottomContextMenuItem.Visible =
                                                                    indexes.Count > 0;

            ReadBreakpointContextMenuItem.Visible      =
                WriteBreakpointContextMenuItem.Visible =
                    Separator6.Visible =
                        SelectedWatches.Any() &&
                        Debuggable != null &&
                        Debuggable.MemoryCallbacksAvailable() &&
                        SelectedWatches.All(w => w.Domain.Name == (MemoryDomains != null ? MemoryDomains.SystemBus.Name : ""));

            PokeContextMenuItem.Enabled       =
                FreezeContextMenuItem.Visible =
                    SelectedIndices.Any() &&
                    SelectedWatches.All(w => w.Domain.CanPoke());

            var allCheats = SelectedWatches.All(x => Global.CheatList.IsActive(x.Domain, x.Address));

            if (allCheats)
            {
                FreezeContextMenuItem.Text  = "&Unfreeze Address";
                FreezeContextMenuItem.Image = Properties.Resources.Unfreeze;
            }
            else
            {
                FreezeContextMenuItem.Text  = "&Freeze Address";
                FreezeContextMenuItem.Image = Properties.Resources.Freeze;
            }

            UnfreezeAllContextMenuItem.Visible = Global.CheatList.ActiveCount > 0;

            ViewInHexEditorContextMenuItem.Visible = SelectedWatches.Count() == 1;

            newToolStripMenuItem.Visible = indexes.Count == 0;
        }
예제 #6
0
파일: RamWatch.cs 프로젝트: lenalia/BizHawk
        private void FreezeAddressMenuItem_Click(object sender, EventArgs e)
        {
            var allCheats = SelectedWatches.All(x => Global.CheatList.IsActive(x.Domain, x.Address));

            if (allCheats)
            {
                SelectedWatches.UnfreezeAll();
            }
            else
            {
                SelectedWatches.FreezeAll();
            }
        }
예제 #7
0
파일: RamWatch.cs 프로젝트: lenalia/BizHawk
        private void NewRamWatch_Load(object sender, EventArgs e)
        {
            TopMost  = Settings.TopMost;
            _watches = new WatchList(_memoryDomains, _emu.SystemId);
            LoadConfigSettings();
            RamWatchMenu.Items.Add(Settings.Columns.GenerateColumnsMenu(ColumnToggleCallback));
            UpdateStatusBar();

            PokeAddressToolBarItem.Enabled       =
                FreezeAddressToolBarItem.Enabled =
                    SelectedIndices.Any() &&
                    SelectedWatches.All(w => w.Domain.CanPoke());
        }
예제 #8
0
		private void FreezeAddressMenuItem_Click(object sender, EventArgs e)
		{
			var allCheats = SelectedWatches.All(x => MainForm.CheatList.IsActive(x.Domain, x.Address));
			if (allCheats)
			{
				MainForm.CheatList.RemoveRange(SelectedWatches);
			}
			else
			{
				MainForm.CheatList.AddRange(
					SelectedWatches.Select(w => new Cheat(w, w.Value)));
			}
		}
예제 #9
0
파일: RamWatch.cs 프로젝트: lenalia/BizHawk
        private void WatchesSubMenu_DropDownOpened(object sender, EventArgs e)
        {
            EditWatchMenuItem.Enabled                =
                DuplicateWatchMenuItem.Enabled       =
                    RemoveWatchMenuItem.Enabled      =
                        MoveUpMenuItem.Enabled       =
                            MoveDownMenuItem.Enabled =
                                SelectedIndices.Any();

            PokeAddressMenuItem.Enabled       =
                FreezeAddressMenuItem.Enabled =
                    SelectedIndices.Any() &&
                    SelectedWatches.All(w => w.Domain.CanPoke());

            PauseMenuItem.Text = _paused ? "Unpause" : "Pause";
        }
예제 #10
0
파일: RamWatch.cs 프로젝트: jokm1/BizHawk
        private void WatchesSubMenu_DropDownOpened(object sender, EventArgs e)
        {
            EditWatchMenuItem.Enabled                          =
                DuplicateWatchMenuItem.Enabled                 =
                    RemoveWatchMenuItem.Enabled                =
                        MoveUpMenuItem.Enabled                 =
                            MoveDownMenuItem.Enabled           =
                                MoveTopMenuItem.Enabled        =
                                    MoveBottomMenuItem.Enabled =
                                        SelectedIndices.Any();

            PokeAddressMenuItem.Enabled       =
                FreezeAddressMenuItem.Enabled =
                    SelectedIndices.Any() &&
                    SelectedWatches.All(w => w.Domain.Writable);
        }
예제 #11
0
		private void SearchSubMenu_DropDownOpened(object sender, EventArgs e)
		{
			ClearChangeCountsMenuItem.Enabled = _settings.IsDetailed();

			RemoveMenuItem.Enabled =
				AddToRamWatchMenuItem.Enabled =
				SelectedIndices.Any();

			PokeAddressMenuItem.Enabled =
				FreezeAddressMenuItem.Enabled =
				SelectedIndices.Any() &&
				SelectedWatches.All(w => w.Domain.Writable);

			UndoMenuItem.Enabled =
				ClearUndoMenuItem.Enabled =
				_searches.CanUndo;

			RedoMenuItem.Enabled = _searches.CanRedo;
		}
예제 #12
0
        private void NewRamWatch_Load(object sender, EventArgs e)
        {
            // Hack for previous config settings
            if (Settings.Columns.Any(c => string.IsNullOrWhiteSpace(c.Text)))
            {
                Settings = new RamWatchSettings();
            }

            TopMost  = Settings.TopMost;
            _watches = new WatchList(MemoryDomains, Emu.SystemId);
            LoadConfigSettings();
            RamWatchMenu.Items.Add(WatchListView.ToColumnsMenu(ColumnToggleCallback));
            UpdateStatusBar();

            PokeAddressToolBarItem.Enabled       =
                FreezeAddressToolBarItem.Enabled =
                    SelectedIndices.Any() &&
                    SelectedWatches.All(w => w.Domain.CanPoke());
        }
예제 #13
0
		private void ListViewContextMenu_Opening(object sender, CancelEventArgs e)
		{
			DoSearchContextMenuItem.Enabled = _searches.Count > 0;

			RemoveContextMenuItem.Visible =
				AddToRamWatchContextMenuItem.Visible =
				FreezeContextMenuItem.Visible =
				ContextMenuSeparator2.Visible =
				ViewInHexEditorContextMenuItem.Visible =
				SelectedIndices.Any();

			PokeContextMenuItem.Enabled =
				FreezeContextMenuItem.Visible =
				SelectedIndices.Any() &&
				SelectedWatches.All(w => w.Domain.Writable);

			UnfreezeAllContextMenuItem.Visible = MainForm.CheatList.ActiveCount > 0;

			ContextMenuSeparator3.Visible = SelectedIndices.Any() || (MainForm.CheatList.ActiveCount > 0);

			var allCheats = true;
			foreach (var index in SelectedIndices)
			{
				if (!MainForm.CheatList.IsActive(_settings.Domain, _searches[index].Address))
				{
					allCheats = false;
				}
			}

			if (allCheats)
			{
				FreezeContextMenuItem.Text = "&Unfreeze Address";
				FreezeContextMenuItem.Image = Resources.Unfreeze;
			}
			else
			{
				FreezeContextMenuItem.Text = "&Freeze Address";
				FreezeContextMenuItem.Image = Resources.Freeze;
			}
		}