Sfoglia il codice sorgente

更新样式

master
fyf 2 anni fa
parent
commit
32fcae1bd4
10 ha cambiato i file con 292 aggiunte e 16 eliminazioni
  1. +16
    -0
      BPASmartClient.SCADAControl/BPASmartClient.SCADAControl.csproj
  2. +12
    -2
      BPASmartClient.SCADAControl/CustomerControls/TheTextBlock.cs
  3. +14
    -3
      BPASmartClient.SCADAControl/CustomerControls/TheTextBox.cs
  4. BIN
     
  5. BIN
     
  6. BIN
     
  7. BIN
     
  8. +249
    -0
      BPASmartClient.SCADAControl/Themes/Generic.xaml
  9. +1
    -1
      BeDesignerSCADA/Controls/MainCanvasPanel.xaml
  10. +0
    -10
      BeDesignerSCADA/MainWindow.xaml

+ 16
- 0
BPASmartClient.SCADAControl/BPASmartClient.SCADAControl.csproj Vedi File

@@ -26,6 +26,10 @@
<None Remove="Images\redis.png" />
<None Remove="Images\redisrun.png" />
<None Remove="Images\redisstop.png" />
<None Remove="Images\Scroll_←.png" />
<None Remove="Images\Scroll_↑.png" />
<None Remove="Images\Scroll_→.png" />
<None Remove="Images\Scroll_↓.png" />
<None Remove="Images\State0.png" />
<None Remove="Images\State1.png" />
<None Remove="Images\State11.png" />
@@ -110,6 +114,18 @@
<Resource Include="Images\redisstop.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Images\Scroll_←.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Images\Scroll_↑.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Images\Scroll_→.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Images\Scroll_↓.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Images\State0.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>


+ 12
- 2
BPASmartClient.SCADAControl/CustomerControls/TheTextBlock.cs Vedi File

@@ -33,8 +33,18 @@ namespace BPASmartClient.SCADAControl.CustomerControls
ResourceDictionary languageResDic = new ResourceDictionary();
languageResDic.Source = new Uri(@"/BPASmartClient.SCADAControl;component/Themes/Generic.xaml", UriKind.RelativeOrAbsolute);
this.Resources.MergedDictionaries.Add(languageResDic);
Height = 30;
Width = 80;
this.Loaded += TheTextBlock_Loaded;
}

private void TheTextBlock_Loaded(object sender, RoutedEventArgs e)
{
if (this.ActualWidth <= 0)
{
Text = "文本";
Height = 30;
Width = 80;
FontSize = 16;
}
}

public string ControlType => "控件";


+ 14
- 3
BPASmartClient.SCADAControl/CustomerControls/TheTextBox.cs Vedi File

@@ -37,12 +37,23 @@ namespace BPASmartClient.SCADAControl.CustomerControls
ResourceDictionary languageResDic = new ResourceDictionary();
languageResDic.Source = new Uri(@"/BPASmartClient.SCADAControl;component/Themes/Generic.xaml",UriKind.RelativeOrAbsolute);
this.Resources.MergedDictionaries.Add(languageResDic);
Height = 30;
Width = 80;
FontSize = 16;
this.KeyDown += TheTextBox_KeyDown;
this.TextChanged += TheTextBox_TextChanged;
this.Loaded += TheTextBox_Loaded;
}

private void TheTextBox_Loaded(object sender, RoutedEventArgs e)
{
if (this.ActualWidth <= 10)
{
Text = "文本框";
Height = 30;
Width = 80;
FontSize = 16;
}
}

