private void pseudoOpSetButton_Click(object sender, EventArgs e) { AsmComboItem item = (AsmComboItem)pseudoOpQuickComboBox.SelectedItem; AssemblerInfo.Id asmId = item.AssemblerId; AsmGen.IGenerator gen = AssemblerInfo.GetGenerator(asmId); PseudoOp.PseudoOpNames opNames; Asm65.Formatter.FormatConfig formatConfig; gen.GetDefaultDisplayFormat(out opNames, out formatConfig); ImportPseudoOpNames(opNames); // dirty flag set by change watchers if one or more fields have changed }
private void displayFmtSetButton_Click(object sender, EventArgs e) { AsmComboItem item = (AsmComboItem)displayFmtQuickComboBox.SelectedItem; AssemblerInfo.Id asmId = item.AssemblerId; AsmGen.IGenerator gen = AssemblerInfo.GetGenerator(asmId); PseudoOp.PseudoOpNames opNames; Asm65.Formatter.FormatConfig formatConfig; gen.GetDefaultDisplayFormat(out opNames, out formatConfig); SetWidthDisamSettings(formatConfig.mForceAbsOpcodeSuffix, formatConfig.mForceLongOpcodeSuffix, formatConfig.mForceAbsOperandPrefix, formatConfig.mForceLongOperandPrefix); SetExpressionStyle(formatConfig.mExpressionMode); // dirty flag set by change watchers if one or more fields have changed }
/// <summary> /// Populates the UI elements from the asm config item in the settings. If that doesn't /// exist, use the default config. /// </summary> private void PopulateAsmConfigItems() { AsmComboItem item = (AsmComboItem)asmConfigComboBox.SelectedItem; AssemblerInfo.Id asmId = item.AssemblerId; AssemblerConfig config = AssemblerConfig.GetConfig(mSettings, asmId); if (config == null) { AsmGen.IAssembler asm = AssemblerInfo.GetAssembler(asmId); config = asm.GetDefaultConfig(); } asmExePathTextBox.Text = config.ExecutablePath; asmLabelColWidthTextBox.Text = config.ColumnWidths[0].ToString(); asmOpcodeColWidthTextBox.Text = config.ColumnWidths[1].ToString(); asmOperandColWidthTextBox.Text = config.ColumnWidths[2].ToString(); asmCommentColWidthTextBox.Text = config.ColumnWidths[3].ToString(); }
private void asmExeBrowseButton_Click(object sender, EventArgs e) { AsmComboItem item = (AsmComboItem)asmConfigComboBox.SelectedItem; AssemblerInfo.Id asmId = item.AssemblerId; // Figure out what we're looking for. For example, cc65 needs "cl65". AsmGen.IAssembler asm = AssemblerInfo.GetAssembler(asmId); asm.GetExeIdentifiers(out string humanName, out string exeName); // Ask the user to find it. string pathName = BrowseForExecutable(humanName, exeName); if (pathName != null) { asmExePathTextBox.Text = pathName; AssemblerConfig.SetConfig(mSettings, asmId, GetAsmConfigFromUi()); SetDirty(true); } }
public EditAppSettings(ProjectView projectView, Tab initialTab, AssemblerInfo.Id initialAsmId) { InitializeComponent(); mProjectView = projectView; mInitialTab = initialTab; mInitialAsmId = initialAsmId; // Make a work copy, so we can discard changes if the user cancels out of the dialog. projectView.SerializeCodeListColumnWidths(); mSettings = AppSettings.Global.GetCopy(); // Put column-width buttons in an array. mColButtons = new Button[] { showCol0, showCol1, showCol2, showCol3, showCol4, showCol5, showCol6, showCol7, showCol8 }; Debug.Assert(NUM_COLUMNS == 9); // Extract formats from column-width button labels. for (int i = 0; i < NUM_COLUMNS; i++) { mColButtons[i].Click += ColumnVisibilityButtonClick; mColumnFormats[i] = mColButtons[i].Text; } // Map text boxes to PseudoOpName fields. mPseudoNameMap = new TextBoxPropertyMap[] { new TextBoxPropertyMap(equDirectiveTextBox, "EquDirective"), new TextBoxPropertyMap(orgDirectiveTextBox, "OrgDirective"), new TextBoxPropertyMap(regWidthDirectiveTextBox, "RegWidthDirective"), new TextBoxPropertyMap(defineData1TextBox, "DefineData1"), new TextBoxPropertyMap(defineData2TextBox, "DefineData2"), new TextBoxPropertyMap(defineData3TextBox, "DefineData3"), new TextBoxPropertyMap(defineData4TextBox, "DefineData4"), new TextBoxPropertyMap(defineBigData2TextBox, "DefineBigData2"), new TextBoxPropertyMap(fillTextBox, "Fill"), new TextBoxPropertyMap(denseTextBox, "Dense"), new TextBoxPropertyMap(strGenericTextBox, "StrGeneric"), new TextBoxPropertyMap(strGenericHiTextBox, "StrGenericHi"), new TextBoxPropertyMap(strReverseTextBox, "StrReverse"), new TextBoxPropertyMap(strReverseHiTextBox, "StrReverseHi"), new TextBoxPropertyMap(strLen8TextBox, "StrLen8"), new TextBoxPropertyMap(strLen8HiTextBox, "StrLen8Hi"), new TextBoxPropertyMap(strLen16TextBox, "StrLen16"), new TextBoxPropertyMap(strLen16HiTextBox, "StrLen16Hi"), new TextBoxPropertyMap(strNullTermTextBox, "StrNullTerm"), new TextBoxPropertyMap(strNullTermHiTextBox, "StrNullTermHi"), new TextBoxPropertyMap(strDciTextBox, "StrDci"), new TextBoxPropertyMap(strDciHiTextBox, "StrDciHi"), }; ConfigureComboBox(asmConfigComboBox); ConfigureComboBox(displayFmtQuickComboBox); ConfigureComboBox(pseudoOpQuickComboBox); expressionStyleComboBox.DisplayMember = "Name"; foreach (ExpressionStyleItem esi in sExpStyleItems) { expressionStyleComboBox.Items.Add(esi); } }