Skip to content

Commit

Permalink
v3.15.1
Browse files Browse the repository at this point in the history
- **File formats:**
  - (Fix) CTB, CXDLPv4 and GOO: Unable to set some of the virtual bottom properties to 0
  - (Fix) Anycubic and GOO: When open file in partial mode, the layer data was not set from the layer table
  - (Fix) CXDLP: "Invalid printer model" error
- (Add) File - Reset layers properties: Reset layers properties with the global properties of the file
  • Loading branch information
sn4k3 committed Jun 30, 2023
1 parent ddcc5a2 commit ad2c5bd
Show file tree
Hide file tree
Showing 21 changed files with 228 additions and 155 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 30/06/2023 - v3.15.1

- **File formats:**
- (Fix) CTB, CXDLPv4 and GOO: Unable to set some of the virtual bottom properties to 0
- (Fix) Anycubic and GOO: When open file in partial mode, the layer data was not set from the layer table
- (Fix) CXDLP: "Invalid printer model" error
- (Add) File - Reset layers properties: Reset layers properties with the global properties of the file


## 26/06/2023 - v3.15.0

- **File formats:**
Expand Down
14 changes: 4 additions & 10 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
- **File formats:**
- (Add) CXDLPv4 format
- (Improvement) Add missing keys for SL1 format from PrusaSlicer 2.6.0
- **UI**:
- (Add) About - Terms of Use
- (Add) Outline: Enclosing circles
- (Improvement) Minor alteration on how current layer preview cache the contours
- (Improvement) Revamp tool Edit print parameters
- (Improvement) Revamp message boxes
- (Remove) Avalonia.MessageBox dependency in favor of use our own message box
- (Change) PrusaSlicer printers - Creality Halot Mage/Pro: Use CXDLPV4 format instead ENCRYPTED.CTB
- (Fix) CTB, CXDLPv4 and GOO: Unable to set some of the virtual bottom properties to 0
- (Fix) Anycubic and GOO: When open file in partial mode, the layer data was not set from the layer table
- (Fix) CXDLP: "Invalid printer model" error
- (Add) File - Reset layers properties: Reset layers properties with the global properties of the file

13 changes: 7 additions & 6 deletions UVtools.AvaloniaControls/AdvancedImageBox.axaml.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
/*
* GNU AFFERO GENERAL PUBLIC LICENSE
* Version 3, 19 November 2007
* Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
* Everyone is permitted to copy and distribute verbatim copies
* of this license document, but changing it is not allowed.
*/
* The MIT License (MIT)
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so.
*/
// Port from: https://github.com/cyotek/Cyotek.Windows.Forms.ImageBox to AvaloniaUI
using Avalonia;
using Avalonia.Controls;
Expand Down
80 changes: 60 additions & 20 deletions UVtools.AvaloniaControls/ExtendedNumericUpDown.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
/*
* GNU AFFERO GENERAL PUBLIC LICENSE
* Version 3, 19 November 2007
* Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
* Everyone is permitted to copy and distribute verbatim copies
* of this license document, but changing it is not allowed.
*/
* The MIT License (MIT)
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so.
*/

