Skip to content

Commit

Permalink
Code update
Browse files Browse the repository at this point in the history
Add save project
Add open project
Add line highlight
Add JMZ command
Add HLT command
Remove extra commands
Fix bugs
  • Loading branch information
jpdante committed Sep 23, 2019
1 parent c7c59b4 commit 6019c2e
Show file tree
Hide file tree
Showing 12 changed files with 328 additions and 319 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<ItemGroup>
<Resource Include="resources\VHDL.xml" />
</ItemGroup>
<ItemGroup>
<Resource Include="resources\syntax.xsd" />
</ItemGroup>
Expand Down
19 changes: 13 additions & 6 deletions AurelienRibon.Ui.SyntaxHighlightBox/resources/ASM.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Syntax name="ASM">
<HighlightWordsRule name="Instructions">
<Words>
MOV ADD SUB MUL DIV LOD STO JMP BREQ CP HALt
ADD SUB MUL DIV LOD STO JMP JMZ HLT NOP
</Words>
<IgnoreCase>true</IgnoreCase>
<Foreground>#2A0085</Foreground>
Expand All @@ -15,7 +15,7 @@
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
</Words>
<IgnoreCase>true</IgnoreCase>
<Foreground>#006335</Foreground>
<Foreground>#0D7B40</Foreground>
<FontWeight>Normal</FontWeight>
<FontStyle>Normal</FontStyle>
</HighlightWordsRule>
Expand All @@ -26,17 +26,24 @@
<FontWeight>Normal</FontWeight>
<FontStyle>Normal</FontStyle>
</HighlightLineRule>
<AdvancedHighlightRule name="Numbers">
<Expression>\b([0-9]+)\b</Expression>
<AdvancedHighlightRule name="Line Numbers">
<Expression>([0-9]+)</Expression>
<IgnoreCase>false</IgnoreCase>
<Foreground>#F68A1B</Foreground>
<Foreground>#0D7B40</Foreground>
<FontWeight>Normal</FontWeight>
<FontStyle>Normal</FontStyle>
</AdvancedHighlightRule>
<AdvancedHighlightRule name="Numbers">
<Expression>#([0-9]+)</Expression>
<IgnoreCase>false</IgnoreCase>
<Foreground>#AC5A12</Foreground>
<FontWeight>Normal</FontWeight>
<FontStyle>Normal</FontStyle>
</AdvancedHighlightRule>
<AdvancedHighlightRule name="Hex">
<Expression>0[xX][0-9a-fA-F]+</Expression>
<IgnoreCase>false</IgnoreCase>
<Foreground>#006335</Foreground>
<Foreground>#0D7B40</Foreground>
<FontWeight>Normal</FontWeight>
<FontStyle>Normal</FontStyle>
</AdvancedHighlightRule>
Expand Down
80 changes: 0 additions & 80 deletions AurelienRibon.Ui.SyntaxHighlightBox/resources/VHDL.xml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ private void OnScrollChanged(object sender, ScrollChangedEventArgs e) {

private void UpdateTotalLineCount() {
totalLineCount = TextUtilities.GetLineCount(Text);
}
}

private void UpdateBlocks() {
if (blocks.Count == 0)
Expand Down Expand Up @@ -262,7 +262,7 @@ public int GetIndexOfFirstVisibleLine() {
public int GetIndexOfLastVisibleLine() {
double height = VerticalOffset + ViewportHeight;
int guessedLine = (int)(height / lineHeight);
return guessedLine > totalLineCount - 1 ? totalLineCount - 1 : guessedLine;
return guessedLine > totalLineCount - 1 ? totalLineCount - 1 : guessedLine;
}

/// <summary>
Expand Down
8 changes: 4 additions & 4 deletions VNS/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
</ListView>
<SyntaxHighlightBox:SyntaxHighlightBox x:Name="CodeBox" Margin="10,25,0,51" HorizontalAlignment="Left" Width="228" CharacterCasing="Upper" FontFamily="Arial" FontSize="16" TextChanged="CodeBox_TextChanged"/>
<Grid Height="46" VerticalAlignment="Bottom" Background="{DynamicResource {x:Static SystemColors.MenuBrushKey}}">
<Button x:Name="StartBtn" Content="Iniciar" Margin="10,10,0,10" Height="Auto" Click="StartBtn_Click" HorizontalAlignment="Left" Width="100"/>
<Button x:Name="NextBtn" Content="Avancar" Margin="115,10,0,10" Height="Auto" HorizontalAlignment="Left" Width="100" Click="NextBtn_Click"/>
<Button x:Name="StopBtn" Content="Parar" Margin="220,10,0,10" Height="Auto" HorizontalAlignment="Left" Width="100" Click="StopBtn_Click" IsEnabled="{Binding WindowBindings.IsRunning, RelativeSource={RelativeSource FindAncestor, AncestorType=Window}}"/>
<Button x:Name="StartBtn" Content="Start" Margin="10,10,0,10" Height="Auto" Click="StartBtn_Click" HorizontalAlignment="Left" Width="100"/>
<Button x:Name="NextBtn" Content="Step" Margin="115,10,0,10" Height="Auto" HorizontalAlignment="Left" Width="100" Click="NextBtn_Click"/>
<Button x:Name="StopBtn" Content="Stop" Margin="220,10,0,10" Height="Auto" HorizontalAlignment="Left" Width="100" Click="StopBtn_Click" IsEnabled="{Binding WindowBindings.IsRunning, RelativeSource={RelativeSource FindAncestor, AncestorType=Window}}"/>
<Slider x:Name="DelaySizer" Margin="0,10,65,10" HorizontalAlignment="Right" Width="318" Maximum="5000" Minimum="1" Value="200" mah:SliderHelper.ChangeValueBy="LargeChange" TickFrequency="10" ValueChanged="DelaySizer_ValueChanged" SmallChange="1" LargeChange="10"/>
<Label x:Name="MsLabel" Content="200 ms" Margin="0,10,10,10" HorizontalAlignment="Right" Width="55" Foreground="Black"/>
<Label Content="Intervalo:" Margin="0,10,388,10" HorizontalAlignment="Right" Width="59" Foreground="Black"/>
<Label Content="Delay:" Margin="0,10,388,10" HorizontalAlignment="Right" Width="59" Foreground="Black"/>
</Grid>
<Grid Margin="238,25,192,51">
<Viewbox>
Expand Down
Loading

0 comments on commit 6019c2e

Please sign in to comment.