Skip to content

Commit

Permalink
[0.0.7.3] 新バーの試作型追加、内部処理調整
Browse files Browse the repository at this point in the history
  • Loading branch information
FairyZeta committed Jun 6, 2016
1 parent cd1041a commit d521c82
Show file tree
Hide file tree
Showing 13 changed files with 718 additions and 124 deletions.
4 changes: 2 additions & 2 deletions FairyZeta.FF14.ACT.Timeline.Core/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@
// Build Number
// Revision
//
[assembly: AssemblyVersion("0.0.7.2")]
[assembly: AssemblyFileVersion("0.0.7.2")]
[assembly: AssemblyVersion("0.0.7.3")]
[assembly: AssemblyFileVersion("0.0.7.3")]
4 changes: 3 additions & 1 deletion FairyZeta.FF14.ACT.Timeline.Core/Timeline.ENUM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,9 @@ public enum ColorEditTarget
public enum BarFormType
{
/// <summary> シンプル型 </summary>
SimpleType
SimpleType,
/// <summary> ウィンドウズ標準型 </summary>
WindowsType,
}

/// <summary> Doubleの小数点
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace FairyZeta.FF14.ACT.Timeline.Core.WPF.Controls
{
public class TimelineProgressBar : GradientProgressBar
public class TimelineProgressBar : ExtendProgressBar
{
/*--- Property/Field Definitions ------------------------------------------------------------------------------------------------------------------------------*/

Expand Down

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions FairyZeta.FF14.ACT.Timeline/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を
// 既定値にすることができます:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.0.7.2")]
[assembly: AssemblyFileVersion("0.0.7.2")]
[assembly: AssemblyVersion("0.0.7.3")]
[assembly: AssemblyFileVersion("0.0.7.3")]
4 changes: 2 additions & 2 deletions FairyZeta.FF14.ACT/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を
// 既定値にすることができます:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.0.7.2")]
[assembly: AssemblyFileVersion("0.0.7.2")]
[assembly: AssemblyVersion("0.0.7.3")]
[assembly: AssemblyFileVersion("0.0.7.3")]
343 changes: 322 additions & 21 deletions FairyZeta.Framework.Test/MainWindow.xaml

Large diffs are not rendered by default.

31 changes: 31 additions & 0 deletions FairyZeta.Framework.Test/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Threading;
using Prism.Mvvm;
using FairyZeta.Framework;
using FairyZeta.Framework.Dropbox;
Expand All @@ -27,6 +28,19 @@ public string TestString
}
#endregion

#region #- [Property] double.ProgressValue - <プログレス値> -----
/// <summary> プログレス値 </summary>
private double _ProgressValue;
/// <summary> プログレス値 </summary>
public double ProgressValue
{
get { return _ProgressValue; }
set { this.SetProperty(ref this._ProgressValue, value); }
}
#endregion

private DispatcherTimer progressTimer;

/*--- Constructers --------------------------------------------------------------------------------------------------------------------------------------------*/

/// <summary> FZ.TEST/メインウィンドウビューモデル/コンストラクタ
Expand Down Expand Up @@ -57,12 +71,29 @@ public MainWindowViewModel()
private bool initViewModel()
{
this.TestString = "バインドテスト";

this.progressTimer = new DispatcherTimer();
this.progressTimer.Interval = new TimeSpan(0, 0, 0,0,10);
this.progressTimer.Tick += progressTimer_Tick;
this.progressTimer.Start();
return true;
}


/*--- Method: public ------------------------------------------------------------------------------------------------------------------------------------------*/

/*--- Method: private -----------------------------------------------------------------------------------------------------------------------------------------*/

private void progressTimer_Tick(object sender, EventArgs e)
{
if(this.ProgressValue <= 100d)
{
this.ProgressValue += 0.1;
}
else
{
this.ProgressValue = 0;
}
}
}
}
2 changes: 2 additions & 0 deletions FairyZeta.Framework/FairyZeta.Framework.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,11 @@
<Compile Include="Data\BrushData.cs" />
<Compile Include="Data\TempColorPaletteData.cs" />
<Compile Include="FrameworkSettings.cs" />
<Compile Include="WPF\Controls\_Polygon\ExtendPolygon.cs" />
<Compile Include="WPF\Controls\_Button\ImageButton.xaml.cs">
<DependentUpon>ImageButton.xaml</DependentUpon>
</Compile>
<Compile Include="WPF\Controls\_ProgressBar\ExtendProgressBar.cs" />
<Compile Include="WPF\Controls\_TabControl\ImageTabItem.xaml.cs">
<DependentUpon>ImageTabItem.xaml</DependentUpon>
</Compile>
Expand Down
10 changes: 9 additions & 1 deletion FairyZeta.Framework/Framework.ENUM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,13 @@ public enum SaveType
OverRide
}