bool isRun=false;
private void TheTextBox_KeyDown(object sender,KeyEventArgs e)
{


BIN
Vedi File


BIN
Vedi File


BIN
Vedi File


BIN
Vedi File


+ 249
- 0
BPASmartClient.SCADAControl/Themes/Generic.xaml Vedi File

@@ -1,6 +1,7 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero"
xmlns:Themes1="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Classic"
xmlns:con="clr-namespace:BPASmartClient.SCADAControl.Converters"
xmlns:ctrl="clr-namespace:BPASmartClient.SCADAControl.CustomerControls"
@@ -2044,4 +2045,252 @@
</Setter.Value>
</Setter>
</Style>

<!--#region ScrollBar-->
<Style x:Key="UpScrollBarButton" TargetType="{x:Type RepeatButton}">
<Setter Property="OverridesDefaultStyle" Value="true" />
<Setter Property="Cursor" Value="Hand" />
<Setter Property="Focusable" Value="false" />
<Setter Property="IsTabStop" Value="false" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type RepeatButton}">
<Image
Width="8"
Height="5"
Source="../Images/Scroll_↑.png" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="DownScrollBarButton" TargetType="{x:Type RepeatButton}">
<Setter Property="OverridesDefaultStyle" Value="true" />
<Setter Property="Cursor" Value="Hand" />
<Setter Property="Focusable" Value="false" />
<Setter Property="IsTabStop" Value="false" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type RepeatButton}">
<Image
Width="8"
Height="5"
Source="../Images/Scroll_↓.png" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="LeftScrollBarButton" TargetType="{x:Type RepeatButton}">
<Setter Property="OverridesDefaultStyle" Value="true" />
<Setter Property="Cursor" Value="Hand" />
<Setter Property="Focusable" Value="false" />
<Setter Property="IsTabStop" Value="false" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type RepeatButton}">
<Image
Width="5"
Height="8"
Source="../Images/Scroll_←.png" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="RightScrollBarButton" TargetType="{x:Type RepeatButton}">
<Setter Property="OverridesDefaultStyle" Value="true" />
<Setter Property="Cursor" Value="Hand" />
<Setter Property="Focusable" Value="false" />
<Setter Property="IsTabStop" Value="false" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type RepeatButton}">
<Image
Width="5"
Height="8"
Source="../Images/Scroll_→.png" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="VerticalScrollBarPageButton" TargetType="{x:Type RepeatButton}">
<Setter Property="OverridesDefaultStyle" Value="true" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="Focusable" Value="false" />
<Setter Property="IsTabStop" Value="false" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type RepeatButton}">
<Rectangle
Width="{TemplateBinding Width}"
Height="{TemplateBinding Height}"
Fill="{TemplateBinding Background}" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="ScrollBarThumb" TargetType="{x:Type Thumb}">
<Setter Property="OverridesDefaultStyle" Value="true" />
<Setter Property="IsTabStop" Value="false" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Thumb}">
<Border
x:Name="bd1"
Margin="2,2,2,2"
Background="#00c2f4"
CornerRadius="3"
Cursor="Hand"
Opacity="1"
SnapsToDevicePixels="true" />
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Setter TargetName="bd1" Property="Margin" Value="-1,-1,-1,-1" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<LinearGradientBrush x:Key="HorizontalScrollBarBackground" StartPoint="0,0" EndPoint="0,1">
<GradientStop Offset="0" Color="#E1E1E1" />
<GradientStop Offset="0.20" Color="#EDEDED" />
<GradientStop Offset="0.80" Color="#EDEDED" />
<GradientStop Offset="1" Color="#E3E3E3" />
</LinearGradientBrush>
<Style x:Key="HorizontalScrollBarPageButton" TargetType="{x:Type RepeatButton}">
<Setter Property="OverridesDefaultStyle" Value="true" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="Focusable" Value="false" />
<Setter Property="IsTabStop" Value="false" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type RepeatButton}">
<Rectangle
Width="{TemplateBinding Width}"
Height="{TemplateBinding Height}"
Fill="{TemplateBinding Background}" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="{x:Type ScrollBar}">
<Setter Property="Background">
<Setter.Value>
<ImageBrush ImageSource="../Images/biogebj.png" Opacity="0.2" />
</Setter.Value>
</Setter>
<Setter Property="Stylus.IsPressAndHoldEnabled" Value="false" />
<Setter Property="Stylus.IsFlicksEnabled" Value="false" />
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
<Setter Property="Opacity" Value="1" />
<Setter Property="MinWidth" Value="3" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ScrollBar}">
<Border
Width="10"
Margin="0,0,0,0"
Background="{TemplateBinding Background}"
CornerRadius="2"
Opacity="{TemplateBinding Opacity}">
<Grid x:Name="Bg" SnapsToDevicePixels="true">
<Grid.RowDefinitions>
<RowDefinition MaxHeight="{DynamicResource {x:Static SystemParameters.VerticalScrollBarButtonHeightKey}}" />
<RowDefinition Height="*" />
<RowDefinition MaxHeight="{DynamicResource {x:Static SystemParameters.VerticalScrollBarButtonHeightKey}}" />
</Grid.RowDefinitions>
<RepeatButton
Themes:ScrollChrome.ScrollGlyph="UpArrow"
Command="{x:Static ScrollBar.LineUpCommand}"
IsEnabled="{TemplateBinding IsMouseOver}"
Style="{StaticResource UpScrollBarButton}" />
<Track
x:Name="PART_Track"
Grid.Row="1"
IsDirectionReversed="true"
IsEnabled="{TemplateBinding IsMouseOver}">
<Track.DecreaseRepeatButton>
<RepeatButton Command="{x:Static ScrollBar.PageUpCommand}" Style="{StaticResource VerticalScrollBarPageButton}" />
</Track.DecreaseRepeatButton>

