diff --git a/SourceGen/WpfGui/EditInstructionOperand.xaml b/SourceGen/WpfGui/EditInstructionOperand.xaml
index 26a1c9f..2d398ca 100644
--- a/SourceGen/WpfGui/EditInstructionOperand.xaml
+++ b/SourceGen/WpfGui/EditInstructionOperand.xaml
@@ -169,7 +169,7 @@ limitations under the License.
+ IsEnabled="{Binding IsDiddleLabelEnabled}" Click="EditLabel_Click"/>
diff --git a/SourceGen/WpfGui/EditInstructionOperand.xaml.cs b/SourceGen/WpfGui/EditInstructionOperand.xaml.cs
index fb4c975..4c92773 100644
--- a/SourceGen/WpfGui/EditInstructionOperand.xaml.cs
+++ b/SourceGen/WpfGui/EditInstructionOperand.xaml.cs
@@ -308,6 +308,12 @@ namespace SourceGen.WpfGui {
SymbolValueHex = SYMBOL_NOT_USED;
}
+ // We want to disable the create/edit label button if a symbol has been
+ // specified, because the label being edited is the one that the numeric
+ // reference points to, not the one the symbol points to.
+ // TODO(maybe): leave it enabled if the symbolic ref matches the numeric ref.
+ IsDiddleLabelEnabled = !FormatSymbol;
+
UpdatePreview();
UpdateCopyToOperand();
}
@@ -857,6 +863,12 @@ namespace SourceGen.WpfGui {
}
private bool mIsCopyToOperandEnabled;
+ public bool IsDiddleLabelEnabled {
+ get { return mIsDiddleLabelEnabled; }
+ set { mIsDiddleLabelEnabled = value; OnPropertyChanged(); }
+ }
+ private bool mIsDiddleLabelEnabled;
+
///
/// Edited label value. Will be null if the label hasn't been created, or has been
/// deleted (by entering a blank string in the label edit box).
@@ -889,7 +901,7 @@ namespace SourceGen.WpfGui {
private DefSymbol mEditedProjectSymbol;
///
- /// Configures the UI in the local variables box at load time.
+ /// Configures the UI in the Numeric Address Reference box at load time.
///
private void NumericReferences_Loaded() {
SymbolEditOffsetResult = -1;
@@ -1121,7 +1133,7 @@ namespace SourceGen.WpfGui {
///
- /// Configures the UI in the local variables box at load time.
+ /// Configures the UI in the Local Variable box at load time.
///
private void LocalVariables_Loaded() {
if (!mOpDef.IsDirectPageInstruction && !mOpDef.IsStackRelInstruction) {