/// <summary> グラデーションタイプ定義
/// </summary>
public enum GradientType
{
/// <summary> 線状グラデーション </summary>
Linear,
/// <summary> 放射状グラデーション </summary>
Radial
}
}
22 changes: 22 additions & 0 deletions FairyZeta.Framework/WPF/Controls/_Polygon/ExtendPolygon.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Shapes;
using System.Windows.Controls;
using System.Windows.Media;

namespace FairyZeta.Framework.WPF.Controls
{
/// <summary> FZ/機能拡張型ポリゴン
/// </summary>
public class ExtendPolygon : Shape
{
private Geometry _DefiningGeometry;
protected override Geometry DefiningGeometry
{
get { return this._DefiningGeometry; }
}
}
}
63 changes: 63 additions & 0 deletions FairyZeta.Framework/WPF/Controls/_ProgressBar/ExtendProgressBar.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Media;
using System.Windows.Controls;

namespace FairyZeta.Framework.WPF.Controls
{
/// <summary> FZ/機能拡張型プログレスバー
/// </summary>
public class ExtendProgressBar : GradientProgressBar
{
/*--- Property/Field Definitions ------------------------------------------------------------------------------------------------------------------------------*/

public static readonly DependencyProperty BaseCornerRadiusProperty =
DependencyProperty.Register("BaseCornerRadius", typeof(CornerRadius), typeof(GradientProgressBar), new FrameworkPropertyMetadata(default(CornerRadius)));
public static readonly DependencyProperty InnerCornerRadiusProperty =
DependencyProperty.Register("InnerCornerRadius", typeof(CornerRadius), typeof(GradientProgressBar), new FrameworkPropertyMetadata(default(CornerRadius)));


public CornerRadius BaseCornerRadius
{
get { return (CornerRadius)GetValue(BaseCornerRadiusProperty); }
set { SetValue(BaseCornerRadiusProperty, value); }
}
public CornerRadius InnerCornerRadius
{
get { return (CornerRadius)GetValue(InnerCornerRadiusProperty); }
set { SetValue(InnerCornerRadiusProperty, value); }
}

public ObservableCollection<Brush> ProgressValueBrushCollection { get; private set; }

/*--- Constructers --------------------------------------------------------------------------------------------------------------------------------------------*/

/// <summary> FZ/機能拡張型プログレスバー/コンストラクタ
/// </summary>
public ExtendProgressBar()
: base()
{
this.initControl();
}

/*--- Method: Initialization ----------------------------------------------------------------------------------------------------------------------------------*/

/// <summary> コントロールの初期化を実行します。
/// </summary>
/// <returns> 正常終了時 True </returns>
private bool initControl()
{
return true;
}

/*--- Method: public ------------------------------------------------------------------------------------------------------------------------------------------*/

/*--- Method: private -----------------------------------------------------------------------------------------------------------------------------------------*/

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,19 @@ public class GradientProgressBar : ProgressBar
DependencyProperty.Register("GradientColor3", typeof(Color), typeof(GradientProgressBar), new FrameworkPropertyMetadata(default(Color), OnColorChanged));

public static readonly DependencyProperty GradientStop1StartValueProperty =
DependencyProperty.Register("GradientStop1StartValue", typeof(double), typeof(GradientProgressBar), new FrameworkPropertyMetadata(30d, OnGradientStopValueChanged));
DependencyProperty.Register("GradientStop1StartValue", typeof(double), typeof(GradientProgressBar), new FrameworkPropertyMetadata(70d, OnGradientStopValueChanged));
public static readonly DependencyProperty GradientStop1EndValueProperty =
DependencyProperty.Register("GradientStop1EndValue", typeof(double), typeof(GradientProgressBar), new FrameworkPropertyMetadata(40d, OnGradientStopValueChanged));
DependencyProperty.Register("GradientStop1EndValue", typeof(double), typeof(GradientProgressBar), new FrameworkPropertyMetadata(60d, OnGradientStopValueChanged));
public static readonly DependencyProperty GradientStop2StartValueProperty =
DependencyProperty.Register("GradientStop2StartValue", typeof(double), typeof(GradientProgressBar), new FrameworkPropertyMetadata(60d, OnGradientStopValueChanged));
DependencyProperty.Register("GradientStop2StartValue", typeof(double), typeof(GradientProgressBar), new FrameworkPropertyMetadata(40d, OnGradientStopValueChanged));
public static readonly DependencyProperty GradientStop2EndValueProperty =
DependencyProperty.Register("GradientStop2EndValue", typeof(double), typeof(GradientProgressBar), new FrameworkPropertyMetadata(70d, OnGradientStopValueChanged));
DependencyProperty.Register("GradientStop2EndValue", typeof(double), typeof(GradientProgressBar), new FrameworkPropertyMetadata(30d, OnGradientStopValueChanged));

public static readonly DependencyProperty AutoHideProperty =
DependencyProperty.Register("AutoHide", typeof(bool), typeof(GradientProgressBar), new FrameworkPropertyMetadata(false, OnHidePropertyChanged));
public static readonly DependencyProperty HideTypeProperty =
DependencyProperty.Register("HideType", typeof(Visibility), typeof(GradientProgressBar), new FrameworkPropertyMetadata(Visibility.Collapsed, OnHidePropertyChanged));


/// <summary> (Dependency) グラデーションカラー1 </summary>
public Color GradientColor1
Expand Down Expand Up @@ -74,6 +80,20 @@ public double GradientStop2EndValue
get { return (double)GetValue(GradientStop2EndValueProperty); }
set { SetValue(GradientStop2EndValueProperty, value); }
}

/// <summary> (Dependency) 進捗100%時に自動で非表示にするか </summary>
public bool AutoHide
{
get { return (bool)GetValue(AutoHideProperty); }
set { SetValue(AutoHideProperty, value); }
}
/// <summary> (Dependency) 自動非表示にする場合の非表示タイプ( not "Visible" ) </summary>
public Visibility HideType
{
get { return (Visibility)GetValue(HideTypeProperty); }
set { SetValue(HideTypeProperty, value); }
}

/*--- Constructers --------------------------------------------------------------------------------------------------------------------------------------------*/

/// <summary> FZ/グラデーションプログレスバー/コンストラクタ
Expand Down Expand Up @@ -136,6 +156,18 @@ private static void OnGradientStopValueChanged(DependencyObject obj, DependencyP
}
}

/// <summary> Hide関連変更時のコールバック
/// </summary>
/// <param name="obj"></param>
/// <param name="e"></param>
private static void OnHidePropertyChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e)
{
GradientProgressBar ctrl = obj as GradientProgressBar;
if (ctrl != null)
{
ctrl.CalculateNewGradient();
}
}
/// <summary> 新しいグラデーションブラシを生成します。
/// </summary>
protected void CalculateNewGradient()
Expand All @@ -148,7 +180,11 @@ protected void CalculateNewGradient()

if (progress <= 0)
{

if (this.AutoHide)
{
base.Visibility = this.HideType;
return;
}
}
else if (progress < this.GradientStop2StartValue)
{
Expand All @@ -171,6 +207,11 @@ protected void CalculateNewGradient()
}


if (this.AutoHide)
{
base.Visibility = Visibility.Visible;
}

base.Foreground = brush;
}
}
Expand Down

0 comments on commit d521c82

Please sign in to comment.