Skip to content

Commit

Permalink
Version Checking updated and new check file used. Canvas for Control …
Browse files Browse the repository at this point in the history
…Center fixed. Update to 0616. Changelog updates Fix for Control Center Last Window position not working.
  • Loading branch information
BlueFinBima authored and BlueFinBima committed Jun 16, 2019
1 parent 5c382b0 commit bbac4c2
Show file tree
Hide file tree
Showing 13 changed files with 281 additions and 141 deletions.
4 changes: 2 additions & 2 deletions Control Center/Control Center.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0611</ApplicationRevision>
<ApplicationVersion>1.4.2019.0611</ApplicationVersion>
<ApplicationRevision>616</ApplicationRevision>
<ApplicationVersion>1.4.2019.0616</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
Expand Down
26 changes: 13 additions & 13 deletions Control Center/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
xmlns:local="clr-namespace:GadrocsWorkshop.Helios.ControlCenter"
Title="Helios Control Center"
DataContext="{Binding RelativeSource={RelativeSource Self}}"
Height="597" Width="525" Background="Red" WindowStyle="None" ResizeMode="NoResize" Name="HeliosWindow" Icon="Icon.png" Topmost="True" Loaded="Window_Loaded" ContentRendered="Window_Opened">
Height="595" Width="504" Background="Red" WindowStyle="None" ResizeMode="NoResize" Name="HeliosWindow" Icon="Icon.png" Topmost="True" Loaded="Window_Loaded" ContentRendered="Window_Opened">
<Window.Resources>

<Style TargetType="{x:Type CheckBox}" x:Key="HeliosSwitchStyle">
Expand Down Expand Up @@ -114,19 +114,19 @@
</Grid.RowDefinitions>

<StackPanel Margin="0,0,0,0">
<Canvas Name="ControlCenterCanvas" Margin="0" Height="277" Width="504">
<Canvas x:Name="ControlCenterCanvas" Margin="0,0,0,0" Height="276">
<Image Source="ControlCenterBackground.png" Canvas.Top="0" Canvas.Left="0" />
<Thumb Name="ControlCenterDragThumb" Width="504" Height="277" Opacity="0" DragDelta="MoveThumb_DragDelta" />
<Button Canvas.Left="70" Canvas.Top="171" Height="50" Name="StartButton" Width="50" Style="{StaticResource HeliosPushButtonStyle}" Command="local:ControlCenterCommands.StartProfile"/>
<Button Canvas.Left="161" Canvas.Top="171" Height="50" Name="StopButton" Width="50" Style="{StaticResource HeliosPushButtonStyle}" Command="local:ControlCenterCommands.StopProfile"/>
<Button Canvas.Left="254" Canvas.Top="171" Height="50" Name="ResetProfileButton" Width="50" Style="{StaticResource HeliosPushButtonStyle}" Command="local:ControlCenterCommands.ResetProfile" />
<Button Canvas.Left="413" Canvas.Top="49" Height="50" Name="PrefsButton" Width="50" Style="{StaticResource HeliosPushButtonStyle}" Command="local:ControlCenterCommands.TogglePreferences" />
<Button Canvas.Left="323" Canvas.Top="26" Height="50" Name="PrevButton" Width="50" Style="{StaticResource HeliosPrevButtonStyle}" Command="local:ControlCenterCommands.PreviousProfile" />
<Button Canvas.Left="323" Canvas.Top="82" Height="50" Name="NextButton" Width="50" Style="{StaticResource HeliosNextButtonStyle}" Command="local:ControlCenterCommands.NextProfile" />
<Button Canvas.Left="413" Canvas.Top="171" Height="50" Name="DeleteButton" Width="50" Style="{StaticResource HeliosRoundPushButtonStyle}" Command="local:ControlCenterCommands.DeleteProfile" />
<CheckBox Canvas.Left="7" Canvas.Top="30" Height="100" Name="PowerButton" Width="50" Style="{StaticResource HeliosSwitchStyle}" IsChecked="True" Unchecked="PowerButton_Unchecked" />
<TextBlock Canvas.Left="76" Canvas.Top="36" Height="29" Name="ProfileName" Text="{Binding SelectedProfileName}" Width="223" Foreground="#FF79CC87" FontFamily="Franklin Gothic" FontSize="20" />
<TextBlock Canvas.Left="76" Canvas.Top="71" Height="53" Name="MesssgeText" Text="{Binding Message}" Width="223" FontFamily="Franklin Gothic" Foreground="#FF79CC87" FontSize="10" TextWrapping="Wrap" />
<Thumb x:Name="ControlCenterDragThumb" Width="504" Height="277" Opacity="0" Canvas.Left="0" DragDelta="MoveThumb_DragDelta" />
<Button Canvas.Left="70" Canvas.Top="171" Height="50" x:Name="StartButton" Width="50" Style="{StaticResource HeliosPushButtonStyle}" Command="local:ControlCenterCommands.StartProfile"/>
<Button Canvas.Left="161" Canvas.Top="171" Height="50" x:Name="StopButton" Width="50" Style="{StaticResource HeliosPushButtonStyle}" Command="local:ControlCenterCommands.StopProfile"/>
<Button Canvas.Left="254" Canvas.Top="171" Height="50" x:Name="ResetProfileButton" Width="50" Style="{StaticResource HeliosPushButtonStyle}" Command="local:ControlCenterCommands.ResetProfile" />
<Button Canvas.Left="413" Canvas.Top="49" Height="50" x:Name="PrefsButton" Width="50" Style="{StaticResource HeliosPushButtonStyle}" Command="local:ControlCenterCommands.TogglePreferences" />
<Button Canvas.Left="323" Canvas.Top="26" Height="50" x:Name="PrevButton" Width="50" Style="{StaticResource HeliosPrevButtonStyle}" Command="local:ControlCenterCommands.PreviousProfile" />
<Button Canvas.Left="323" Canvas.Top="82" Height="50" x:Name="NextButton" Width="50" Style="{StaticResource HeliosNextButtonStyle}" Command="local:ControlCenterCommands.NextProfile" />
<Button Canvas.Left="413" Canvas.Top="171" Height="50" x:Name="DeleteButton" Width="50" Style="{StaticResource HeliosRoundPushButtonStyle}" Command="local:ControlCenterCommands.DeleteProfile" />
<CheckBox Canvas.Left="7" Canvas.Top="30" Height="100" x:Name="PowerButton" Width="50" Style="{StaticResource HeliosSwitchStyle}" IsChecked="True" Unchecked="PowerButton_Unchecked" />
<TextBlock Canvas.Left="76" Canvas.Top="36" Height="29" x:Name="ProfileName" Text="{Binding SelectedProfileName}" Width="223" Foreground="#FF79CC87" FontFamily="Franklin Gothic" FontSize="20" />
<TextBlock Canvas.Left="76" Canvas.Top="71" Height="53" x:Name="MesssgeText" Text="{Binding Message}" Width="223" FontFamily="Franklin Gothic" Foreground="#FF79CC87" FontSize="10" TextWrapping="Wrap" />
<Button Canvas.Left="40" Canvas.Top="242" Content="Hide" FontWeight="Bold" Foreground="White" Height="25" Style="{StaticResource HeliosPushButtonStyle}" Width="80" Click="Button_Click" />
</Canvas>
<Canvas Name="PreferencesCanvas" Margin="0" Height="320" Width="504" Visibility="Collapsed">
Expand Down
4 changes: 2 additions & 2 deletions Control Center/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ private void Window_Loaded(object sender, RoutedEventArgs e)

