Skip to content

Commit

Permalink
show files on text field
Browse files Browse the repository at this point in the history
  • Loading branch information
diogobernini committed Jun 6, 2015
1 parent 9f72a0b commit 106f571
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
16 changes: 2 additions & 14 deletions Assembler UI/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,9 @@
Title="F# MIPS Assembler" Height="461.755" Width="700.782">
<Grid>
<Button Content="Pick an asm file" HorizontalAlignment="Left" VerticalAlignment="Top" Width="150" Click="Button_Click" Margin="544,0,0,0"/>
<RichTextBox Name="asmOriginal" HorizontalAlignment="Left" Height="413" Margin="0,19,0,0" VerticalAlignment="Top" Width="350">
<FlowDocument>
<Paragraph>
<Run Text="ASSEMBLY FILE"/>
</Paragraph>
</FlowDocument>
</RichTextBox>
<RichTextBox Name="asmFinal" HorizontalAlignment="Left" Height="413" Margin="350,19,0,0" VerticalAlignment="Top" Width="344">
<FlowDocument>
<Paragraph>
<Run Text="ASSEMBLED FILE"/>
</Paragraph>
</FlowDocument>
</RichTextBox>
<Label Name="TxtFile" Content="File Name" HorizontalAlignment="Left" Margin="10,-3,0,0" VerticalAlignment="Top" RenderTransformOrigin="1.152,0.026" Width="529" Height="30"/>
<TextBlock Name="asmOriginal" HorizontalAlignment="Left" Margin="10,32,0,0" TextWrapping="Wrap" Text="ASSEMBLY ORIGINAL" VerticalAlignment="Top" Height="390" Width="334"/>
<TextBlock Name="asmFinal" HorizontalAlignment="Left" Margin="350,32,0,0" TextWrapping="Wrap" Text="ASSEMBLY FINAL" VerticalAlignment="Top" Height="390" Width="334"/>

</Grid>
</Window>
4 changes: 3 additions & 1 deletion Assembler UI/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ private void Button_Click(object sender, RoutedEventArgs e)
var file = fileDialog.FileName;
char[] charsToTrim = { '.', 'a', 's', 'm' };
var fileNoExt = file.TrimEnd(charsToTrim);
var list = global::Program.Assembler.assemble(file, fileNoExt + "compiled.asm");
var list = Program.Assembler.assemble(file, fileNoExt + "compiled.asm");
asmFinal.Text = String.Join("\n", list);
asmOriginal.Text = String.Join("\n", Program.Assembler.readLines(file));
TxtFile.Content = file;
TxtFile.ToolTip = file;
break;
Expand Down

0 comments on commit 106f571

Please sign in to comment.