public LongValueToolStripTextBox(LongValueTextBox innerBox) : base(innerBox) { InitializeComponent(); AutoSize = false; Size = innerBox.Size; Control.SizeChanged += Control_SizeChanged; }
void TextBox_ValueChanged(LongValueTextBox source, LongValueTextBox.ValueChangedEventArgs args) { IWord wordValue = mWordEditor.WordValue; IWord oldValue = new Word(wordValue.Magnitude, wordValue.Sign); wordValue.MagnitudeLongValue = mLongValueTextBox.Magnitude; wordValue.Sign = mLongValueTextBox.Sign; mWordEditor.Update(); OnValueChanged(new WordEditorValueChangedEventArgs(oldValue, new Word(wordValue.Magnitude, wordValue.Sign))); }
void MFirstAddressTextBox_ValueChanged(LongValueTextBox source, LongValueTextBox.ValueChangedEventArgs args) { var oldViewInfo = new EditorListViewInfo { FirstVisibleIndex = mWordEditorList.FirstVisibleIndex }; int selectedEditorIndex = mWordEditorList.ActiveEditorIndex; if (selectedEditorIndex >= 0) { oldViewInfo.SelectedIndex = oldViewInfo.FirstVisibleIndex + selectedEditorIndex; oldViewInfo.FocusedField = mWordEditorList[selectedEditorIndex].FocusedField; } mWordEditorList.FirstVisibleIndex = (int)args.NewValue; mAddressHistorySelector.AddItem(oldViewInfo, new EditorListViewInfo { FirstVisibleIndex = mWordEditorList.FirstVisibleIndex }); }
public WordValueEditor(int byteCount, bool includeSign) { mIncludeSign = includeSign; mReadOnly = false; mTextBoxWidth = 80; mWordEditor = new WordEditor(byteCount, includeSign); mEqualsLabel = new Label(); mLongValueTextBox = new LongValueTextBox(includeSign); mWordEditor.Name = "WordEditor"; mWordEditor.Location = new Point(0, 0); mWordEditor.ReadOnly = mReadOnly; mWordEditor.TabIndex = 0; mWordEditor.TabStop = true; mWordEditor.ValueChanged += WordEditor_ValueChanged; mWordEditor.NavigationKeyDown += This_KeyDown; mEqualsLabel.Name = "EqualsLabel"; mEqualsLabel.TabIndex = 1; mEqualsLabel.TabStop = false; mEqualsLabel.Text = "="; mEqualsLabel.Size = new Size(10, 19); mLongValueTextBox.Name = "LongValueTextBox"; mLongValueTextBox.ReadOnly = mReadOnly; mLongValueTextBox.SupportNegativeZero = true; mLongValueTextBox.TabIndex = 2; mLongValueTextBox.TabStop = true; mLongValueTextBox.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top; mLongValueTextBox.ValueChanged += TextBox_ValueChanged; mLongValueTextBox.NavigationKeyDown += This_KeyDown; SuspendLayout(); Controls.Add(mWordEditor); Controls.Add(mEqualsLabel); Controls.Add(mLongValueTextBox); Name = "WordValueEditor"; KeyDown += This_KeyDown; SizeComponent(); }
void InitializeComponent() { SuspendLayout(); Controls.Clear(); if (mMemory == null) { Controls.Add(mNoMemoryLabel); mNoMemoryLabel.Size = Size; ResumeLayout(false); } else { mFirstAddressPanel = new Panel(); mFirstAddressLabel = new Label(); mFirstAddressTextBox = new LongValueTextBox(true, mMemory.MinWordIndex, mMemory.MaxWordIndex); mSetClipboardLabel = new Label(); mAddressScrollBar = new VScrollBar(); mAddressHistorySelector = new LinkedItemsSelectorControl <EditorListViewInfo>(); mAddressHistorySelector.SetCurrentItemCallback(GetCurrentListViewInfo); mMixCharButtons = new MixCharClipboardButtonControl(); mExportButton = new Button(); mUpButton = new Button(); mDownButton = new Button(); mFirstAddressPanel.SuspendLayout(); mFirstAddressLabel.Location = new Point(0, 0); mFirstAddressLabel.Name = "mFirstAddressLabel"; mFirstAddressLabel.Size = new Size(110, 21); mFirstAddressLabel.TabIndex = 0; mFirstAddressLabel.Text = "First visible address:"; mFirstAddressLabel.TextAlign = ContentAlignment.MiddleLeft; mFirstAddressTextBox.Location = new Point(mFirstAddressLabel.Width, 0); mFirstAddressTextBox.Name = "mFirstAddressTextBox"; mFirstAddressTextBox.Size = new Size(32, 20); mFirstAddressTextBox.TabIndex = 1; mFirstAddressTextBox.ClearZero = false; mFirstAddressTextBox.ValueChanged += MFirstAddressTextBox_ValueChanged; mAddressHistorySelector.Location = new Point(mFirstAddressTextBox.Right + 4, 0); mAddressHistorySelector.Name = "mAddressHistorySelector"; mAddressHistorySelector.TabIndex = 2; mAddressHistorySelector.ItemSelected += MAddressHistorySelector_ItemSelected; mSetClipboardLabel.Location = new Point(mAddressHistorySelector.Right + 16, 0); mSetClipboardLabel.Name = "mSetClipboardLabel"; mSetClipboardLabel.Size = new Size(88, mFirstAddressLabel.Height); mSetClipboardLabel.TabIndex = 3; mSetClipboardLabel.Text = "Set clipboard to:"; mSetClipboardLabel.TextAlign = ContentAlignment.MiddleLeft; mMixCharButtons.Location = new Point(mSetClipboardLabel.Right, 0); mMixCharButtons.Name = "mMixCharButtons"; mMixCharButtons.TabIndex = 4; mExportButton.Location = new Point(mMixCharButtons.Right + 16, 0); mExportButton.Name = "mExportButton"; mExportButton.Size = new Size(62, 21); mExportButton.TabIndex = 5; mExportButton.Text = "&Export..."; mExportButton.Click += MExportButton_Click; mDownButton.Visible = mMemory is Memory; mDownButton.Enabled = false; mDownButton.FlatStyle = FlatStyle.Flat; mDownButton.Anchor = AnchorStyles.Top | AnchorStyles.Right; mDownButton.Image = Resources.Symbols_Down_16xLG; mDownButton.Name = "mDownButton"; mDownButton.Size = new Size(21, 21); mDownButton.Location = new Point(Width - mDownButton.Width, 0); mDownButton.TabIndex = 7; mDownButton.Click += MDownButton_Click; mUpButton.Visible = mMemory is Memory; mUpButton.Enabled = false; mUpButton.FlatStyle = FlatStyle.Flat; mUpButton.Anchor = AnchorStyles.Top | AnchorStyles.Right; mUpButton.Image = Resources.Symbols_Up_16xLG___kopie; mUpButton.Name = "mUpButton"; mUpButton.Size = new Size(21, 21); mUpButton.Location = new Point(mDownButton.Left - mUpButton.Width, 0); mUpButton.TabIndex = 6; mUpButton.Click += MUpButton_Click; mFirstAddressPanel.Controls.Add(mFirstAddressLabel); mFirstAddressPanel.Controls.Add(mFirstAddressTextBox); mFirstAddressPanel.Controls.Add(mAddressHistorySelector); mFirstAddressPanel.Controls.Add(mSetClipboardLabel); mFirstAddressPanel.Controls.Add(mMixCharButtons); mFirstAddressPanel.Controls.Add(mExportButton); mFirstAddressPanel.Controls.Add(mUpButton); mFirstAddressPanel.Controls.Add(mDownButton); mFirstAddressPanel.Dock = DockStyle.Top; mFirstAddressPanel.Name = "mFirstAddressPanel"; mFirstAddressPanel.TabIndex = 0; mFirstAddressPanel.Size = new Size(Width, mFirstAddressTextBox.Height + 2); mWordEditorList = new WordEditorList(mMemory.MinWordIndex, mMemory.MaxWordIndex, CreateWordEditor, LoadWordEditor) { Dock = DockStyle.Fill, ReadOnly = mReadOnly }; mWordEditorList.FirstVisibleIndexChanged += MWordEditorList_FirstVisibleIndexChanged; Controls.Add(mWordEditorList); Controls.Add(mFirstAddressPanel); Name = "MemoryEditor"; SizeChanged += MemoryEditor_SizeChanged; mFirstAddressPanel.ResumeLayout(false); ResumeLayout(false); SetUpDownButtonStates(NavigationDirection.None); } }
void MFirstWordTextBox_ValueChanged(LongValueTextBox source, LongValueTextBox.ValueChangedEventArgs args) { mWordEditorList.FirstVisibleIndex = (int)args.NewValue; }
void MFirstRecordTextBox_ValueChanged(LongValueTextBox source, LongValueTextBox.ValueChangedEventArgs args) { mMixByteCollectionEditorList.FirstVisibleIndex = (int)args.NewValue; }