Example #1
0
        public void FindMatch(SearchParameters options)
        {
            int         activeEditorIndex = mWordEditorList.ActiveEditorIndex;
            IWordEditor activeEditor      = activeEditorIndex >= 0 ? mWordEditorList[activeEditorIndex] : null;

            if (activeEditor != null)
            {
                options.SearchFromWordIndex  = ((IMemoryFullWord)activeEditor.WordValue).Index;
                options.SearchFromField      = activeEditor.FocusedField ?? FieldTypes.None;
                options.SearchFromFieldIndex = options.SearchFromField != FieldTypes.None ? activeEditor.CaretIndex ?? 0 : 0;
            }
            else
            {
                if (mWordEditorList.FirstVisibleIndex > options.SearchFromWordIndex || mWordEditorList.FirstVisibleIndex + mWordEditorList.VisibleEditorCount <= options.SearchFromWordIndex)
                {
                    options.SearchFromWordIndex = mWordEditorList.FirstVisibleIndex;
                }
                options.SearchFromField      = FieldTypes.None;
                options.SearchFromFieldIndex = 0;
            }

            var result = mMemory.FindMatch(options);

            if (result != null)
            {
                MakeAddressVisible(result.WordIndex);
                activeEditor = mWordEditorList[result.WordIndex - mWordEditorList.FirstVisibleIndex];
                activeEditor.Focus(result.Field, result.FieldIndex);
                activeEditor.Select(result.FieldIndex, options.SearchText.Length);
            }
            else
            {
                MessageBox.Show(this, string.Format("Search text \"{0}\" could not be found.", options.SearchText), "Text not found", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Example #2
0
        void LoadWordEditor(IWordEditor editor, int index)
        {
            var deviceEditor = (DeviceWordEditor)editor;

            deviceEditor.DeviceWord = index >= 0 ? mRecordEditWords[index] : new FullWord(0L);
            deviceEditor.WordIndex  = index;
        }
Example #3
0
        void LoadWordEditor(IWordEditor editor, int address)
        {
            var memoryEditor = (MemoryWordEditor)editor;

            if (address == memoryEditor.MemoryWord.Index && address >= mMemory.MinWordIndex && memoryEditor.MemoryWord.Equals(mMemory[address]))
            {
                memoryEditor.Update();
            }
            else
            {
                memoryEditor.MemoryWord = address >= mMemory.MinWordIndex ? mMemory[address] : new MemoryFullWord(address);
            }

            memoryEditor.BreakPointChecked = mBreakpoints.Contains(address);
            memoryEditor.Marked            = mMarkedAddress == address;
        }
Example #4
0
 void Editor_ValueChanged(IWordEditor sender, Events.WordEditorValueChangedEventArgs args)
 {
     ChangesPending = true;
 }
Example #5
0
 void WordEditor_ValueChanged(IWordEditor sender, WordEditorValueChangedEventArgs args)
 {
     mLongValueTextBox.Magnitude = mWordEditor.WordValue.MagnitudeLongValue;
     mLongValueTextBox.Sign      = mWordEditor.WordValue.Sign;
     OnValueChanged(args);
 }
Example #6
0
 void MWordValueEditor_ValueChanged(IWordEditor sender, WordEditorValueChangedEventArgs args)
 {
     mWordCharTextBox.Update();
     OnValueChanged(args);
 }
Example #7
0
 void MFullWordEditor_ValueChanged(IWordEditor sender, WordEditorValueChangedEventArgs args) => OnValueChanged(args);
Example #8
0
 void MFullWordEditor_ValueChanged(IWordEditor sender, WordEditorValueChangedEventArgs args)
 {
     mInstructionTextBox.Update();
     OnValueChanged(args);
 }