using Avalonia;
using Avalonia.Controls;
Expand All @@ -17,11 +18,34 @@ namespace UVtools.AvaloniaControls;
/// </summary>
public class ExtendedNumericUpDown : NumericUpDown
{
#region Enums

public enum ResetVisibilityType
{
/// <summary>
/// Hidden
/// </summary>
Hidden,

/// <summary>
/// Always visible
/// </summary>
Visible,

/// <summary>
/// Visible if it's possible to reset the value, otherwise hidden
/// </summary>
Auto
}

#endregion

#region Members
private bool _firstTime = true;
private double _initialValue;
private string? _initialText;
private bool _isResetEnabled;
private bool _isResetVisible;
#endregion

#region Avalonia Properties
Expand All @@ -31,7 +55,6 @@ public class ExtendedNumericUpDown : NumericUpDown
public static readonly StyledProperty<bool> IsInitialValueVisibleProperty =
AvaloniaProperty.Register<ExtendedNumericUpDown, bool>(nameof(IsInitialValueVisible));


/// <summary>
/// Defines the <see cref="InitialText"/> property.
/// </summary>
Expand All @@ -55,14 +78,15 @@ public class ExtendedNumericUpDown : NumericUpDown
/// <summary>
/// Defines the <see cref="IsResetVisible"/> property.
/// </summary>
public static readonly StyledProperty<bool> IsResetVisibleProperty =
AvaloniaProperty.Register<ExtendedNumericUpDown, bool>(nameof(IsResetVisible));
public static readonly DirectProperty<ExtendedNumericUpDown, bool> IsResetVisibleProperty =
AvaloniaProperty.RegisterDirect<ExtendedNumericUpDown, bool>(nameof(IsResetVisible), updown => updown.IsResetVisible,
(updown, v) => updown.IsResetVisible = v);

/// <summary>
/// Defines the <see cref="ResetAutoVisibility"/> property.
/// Defines the <see cref="ResetVisibility"/> property.
/// </summary>
public static readonly StyledProperty<bool> ResetAutoVisibilityProperty =
AvaloniaProperty.Register<ExtendedNumericUpDown, bool>(nameof(ResetAutoVisibility));
public static readonly StyledProperty<ResetVisibilityType> ResetVisibilityProperty =
AvaloniaProperty.Register<ExtendedNumericUpDown, ResetVisibilityType>(nameof(ResetVisibility));

/// <summary>
/// Defines the <see cref="IsResetEnabled"/> property.
Expand Down Expand Up @@ -110,22 +134,26 @@ public string? ValueUnit
}

/// <summary>
/// Gets or sets if the reset button should be visible
/// Gets if the reset button is visible
/// </summary>
public bool IsResetVisible
{
get => GetValue(IsResetVisibleProperty);
set => SetValue(IsResetVisibleProperty, value);
get => _isResetVisible;
private set => SetAndRaise(IsResetVisibleProperty, ref _isResetVisible, value);
}

/// <summary>
/// <para>Gets or sets if the reset button should auto show (When Value is different from <see cref="InitialValue"/>) and auto hide (When Value is equal to <see cref="InitialValue"/>).</para>
/// <para>The <see cref="IsResetVisible"/> property will auto change.</para>
/// </summary>
public bool ResetAutoVisibility
public ResetVisibilityType ResetVisibility
{
get => GetValue(ResetAutoVisibilityProperty);
set => SetValue(ResetAutoVisibilityProperty, value);
get => GetValue(ResetVisibilityProperty);
set
{
SetValue(ResetVisibilityProperty, value);
SetResetVisibility();
}
}

/// <summary>
Expand All @@ -136,8 +164,8 @@ public bool IsResetEnabled
get => _isResetEnabled;
private set
{
SetAndRaise(IsResetEnabledProperty, ref _isResetEnabled, value);
if (ResetAutoVisibility)
if(!SetAndRaise(IsResetEnabledProperty, ref _isResetEnabled, value)) return;
if (ResetVisibility == ResetVisibilityType.Auto)
{
IsResetVisible = _isResetEnabled;
}
Expand Down Expand Up @@ -192,5 +220,17 @@ public void ResetValue()
Value = _initialValue;
IsResetEnabled = false;
}


private void SetResetVisibility()
{
IsResetVisible = ResetVisibility switch
{
ResetVisibilityType.Hidden => false,
ResetVisibilityType.Visible => true,
ResetVisibilityType.Auto => IsResetEnabled,
_ => throw new ArgumentOutOfRangeException(nameof(ResetVisibility), ResetVisibility, "Value not processed."),
};
}
#endregion
}
20 changes: 20 additions & 0 deletions UVtools.AvaloniaControls/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
The MIT License (MIT)

Copyright � 2020-2023 UVtools

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 changes: 16 additions & 11 deletions UVtools.AvaloniaControls/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,19 @@

