mirror of
https://github.com/fadden/6502bench.git
synced 2025-08-11 18:25:04 +00:00
Minor UI tweaks
Typing a long comment in the project symbol editor caused the window to expand, which wasn't intended. Use the mono font in the comment editor. Set the focus to the OK button after creating or editing a project property. Show constant vs. address in the info panel when an EQU directive is selected.
This commit is contained in:
@@ -788,21 +788,6 @@ namespace SourceGen {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
///// <summary>
|
|
||||||
///// Removes all header lines from the line list.
|
|
||||||
///// </summary>
|
|
||||||
//private void ClearHeaderLines() {
|
|
||||||
// // Find the first non-header item.
|
|
||||||
// int endIndex = FindLineByOffset(mLineList, 0);
|
|
||||||
// if (endIndex == 0) {
|
|
||||||
// // no header lines present
|
|
||||||
// Debug.WriteLine("No header lines found");
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// Debug.WriteLine("Removing " + endIndex + " header lines");
|
|
||||||
// mLineList.RemoveRange(0, endIndex);
|
|
||||||
//}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Generates a synthetic offset for the FileOffset field from an index value. The
|
/// Generates a synthetic offset for the FileOffset field from an index value. The
|
||||||
/// index arg is the index of an entry in the DisasmProject.ActiveDefSymbolList.
|
/// index arg is the index of an entry in the DisasmProject.ActiveDefSymbolList.
|
||||||
@@ -823,6 +808,10 @@ namespace SourceGen {
|
|||||||
return offset + (1 << 24);
|
return offset + (1 << 24);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NOTE: the two functions above are tied to the implementation of the function
|
||||||
|
// below: we output the lines in the order in which they appear in ActiveDefSymbolList.
|
||||||
|
// If we want to get fancy and sort them, we'll need to do some additional work.
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Generates the header lines (header comment, EQU directives).
|
/// Generates the header lines (header comment, EQU directives).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -834,7 +823,6 @@ namespace SourceGen {
|
|||||||
PseudoOp.PseudoOpNames opNames) {
|
PseudoOp.PseudoOpNames opNames) {
|
||||||
List<Line> tmpLines = new List<Line>();
|
List<Line> tmpLines = new List<Line>();
|
||||||
Line line;
|
Line line;
|
||||||
FormattedParts parts;
|
|
||||||
|
|
||||||
// Check for header comment.
|
// Check for header comment.
|
||||||
if (proj.LongComments.TryGetValue(Line.HEADER_COMMENT_OFFSET,
|
if (proj.LongComments.TryGetValue(Line.HEADER_COMMENT_OFFSET,
|
||||||
@@ -853,7 +841,7 @@ namespace SourceGen {
|
|||||||
null, defSym.DataDescriptor, defSym.Value, 1,
|
null, defSym.DataDescriptor, defSym.Value, 1,
|
||||||
PseudoOp.FormatNumericOpFlags.None);
|
PseudoOp.FormatNumericOpFlags.None);
|
||||||
string comment = formatter.FormatEolComment(defSym.Comment);
|
string comment = formatter.FormatEolComment(defSym.Comment);
|
||||||
parts = FormattedParts.CreateEquDirective(defSym.Label,
|
FormattedParts parts = FormattedParts.CreateEquDirective(defSym.Label,
|
||||||
formatter.FormatPseudoOp(opNames.EquDirective),
|
formatter.FormatPseudoOp(opNames.EquDirective),
|
||||||
valueStr, comment);
|
valueStr, comment);
|
||||||
line.Parts = parts;
|
line.Parts = parts;
|
||||||
|
@@ -3270,6 +3270,11 @@ namespace SourceGen {
|
|||||||
sourceStr = "???";
|
sourceStr = "???";
|
||||||
}
|
}
|
||||||
extraStr = "Source: " + sourceStr;
|
extraStr = "Source: " + sourceStr;
|
||||||
|
if (defSym.SymbolType == Symbol.Type.Constant) {
|
||||||
|
extraStr += " (constant)";
|
||||||
|
} else {
|
||||||
|
extraStr += " (address)";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case LineListGen.Line.Type.LocalVariableTable:
|
case LineListGen.Line.Type.LocalVariableTable:
|
||||||
|
@@ -30,6 +30,7 @@ limitations under the License.
|
|||||||
<StackPanel Margin="8">
|
<StackPanel Margin="8">
|
||||||
<TextBlock Text="Enter comment:"/>
|
<TextBlock Text="Enter comment:"/>
|
||||||
<TextBox Name="commentTextBox" Text="{Binding CommentText}" Width="480" Margin="0,4,0,0"
|
<TextBox Name="commentTextBox" Text="{Binding CommentText}" Width="480" Margin="0,4,0,0"
|
||||||
|
FontFamily="{StaticResource GeneralMonoFont}"
|
||||||
TextChanged="CommentTextBox_TextChanged"/>
|
TextChanged="CommentTextBox_TextChanged"/>
|
||||||
<DockPanel>
|
<DockPanel>
|
||||||
<TextBlock DockPanel.Dock="Right"
|
<TextBlock DockPanel.Dock="Right"
|
||||||
|
@@ -22,7 +22,7 @@ limitations under the License.
|
|||||||
xmlns:local="clr-namespace:SourceGen.WpfGui"
|
xmlns:local="clr-namespace:SourceGen.WpfGui"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Title="Edit Symbol"
|
Title="Edit Symbol"
|
||||||
SizeToContent="WidthAndHeight" ResizeMode="NoResize"
|
SizeToContent="Height" Width="320" ResizeMode="NoResize"
|
||||||
ShowInTaskbar="False" WindowStartupLocation="CenterOwner"
|
ShowInTaskbar="False" WindowStartupLocation="CenterOwner"
|
||||||
Loaded="Window_Loaded"
|
Loaded="Window_Loaded"
|
||||||
ContentRendered="Window_ContentRendered">
|
ContentRendered="Window_ContentRendered">
|
||||||
@@ -69,7 +69,7 @@ limitations under the License.
|
|||||||
<TextBlock Grid.Column="0" Grid.Row="3" Text="Comment:" Margin="0,0,8,0"/>
|
<TextBlock Grid.Column="0" Grid.Row="3" Text="Comment:" Margin="0,0,8,0"/>
|
||||||
<StackPanel Grid.Column="1" Grid.Row="3">
|
<StackPanel Grid.Column="1" Grid.Row="3">
|
||||||
<TextBox Margin="0,1,0,0" Text="{Binding Comment, UpdateSourceTrigger=PropertyChanged}"
|
<TextBox Margin="0,1,0,0" Text="{Binding Comment, UpdateSourceTrigger=PropertyChanged}"
|
||||||
FontFamily="{StaticResource GeneralMonoFont}"/>
|
FontFamily="{StaticResource GeneralMonoFont}" ScrollViewer.CanContentScroll="True"/>
|
||||||
<TextBlock Text="• Optional" Margin="0,4,0,16"/>
|
<TextBlock Text="• Optional" Margin="0,4,0,16"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
|
@@ -452,6 +452,8 @@ namespace SourceGen.WpfGui {
|
|||||||
// the symbol at the correct sorted position.
|
// the symbol at the correct sorted position.
|
||||||
LoadProjectSymbols();
|
LoadProjectSymbols();
|
||||||
UpdateControls();
|
UpdateControls();
|
||||||
|
|
||||||
|
okButton.Focus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -485,6 +487,8 @@ namespace SourceGen.WpfGui {
|
|||||||
IsDirty = true;
|
IsDirty = true;
|
||||||
LoadProjectSymbols();
|
LoadProjectSymbols();
|
||||||
UpdateControls();
|
UpdateControls();
|
||||||
|
|
||||||
|
okButton.Focus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user