private void Window_Opened(object sender, EventArgs e)
{
Height = _prefsShown ? 477 : 277;
Height = _prefsShown ? 277+320 : 277;
Width = 504;

if (Environment.OSVersion.Version.Major > 5 && ConfigManager.SettingsManager.LoadSetting("ControlCenter", "AeroWarning", true))
Expand Down Expand Up @@ -871,7 +871,7 @@ private void SetLicenseMessage()
private void SetProjectReleaseMessage()
{
Version _runningVersion = Assembly.GetEntryAssembly().GetName().Version;
Message = _runningVersion.Major.ToString() + "." + _runningVersion.Minor.ToString() + "." + _runningVersion.Build.ToString() + "." + _runningVersion.Revision.ToString("0000") +
Message = _runningVersion.Major.ToString() + "." + _runningVersion.Minor.ToString() + "." + _runningVersion.Build.ToString("0000") + "." + _runningVersion.Revision.ToString("0000") +
"\nProject Fork: BlueFinBima\n";
}
#endregion
Expand Down
50 changes: 50 additions & 0 deletions Control Center/NativeMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@
namespace GadrocsWorkshop.Helios.ControlCenter
{
using System;
using System.ComponentModel;
using System.Runtime.InteropServices;
using System.Windows.Input;

// RECT structure required by WINDOWPLACEMENT structure
[Serializable]
[StructLayout(LayoutKind.Sequential)]
[TypeConverter(typeof(RECTConverter))]
public struct RECT
{
public int Left;
Expand All @@ -36,8 +38,56 @@ public RECT(int left, int top, int right, int bottom)
this.Right = right;
this.Bottom = bottom;
}

public int Width
{
get { return Right - Left; }
}

public int Height
{
get { return Bottom - Top; }
}

public override string ToString()
{
return "(" + Left.ToString() + "," + Top.ToString() + " " + Right.ToString() + "," + Bottom.ToString() + ")";
}
}

public class RECTConverter : TypeConverter
{
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
{
if (sourceType == typeof(string))
{
return true;
}
return base.CanConvertFrom(context, sourceType);
}

public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value)
{
if (value is string)
{
string[] v = ((string)value).Split(',');
return new RECT(int.Parse(v[0]), int.Parse(v[1]), int.Parse(v[2]), int.Parse(v[3]));
}
return base.ConvertFrom(context, culture, value);
}

public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
{
if (destinationType == typeof(string))
{
RECT rectValue = (RECT)value;
return rectValue.Left + "," + rectValue.Top + "," + rectValue.Right + "," + rectValue.Bottom;
}
return base.ConvertTo(context, culture, value, destinationType);
}
}


// POINT structure required by WINDOWPLACEMENT structure
[Serializable]
[StructLayout(LayoutKind.Sequential)]
Expand Down
4 changes: 2 additions & 2 deletions Control Center/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.4.2019.0611")]
[assembly: AssemblyFileVersion("1.4.2019.0611")]
[assembly: AssemblyVersion("1.4.2019.0616")]
[assembly: AssemblyFileVersion("1.4.2019.0616")]
4 changes: 2 additions & 2 deletions Helios/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.4.2019.0611")]
[assembly: AssemblyFileVersion("1.4.2019.0611")]
[assembly: AssemblyVersion("1.4.2019.0616")]
[assembly: AssemblyFileVersion("1.4.2019.0616")]
Loading

0 comments on commit bbac4c2

Please sign in to comment.