[![Nuget](https://img.shields.io/nuget/v/UVtools.AvaloniaControls?style=flat-square)](https://www.nuget.org/packages/UVtools.AvaloniaControls)

* **AdvancedImageBox**
* Port of: https://github.com/cyotek/Cyotek.Windows.Forms.ImageBox
* Demo: https://youtu.be/bIr6P4dDlHc
* Features:
* Image modes (Zoom, fit, strech)
* Pan & zoom
* Select regions
* Pixel grid
* Cursor images
* Configurable
* Fast
- **AdvancedImageBox**
- Port of: https://github.com/cyotek/Cyotek.Windows.Forms.ImageBox
- Demo: https://youtu.be/bIr6P4dDlHc
- Features:
- Image modes (Zoom, fit, strech)
- Pan & zoom
- Select regions
- Pixel grid
- Cursor images
- Configurable
- Fast
- **ExtendedNumericUpDown**
Extended the NumericUpDown with more features
- Features:
- Initial value with a reset button
- Value unit label
12 changes: 6 additions & 6 deletions UVtools.AvaloniaControls/Styles/ExtendedNumericUpDown.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
FormatString="F2"
ValueUnit="mm"
IsInitialValueVisible="True"
IsResetVisible="True"
ResetVisibility="Visible"
Watermark="Enter text"
Height="60"/>

Expand All @@ -48,7 +48,7 @@
FormatString="F2"
ValueUnit="mm"
IsInitialValueVisible="True"
ResetAutoVisibility="True"
ResetVisibility="Auto"
Watermark="Enter text"/>

<c:ExtendedNumericUpDown Minimum="0"
Expand All @@ -57,6 +57,7 @@
Width="300"
Value="80"
FormatString="F2"
IsResetVisible="True"
ValueUnit="mm"
Watermark="Enter text"/>

Expand All @@ -68,7 +69,7 @@
FormatString="F2"
ValueUnit="mm"
IsInitialValueVisible="True"
IsResetVisible="True"
ResetVisibility="Visible"
IsReadOnly="True"
Watermark="Enter text" />

Expand All @@ -80,7 +81,7 @@
FormatString="F2"
ValueUnit="mm"
IsInitialValueVisible="True"
IsResetVisible="True"
ResetVisibility="Visible"
IsEnabled="False"
Watermark="Enter text" />

Expand All @@ -91,8 +92,7 @@
VerticalContentAlignment="Center"
HorizontalContentAlignment="Center"
ButtonSpinnerLocation="Left"
Watermark="Enter text"
IsResetVisible="False"/>
Watermark="Enter text"/>
</StackPanel>
</Border>
</Design.PreviewWith>
Expand Down
19 changes: 6 additions & 13 deletions UVtools.AvaloniaControls/UVtools.AvaloniaControls.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@
<PackageIconUrl />
<RepositoryUrl>https://github.com/sn4k3/UVtools/tree/master/UVtools.AvaloniaControls</RepositoryUrl>
<RepositoryType>Git</RepositoryType>
<PackageTags>Advanced image box; Avalonia</PackageTags>
<PackageTags>Advanced image box; Extended numericupdown; Avalonia</PackageTags>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<Description>AvaloniaUI Controls
- AdvancedImageBox: Pan, zoom, cursor, pixel grid and selections image box</Description>
<Version>2.1.0</Version>
- AdvancedImageBox: Pan, zoom, cursor, pixel grid and selections image box
- ExtendedNumericUpDown: Initial value with a reset button and value unit label</Description>
<Version>2.1.1</Version>
<Nullable>enable</Nullable>
<PackageProjectUrl>https://github.com/sn4k3/UVtools</PackageProjectUrl>
<PackageReadmeFile>README.md</PackageReadmeFile>
<Title>UVtools Avalonia Controls</Title>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
Expand All @@ -42,7 +44,7 @@
</ItemGroup>

<ItemGroup>
<None Include="..\LICENSE">
<None Include="LICENSE">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
Expand All @@ -52,15 +54,6 @@
</None>
</ItemGroup>

<ItemGroup>
<AvaloniaXaml Update="Controls.axaml">
<Generator>MSBuild:Compile</Generator>
</AvaloniaXaml>
<AvaloniaXaml Update="Styles\ExtendedNumericUpDown.axaml">
<Generator>MSBuild:Compile</Generator>
</AvaloniaXaml>
</ItemGroup>

<ItemGroup>
<None Update="README.md">
<Pack>True</Pack>
Expand Down
Loading

0 comments on commit ad2c5bd

Please sign in to comment.