Skip to content

Commit

Permalink
Added first iteration of ErrorWindow
Browse files Browse the repository at this point in the history
  • Loading branch information
X39 committed Mar 2, 2020
1 parent c579789 commit 5464e2f
Show file tree
Hide file tree
Showing 12 changed files with 846 additions and 1 deletion.
15 changes: 15 additions & 0 deletions ArmA.Studio.sln
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Arma.Studio.CallstackWindow
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Arma.Studio.ImmediateWindow", "Arma.Studio.ImmediateWindow\Arma.Studio.ImmediateWindow.csproj", "{5CB6E39A-BD21-4819-B2A2-5F2456B726FB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Arma.Studio.ErrorWindow", "Arma.Studio.ErrorWindow\Arma.Studio.ErrorWindow.csproj", "{19BA0777-B414-4C19-9E73-47D6B1B78AF8}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -157,6 +159,18 @@ Global
{5CB6E39A-BD21-4819-B2A2-5F2456B726FB}.Release|x64.Build.0 = Release|Any CPU
{5CB6E39A-BD21-4819-B2A2-5F2456B726FB}.Release|x86.ActiveCfg = Release|Any CPU
{5CB6E39A-BD21-4819-B2A2-5F2456B726FB}.Release|x86.Build.0 = Release|Any CPU
{19BA0777-B414-4C19-9E73-47D6B1B78AF8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{19BA0777-B414-4C19-9E73-47D6B1B78AF8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{19BA0777-B414-4C19-9E73-47D6B1B78AF8}.Debug|x64.ActiveCfg = Debug|Any CPU
{19BA0777-B414-4C19-9E73-47D6B1B78AF8}.Debug|x64.Build.0 = Debug|Any CPU
{19BA0777-B414-4C19-9E73-47D6B1B78AF8}.Debug|x86.ActiveCfg = Debug|Any CPU
{19BA0777-B414-4C19-9E73-47D6B1B78AF8}.Debug|x86.Build.0 = Debug|Any CPU
{19BA0777-B414-4C19-9E73-47D6B1B78AF8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{19BA0777-B414-4C19-9E73-47D6B1B78AF8}.Release|Any CPU.Build.0 = Release|Any CPU
{19BA0777-B414-4C19-9E73-47D6B1B78AF8}.Release|x64.ActiveCfg = Release|Any CPU
{19BA0777-B414-4C19-9E73-47D6B1B78AF8}.Release|x64.Build.0 = Release|Any CPU
{19BA0777-B414-4C19-9E73-47D6B1B78AF8}.Release|x86.ActiveCfg = Release|Any CPU
{19BA0777-B414-4C19-9E73-47D6B1B78AF8}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -172,6 +186,7 @@ Global
{B978950C-CB04-4F70-BF10-DDE1AE83CA05} = {094C7162-5575-4781-A174-116E78B5B04B}
{CC899ACD-E1A8-406C-AF70-22A6FE5228A0} = {094C7162-5575-4781-A174-116E78B5B04B}
{5CB6E39A-BD21-4819-B2A2-5F2456B726FB} = {094C7162-5575-4781-A174-116E78B5B04B}
{19BA0777-B414-4C19-9E73-47D6B1B78AF8} = {094C7162-5575-4781-A174-116E78B5B04B}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {70BCA3AD-C46B-45A2-A847-960793B49531}
Expand Down
2 changes: 2 additions & 0 deletions Arma.Studio.Data/TextEditor/LintInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,7 @@ public class LintInfo
public int Line { get; set; }
public int Column { get; set; }
public int Length { get; set; }
public string File { get; set; }
public string Description { get; set; }
}
}
86 changes: 86 additions & 0 deletions Arma.Studio.ErrorWindow/Arma.Studio.ErrorWindow.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{19BA0777-B414-4C19-9E73-47D6B1B78AF8}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Arma.Studio.ErrorWindow</RootNamespace>
<AssemblyName>Arma.Studio.ErrorWindow</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xaml" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Compile Include="ErrorWindowDataContext.cs" />
<Compile Include="PluginMain.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Language.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Language.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="ErrorWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Language.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>Language.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Arma.Studio.Data\Arma.Studio.Data.csproj">
<Project>{05a55f19-86ee-46a1-875a-15bbfe31a4ab}</Project>
<Name>Arma.Studio.Data</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>
if not exist "$(SolutionDir)Arma.Studio\$(OutDir)Plugins" mkdir ""$(SolutionDir)Arma.Studio\$(OutDir)Plugins""
if not exist "$(SolutionDir)Arma.Studio\$(OutDir)Plugins\ErrorWindow" mkdir ""$(SolutionDir)Arma.Studio\$(OutDir)Plugins\ErrorWindow""
xcopy /Y "$(TargetDir)*" "$(SolutionDir)Arma.Studio\$(OutDir)Plugins\ErrorWindow"
(
echo ^&lt;plugin^&gt;
echo ^&lt;library^&gt;$(TargetFileName)^&lt;/library^&gt;
echo ^&lt;/plugin^&gt;
) &gt; "$(SolutionDir)Arma.Studio\$(OutDir)Plugins\ErrorWindow\plugin.xml"
</PostBuildEvent>
</PropertyGroup>
</Project>
191 changes: 191 additions & 0 deletions Arma.Studio.ErrorWindow/ErrorWindow.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
<DataTemplate xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:asd="http://schemas.armastudio.io/data"
xmlns:xceed="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:text="clr-namespace:System.Text;assembly=mscorlib"
xmlns:local="clr-namespace:Arma.Studio.ErrorWindow;assembly=Arma.Studio.ErrorWindow"
xmlns:p="clr-namespace:Arma.Studio.ErrorWindow.Properties;assembly=Arma.Studio.ErrorWindow"
DataType="{x:Type local:ErrorWindowDataContext}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" ToolBarTray.IsLocked="True" Orientation="Horizontal" Margin="4">
<StackPanel.Resources>
<Style TargetType="ToggleButton">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ToggleButton">
<Border BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}">
<ContentPresenter/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Margin" Value="1"/>
<Setter Property="BorderBrush" Value="#007ACC"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Padding" Value="2"/>
<Style.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Margin" Value="0"/>
<Setter Property="Background" Value="Transparent"/>
</Trigger>
</Style.Triggers>
</Style>
<Style TargetType="Separator">
<Setter Property="Margin" Value="4 0"/>
<Setter Property="LayoutTransform">
<Setter.Value>
<TransformGroup>
<TransformGroup.Children>
<TransformCollection>
<RotateTransform Angle="90"/>
</TransformCollection>
</TransformGroup.Children>
</TransformGroup>
</Setter.Value>
</Setter>
</Style>
</StackPanel.Resources>
<ToggleButton IsChecked="{Binding IsErrorsDisplayed}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Rectangle Grid.Column="0" Width="16" Height="16" Fill="{StaticResource DrawingBrushStatusCriticalError}"/>
<StackPanel Grid.Column="1" Orientation="Horizontal">
<TextBlock Margin="4 0">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Text" Value="{x:Static p:Language.Errors}"/>
<Style.Triggers>
<DataTrigger Binding="{Binding CurrentErrorCount}" Value="1">
<Setter Property="Text" Value="{x:Static p:Language.Error}"/>
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock Text="("/>
<TextBlock Text="{Binding CurrentErrorCount}"/>
<TextBlock Text=")"/>
</StackPanel>
</Grid>
</ToggleButton>
<Separator/>
<ToggleButton IsChecked="{Binding IsWarningsDisplayed, FallbackValue=true}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Rectangle Grid.Column="0" Width="16" Height="16" Fill="{StaticResource DrawingBrushStatusWarning}"/>
<StackPanel Grid.Column="1" Orientation="Horizontal">
<TextBlock Margin="4 0">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Text" Value="{x:Static p:Language.Warnings}"/>
<Style.Triggers>
<DataTrigger Binding="{Binding CurrentWarningCount}" Value="1">
<Setter Property="Text" Value="{x:Static p:Language.Warning}"/>
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock Text="("/>
<TextBlock Text="{Binding CurrentWarningCount}"/>
<TextBlock Text=")"/>
</StackPanel>
</Grid>
</ToggleButton>
<Separator/>
<ToggleButton IsChecked="{Binding IsInfosDisplayed}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Rectangle Grid.Column="0" Width="16" Height="16" Fill="{StaticResource DrawingBrushStatusInformation}"/>
<StackPanel Grid.Column="1" Orientation="Horizontal">
<TextBlock Margin="4 0">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Text" Value="{x:Static p:Language.Infos}"/>
<Style.Triggers>
<DataTrigger Binding="{Binding CurrentInfoCount}" Value="1">
<Setter Property="Text" Value="{x:Static p:Language.Info}"/>
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock Text="("/>
<TextBlock Text="{Binding CurrentInfoCount}"/>
<TextBlock Text=")"/>
</StackPanel>
</Grid>
</ToggleButton>
</StackPanel>
<ListView Grid.Row="1" ItemsSource="{Binding LintInfos}">
<ListView.ItemContainerStyle>
<Style TargetType="ListViewItem">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListViewItem">
<Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="0 4">
<GridViewRowPresenter/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="asd:MouseDoubleClick.Command" Value="{Binding DataContext.CmdEntryOnDoubleClick, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"/>
<Setter Property="asd:MouseDoubleClick.CommandParameter" Value="{Binding}"/>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="LightBlue"/>
</Trigger>
</Style.Triggers>
</Style>
</ListView.ItemContainerStyle>
<ListView.View>
<GridView>
<GridViewColumn>
<GridViewColumn.CellTemplate>
<DataTemplate>
<Rectangle Height="16" Width="16">
<Rectangle.Style>
<Style TargetType="Rectangle">
<Setter Property="Fill" Value="{StaticResource DrawingBrushStatusInformation}"/>
<Setter Property="ToolTip" Value="{x:Static p:Language.Info}"/>
<Style.Triggers>
<DataTrigger Binding="{Binding Severity}" Value="{x:Static asd:ESeverity.Error}">
<Setter Property="Fill" Value="{StaticResource DrawingBrushStatusCriticalError}"/>
<Setter Property="ToolTip" Value="{x:Static p:Language.Error}"/>
</DataTrigger>
<DataTrigger Binding="{Binding Severity}" Value="{x:Static asd:ESeverity.Warning}">
<Setter Property="Fill" Value="{StaticResource DrawingBrushStatusWarning}"/>
<Setter Property="ToolTip" Value="{x:Static p:Language.Warning}"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Rectangle.Style>
</Rectangle>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn Header="{x:Static p:Language.Line}" DisplayMemberBinding="{Binding Line}"/>
<GridViewColumn Header="{x:Static p:Language.Column}" DisplayMemberBinding="{Binding Column}"/>
<GridViewColumn Header="{x:Static p:Language.Description}" DisplayMemberBinding="{Binding Description}"/>
<GridViewColumn Header="{x:Static p:Language.File}" DisplayMemberBinding="{Binding File}" Width="512"/>
</GridView>
</ListView.View>
</ListView>
</Grid>
</DataTemplate>
Loading

0 comments on commit 5464e2f

Please sign in to comment.