<Track.IncreaseRepeatButton>
<RepeatButton Command="{x:Static ScrollBar.PageDownCommand}" Style="{StaticResource VerticalScrollBarPageButton}" />
</Track.IncreaseRepeatButton>
<Track.Thumb>
<Thumb Themes:ScrollChrome.ScrollGlyph="VerticalGripper" Style="{StaticResource ScrollBarThumb}" />
</Track.Thumb>
</Track>
<RepeatButton
Grid.Row="2"
Themes:ScrollChrome.ScrollGlyph="DownArrow"
Command="{x:Static ScrollBar.LineDownCommand}"
IsEnabled="{TemplateBinding IsMouseOver}"
Style="{StaticResource DownScrollBarButton}" />
</Grid>
</Border>

</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="Orientation" Value="Horizontal">

<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ScrollBar}">
<Border
Height="10"
Margin="0,0,0,0"
Background="{TemplateBinding Background}"
CornerRadius="2"
Opacity="{TemplateBinding Opacity}">
<Grid
x:Name="Bg"
Background="{TemplateBinding Background}"
SnapsToDevicePixels="true">
<Grid.ColumnDefinitions>
<ColumnDefinition MaxWidth="{DynamicResource {x:Static SystemParameters.HorizontalScrollBarButtonWidthKey}}" />
<ColumnDefinition Width="*" />
<ColumnDefinition MaxWidth="{DynamicResource {x:Static SystemParameters.HorizontalScrollBarButtonWidthKey}}" />
</Grid.ColumnDefinitions>
<RepeatButton
Themes:ScrollChrome.ScrollGlyph="LeftArrow"
Command="{x:Static ScrollBar.LineLeftCommand}"
IsEnabled="{TemplateBinding IsMouseOver}"
Style="{StaticResource LeftScrollBarButton}" />
<Track
x:Name="PART_Track"
Grid.Column="1"
IsEnabled="{TemplateBinding IsMouseOver}">
<Track.DecreaseRepeatButton>
<RepeatButton Command="{x:Static ScrollBar.PageLeftCommand}" Style="{StaticResource HorizontalScrollBarPageButton}" />
</Track.DecreaseRepeatButton>
<Track.IncreaseRepeatButton>
<RepeatButton Command="{x:Static ScrollBar.PageRightCommand}" Style="{StaticResource HorizontalScrollBarPageButton}" />
</Track.IncreaseRepeatButton>
<Track.Thumb>
<Thumb Themes:ScrollChrome.ScrollGlyph="HorizontalGripper" Style="{StaticResource ScrollBarThumb}" />
</Track.Thumb>
</Track>
<RepeatButton
Grid.Column="2"
Themes:ScrollChrome.ScrollGlyph="RightArrow"
Command="{x:Static ScrollBar.LineRightCommand}"
IsEnabled="{TemplateBinding IsMouseOver}"
Style="{StaticResource RightScrollBarButton}" />
</Grid>
</Border>

</ControlTemplate>
</Setter.Value>
</Setter>
</Trigger>
</Style.Triggers>
</Style>
<LinearGradientBrush x:Key="VerticalScrollBarBackground" StartPoint="0,0" EndPoint="1,0">
<GradientStop Offset="0" Color="#E1E1E1" />
<GradientStop Offset="0.20" Color="#EDEDED" />
<GradientStop Offset="0.80" Color="#EDEDED" />
<GradientStop Offset="1" Color="#E3E3E3" />
</LinearGradientBrush>
<!--#endregion-->
</ResourceDictionary>

+ 1
- 1
BeDesignerSCADA/Controls/MainCanvasPanel.xaml Vedi File

@@ -30,7 +30,7 @@

<!--左侧选择区域-->
<Grid >
<Border BorderThickness="1" BorderBrush="{StaticResource AccentBrush}" Background="White" Margin="4">
<Border BorderThickness="1" BorderBrush="{StaticResource AccentBrush}" Background="Transparent" Margin="4">
<ListBox x:Name="CtlList" Background="Transparent" ItemTemplate="{DynamicResource ToolBoxStyle}" BorderThickness="0" PreviewMouseMove="CtlList_PreviewMouseMove">
</ListBox>
</Border>


+ 0
- 10
BeDesignerSCADA/MainWindow.xaml Vedi File

@@ -12,16 +12,6 @@
mc:Ignorable="d"
WindowStartupLocation="CenterScreen"
Title="黑菠萝科技-[组态软件1.0]" Height="900" Width="1400" Icon="/Images/ico.ico" >

<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/BeDesignerSCADA;component/Themes/Styles.xaml" />
<ResourceDictionary Source="/BPASmartClient.SCADAControl;component/Themes/Generic.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Window.Resources>

<Border x:Name="grid">
</Border>
</Window>

Caricamento…
Annulla
Salva