diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 42bc945d4..f15ddf910 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,42 +21,72 @@ jobs: configuration: [Debug, Release, ReleaseLite, Canary, CanaryLite, Nightly, NightlyLite] steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 # Full history for versioning - - - name: Setup .NET SDK - uses: actions/setup-dotnet@v4 - with: - dotnet-version: | - 10.0.x - 9.0.x - 8.0.x - 6.0.x - - - name: Setup MSBuild - uses: microsoft/setup-msbuild@v2 - with: - vs-version: 'latest' - - - name: Setup NuGet - uses: NuGet/setup-nuget@v2 - with: - nuget-version: 'latest' - - - name: Restore NuGet packages - run: nuget restore "Source/Krypton Toolkit/Krypton Toolkit Suite Extended 2022 - VS2022.sln" - - - name: Build solution - run: msbuild "Source/Krypton Toolkit/Krypton Toolkit Suite Extended 2022 - VS2022.sln" /p:Configuration=${{ matrix.configuration }} /p:Platform="Any CPU" /m /v:minimal - - - name: Upload build artifacts - if: matrix.configuration != 'Debug' - uses: actions/upload-artifact@v4 - with: - name: Build-${{ matrix.configuration }} - path: | - Bin/${{ matrix.configuration }}/ - retention-days: 7 + - name: Checkout repository + uses: actions/checkout@v6 + with: + fetch-depth: 0 # Full history for versioning + + # Extended-Toolkit project refs expect Standard-Toolkit as sibling (..\Standard-Toolkit) + - name: Checkout Standard-Toolkit + run: git clone --depth 1 https://github.com/Krypton-Suite/Standard-Toolkit.git ../Standard-Toolkit + + - name: Setup .NET SDK + uses: actions/setup-dotnet@v5 + with: + dotnet-version: | + 10.0.x + 9.0.x + 8.0.x + 6.0.x + + # .NET 11 (Preview) + - name: Setup .NET 11 (Preview) + uses: actions/setup-dotnet@v5 + with: + dotnet-version: 11.0.x + dotnet-quality: preview + + # global.json dynamically generate (use latest SDK available) + - name: Force .NET 11 SDK via global.json + run: | + $sdkVersion = (dotnet --list-sdks | Select-String "11.0").ToString().Split(" ")[0] + if (-not $sdkVersion) { + # Fallback to .NET 10 if .NET 11 is not available + $sdkVersion = (dotnet --list-sdks | Select-String "10.0").ToString().Split(" ")[0] + } + Write-Output "Using SDK $sdkVersion" + @" + { + "sdk": { + "version": "$sdkVersion", + "rollForward": "latestFeature" + } + } + "@ | Out-File -Encoding utf8 global.json + + - name: Setup MSBuild + uses: microsoft/setup-msbuild@v2 + with: + vs-version: 'latest' + + - name: Setup NuGet + uses: NuGet/setup-nuget@v2 + with: + nuget-version: 'latest' + + # Use the non-NuGet solution so projects use ProjectReference to Standard-Toolkit (no Krypton.Standard.Toolkit package on nuget.org) + - name: Restore NuGet packages + run: nuget restore "Source/Krypton Toolkit/Krypton Toolkit Suite Extended 2022 - VS2022.sln" + + - name: Build solution + run: msbuild "Source/Krypton Toolkit/Krypton Toolkit Suite Extended 2022 - VS2022.sln" /p:Configuration=${{ matrix.configuration }} /p:Platform="Any CPU" /m /v:minimal + + - name: Upload build artifacts + if: matrix.configuration != 'Debug' + uses: actions/upload-artifact@v6 + with: + name: Build-${{ matrix.configuration }} + path: | + Bin/${{ matrix.configuration }}/ + retention-days: 7 diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 0c48befe3..c6c3a4581 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -40,11 +40,11 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v6 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@v4 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -58,7 +58,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@v2 + uses: github/codeql-action/autobuild@v4 # ā„¹ļø Command-line programs to run using the OS shell. # šŸ“š See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun @@ -71,6 +71,6 @@ jobs: # ./location_of_script_within_repo/buildscript.sh - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@v4 with: category: "/language:${{matrix.language}}" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 90e6d6a32..af2298975 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -30,171 +30,195 @@ jobs: runs-on: windows-latest steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 # Full history for versioning - - - name: Setup .NET SDK - uses: actions/setup-dotnet@v4 - with: - dotnet-version: | - 10.0.x - 9.0.x - 8.0.x - 6.0.x - # continue-on-error: true - + - name: Checkout repository + uses: actions/checkout@v6 + with: + fetch-depth: 0 # Full history for versioning + + - name: Setup .NET SDK + uses: actions/setup-dotnet@v5 + with: + dotnet-version: | + 10.0.x + 9.0.x + 8.0.x + 6.0.x + # continue-on-error: true + + # .NET 11 (Preview) + - name: Setup .NET 11 (Preview) + uses: actions/setup-dotnet@v5 + with: + dotnet-version: 11.0.x + dotnet-quality: preview + + - name: Force .NET 11 SDK via global.json # global.json dynamically generated + run: | + $sdkVersion = (dotnet --list-sdks | Select-String "11.0").ToString().Split(" ")[0] + if (-not $sdkVersion) { + # Fallback to .NET 10 if .NET 11 is not available + $sdkVersion = (dotnet --list-sdks | Select-String "10.0").ToString().Split(" ")[0] + } + Write-Output "Using SDK $sdkVersion" + @" + { + "sdk": { + "version": "$sdkVersion", + "rollForward": "latestFeature" + } + } + "@ | Out-File -Encoding utf8 global.json + - name: Setup MSBuild - uses: microsoft/setup-msbuild@v2 - with: - vs-version: 'latest' - - - name: Setup NuGet - uses: NuGet/setup-nuget@v2 - with: - nuget-version: 'latest' - - - name: Determine Configuration - id: config - shell: pwsh - run: | - if ("${{ github.event_name }}" -eq "workflow_dispatch") { - $config = "${{ inputs.configuration }}" - } else { - # For tag pushes, determine configuration from tag name or default to Release - $config = "Release" - } - echo "configuration=$config" >> $env:GITHUB_OUTPUT - echo "Building with configuration: $config" - - - name: Restore NuGet packages (Main Solution) - run: nuget restore "Source/Krypton Toolkit/Krypton Toolkit Suite Extended 2022 - VS2022.sln" - - - name: Build Main Solution - run: msbuild "Source/Krypton Toolkit/Krypton Toolkit Suite Extended 2022 - VS2022.sln" /p:Configuration=${{ steps.config.outputs.configuration }} /p:Platform="Any CPU" /m /v:minimal - - - name: Restore NuGet packages (NuGet Solution) - run: nuget restore "Source/Krypton Toolkit/Krypton Toolkit Suite Extended 2022 - VS2022 - NuGet.sln" - - - name: Build NuGet Solution - run: msbuild "Source/Krypton Toolkit/Krypton Toolkit Suite Extended 2022 - VS2022 - NuGet.sln" /p:Configuration=${{ steps.config.outputs.configuration }} /p:Platform="Any CPU" /m /v:minimal - - - name: Build and Pack Ultimate Packages - shell: pwsh - run: | - $config = "${{ steps.config.outputs.configuration }}" - $outputDir = "Bin/NuGet Packages/$config" - - # Ultimate Package - $ultimateProject = "Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Ultimate/Krypton.Toolkit.Suite.Extended.Ultimate 2022.csproj" - if (Test-Path $ultimateProject) { - Write-Host "Building and packing Ultimate package..." - dotnet pack $ultimateProject --configuration $config --output $outputDir /p:IncludeSymbols=true /p:SymbolPackageFormat=snupkg - } else { - Write-Warning "Ultimate package project not found at: $ultimateProject" - } - - # Ultimate.Lite Package - $ultimateLiteProject = "Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Ultimate.Lite/Krypton.Toolkit.Suite.Extended.Ultimate.Lite 2022.csproj" - if (Test-Path $ultimateLiteProject) { - Write-Host "Building and packing Ultimate.Lite package..." - dotnet pack $ultimateLiteProject --configuration $config --output $outputDir /p:IncludeSymbols=true /p:SymbolPackageFormat=snupkg - } else { - Write-Warning "Ultimate.Lite package project not found at: $ultimateLiteProject" - } - - - name: Pack NuGet packages - shell: pwsh - run: | - $config = "${{ steps.config.outputs.configuration }}" - - # Find all .csproj files and pack them - # Note: Directory.Build.targets automatically configures all projects to include referenced binaries - Get-ChildItem -Path "Source/Krypton Toolkit" -Filter "*.csproj" -Recurse | ForEach-Object { - $project = $_.FullName - $projectName = $_.Name - - # Skip application projects (not libraries) and Ultimate packages (already packed) - if ($projectName -like "*Examples*" -or - $projectName -like "*ZipExtractor*" -or - $projectName -like "*AutoUpdateCreator*" -or - $projectName -like "*Ultimate*") { - Write-Host "Skipping: $projectName" - return + uses: microsoft/setup-msbuild@v2 + with: + vs-version: 'latest' + + - name: Setup NuGet + uses: NuGet/setup-nuget@v2 + with: + nuget-version: 'latest' + + - name: Determine Configuration + id: config + shell: pwsh + run: | + if ("${{ github.event_name }}" -eq "workflow_dispatch") { + $config = "${{ inputs.configuration }}" + } else { + # For tag pushes, determine configuration from tag name or default to Release + $config = "Release" } - - Write-Host "Packing: $project" - - # Pack (settings are applied from Directory.Build.targets) - dotnet pack $project --configuration $config --no-build --output "Bin/NuGet Packages/$config" - } - - # Verify the Ultimate packages were created - $ultimatePackages = Get-ChildItem -Path "Bin/NuGet Packages/$config" -Filter "*Ultimate*.nupkg" -Exclude "*.symbols.nupkg" - if ($ultimatePackages) { - Write-Host "`nāœ… Ultimate packages created successfully:" - foreach ($pkg in $ultimatePackages) { - Write-Host " - $($pkg.Name) ($([math]::Round($pkg.Length / 1MB, 2)) MB)" + echo "configuration=$config" >> $env:GITHUB_OUTPUT + echo "Building with configuration: $config" + + - name: Restore NuGet packages (Main Solution) + run: nuget restore "Source/Krypton Toolkit/Krypton Toolkit Suite Extended 2022 - VS2022.sln" + + - name: Build Main Solution + run: msbuild "Source/Krypton Toolkit/Krypton Toolkit Suite Extended 2022 - VS2022.sln" /p:Configuration=${{ steps.config.outputs.configuration }} /p:Platform="Any CPU" /m /v:minimal + + - name: Restore NuGet packages (NuGet Solution) + run: nuget restore "Source/Krypton Toolkit/Krypton Toolkit Suite Extended 2022 - VS2022 - NuGet.sln" + + - name: Build NuGet Solution + run: msbuild "Source/Krypton Toolkit/Krypton Toolkit Suite Extended 2022 - VS2022 - NuGet.sln" /p:Configuration=${{ steps.config.outputs.configuration }} /p:Platform="Any CPU" /m /v:minimal + + - name: Build and Pack Ultimate Packages + shell: pwsh + run: | + $config = "${{ steps.config.outputs.configuration }}" + $outputDir = "Bin/NuGet Packages/$config" + + # Ultimate Package + $ultimateProject = "Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Ultimate/Krypton.Toolkit.Suite.Extended.Ultimate 2022.csproj" + if (Test-Path $ultimateProject) { + Write-Host "Building and packing Ultimate package..." + dotnet pack $ultimateProject --configuration $config --output $outputDir /p:IncludeSymbols=true /p:SymbolPackageFormat=snupkg + } else { + Write-Warning "Ultimate package project not found at: $ultimateProject" } - } else { - Write-Warning "āš ļø No Ultimate packages were found!" - } - - - name: List NuGet packages - shell: pwsh - run: | - $config = "${{ steps.config.outputs.configuration }}" - $nugetDir = "Bin/NuGet Packages/$config" - if (Test-Path $nugetDir) { - Write-Host "NuGet packages in $nugetDir:" - Get-ChildItem -Path $nugetDir -Filter "*.nupkg" | ForEach-Object { - Write-Host " - $($_.Name)" + + # Ultimate.Lite Package + $ultimateLiteProject = "Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Ultimate.Lite/Krypton.Toolkit.Suite.Extended.Ultimate.Lite 2022.csproj" + if (Test-Path $ultimateLiteProject) { + Write-Host "Building and packing Ultimate.Lite package..." + dotnet pack $ultimateLiteProject --configuration $config --output $outputDir /p:IncludeSymbols=true /p:SymbolPackageFormat=snupkg + } else { + Write-Warning "Ultimate.Lite package project not found at: $ultimateLiteProject" } - } else { - Write-Host "No NuGet packages directory found at: $nugetDir" - } - - - name: Upload build artifacts - uses: actions/upload-artifact@v4 - with: - name: Release-${{ steps.config.outputs.configuration }} - path: | - Bin/${{ steps.config.outputs.configuration }}/ - Bin/NuGet Packages/${{ steps.config.outputs.configuration }}/ - retention-days: 30 - - - name: Publish to NuGet.org - if: (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')) || (github.event_name == 'workflow_dispatch' && inputs.publish_nuget) - shell: pwsh - env: - NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} - run: | - $config = "${{ steps.config.outputs.configuration }}" - $nugetDir = "Bin/NuGet Packages/$config" - - if (-not (Test-Path $nugetDir)) { - Write-Error "NuGet packages directory not found: $nugetDir" - exit 1 - } - - # Push all .nupkg files (excluding symbol packages which are uploaded automatically) - Get-ChildItem -Path $nugetDir -Filter "*.nupkg" -Exclude "*.symbols.nupkg" | ForEach-Object { - $package = $_.FullName - Write-Host "Publishing: $package" - dotnet nuget push $package --api-key $env:NUGET_API_KEY --source https://api.nuget.org/v3/index.json --skip-duplicate - } - - - name: Create GitHub Release - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') - uses: softprops/action-gh-release@v2 - with: - files: | - Bin/NuGet Packages/${{ steps.config.outputs.configuration }}/*.nupkg - Bin/NuGet Packages/${{ steps.config.outputs.configuration }}/*.snupkg - draft: false - prerelease: ${{ contains(steps.config.outputs.configuration, 'Canary') || contains(steps.config.outputs.configuration, 'Nightly') }} - generate_release_notes: true - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Pack NuGet packages + shell: pwsh + run: | + $config = "${{ steps.config.outputs.configuration }}" + + # Find all .csproj files and pack them + # Note: Directory.Build.targets automatically configures all projects to include referenced binaries + Get-ChildItem -Path "Source/Krypton Toolkit" -Filter "*.csproj" -Recurse | ForEach-Object { + $project = $_.FullName + $projectName = $_.Name + + # Skip application projects (not libraries) and Ultimate packages (already packed) + if ($projectName -like "*Examples*" -or + $projectName -like "*ZipExtractor*" -or + $projectName -like "*AutoUpdateCreator*" -or + $projectName -like "*Ultimate*") { + Write-Host "Skipping: $projectName" + return + } + + Write-Host "Packing: $project" + + # Pack (settings are applied from Directory.Build.targets) + dotnet pack $project --configuration $config --no-build --output "Bin/NuGet Packages/$config" + } + + # Verify the Ultimate packages were created + $ultimatePackages = Get-ChildItem -Path "Bin/NuGet Packages/$config" -Filter "*Ultimate*.nupkg" -Exclude "*.symbols.nupkg" + if ($ultimatePackages) { + Write-Host "`nāœ… Ultimate packages created successfully:" + foreach ($pkg in $ultimatePackages) { + Write-Host " - $($pkg.Name) ($([math]::Round($pkg.Length / 1MB, 2)) MB)" + } + } else { + Write-Warning "āš ļø No Ultimate packages were found!" + } + + - name: List NuGet packages + shell: pwsh + run: | + $config = "${{ steps.config.outputs.configuration }}" + $nugetDir = "Bin/NuGet Packages/$config" + if (Test-Path $nugetDir) { + Write-Host "NuGet packages in $nugetDir:" + Get-ChildItem -Path $nugetDir -Filter "*.nupkg" | ForEach-Object { + Write-Host " - $($_.Name)" + } + } else { + Write-Host "No NuGet packages directory found at: $nugetDir" + } + + - name: Upload build artifacts + uses: actions/upload-artifact@v6 + with: + name: Release-${{ steps.config.outputs.configuration }} + path: | + Bin/${{ steps.config.outputs.configuration }}/ + Bin/NuGet Packages/${{ steps.config.outputs.configuration }}/ + retention-days: 30 + + - name: Publish to NuGet.org + if: (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')) || (github.event_name == 'workflow_dispatch' && inputs.publish_nuget) + shell: pwsh + env: + NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} + run: | + $config = "${{ steps.config.outputs.configuration }}" + $nugetDir = "Bin/NuGet Packages/$config" + + if (-not (Test-Path $nugetDir)) { + Write-Error "NuGet packages directory not found: $nugetDir" + exit 1 + } + + # Push all .nupkg files (excluding symbol packages which are uploaded automatically) + Get-ChildItem -Path $nugetDir -Filter "*.nupkg" -Exclude "*.symbols.nupkg" | ForEach-Object { + $package = $_.FullName + Write-Host "Publishing: $package" + dotnet nuget push $package --api-key $env:NUGET_API_KEY --source https://api.nuget.org/v3/index.json --skip-duplicate + } + + - name: Create GitHub Release + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') + uses: softprops/action-gh-release@v2 + with: + files: | + Bin/NuGet Packages/${{ steps.config.outputs.configuration }}/*.nupkg + Bin/NuGet Packages/${{ steps.config.outputs.configuration }}/*.snupkg + draft: false + prerelease: ${{ contains(steps.config.outputs.configuration, 'Canary') || contains(steps.config.outputs.configuration, 'Nightly') }} + generate_release_notes: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/Assets/License/LICENSE.md b/Assets/License/LICENSE.md index 159a9c459..8cd596efd 100644 --- a/Assets/License/LICENSE.md +++ b/Assets/License/LICENSE.md @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2017 - 2023 Krypton Suite +Copyright (c) 2017 - 2026 Krypton Suite Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/Assets/NuGet/Schemas/Krypton.Toolkit.Suite.Extended.Lite.nuspec b/Assets/NuGet/Schemas/Krypton.Toolkit.Suite.Extended.Lite.nuspec index dbc82852c..0ed196083 100644 --- a/Assets/NuGet/Schemas/Krypton.Toolkit.Suite.Extended.Lite.nuspec +++ b/Assets/NuGet/Schemas/Krypton.Toolkit.Suite.Extended.Lite.nuspec @@ -2,23 +2,25 @@ Krypton.Toolkit.Suite.Extended.Lite - 70.22.11.225 + 110.26.1.1 Peter Wagner (A.K.A Wagnerp) and Simon Coghlan (A.K.A Smurf-IV),Phil Wright (A.K.A ComponentFactory),et al. true https://github.com/Krypton-Suite/Extended-Toolkit - Krypton Stable.png + Icon.png https://github.com/Krypton-Suite/Extended-Toolkit - An extension to the Standard Toolkit, which supports .NET Framework 4.8 - 4.8.1, .NET Core 3.1 and .NET 6 - 7. This package implements all modules in one package. + An extension to the Standard Toolkit, which supports .NET Framework 4.8 - 4.8.1 and .NET 8 - 10. This package implements all modules in one package. Get updates here: https://github.com/Krypton-Suite/Extended-Toolkit Get updates here: https://github.com/Krypton-Suite/Extended-Toolkit Krypton ComponentFactory WinForms Themes Controls DataGrid Ribbon Workspace Tabs .Net Toolkit Core - - - + + + + + diff --git a/Assets/NuGet/Schemas/Krypton.Toolkit.Suite.Extended.nuspec b/Assets/NuGet/Schemas/Krypton.Toolkit.Suite.Extended.nuspec index c387ee13f..78b8215fd 100644 --- a/Assets/NuGet/Schemas/Krypton.Toolkit.Suite.Extended.nuspec +++ b/Assets/NuGet/Schemas/Krypton.Toolkit.Suite.Extended.nuspec @@ -1,30 +1,28 @@  - Krypton.Toolkit.Suite.Extended - 70.22.11.225 - - Peter Wagner (A.K.A Wagnerp) and Simon Coghlan (A.K.A Smurf-IV),Phil Wright (A.K.A ComponentFactory),et al. - - true - https://github.com/Krypton-Suite/Extended-Toolkit - Krypton Stable.png - https://github.com/Krypton-Suite/Extended-Toolkit - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET Core 3.1 and .NET 5 - 7. This package implements all modules in one package. - Get updates here: https://github.com/Krypton-Suite/Extended-Toolkit - Get updates here: https://github.com/Krypton-Suite/Extended-Toolkit - Krypton ComponentFactory WinForms Themes Controls DataGrid Ribbon Workspace Tabs .Net Toolkit Core + Krypton.Toolkit.Suite.Extended + 110.26.1.1 + + Peter Wagner (A.K.A Wagnerp) and Simon Coghlan (A.K.A Smurf-IV),Phil Wright (A.K.A ComponentFactory),et al. + + true + https://github.com/Krypton-Suite/Extended-Toolkit + Icon.png + https://github.com/Krypton-Suite/Extended-Toolkit + An extension to the Standard Toolkit, which supports .NET Framework 4.7.2 - 4.8.1 .NET 8 - 10. This package implements all modules in one package. + Get updates here: https://github.com/Krypton-Suite/Extended-Toolkit + Get updates here: https://github.com/Krypton-Suite/Extended-Toolkit + Krypton ComponentFactory WinForms Themes Controls DataGrid Ribbon Workspace Tabs .Net Toolkit Core - - - - - - - - - - + + + + + + + + \ No newline at end of file diff --git a/Directory.Build.props b/Directory.Build.props index 49bfb6c07..582444b43 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -19,28 +19,28 @@ - net472;net48;net481;net8.0-windows7.0;net9.0-windows7.0;net10.0-windows7.0 + net472;net48;net481;net8.0-windows;net9.0-windows;net10.0-windows;net11.0-windows - net48;net481;net8.0-windows7.0;net9.0-windows7.0;net10.0-windows7.0 + net48;net481;net8.0-windows;net9.0-windows;net10.0-windows;net11.0-windows - net472;net48;net481;net8.0-windows7.0;net9.0-windows7.0;net10.0-windows7.0 + net472;net48;net481;net8.0-windows;net9.0-windows;net10.0-windows;net11.0-windows - net472;net48;net481;net8.0-windows7.0;net9.0-windows7.0;net10.0-windows7.0 + net472;net48;net481;net8.0-windows;net9.0-windows;net10.0-windows;net11.0-windows @@ -51,13 +51,13 @@ --> - net472;net48;net481;net8.0-windows7.0;net9.0-windows7.0;net10.0-windows7.0 + net472;net48;net481;net8.0-windows;net9.0-windows;net10.0-windows;net11.0-windows - net48;net481;net8.0-windows7.0;net9.0-windows7.0;net10.0-windows7.0 + net48;net481;net8.0-windows;net9.0-windows;net10.0-windows;net11.0-windows - net8.0-windows7.0;net9.0-windows7.0;net10.0-windows7.0 + net8.0-windows;net9.0-windows;net10.0-windows;net11.0-windows net472;net48;net481 @@ -153,4 +153,16 @@ + + + + true + \ No newline at end of file diff --git a/Directory.Build.targets b/Directory.Build.targets index 231ccf420..4d1d1a272 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -130,7 +130,60 @@ BSD-3-Clause true Krypton ComponentFactory WinForms Themes Controls DataGrid Ribbon Workspace Tabs .Net Toolkit Core Extended + + + + + false + + + + + + <_ExtendedToolkitProjectReferences Include="@(ProjectReference)" + Condition="$([System.String]::Copy('%(Identity)').Contains('Krypton.Toolkit.Suite.Extended'))" /> + + + + + <_PackageDependenciesToRemove Include="@(_ExtendedToolkitProjectReferences->Metadata('PackageId'))" + Condition="'%(_ExtendedToolkitProjectReferences.PackageId)' != ''" /> + + <_PackageDependenciesToRemove Include="@(_PackageDependencies)" + Condition="$([System.String]::Copy('%(Identity)').StartsWith('Krypton.Toolkit.Suite.Extended'))" /> + + + + <_PackageDependencies Remove="@(_PackageDependenciesToRemove)" /> + + + + + + + + <_ReadmeFile Include="$(MSBuildProjectDirectory)\README.md" Condition="Exists('$(MSBuildProjectDirectory)\README.md')" /> + <_ReadmeFile Include="$(MSBuildProjectDirectory)\Readme.md" Condition="Exists('$(MSBuildProjectDirectory)\Readme.md')" /> + + + + + + + + + + README.md + + diff --git a/Documents/Examples/Examples.md b/Documents/Examples/Examples.md index f274b8d61..7e2a9f6f0 100644 --- a/Documents/Examples/Examples.md +++ b/Documents/Examples/Examples.md @@ -45,6 +45,62 @@ ![](https://github.com/Krypton-Suite/Extended-Toolkit/blob/master/Assets/Examples/ExtendedKryptonMessageBox2.png) +### Expandable Footer Feature + +The `KryptonMessageBoxExtended` now supports an **expandable footer** feature, similar to Windows TaskDialog. This allows displaying additional information (error details, stack traces, help text) in a collapsible footer area. + +**Key Features:** +- Collapsible footer with "Show details" / "Hide details" toggle +- Multiple content types: Text (default), CheckBox, or RichTextBox +- Configurable RichTextBox height for formatted content +- Configurable initial state (expanded or collapsed) +- Automatic form sizing +- Works with all message box features (icons, buttons, timeout, etc.) + +**Example Usage:** + +```csharp +using Krypton.Toolkit.Suite.Extended.Messagebox; + +// Text footer (default) +KryptonMessageBoxExtended.Show( + this, + "An error occurred while processing your request.", + "Error", + ExtendedMessageBoxButtons.OK, + ExtendedKryptonMessageBoxIcon.Error, + footerText: "Stack Trace:\n at Examples.MyClass.ProcessData()\n ...", + footerExpanded: false // Footer starts collapsed +); + +// CheckBox footer +KryptonMessageBoxExtended.Show( + this, + "Do you want to save your changes?", + "Save Changes?", + ExtendedMessageBoxButtons.YesNo, + ExtendedKryptonMessageBoxIcon.Question, + footerText: "Remember my choice", + footerContentType: ExtendedKryptonMessageBoxFooterContentType.CheckBox +); + +// RichTextBox footer with custom height +KryptonMessageBoxExtended.Show( + this, + "An error occurred.", + "Error", + ExtendedMessageBoxButtons.OK, + ExtendedKryptonMessageBoxIcon.Error, + footerText: "Detailed error information...", + footerContentType: ExtendedKryptonMessageBoxFooterContentType.RichTextBox, + footerRichTextBoxHeight: 150 +); +``` + +**Comprehensive Documentation:** +- [KryptonMessageBoxExtended Footer Documentation](../Help/ExtendedKryptonMessageBox-Footer.md) +- [MessageBox Footer Example Source Code](https://github.com/Krypton-Suite/Extended-Toolkit/tree/version-next/Source/Krypton%20Toolkit/Examples/MessageBoxFooterExample.cs) + ## Krypton Colour Mixer ![](https://github.com/Krypton-Suite/Extended-Toolkit/blob/master/Assets/Examples/KryptonColourMixer.png) diff --git a/Documents/Help/Changelog.md b/Documents/Help/Changelog.md index 7f296c3ab..ddc975352 100644 --- a/Documents/Help/Changelog.md +++ b/Documents/Help/Changelog.md @@ -2,11 +2,44 @@ - ======= ## 2026-11-xx - Build 2611 - November 2026 +* Resolved [#351](https://github.com/Krypton-Suite/Extended-Toolkit/issues/351), Closing a floating toolbar window causes the toolbar to disappear - Closing the floating toolbar or menustrip window (e.g. via the close button) now returns the control to its original host instead of making it disappear. Updated `FloatableToolStrip` and `FloatableMenuStrip` to re-parent the control back to the host in the FormClosing handler, consistent with double-clicking the title bar. +* Implemented [#57](https://github.com/Krypton-Suite/Extended-Toolkit/issues/57), `Alert.ShowMessage` optional header/title + - **New API** - `Alert.ShowMessage(string message, string? headerText = null)` shows a message with an optional header or title + - When `headerText` is provided, the alert displays the header in bold with the message below; when omitted, only the message is shown (same behaviour as existing typed methods) +* Resolved [#56](https://github.com/Krypton-Suite/Extended-Toolkit/issues/56), Alert.ShowMessage should be within the bounds of the parent application + - **Positioning Fix** - Alerts now appear within the parent application bounds instead of the primary screen bottom-right (fixes unnoticed alerts on 4K monitors or RDP sessions when the app is in a small window) + - **Optional Owner Parameter** - All `Alert` methods now accept an optional `IWin32Window? owner` parameter for explicit parent binding + - **Smart Fallback** - When no owner is passed, uses `Form.ActiveForm` when available for improved default behavior + - **Proper Ownership** - Sets form `Owner` when a Form is passed, ensuring correct z-order and window relationship +* Resolved [#411](https://github.com/Krypton-Suite/Extended-Toolkit/issues/411), Exapanding a TreeGridView Node takes a long time when there are many children + - **Performance Optimization** - Significantly improved expansion/collapse performance for nodes with many children (250+ nodes) + - **Batch Operations** - Replaced individual row insertions/removals with optimized batch operations + - **Expected Performance** - Reduced expansion time from ~6 seconds to ~0.5 seconds for 250 children (approximately 12x faster) + - **Implementation Details**: + - Added `SiteNodes()` method for batch inserting child nodes efficiently + - Added `UnSiteNodes()` method for batch removing child nodes and descendants + - Optimized insertion position calculation to avoid redundant calculations + - Improved removal order to prevent index shifting issues +* Resolved [#25](https://github.com/Krypton-Suite/Extended-Toolkit/issues/25), Can't add outlook grid group box control - Fixed language-related error when adding `KryptonOutlookGridGroupBox` control in Visual Studio designer. Replaced deprecated `LanguageManager.Instance.GetString()` calls with `KryptonOutlookGridLanguageManager.GeneralStrings` for DateInterval enum localization, eliminating dependency on resource files that could fail with EN/GB language settings. +* Resolved [#156](https://github.com/Krypton-Suite/Extended-Toolkit/issues/156), `KryptonOutlookGrid` Group Header graphic issue with scaling at 150% +* Implemented [#511](https://github.com/Krypton-Suite/Extended-Toolkit/issues/511), `KryptonMessageBoxExtended` Expandable Footer Feature + - **New Expandable Footer** - Similar to Windows TaskDialog, the message box now supports an expandable footer area + - **Collapsed/Expanded States** - Footer can start collapsed or expanded, with user toggle capability + - **Toggle Button** - "Show details" / "Hide details" button allows users to expand/collapse the footer + - **Multiple Content Types** - Footer supports three content types: + - **Text** (default) - Uses `KryptonWrapLabel` for simple text content + - **CheckBox** - Uses `KryptonCheckBox` for options like "Remember my choice" + - **RichTextBox** - Uses `KryptonRichTextBox` for formatted text with configurable height + - **Configurable Content** - Developers can specify footer text content, content type, initial expanded state, and RichTextBox height + - **Automatic Sizing** - Form automatically adjusts size when footer is expanded/collapsed + - **New API Overloads** - Added `Show` method overloads with `footerText`, `footerExpanded`, `footerContentType`, and `footerRichTextBoxHeight` parameters + - **Use Cases** - Ideal for displaying stack traces, error details, validation errors, system information, user preferences, and additional context without cluttering the main message +* Implements [#562](https://github.com/Krypton-Suite/Extended-Toolkit/issues/562), Use `Krypton.Standard.Toolkit` NuGet Packages +* Implements [#486](https://github.com/Krypton-Suite/Extended-Toolkit/issues/486), Add `ForceDesignerDPIUnaware` option to `csproj` files * Support for .NET 11 * Version bump `100.xx.xx.xx` -> `110.xx.xx.xx` diff --git a/Documents/Help/ExtendedKryptonMessageBox-Footer.md b/Documents/Help/ExtendedKryptonMessageBox-Footer.md new file mode 100644 index 000000000..c750c03f1 --- /dev/null +++ b/Documents/Help/ExtendedKryptonMessageBox-Footer.md @@ -0,0 +1,547 @@ +# KryptonMessageBoxExtended - Expandable Footer Feature + +## Overview + +The `KryptonMessageBoxExtended` now supports an **expandable footer** feature, similar to Windows TaskDialog. This allows developers to display additional information (such as error details, stack traces, or help text) in a collapsible footer area that users can expand or collapse as needed. + +## Table of Contents + + + +* [Overview](#overview) +* [Features](#features) +* [API Reference](#api-reference) + * [Show Method Overloads](#show-method-overloads) + * [Properties](#properties) +* [Usage Examples](#usage-examples) + * [Basic Usage](#basic-usage) + * [Error with Stack Trace](#error-with-stack-trace) + * [Warning with Additional Context](#warning-with-additional-context) + * [Information with Technical Details](#information-with-technical-details) + * [Question with Help Text](#question-with-help-text) + * [Validation Errors](#validation-errors) +* [Implementation Details](#implementation-details) + * [Footer Panel Structure](#footer-panel-structure) + * [Toggle Mechanism](#toggle-mechanism) + * [Sizing Behavior](#sizing-behavior) +* [Best Practices](#best-practices) +* [Compatibility](#compatibility) +* [See Also](#see-also) + + + +## Features + +### Key Features + +- **Expandable/Collapsible Footer** - Footer can be shown or hidden by the user via a toggle link +- **Configurable Initial State** - Footer can start expanded or collapsed based on developer preference +- **Multiple Content Types** - Footer supports Text (KryptonWrapLabel), CheckBox (KryptonCheckBox), or RichTextBox (KryptonRichTextBox) +- **Configurable RichTextBox Height** - When using RichTextBox, developers can specify a custom height +- **Automatic Sizing** - Form automatically adjusts its size when footer is expanded or collapsed +- **Optional Feature** - Footer is completely optional; if not specified, message box behaves as before +- **Seamless Integration** - Works with all existing message box features (icons, buttons, timeout, etc.) +- **User-Friendly** - Toggle link text automatically changes between "Show details" and "Hide details" + +### Visual Design + +- Footer appears below the button panel +- Border edge separates footer from main content +- Toggle link appears at the top of the footer area +- Footer text uses the same font as the main message (configurable via `MessageBoxTypeface`) +- Footer panel uses alternate panel style for visual distinction + +## API Reference + +### Show Method Overloads + +The expandable footer feature is available through new `Show` method overloads that include `footerText` and `footerExpanded` parameters. + +#### Basic Footer Overload + +```csharp +public static DialogResult Show( + string text, + string caption, + ExtendedMessageBoxButtons buttons, + ExtendedKryptonMessageBoxIcon icon, + string? footerText = null, + bool footerExpanded = false, + ExtendedKryptonMessageBoxFooterContentType footerContentType = ExtendedKryptonMessageBoxFooterContentType.Text, + int? footerRichTextBoxHeight = null, + bool? showCtrlCopy = null, + Font? messageBoxTypeface = null +) +``` + +**Parameters:** +- `text` - The main message text to display +- `caption` - The title bar caption +- `buttons` - Button configuration (OK, YesNo, YesNoCancel, etc.) +- `icon` - Icon to display (Error, Warning, Information, Question, None) +- `footerText` - **NEW**: Text content to display in the footer. If `null` or empty, footer will not be shown (unless `footerContentType` is `CheckBox`) +- `footerExpanded` - **NEW**: If `true`, footer starts expanded; if `false`, starts collapsed (default: `false`) +- `footerContentType` - **NEW**: Type of content to display in footer: `Text` (default), `CheckBox`, or `RichTextBox` +- `footerRichTextBoxHeight` - **NEW**: Height in pixels for RichTextBox when `footerContentType` is `RichTextBox`. If `null`, uses default height +- `showCtrlCopy` - Show "Ctrl+C to copy" hint in title bar +- `messageBoxTypeface` - Custom font for message and footer text + +**Returns:** `DialogResult` indicating which button was clicked + +#### Owner-Specified Overload + +```csharp +public static DialogResult Show( + IWin32Window owner, + string text, + string caption, + ExtendedMessageBoxButtons buttons, + ExtendedKryptonMessageBoxIcon icon, + string? footerText = null, + bool footerExpanded = false, + ExtendedKryptonMessageBoxFooterContentType footerContentType = ExtendedKryptonMessageBoxFooterContentType.Text, + int? footerRichTextBoxHeight = null, + bool? showCtrlCopy = null, + Font? messageBoxTypeface = null +) +``` + +**Additional Parameters:** +- `owner` - Owner window for the modal dialog + +### Properties + +The following properties are available on `KryptonMessageBoxExtended` instances (though typically accessed through static methods): + +#### FooterText + +```csharp +public string FooterText { get; set; } +``` + +Gets or sets the footer text content to display in the expandable footer area. + +- **Type:** `string` +- **Default:** `null` (footer not shown) +- **Remarks:** If `null` or empty, the footer will not be displayed + +#### FooterExpanded + +```csharp +public bool FooterExpanded { get; set; } +``` + +Gets or sets a value indicating whether the footer is initially expanded. + +- **Type:** `bool` +- **Default:** `false` +- **Remarks:** + - `true` - Footer starts expanded and visible + - `false` - Footer starts collapsed (only toggle link visible) + +#### IsFooterExpanded + +```csharp +public bool IsFooterExpanded { get; } +``` + +Gets a value indicating whether the footer is currently visible and expanded. + +- **Type:** `bool` (read-only) +- **Remarks:** Returns `true` if footer is visible and expanded, `false` otherwise + +## Usage Examples + +### Basic Usage + +#### Simple Error with Collapsed Footer + +```csharp +using Krypton.Toolkit.Suite.Extended.Messagebox; +using System.Windows.Forms; + +// Error message with collapsed footer containing stack trace (Text content type - default) +string mainMessage = "An error occurred while processing your request."; +string footerText = @"Stack Trace: + at Examples.MyClass.ProcessData() + at Examples.MyClass.Main(String[] args) + +Exception: System.InvalidOperationException +Message: The operation cannot be completed."; + +DialogResult result = KryptonMessageBoxExtended.Show( + this, + mainMessage, + "Error", + ExtendedMessageBoxButtons.OK, + ExtendedKryptonMessageBoxIcon.Error, + footerText, + footerExpanded: false, // Footer starts collapsed + footerContentType: ExtendedKryptonMessageBoxFooterContentType.Text // Default, can be omitted +); +``` + +#### Warning with Expanded Footer + +```csharp +// Warning with important information that should be visible immediately +string mainMessage = "This operation will modify system settings."; +string footerText = @"Additional Information: +• This change affects all users on this system +• A system restart may be required +• Previous settings will be backed up automatically"; + +DialogResult result = KryptonMessageBoxExtended.Show( + this, + mainMessage, + "Warning", + ExtendedMessageBoxButtons.YesNo, + ExtendedKryptonMessageBoxIcon.Warning, + footerText, + footerExpanded: true // Footer starts expanded +); +``` + +### Error with Stack Trace (Text Footer) + +Display comprehensive error information in a collapsed footer to avoid overwhelming users: + +```csharp +try +{ + // Your code here +} +catch (Exception ex) +{ + string mainMessage = "An unexpected error occurred."; + string footerText = $@"Exception Details: +Type: {ex.GetType().FullName} +Message: {ex.Message} +Source: {ex.Source} + +Stack Trace: +{ex.StackTrace} + +{(ex.InnerException != null ? $"\nInner Exception:\n{ex.InnerException}" : "")}"; + + KryptonMessageBoxExtended.Show( + this, + mainMessage, + "Error", + ExtendedMessageBoxButtons.OK, + ExtendedKryptonMessageBoxIcon.Error, + footerText, + footerExpanded: false, + footerContentType: ExtendedKryptonMessageBoxFooterContentType.Text // Default + ); +} +``` + +### Error with RichTextBox Footer + +For formatted error details, use RichTextBox with custom height: + +```csharp +catch (Exception ex) +{ + string mainMessage = "An unexpected error occurred."; + string footerText = $@"Exception: {ex.GetType().FullName} +Message: {ex.Message} +Source: {ex.Source} + +Stack Trace: +{ex.StackTrace}"; + + KryptonMessageBoxExtended.Show( + this, + mainMessage, + "Error", + ExtendedMessageBoxButtons.OK, + ExtendedKryptonMessageBoxIcon.Error, + footerText, + footerExpanded: false, + footerContentType: ExtendedKryptonMessageBoxFooterContentType.RichTextBox, + footerRichTextBoxHeight: 200 // Custom height in pixels + ); +} +``` + +### Question with CheckBox Footer + +Use a checkbox in the footer for user preferences: + +```csharp +KryptonMessageBoxExtended.Show( + this, + "Do you want to save your changes before closing?", + "Save Changes?", + ExtendedMessageBoxButtons.YesNoCancel, + ExtendedKryptonMessageBoxIcon.Question, + footerText: "Remember my choice", + footerContentType: ExtendedKryptonMessageBoxFooterContentType.CheckBox, + footerExpanded: true // Checkbox visible by default +); +``` + +### Warning with Additional Context + +Provide additional context for warnings without cluttering the main message: + +```csharp +string mainMessage = "This operation will modify system settings."; +string footerText = @"Additional Information: +• This change affects all users on this system +• A system restart may be required +• Previous settings will be backed up automatically +• You can restore previous settings from the Settings menu + +For more information, visit: https://example.com/help"; + +DialogResult result = KryptonMessageBoxExtended.Show( + this, + mainMessage, + "Warning", + ExtendedMessageBoxButtons.YesNo, + ExtendedKryptonMessageBoxIcon.Warning, + footerText, + footerExpanded: true +); +``` + +### Information with Technical Details + +Show technical details that may be useful for advanced users or troubleshooting: + +```csharp +string mainMessage = "Your file has been successfully processed."; +string footerText = $@"Processing Details: +File: {filePath} +Size: {fileSize:N0} bytes +Processing Time: {processingTime.TotalSeconds:F2} seconds +Pages Processed: {pageCount} +Format: {fileFormat} +Checksum: {checksum} +Timestamp: {DateTime.UtcNow:yyyy-MM-dd HH:mm:ss} UTC"; + +KryptonMessageBoxExtended.Show( + this, + mainMessage, + "Information", + ExtendedMessageBoxButtons.OK, + ExtendedKryptonMessageBoxIcon.Information, + footerText, + footerExpanded: false +); +``` + +### Question with Help Text + +Provide guidance for user decisions: + +```csharp +string mainMessage = "Do you want to save your changes before closing?"; +string footerText = @"Help: +• Click 'Yes' to save your changes and close the document +• Click 'No' to close without saving (changes will be lost) +• Click 'Cancel' to return to the document and continue editing + +Keyboard Shortcuts: +• Ctrl+S: Save +• Ctrl+W: Close +• Esc: Cancel"; + +DialogResult result = KryptonMessageBoxExtended.Show( + this, + mainMessage, + "Save Changes?", + ExtendedMessageBoxButtons.YesNoCancel, + ExtendedKryptonMessageBoxIcon.Question, + footerText, + footerExpanded: false +); +``` + +### Validation Errors + +Display multiple validation errors in an organized format: + +```csharp +var validationErrors = new List +{ + "Email Address: Invalid format. Expected format: user@example.com", + "Phone Number: Required field cannot be empty", + "Date of Birth: Date cannot be in the future", + "Password: Must be at least 8 characters and contain uppercase, lowercase, and numbers", + "Confirm Password: Passwords do not match" +}; + +string mainMessage = "Please correct the following validation errors:"; +string footerText = "Validation Errors:\n" + + string.Join("\n", validationErrors.Select((err, idx) => $"{idx + 1}. {err}")) + + "\n\nPlease review each field and correct the errors before proceeding."; + +KryptonMessageBoxExtended.Show( + this, + mainMessage, + "Validation Failed", + ExtendedMessageBoxButtons.OK, + ExtendedKryptonMessageBoxIcon.Warning, + footerText, + footerExpanded: true // Expanded to show all errors immediately +); +``` + +## Implementation Details + +### Footer Panel Structure + +The footer consists of the following components: + +1. **Footer Panel** (`KryptonPanel`) + - Uses `PaletteBackStyle.PanelAlternate` for visual distinction + - Docked to top of form (below button panel) + - Height adjusts dynamically based on expanded state + +2. **Border Edge** (`KryptonBorderEdge`) + - Separates footer from main content + - Uses `PaletteBorderStyle.HeaderPrimary` + - Docked to top of footer panel + +3. **Toggle Button** (`KryptonButton`) + - "Show details" when collapsed + - "Hide details" when expanded + - Clickable button to toggle footer state + - Uses default Krypton button styling + +4. **Footer Content** (one of the following, based on `footerContentType`): + - **Text** (`KryptonWrapLabel`) - Displays text content with word wrapping + - **CheckBox** (`KryptonCheckBox`) - Displays a checkbox with configurable text label + - **RichTextBox** (`KryptonRichTextBox`) - Displays formatted text with configurable height (read-only) + - All content types use the same font as main message (configurable via `MessageBoxTypeface`) + - Content is visible only when footer is expanded + +### Toggle Mechanism + +When the user clicks the toggle button: + +1. Footer expanded state is toggled +2. Footer content visibility is updated (Text, CheckBox, or RichTextBox) +3. Toggle button text changes ("Show details" ↔ "Hide details") +4. Footer panel height is recalculated based on content type: + - **Text**: Height calculated from text measurement + - **CheckBox**: Height based on checkbox control height + - **RichTextBox**: Height uses specified `footerRichTextBoxHeight` or default +5. Form size is recalculated to accommodate new footer height + +### Sizing Behavior + +The form automatically adjusts its size when the footer is expanded or collapsed: + +- **Collapsed State**: Footer height is minimal (~30 pixels) - just enough for the toggle button +- **Expanded State**: Footer height is calculated based on content type: + - **Text**: Height calculated from text measurement, wrapping, and available width + - **CheckBox**: Height based on checkbox control height + - **RichTextBox**: Height uses specified `footerRichTextBoxHeight` parameter or default (100 pixels) + - All types include padding for toggle button and borders + - Minimum height of 50 pixels applies + +The `UpdateSizing()` method accounts for: +- Message panel height +- Button panel height +- Footer panel height (varies based on state) +- Maximum width across all panels + +## Best Practices + +### When to Use the Footer + +āœ… **Good Use Cases:** +- **Error Details**: Stack traces, exception information, technical error codes +- **Additional Context**: Extra information that doesn't fit in the main message +- **Help Text**: Guidance for user decisions, keyboard shortcuts +- **Validation Errors**: Multiple field validation errors +- **System Information**: Diagnostic information, file details, processing statistics +- **Troubleshooting**: Steps to resolve issues, contact information + +āŒ **Avoid Using Footer For:** +- Critical information that users must see immediately (use main message instead) +- Very short text that fits easily in the main message +- Information that changes the meaning of the main message + +### Footer Content Guidelines + +1. **Keep it Relevant**: Footer should provide additional context, not replace the main message +2. **Choose Appropriate Content Type**: + - Use **Text** for simple text content, stack traces, error details + - Use **CheckBox** for user preferences and optional settings + - Use **RichTextBox** for formatted text, code snippets, or longer content requiring scrolling +3. **Structure Clearly**: Use bullet points, numbered lists, or clear sections for readability +4. **Appropriate Length**: Very long footer text may require scrolling; consider breaking into sections or using RichTextBox +5. **RichTextBox Height**: Set a reasonable height (typically 100-200 pixels) based on expected content length +6. **Technical vs. User-Friendly**: Consider your audience - technical details are fine for developer tools, but keep user-facing messages simple + +### Initial State Recommendations + +- **Start Collapsed** (`footerExpanded: false`): + - Stack traces and error details (Text or RichTextBox) + - Technical information (Text or RichTextBox) + - Optional help text (Text) + - Information that most users won't need + - CheckBox for optional preferences (CheckBox) + +- **Start Expanded** (`footerExpanded: true`): + - Important warnings that users should read (Text or RichTextBox) + - Validation errors that need immediate attention (Text or RichTextBox) + - Critical additional context + - CheckBox that users should see immediately (CheckBox) + +### Integration with Other Features + +The footer feature works seamlessly with all existing `KryptonMessageBoxExtended` features: + +- āœ… **Icons**: All icon types (Error, Warning, Information, Question, None) +- āœ… **Button Configurations**: All button types (OK, YesNo, YesNoCancel, etc.) +- āœ… **Custom Fonts**: Footer content uses the same `MessageBoxTypeface` as the main message +- āœ… **Timeout**: Footer works with timeout functionality +- āœ… **Do Not Show Again**: Footer works with the "Do not show again" checkbox (separate from footer CheckBox) +- āœ… **Custom Button Text**: Footer works with custom button text +- āœ… **Content Types**: All three footer content types (Text, CheckBox, RichTextBox) work with all features +- āœ… **RTL Support**: Footer supports right-to-left layouts + +## Compatibility + +### Framework Support + +The expandable footer feature is available in all supported framework versions: +- .NET Framework 4.7.2 and later +- .NET 8.0 and later +- .NET 9.0 and later +- .NET 10.0 and later +- .NET 11.0 and later + +### Backward Compatibility + +- **Fully Backward Compatible**: Existing code continues to work without modification +- **Optional Feature**: If `footerText` is `null` or empty, the footer is not shown and the message box behaves exactly as before +- **No Breaking Changes**: All existing `Show` method overloads remain unchanged + +### Namespace + +```csharp +using Krypton.Toolkit.Suite.Extended.Settings; +``` + +The `KryptonMessageBoxExtended` class is located in the `Krypton.Toolkit.Suite.Extended.Settings` namespace. + +## See Also + +- [KryptonMessageBoxExtended API Documentation](../../Source/Krypton%20Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Other/KryptonMessageBoxExtended.cs) +- [MessageBox Footer Example](../../Source/Krypton%20Toolkit/Examples/MessageBoxFooterExample.cs) +- [Issue #511 - Feature Request](https://github.com/Krypton-Suite/Extended-Toolkit/issues/511) +- [Changelog](Changelog.md) + +--- + +**Last Updated:** January 2026 +**Feature Version:** 1.0 +**Namespace:** `Krypton.Toolkit.Suite.Extended.Settings` diff --git a/Source/Documentation/Extended Toolkit API Documentation/Extended Toolkit API Documentation.shfbproj b/Source/Documentation/Extended Toolkit API Documentation/Extended Toolkit API Documentation.shfbproj index 43446799e..230b8fae8 100644 --- a/Source/Documentation/Extended Toolkit API Documentation/Extended Toolkit API Documentation.shfbproj +++ b/Source/Documentation/Extended Toolkit API Documentation/Extended Toolkit API Documentation.shfbproj @@ -1,4 +1,4 @@ - + @@ -144,8 +144,10 @@ - - + + + + diff --git a/Source/Krypton Toolkit/AutoUpdateCreator/AutoUpdateCreator.csproj b/Source/Krypton Toolkit/AutoUpdateCreator/AutoUpdateCreator.csproj index 80c392593..879d90eff 100644 --- a/Source/Krypton Toolkit/AutoUpdateCreator/AutoUpdateCreator.csproj +++ b/Source/Krypton Toolkit/AutoUpdateCreator/AutoUpdateCreator.csproj @@ -19,25 +19,25 @@ - + - + - + - + diff --git a/Source/Krypton Toolkit/Directory.Build.props b/Source/Krypton Toolkit/Directory.Build.props index 312076004..c345324bc 100644 --- a/Source/Krypton Toolkit/Directory.Build.props +++ b/Source/Krypton Toolkit/Directory.Build.props @@ -18,9 +18,14 @@ - - - + + + + + + + + @@ -48,9 +53,14 @@ - - - + + + + + + + + @@ -78,9 +88,14 @@ - - - + + + + + + + + @@ -108,9 +123,14 @@ - - - + + + + + + + + @@ -138,9 +158,14 @@ - - - + + + + + + + + @@ -169,9 +194,14 @@ - - - + + + + + + + + diff --git a/Source/Krypton Toolkit/Directory.Build.targets b/Source/Krypton Toolkit/Directory.Build.targets index b95a04932..048c3aa67 100644 --- a/Source/Krypton Toolkit/Directory.Build.targets +++ b/Source/Krypton Toolkit/Directory.Build.targets @@ -135,9 +135,9 @@ - An extension to the Standard Toolkit, which supports .NET Framework 4.7.2 - 4.8.1 and .NET 8 - 10. $(Description) + An extension to the Standard Toolkit, which supports .NET Framework 4.7.2 - 4.8.1 and .NET 8 - 11. $(Description) - This package supports all .NET Framework versions starting .NET Framework 4.7.2 - 4.8.1 and .NET 8 - 10. + This package supports all .NET Framework versions starting .NET Framework 4.7.2 - 4.8.1 and .NET 8 - 11. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the standard toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Standard/Krypton-Toolkit-Suite-Standard-Modules.md @@ -152,9 +152,9 @@ $(PackageId).Nightly - An extension to the Standard Toolkit, which supports .NET Framework 4.7.2 - 4.8.1 and .NET 8 - 10. $(Description) + An extension to the Standard Toolkit, which supports .NET Framework 4.7.2 - 4.8.1 and .NET 8 - 11. $(Description) - This package supports all .NET Framework versions starting .NET Framework 4.7.2 - 4.8.1 and .NET 8 - 10. + This package supports all .NET Framework versions starting .NET Framework 4.7.2 - 4.8.1 and .NET 8 - 11. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the standard toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Standard/Krypton-Toolkit-Suite-Standard-Modules.md @@ -169,9 +169,9 @@ $(PackageId).Lite.Canary - An extension to the Standard Toolkit, which supports .NET Framework 4.8 - 4.8.1 and .NET 8 - 10 (Canary Lite Configuration). $(Description) + An extension to the Standard Toolkit, which supports .NET Framework 4.8 - 4.8.1 and .NET 8 - 11 (Canary Lite Configuration). $(Description) - This package supports .NET Framework 4.8 - 4.8.1 and .NET 8 - 10 (excludes .NET Framework 4.7.2 for smaller package size). + This package supports .NET Framework 4.8 - 4.8.1 and .NET 8 - 11 (excludes .NET Framework 4.7.2 for smaller package size). All libraries are included targeting each specific framework version for performance purposes. This package is for those who want to try out the latest features before deployment in a lighter package. Please use $(PackageId) if full framework support or stable deployment is intended. @@ -186,9 +186,9 @@ $(PackageId).Lite.Nightly - An extension to the Standard Toolkit, which supports .NET Framework 4.8 - 4.8.1 and .NET 8 - 10 (Nightly Lite Configuration). $(Description) + An extension to the Standard Toolkit, which supports .NET Framework 4.8 - 4.8.1 and .NET 8 - 11 (Nightly Lite Configuration). $(Description) - This package supports .NET Framework 4.8 - 4.8.1 and .NET 8 - 10 (excludes .NET Framework 4.7.2 for smaller package size). + This package supports .NET Framework 4.8 - 4.8.1 and .NET 8 - 11 (excludes .NET Framework 4.7.2 for smaller package size). All libraries are included targeting each specific framework version for performance purposes. This package is for those who want to try out the latest cutting edge features before deployment in a lighter package. Please use $(PackageId) if full framework support or stable deployment is intended. @@ -203,9 +203,9 @@ $(PackageId).Lite - An extension to the Standard Toolkit, which supports .NET Framework 4.8 - 4.8.1 and .NET 8 - 10 (Release Lite Configuration). $(Description) + An extension to the Standard Toolkit, which supports .NET Framework 4.8 - 4.8.1 and .NET 8 - 11 (Release Lite Configuration). $(Description) - This package supports .NET Framework 4.8 - 4.8.1 and .NET 8 - 10 (excludes .NET Framework 4.7.2 for smaller package size). + This package supports .NET Framework 4.8 - 4.8.1 and .NET 8 - 11 (excludes .NET Framework 4.7.2 for smaller package size). All libraries are included targeting each specific framework version for performance purposes. To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md @@ -218,9 +218,9 @@ $(PackageId).Lite - An extension to the Standard Toolkit, which supports .NET Framework 4.8 and 4.8.1 and .NET 8 - 10. $(Description) + An extension to the Standard Toolkit, which supports .NET Framework 4.8 and 4.8.1 and .NET 8 - 11. $(Description) - This package supports all .NET Framework versions starting .NET Framework 4.8 and 4.8.1 and .NET 8 - 10. + This package supports all .NET Framework versions starting .NET Framework 4.8 and 4.8.1 and .NET 8 - 11. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the standard toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Standard/Krypton-Toolkit-Suite-Standard-Modules.md @@ -233,9 +233,9 @@ $(PackageId) - An extension to the Standard Toolkit, which supports .NET Framework 4.7.2 - 4.8.1 and .NET 8 - 10. $(Description) + An extension to the Standard Toolkit, which supports .NET Framework 4.7.2 - 4.8.1 and .NET 8 - 11. $(Description) - This package supports all .NET Framework versions starting .NET Framework 4.7.2 - 4.8.1 and .NET 8 - 10. + This package supports all .NET Framework versions starting .NET Framework 4.7.2 - 4.8.1 and .NET 8 - 11. Also, all libraries are included targeting each specific framework version for performance purposes. To view all of the standard toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Standard/Krypton-Toolkit-Suite-Standard-Modules.md diff --git a/Source/Krypton Toolkit/Examples/Examples.csproj b/Source/Krypton Toolkit/Examples/Examples.csproj index 153fc95eb..765685445 100644 --- a/Source/Krypton Toolkit/Examples/Examples.csproj +++ b/Source/Krypton Toolkit/Examples/Examples.csproj @@ -47,15 +47,35 @@ - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - diff --git a/Source/Krypton Toolkit/Examples/MessageBoxFooterExample.Designer.cs b/Source/Krypton Toolkit/Examples/MessageBoxFooterExample.Designer.cs new file mode 100644 index 000000000..e25330d49 --- /dev/null +++ b/Source/Krypton Toolkit/Examples/MessageBoxFooterExample.Designer.cs @@ -0,0 +1,227 @@ +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2017 - 2026 Krypton Suite + * + * 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. + * + */ + +#endregion + +namespace Examples +{ + partial class MessageBoxFooterExample + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.kryptonPanel1 = new Krypton.Toolkit.KryptonPanel(); + this.kryptonGroupBox1 = new Krypton.Toolkit.KryptonGroupBox(); + this.btnErrorWithFooter = new Krypton.Toolkit.KryptonButton(); + this.btnWarningWithExpandedFooter = new Krypton.Toolkit.KryptonButton(); + this.btnInfoWithTechnicalDetails = new Krypton.Toolkit.KryptonButton(); + this.btnQuestionWithHelp = new Krypton.Toolkit.KryptonButton(); + this.btnExceptionDetails = new Krypton.Toolkit.KryptonButton(); + this.btnValidationErrors = new Krypton.Toolkit.KryptonButton(); + this.btnSystemInfo = new Krypton.Toolkit.KryptonButton(); + this.btnNoFooter = new Krypton.Toolkit.KryptonButton(); + this.kryptonLabel1 = new Krypton.Toolkit.KryptonLabel(); + ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).BeginInit(); + this.kryptonPanel1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox1.Panel)).BeginInit(); + this.kryptonGroupBox1.Panel.SuspendLayout(); + this.kryptonGroupBox1.SuspendLayout(); + this.SuspendLayout(); + // + // kryptonPanel1 + // + this.kryptonPanel1.Controls.Add(this.kryptonGroupBox1); + this.kryptonPanel1.Controls.Add(this.kryptonLabel1); + this.kryptonPanel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.kryptonPanel1.Location = new System.Drawing.Point(0, 0); + this.kryptonPanel1.Name = "kryptonPanel1"; + this.kryptonPanel1.Size = new System.Drawing.Size(800, 600); + this.kryptonPanel1.TabIndex = 0; + // + // kryptonGroupBox1 + // + this.kryptonGroupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.kryptonGroupBox1.Location = new System.Drawing.Point(12, 50); + this.kryptonGroupBox1.Name = "kryptonGroupBox1"; + // + // kryptonGroupBox1.Panel + // + this.kryptonGroupBox1.Panel.Controls.Add(this.btnErrorWithFooter); + this.kryptonGroupBox1.Panel.Controls.Add(this.btnWarningWithExpandedFooter); + this.kryptonGroupBox1.Panel.Controls.Add(this.btnInfoWithTechnicalDetails); + this.kryptonGroupBox1.Panel.Controls.Add(this.btnQuestionWithHelp); + this.kryptonGroupBox1.Panel.Controls.Add(this.btnExceptionDetails); + this.kryptonGroupBox1.Panel.Controls.Add(this.btnValidationErrors); + this.kryptonGroupBox1.Panel.Controls.Add(this.btnSystemInfo); + this.kryptonGroupBox1.Panel.Controls.Add(this.btnNoFooter); + this.kryptonGroupBox1.Size = new System.Drawing.Size(776, 538); + this.kryptonGroupBox1.TabIndex = 1; + this.kryptonGroupBox1.Values.Heading = "Expandable Footer Examples"; + // + // btnErrorWithFooter + // + this.btnErrorWithFooter.Location = new System.Drawing.Point(15, 15); + this.btnErrorWithFooter.Name = "btnErrorWithFooter"; + this.btnErrorWithFooter.Size = new System.Drawing.Size(360, 50); + this.btnErrorWithFooter.TabIndex = 0; + this.btnErrorWithFooter.Values.Text = "1. Error with Collapsed Footer (Stack Trace)"; + this.btnErrorWithFooter.Click += new System.EventHandler(this.btnErrorWithFooter_Click); + // + // btnWarningWithExpandedFooter + // + this.btnWarningWithExpandedFooter.Location = new System.Drawing.Point(400, 15); + this.btnWarningWithExpandedFooter.Name = "btnWarningWithExpandedFooter"; + this.btnWarningWithExpandedFooter.Size = new System.Drawing.Size(360, 50); + this.btnWarningWithExpandedFooter.TabIndex = 1; + this.btnWarningWithExpandedFooter.Values.Text = "2. Warning with Expanded Footer"; + this.btnWarningWithExpandedFooter.Click += new System.EventHandler(this.btnWarningWithExpandedFooter_Click); + // + // btnInfoWithTechnicalDetails + // + this.btnInfoWithTechnicalDetails.Location = new System.Drawing.Point(15, 80); + this.btnInfoWithTechnicalDetails.Name = "btnInfoWithTechnicalDetails"; + this.btnInfoWithTechnicalDetails.Size = new System.Drawing.Size(360, 50); + this.btnInfoWithTechnicalDetails.TabIndex = 2; + this.btnInfoWithTechnicalDetails.Values.Text = "3. Information with Technical Details"; + this.btnInfoWithTechnicalDetails.Click += new System.EventHandler(this.btnInfoWithTechnicalDetails_Click); + // + // btnQuestionWithHelp + // + this.btnQuestionWithHelp.Location = new System.Drawing.Point(400, 80); + this.btnQuestionWithHelp.Name = "btnQuestionWithHelp"; + this.btnQuestionWithHelp.Size = new System.Drawing.Size(360, 50); + this.btnQuestionWithHelp.TabIndex = 3; + this.btnQuestionWithHelp.Values.Text = "4. Question with Help Text"; + this.btnQuestionWithHelp.Click += new System.EventHandler(this.btnQuestionWithHelp_Click); + // + // btnExceptionDetails + // + this.btnExceptionDetails.Location = new System.Drawing.Point(15, 145); + this.btnExceptionDetails.Name = "btnExceptionDetails"; + this.btnExceptionDetails.Size = new System.Drawing.Size(360, 50); + this.btnExceptionDetails.TabIndex = 4; + this.btnExceptionDetails.Values.Text = "5. Exception Details"; + this.btnExceptionDetails.Click += new System.EventHandler(this.btnExceptionDetails_Click); + // + // btnValidationErrors + // + this.btnValidationErrors.Location = new System.Drawing.Point(400, 145); + this.btnValidationErrors.Name = "btnValidationErrors"; + this.btnValidationErrors.Size = new System.Drawing.Size(360, 50); + this.btnValidationErrors.TabIndex = 5; + this.btnValidationErrors.Values.Text = "6. Validation Errors (Expanded)"; + this.btnValidationErrors.Click += new System.EventHandler(this.btnValidationErrors_Click); + // + // btnSystemInfo + // + this.btnSystemInfo.Location = new System.Drawing.Point(15, 210); + this.btnSystemInfo.Name = "btnSystemInfo"; + this.btnSystemInfo.Size = new System.Drawing.Size(360, 50); + this.btnSystemInfo.TabIndex = 6; + this.btnSystemInfo.Values.Text = "7. System Information"; + this.btnSystemInfo.Click += new System.EventHandler(this.btnSystemInfo_Click); + // + // btnNoFooter + // + this.btnNoFooter.Location = new System.Drawing.Point(400, 210); + this.btnNoFooter.Name = "btnNoFooter"; + this.btnNoFooter.Size = new System.Drawing.Size(360, 50); + this.btnNoFooter.TabIndex = 7; + this.btnNoFooter.Values.Text = "8. Standard Message (No Footer)"; + this.btnNoFooter.Click += new System.EventHandler(this.btnNoFooter_Click); + // + // kryptonLabel1 + // + this.kryptonLabel1.Location = new System.Drawing.Point(12, 12); + this.kryptonLabel1.Name = "kryptonLabel1"; + this.kryptonLabel1.Size = new System.Drawing.Size(776, 32); + this.kryptonLabel1.StateCommon.ShortText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Bold); + this.kryptonLabel1.StateCommon.ShortText.TextH = Krypton.Toolkit.PaletteRelativeAlign.Center; + this.kryptonLabel1.TabIndex = 0; + this.kryptonLabel1.Values.Text = "ExtendedKryptonMessageBox - Expandable Footer Feature Examples"; + // + // MessageBoxFooterExample + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(800, 600); + this.Controls.Add(this.kryptonPanel1); + this.Name = "MessageBoxFooterExample"; + this.Text = "MessageBox Footer Examples"; + this.Load += new System.EventHandler(this.MessageBoxFooterExample_Load); + ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel1)).EndInit(); + this.kryptonPanel1.ResumeLayout(false); + this.kryptonPanel1.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox1.Panel)).EndInit(); + this.kryptonGroupBox1.Panel.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox1)).EndInit(); + this.kryptonGroupBox1.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private Krypton.Toolkit.KryptonPanel kryptonPanel1; + private Krypton.Toolkit.KryptonGroupBox kryptonGroupBox1; + private Krypton.Toolkit.KryptonButton btnErrorWithFooter; + private Krypton.Toolkit.KryptonButton btnWarningWithExpandedFooter; + private Krypton.Toolkit.KryptonButton btnInfoWithTechnicalDetails; + private Krypton.Toolkit.KryptonButton btnQuestionWithHelp; + private Krypton.Toolkit.KryptonButton btnExceptionDetails; + private Krypton.Toolkit.KryptonButton btnValidationErrors; + private Krypton.Toolkit.KryptonButton btnSystemInfo; + private Krypton.Toolkit.KryptonButton btnNoFooter; + private Krypton.Toolkit.KryptonLabel kryptonLabel1; + } +} diff --git a/Source/Krypton Toolkit/Examples/MessageBoxFooterExample.cs b/Source/Krypton Toolkit/Examples/MessageBoxFooterExample.cs new file mode 100644 index 000000000..3cd4f93b4 --- /dev/null +++ b/Source/Krypton Toolkit/Examples/MessageBoxFooterExample.cs @@ -0,0 +1,289 @@ +#region MIT License + +/* + * MIT License + * + * Copyright (c) 2026 - 2026 Krypton Suite + * + * 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. + * + */ + +#endregion + +using Krypton.Toolkit.Suite.Extended.Messagebox; +using System.Windows.Forms; + +namespace Examples +{ + /// + /// Comprehensive example demonstrating the expandable footer feature of ExtendedKryptonMessageBox. + /// This example shows various use cases for the footer including error details, stack traces, and additional information. + /// + public partial class MessageBoxFooterExample : KryptonForm + { + #region Constructor + + public MessageBoxFooterExample() + { + InitializeComponent(); + } + + #endregion + + #region Event Handlers + + private void MessageBoxFooterExample_Load(object sender, EventArgs e) + { + // Set up the form + Text = @"ExtendedKryptonMessageBox - Expandable Footer Examples"; + } + + /// + /// Example 1: Error message with collapsed footer containing stack trace. + /// Demonstrates showing error details in a collapsed footer that users can expand if needed. + /// + private void btnErrorWithFooter_Click(object sender, EventArgs e) + { + string mainMessage = @"An error occurred while processing your request."; + string footerText = @"Stack Trace: + at Examples.MessageBoxFooterExample.btnErrorWithFooter_Click(Object sender, EventArgs e) + at System.Windows.Forms.Control.OnClick(EventArgs e) + at System.Windows.Forms.Button.OnClick(EventArgs e) + at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) + at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) + at System.Windows.Forms.Control.WndProc(Message& m) + at System.Windows.Forms.ButtonBase.WndProc(Message& m) + at System.Windows.Forms.Button.WndProc(Message& m) + at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) + +Exception Details: + Type: System.InvalidOperationException + Message: The operation cannot be completed because the object is in an invalid state. + Source: Examples + TargetSite: Void btnErrorWithFooter_Click(System.Object, System.EventArgs)"; + + KryptonMessageBoxExtended.Show( + this, + mainMessage, + @"Error", + ExtendedMessageBoxButtons.OK, + ExtendedKryptonMessageBoxIcon.Error, + footerText, + footerExpanded: false // Footer starts collapsed + ); + } + + /// + /// Example 2: Warning message with expanded footer showing additional context. + /// Demonstrates showing important information in an expanded footer. + /// + private void btnWarningWithExpandedFooter_Click(object sender, EventArgs e) + { + string mainMessage = @"This operation will modify system settings."; + string footerText = @"Additional Information: +• This change affects all users on this system +• A system restart may be required +• Previous settings will be backed up automatically +• You can restore previous settings from the Settings menu + +For more information, visit: https://example.com/help"; + + KryptonMessageBoxExtended.Show( + this, + mainMessage, + @"Warning", + ExtendedMessageBoxButtons.YesNo, + ExtendedKryptonMessageBoxIcon.Warning, + footerText, + footerExpanded: true // Footer starts expanded + ); + } + + /// + /// Example 3: Information message with technical details in footer. + /// Demonstrates using the footer for technical information that doesn't clutter the main message. + /// + private void btnInfoWithTechnicalDetails_Click(object sender, EventArgs e) + { + string mainMessage = @"Your file has been successfully processed."; + string footerText = @"Processing Details: +File: C:\\Users\\Documents\\report.pdf +Size: 2.5 MB +Processing Time: 1.2 seconds +Pages Processed: 45 +Format: PDF/A-1b +Checksum: A3F9B2C1D4E5F6A7B8C9D0E1F2A3B4C5 +Timestamp: 2026-01-15 14:32:18 UTC"; + + KryptonMessageBoxExtended.Show( + this, + mainMessage, + @"Information", + ExtendedMessageBoxButtons.OK, + ExtendedKryptonMessageBoxIcon.Information, + footerText, + footerExpanded: false + ); + } + + /// + /// Example 4: Question dialog with help text in footer. + /// Demonstrates using the footer to provide additional guidance without overwhelming the main question. + /// + private void btnQuestionWithHelp_Click(object sender, EventArgs e) + { + string mainMessage = @"Do you want to save your changes before closing?"; + string footerText = @"Help: +• Click 'Yes' to save your changes and close the document +• Click 'No' to close without saving (changes will be lost) +• Click 'Cancel' to return to the document and continue editing + +Keyboard Shortcuts: +• Ctrl+S: Save +• Ctrl+W: Close +• Esc: Cancel"; + + KryptonMessageBoxExtended.Show( + this, + mainMessage, + @"Save Changes?", + ExtendedMessageBoxButtons.YesNoCancel, + ExtendedKryptonMessageBoxIcon.Question, + footerText, + footerExpanded: false + ); + } + + /// + /// Example 5: Exception details with full error information. + /// Demonstrates showing comprehensive error information in a collapsed footer. + /// + private void btnExceptionDetails_Click(object sender, EventArgs e) + { + string mainMessage = @"A database connection error occurred."; + string footerText = @"Exception Information: +Type: System.Data.SqlClient.SqlException +Message: A network-related or instance-specific error occurred while establishing a connection to SQL Server. +Error Number: 2 +State: 0 +Class: 20 +Server: SQLSERVER01 +Line Number: 0 + +Connection String: Server=SQLSERVER01;Database=MyDB;Integrated Security=True; +Timeout: 30 seconds + +Troubleshooting Steps: +1. Verify that the SQL Server instance is running +2. Check network connectivity to the server +3. Verify firewall settings allow connections on port 1433 +4. Confirm the database name is correct +5. Check SQL Server authentication settings + +For additional help, contact your system administrator."; + + KryptonMessageBoxExtended.Show( + this, + mainMessage, + @"Database Error", + ExtendedMessageBoxButtons.OK, + ExtendedKryptonMessageBoxIcon.Error, + footerText, + footerExpanded: false + ); + } + + /// + /// Example 6: Validation errors with detailed field information. + /// Demonstrates using the footer to show multiple validation errors in a structured format. + /// + private void btnValidationErrors_Click(object sender, EventArgs e) + { + string mainMessage = @"Please correct the following validation errors:"; + string footerText = @"Validation Errors: +1. Email Address: Invalid format. Expected format: user@example.com +2. Phone Number: Required field cannot be empty +3. Date of Birth: Date cannot be in the future +4. Password: Must be at least 8 characters and contain uppercase, lowercase, and numbers +5. Confirm Password: Passwords do not match + +Please review each field and correct the errors before proceeding."; + + KryptonMessageBoxExtended.Show( + this, + mainMessage, + @"Validation Failed", + ExtendedMessageBoxButtons.OK, + ExtendedKryptonMessageBoxIcon.Warning, + footerText, + footerExpanded: true // Expanded to show all errors immediately + ); + } + + /// + /// Example 7: System information in footer. + /// Demonstrates displaying system or diagnostic information in the footer. + /// + private void btnSystemInfo_Click(object sender, EventArgs e) + { + string mainMessage = @"Application diagnostic information is available."; + string footerText = $@"System Information: +Operating System: {System.Environment.OSVersion} +.NET Version: {System.Environment.Version} +Machine Name: {System.Environment.MachineName} +User Name: {System.Environment.UserName} +Working Directory: {System.Environment.CurrentDirectory} +Processor Count: {System.Environment.ProcessorCount} +System Uptime: {TimeSpan.FromMilliseconds(System.Environment.TickCount):dd\:hh\:mm\:ss} + +Application Information: +Version: 1.0.0.0 +Build Date: {System.DateTime.Now:yyyy-MM-dd} +Configuration: Debug"; + + KryptonMessageBoxExtended.Show( + this, + mainMessage, + @"System Information", + ExtendedMessageBoxButtons.OK, + ExtendedKryptonMessageBoxIcon.Information, + footerText, + footerExpanded: false + ); + } + + /// + /// Example 8: No footer (standard message box). + /// Demonstrates that the footer is optional - if not provided, the message box behaves normally. + /// + private void btnNoFooter_Click(object sender, EventArgs e) + { + KryptonMessageBoxExtended.Show( + this, + @"This is a standard message box without a footer.", + @"Standard Message", + ExtendedMessageBoxButtons.OK, + ExtendedKryptonMessageBoxIcon.Information + ); + } + + #endregion + } +} diff --git a/Source/Krypton Toolkit/Krypton Toolkit Suite Extended 2022 - VS2022 - NuGet.slnx b/Source/Krypton Toolkit/Krypton Toolkit Suite Extended 2022 - VS2022 - NuGet.slnx index 2809d66f4..98d468c58 100644 --- a/Source/Krypton Toolkit/Krypton Toolkit Suite Extended 2022 - VS2022 - NuGet.slnx +++ b/Source/Krypton Toolkit/Krypton Toolkit Suite Extended 2022 - VS2022 - NuGet.slnx @@ -73,7 +73,6 @@ - @@ -152,6 +151,7 @@ + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView 2022.csproj index fc870a241..fd46c74fe 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView 2022.csproj @@ -74,25 +74,25 @@ - + - + - + - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Classes/Values/ImageValue.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Classes/Values/ImageValue.cs index 4d4f35283..4cf1e2354 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Classes/Values/ImageValue.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Classes/Values/ImageValue.cs @@ -116,6 +116,36 @@ public string GetLongText() return string.Empty; } + public Image? GetOverlayImage(PaletteState state) + { + throw new NotImplementedException(); + } + + public Color GetOverlayImageTransparentColor(PaletteState state) + { + throw new NotImplementedException(); + } + + public OverlayImagePosition GetOverlayImagePosition(PaletteState state) + { + throw new NotImplementedException(); + } + + public OverlayImageScaleMode GetOverlayImageScaleMode(PaletteState state) + { + throw new NotImplementedException(); + } + + public float GetOverlayImageScaleFactor(PaletteState state) + { + throw new NotImplementedException(); + } + + public Size GetOverlayImageFixedSize(PaletteState state) + { + throw new NotImplementedException(); + } + #endregion #region ImageTransparentColor diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Controls Toolkit/Internal/InternalKryptonButton.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Controls Toolkit/Internal/InternalKryptonButton.cs index 2b5c324c8..83bdca8ae 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Controls Toolkit/Internal/InternalKryptonButton.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Controls Toolkit/Internal/InternalKryptonButton.cs @@ -473,6 +473,36 @@ public virtual void SetFixedState(PaletteState state) /// String value. public string GetLongText() => KryptonCommand.ExtraText ?? Values.GetLongText(); + public Image? GetOverlayImage(PaletteState state) + { + throw new NotImplementedException(); + } + + public Color GetOverlayImageTransparentColor(PaletteState state) + { + throw new NotImplementedException(); + } + + public OverlayImagePosition GetOverlayImagePosition(PaletteState state) + { + throw new NotImplementedException(); + } + + public OverlayImageScaleMode GetOverlayImageScaleMode(PaletteState state) + { + throw new NotImplementedException(); + } + + public float GetOverlayImageScaleFactor(PaletteState state) + { + throw new NotImplementedException(); + } + + public Size GetOverlayImageFixedSize(PaletteState state) + { + throw new NotImplementedException(); + } + /// /// Gets the content image. /// diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Krypton.Toolkit.Suite.Extended.Buttons 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Krypton.Toolkit.Suite.Extended.Buttons 2022.csproj index 47969ec9d..547d3db1a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Krypton.Toolkit.Suite.Extended.Buttons 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Krypton.Toolkit.Suite.Extended.Buttons 2022.csproj @@ -23,7 +23,8 @@ false true - en preview + en + preview enable 6 true @@ -71,25 +72,25 @@ - + - + - + - + @@ -102,9 +103,9 @@ - + - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Krypton.Toolkit.Suite.Extended.Calendar 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Krypton.Toolkit.Suite.Extended.Calendar 2022.csproj index 9ae5e0ad5..5a385b930 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Krypton.Toolkit.Suite.Extended.Calendar 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Krypton.Toolkit.Suite.Extended.Calendar 2022.csproj @@ -23,7 +23,8 @@ false true - en preview + en + preview enable 6 true @@ -71,25 +72,25 @@ - + - + - + - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.CheckSum.Tools/Krypton.Toolkit.Suite.Extended.CheckSum.Tools 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.CheckSum.Tools/Krypton.Toolkit.Suite.Extended.CheckSum.Tools 2022.csproj index f1fbcb8ae..65173bf55 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.CheckSum.Tools/Krypton.Toolkit.Suite.Extended.CheckSum.Tools 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.CheckSum.Tools/Krypton.Toolkit.Suite.Extended.CheckSum.Tools 2022.csproj @@ -25,7 +25,8 @@ True StrongKrypton.snk true - en preview + en + preview enable 6 true @@ -73,25 +74,25 @@ - + - + - + - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Circular.ProgressBar/Globals/GlobalDeclarations.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Circular.ProgressBar/Globals/GlobalDeclarations.cs index 43f36b1c5..6c5f0274b 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Circular.ProgressBar/Globals/GlobalDeclarations.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Circular.ProgressBar/Globals/GlobalDeclarations.cs @@ -34,4 +34,4 @@ global using Krypton.Toolkit.Suite.Extended.Developer.Utilities; -global using WinFormAnimation_NET5; \ No newline at end of file +global using WinFormAnimationDotNet; \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Circular.ProgressBar/Krypton.Toolkit.Suite.Extended.Circular.ProgressBar 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Circular.ProgressBar/Krypton.Toolkit.Suite.Extended.Circular.ProgressBar 2022.csproj index 0a12740d2..a35347ebd 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Circular.ProgressBar/Krypton.Toolkit.Suite.Extended.Circular.ProgressBar 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Circular.ProgressBar/Krypton.Toolkit.Suite.Extended.Circular.ProgressBar 2022.csproj @@ -25,7 +25,8 @@ True StrongKrypton.snk true - en preview + en + preview enable 6 true @@ -73,25 +74,25 @@ - + - + - + - + @@ -130,7 +131,7 @@ - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ComboBox/Krypton.Toolkit.Suite.Extended.ComboBox 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ComboBox/Krypton.Toolkit.Suite.Extended.ComboBox 2022.csproj index 6e8bb03b5..06f7ab215 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ComboBox/Krypton.Toolkit.Suite.Extended.ComboBox 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ComboBox/Krypton.Toolkit.Suite.Extended.ComboBox 2022.csproj @@ -25,7 +25,8 @@ True StrongKrypton.snk true - en preview + en + preview enable 6 true @@ -73,25 +74,25 @@ - + - + - + - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Security/UACSecurity.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Security/UACSecurity.cs index cc7af625a..d6b01d64f 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Security/UACSecurity.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Classes/Security/UACSecurity.cs @@ -26,6 +26,8 @@ */ #endregion +using KryptonExceptionDialog = Krypton.Utilities.KryptonExceptionDialog; + namespace Krypton.Toolkit.Suite.Extended.Common; /// Adapted from https://www.codeproject.com/Articles/18509/Add-a-UAC-shield-to-a-button-when-elevation-is-req. diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Krypton.Toolkit.Suite.Extended.Common 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Krypton.Toolkit.Suite.Extended.Common 2022.csproj index 1c985eb0a..b7cb43632 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Krypton.Toolkit.Suite.Extended.Common 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Common/Krypton.Toolkit.Suite.Extended.Common 2022.csproj @@ -25,7 +25,8 @@ True StrongKrypton.snk True - true preview + true + preview enable 6 true @@ -73,25 +74,25 @@ - + - + - + - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Compression/Krypton.Toolkit.Suite.Extended.Compression 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Compression/Krypton.Toolkit.Suite.Extended.Compression 2022.csproj index ab48ee125..40d968d2a 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Compression/Krypton.Toolkit.Suite.Extended.Compression 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Compression/Krypton.Toolkit.Suite.Extended.Compression 2022.csproj @@ -25,7 +25,8 @@ True StrongKrypton.snk true - en preview + en + preview enable 6 true @@ -73,25 +74,25 @@ - + - + - + - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Krypton.Toolkit.Suite.Extended.Controls 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Krypton.Toolkit.Suite.Extended.Controls 2022.csproj index 0e6471dbf..7d8d6c5f4 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Krypton.Toolkit.Suite.Extended.Controls 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Controls/Krypton.Toolkit.Suite.Extended.Controls 2022.csproj @@ -1,4 +1,4 @@ - + @@ -25,7 +25,8 @@ True StrongKrypton.snk true - en preview + en + preview enable 6 true @@ -73,25 +74,25 @@ - + - + - + - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Controls/Internal/CircularPictureBox.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Controls/Internal/CircularPictureBox.cs index f613426c6..75c45f172 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Controls/Internal/CircularPictureBox.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Controls/Internal/CircularPictureBox.cs @@ -79,4 +79,33 @@ protected override void OnPaint(PaintEventArgs pe) public string GetShortText() => throw new NotImplementedException(); public string GetLongText() => throw new NotImplementedException(); + public Image? GetOverlayImage(PaletteState state) + { + throw new NotImplementedException(); + } + + public Color GetOverlayImageTransparentColor(PaletteState state) + { + throw new NotImplementedException(); + } + + public OverlayImagePosition GetOverlayImagePosition(PaletteState state) + { + throw new NotImplementedException(); + } + + public OverlayImageScaleMode GetOverlayImageScaleMode(PaletteState state) + { + throw new NotImplementedException(); + } + + public float GetOverlayImageScaleFactor(PaletteState state) + { + throw new NotImplementedException(); + } + + public Size GetOverlayImageFixedSize(PaletteState state) + { + throw new NotImplementedException(); + } } \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Krypton.Toolkit.Suite.Extended.Core 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Krypton.Toolkit.Suite.Extended.Core 2022.csproj index a2bb59e40..52dbb00cf 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Krypton.Toolkit.Suite.Extended.Core 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Core/Krypton.Toolkit.Suite.Extended.Core 2022.csproj @@ -24,7 +24,8 @@ false True StrongKrypton.snk - true preview + true + preview enable 6 true @@ -68,116 +69,36 @@ - - - preview - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - preview - - - - - - - - - - - - - - - - preview - - - - - - - - - - - - - - - - preview - - - - - - - - - - - - - - - - preview - - - - - - - - - - - - - - - - preview - - - - - - - - - - - - - - - - preview - - - - - - - - - + @@ -186,14 +107,14 @@ ..\..\..\Bin\$(configuration)\Krypton.Toolkit.Suite.Extended.Core\Krypton.Toolkit.Suite.Extended.Core.xml ..\..\..\Bin\$(configuration)\Krypton.Toolkit.Suite.Extended.Core\ - False + True enable - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Krypton.Toolkit.Suite.Extended.Data.Visualisation 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Krypton.Toolkit.Suite.Extended.Data.Visualisation 2022.csproj index d53941cfd..c1e467a2d 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Krypton.Toolkit.Suite.Extended.Data.Visualisation 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Data.Visualisation/Krypton.Toolkit.Suite.Extended.Data.Visualisation 2022.csproj @@ -25,7 +25,8 @@ True StrongKrypton.snk true - en preview + en + preview enable 6 true @@ -73,25 +74,25 @@ - + - + - + - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/Krypton.Toolkit.Suite.Extended.DataGridView 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/Krypton.Toolkit.Suite.Extended.DataGridView 2022.csproj index 2bb5b695a..3ddaa077f 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/Krypton.Toolkit.Suite.Extended.DataGridView 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.DataGridView/Krypton.Toolkit.Suite.Extended.DataGridView 2022.csproj @@ -25,7 +25,8 @@ True StrongKrypton.snk true - en preview + en + preview enable 6 true @@ -69,74 +70,36 @@ - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - preview - - - - - - - - - - preview - - - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Debug.Tools/Krypton.Toolkit.Suite.Extended.Debug.Tools 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Debug.Tools/Krypton.Toolkit.Suite.Extended.Debug.Tools 2022.csproj index 980eb5d8e..aac2973ab 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Debug.Tools/Krypton.Toolkit.Suite.Extended.Debug.Tools 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Debug.Tools/Krypton.Toolkit.Suite.Extended.Debug.Tools 2022.csproj @@ -24,7 +24,8 @@ false True StrongKrypton.snk - true preview + true + preview enable 6 true @@ -67,6 +68,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ..\..\..\Bin\$(configuration)\Krypton.Toolkit.Suite.Extended.Debug.Tools\Krypton.Toolkit.Suite.Extended.Debug.Tools.xml diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Developer.Utilities/Krypton.Toolkit.Suite.Extended.Developer.Utilities 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Developer.Utilities/Krypton.Toolkit.Suite.Extended.Developer.Utilities 2022.csproj index d950a96cc..5531d3e07 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Developer.Utilities/Krypton.Toolkit.Suite.Extended.Developer.Utilities 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Developer.Utilities/Krypton.Toolkit.Suite.Extended.Developer.Utilities 2022.csproj @@ -24,7 +24,8 @@ false True StrongKrypton.snk - true preview + true + preview enable 6 true @@ -72,25 +73,25 @@ - + - + - + - + @@ -110,7 +111,7 @@ enable - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Krypton.Toolkit.Suite.Extended.Dialogs 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Krypton.Toolkit.Suite.Extended.Dialogs 2022.csproj index 6d5b5749b..927d82ed4 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Krypton.Toolkit.Suite.Extended.Dialogs 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dialogs/Krypton.Toolkit.Suite.Extended.Dialogs 2022.csproj @@ -25,7 +25,8 @@ True StrongKrypton.snk true - en preview + en + preview enable 6 true @@ -73,25 +74,25 @@ - + - + - + - + @@ -111,8 +112,8 @@ - - + + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dock.Extender/Krypton.Toolkit.Suite.Extended.Dock.Extender 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dock.Extender/Krypton.Toolkit.Suite.Extended.Dock.Extender 2022.csproj index d3c587b26..77a6ebfe9 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dock.Extender/Krypton.Toolkit.Suite.Extended.Dock.Extender 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Dock.Extender/Krypton.Toolkit.Suite.Extended.Dock.Extender 2022.csproj @@ -25,7 +25,8 @@ True StrongKrypton.snk true - en preview + en + preview enable 6 true @@ -73,25 +74,25 @@ - + - + - + - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/KryptonColourButtonExtended.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/KryptonColourButtonExtended.cs index 9f067141b..0351c3c86 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/KryptonColourButtonExtended.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Controls/Components/KryptonColourButtonExtended.cs @@ -838,6 +838,36 @@ public virtual void SetFixedState(PaletteState state) /// String value. public string GetLongText() => KryptonCommand?.ExtraText ?? Values.GetLongText(); + public Image? GetOverlayImage(PaletteState state) + { + throw new NotImplementedException(); + } + + public Color GetOverlayImageTransparentColor(PaletteState state) + { + throw new NotImplementedException(); + } + + public OverlayImagePosition GetOverlayImagePosition(PaletteState state) + { + throw new NotImplementedException(); + } + + public OverlayImageScaleMode GetOverlayImageScaleMode(PaletteState state) + { + throw new NotImplementedException(); + } + + public float GetOverlayImageScaleFactor(PaletteState state) + { + throw new NotImplementedException(); + } + + public Size GetOverlayImageFixedSize(PaletteState state) + { + throw new NotImplementedException(); + } + /// /// Gets the content image. /// diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Krypton.Toolkit.Suite.Extended.Drawing.Utilities 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Krypton.Toolkit.Suite.Extended.Drawing.Utilities 2022.csproj index fafeaf7d8..7ecab916d 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Krypton.Toolkit.Suite.Extended.Drawing.Utilities 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Krypton.Toolkit.Suite.Extended.Drawing.Utilities 2022.csproj @@ -25,7 +25,8 @@ True StrongKrypton.snk true - en preview + en + preview enable 6 true @@ -73,25 +74,25 @@ - + - + - + - + @@ -130,7 +131,7 @@ - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Values/ColourButtonValues.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Values/ColourButtonValues.cs index 532438f2f..3528e8142 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Values/ColourButtonValues.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing.Utilities/Values/ColourButtonValues.cs @@ -432,5 +432,36 @@ public virtual string GetLongText() { return ExtraText; } + + public Image? GetOverlayImage(PaletteState state) + { + throw new NotImplementedException(); + } + + public Color GetOverlayImageTransparentColor(PaletteState state) + { + throw new NotImplementedException(); + } + + public OverlayImagePosition GetOverlayImagePosition(PaletteState state) + { + throw new NotImplementedException(); + } + + public OverlayImageScaleMode GetOverlayImageScaleMode(PaletteState state) + { + throw new NotImplementedException(); + } + + public float GetOverlayImageScaleFactor(PaletteState state) + { + throw new NotImplementedException(); + } + + public Size GetOverlayImageFixedSize(PaletteState state) + { + throw new NotImplementedException(); + } + #endregion } \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing/Krypton.Toolkit.Suite.Extended.Drawing 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing/Krypton.Toolkit.Suite.Extended.Drawing 2022.csproj index 92166a988..51e8341a1 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing/Krypton.Toolkit.Suite.Extended.Drawing 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Drawing/Krypton.Toolkit.Suite.Extended.Drawing 2022.csproj @@ -24,7 +24,8 @@ false True StrongKrypton.snk - true preview + true + preview enable 6 true @@ -72,25 +73,25 @@ - + - + - + - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Effects/Krypton.Toolkit.Suite.Extended.Effects 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Effects/Krypton.Toolkit.Suite.Extended.Effects 2022.csproj index 3e13b22fb..6c96bb529 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Effects/Krypton.Toolkit.Suite.Extended.Effects 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Effects/Krypton.Toolkit.Suite.Extended.Effects 2022.csproj @@ -24,7 +24,8 @@ false True StrongKrypton.snk - true preview + true + preview enable 6 true @@ -72,25 +73,25 @@ - + - + - + - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Krypton.Toolkit.Suite.Extended.Error.Reporting 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Krypton.Toolkit.Suite.Extended.Error.Reporting 2022.csproj index a043cddd0..5b33dccca 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Krypton.Toolkit.Suite.Extended.Error.Reporting 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/Krypton.Toolkit.Suite.Extended.Error.Reporting 2022.csproj @@ -25,7 +25,8 @@ True StrongKrypton.snk true - en preview + en + preview enable 6 true @@ -69,97 +70,49 @@ - - - preview - - - - - - - - - - - - preview - - - - - - - - - - - - preview - - - - - - - - - - - - preview - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - preview - - - - - - - - - - - - preview - - - - - - - - - - - - preview - - - - - + + + + + - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/UX/MVP/Views/ExceptionReportView.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/UX/MVP/Views/ExceptionReportView.Designer.cs index 5346928e1..85745e380 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/UX/MVP/Views/ExceptionReportView.Designer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Error.Reporting/UX/MVP/Views/ExceptionReportView.Designer.cs @@ -1,4 +1,4 @@ -namespace Krypton.Toolkit.Suite.Extended.Error.Reporting +namespace Krypton.Toolkit.Suite.Extended.Error.Reporting { partial class ExceptionReportView { @@ -588,9 +588,9 @@ private void InitializeComponent() private KryptonButton kbtnCopy; private KryptonButton kbtnSave; private KryptonPanel kpnlMain; - private Navigator.KryptonNavigator kryptonNavigator1; - private Navigator.KryptonPage kpGeneral; - private Navigator.KryptonPage kpExceptions; + private Krypton.Navigator.KryptonNavigator kryptonNavigator1; + private Krypton.Navigator.KryptonPage kpGeneral; + private Krypton.Navigator.KryptonPage kpExceptions; private KryptonTextBox ktxtUserExplanation; private KryptonLabel klblExplanation; private KryptonTextBox ktxtTime; @@ -603,9 +603,9 @@ private void InitializeComponent() private KryptonLabel kryptonLabel1; private KryptonTextBox ktxtExceptionMessage; private PictureBox picGeneral; - private Navigator.KryptonPage kpAssemblies; + private Krypton.Navigator.KryptonPage kpAssemblies; private KryptonListView klvAssemblies; - private Navigator.KryptonPage kpSystemInformation; + private Krypton.Navigator.KryptonPage kpSystemInformation; private KryptonTreeView ktvEnvironment; private KryptonPanel kpnlLessDetails; private KryptonTextBox ktxtExceptionMessageLarge2; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.File.Copier/Krypton.Toolkit.Suite.Extended.File.Copier 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.File.Copier/Krypton.Toolkit.Suite.Extended.File.Copier 2022.csproj index a341d93fc..3add02060 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.File.Copier/Krypton.Toolkit.Suite.Extended.File.Copier 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.File.Copier/Krypton.Toolkit.Suite.Extended.File.Copier 2022.csproj @@ -25,7 +25,8 @@ false True StrongKrypton.snk - true preview + true + preview enable 6 true @@ -73,25 +74,25 @@ - + - + - + - + @@ -135,7 +136,7 @@ - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.File.Explorer/Krypton.Toolkit.Suite.Extended.File.Explorer 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.File.Explorer/Krypton.Toolkit.Suite.Extended.File.Explorer 2022.csproj index c25f02d3d..48d04c8b5 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.File.Explorer/Krypton.Toolkit.Suite.Extended.File.Explorer 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.File.Explorer/Krypton.Toolkit.Suite.Extended.File.Explorer 2022.csproj @@ -25,7 +25,8 @@ True StrongKrypton.snk true - en true + en + true preview @@ -71,25 +72,25 @@ - + - + - + - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/Components/Advanced/FloatableMenuStrip.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/Components/Advanced/FloatableMenuStrip.cs index 022c7ba4d..987b9dbed 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/Components/Advanced/FloatableMenuStrip.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/Components/Advanced/FloatableMenuStrip.cs @@ -1,4 +1,4 @@ -#region MIT License +#region MIT License /* * MIT License * @@ -209,9 +209,24 @@ private void _menuStripContainerWindow_FormClosing(object sender, FormClosingEve { e.Cancel = true; + _menuStripContainerWindow.Controls.Remove(this); + _menuStripContainerWindow.Visible = false; - base.OnVisibleChanged(new EventArgs()); + if (_originalParent != null) + { + _originalParent.SuspendLayout(); + + base.Dock = DockStyle.None; + + base.Anchor = AnchorStyles.Top | AnchorStyles.Left; + + _originalParent.Controls.Add(this); + + _originalParent.ResumeLayout(); + } + + _isFloating = false; } } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/Components/Advanced/FloatableToolStrip.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/Components/Advanced/FloatableToolStrip.cs index 1a51173e8..c68fd3c83 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/Components/Advanced/FloatableToolStrip.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/Components/Advanced/FloatableToolStrip.cs @@ -1,4 +1,4 @@ -#region MIT License +#region MIT License /* * MIT License * @@ -184,9 +184,24 @@ private void _toolStripContainerWindow_FormClosing(object sender, FormClosingEve { e.Cancel = true; + _toolStripContainerWindow.Controls.Remove(this); + _toolStripContainerWindow.Visible = false; - base.OnVisibleChanged(new EventArgs()); + if (_originalParent != null) + { + _originalParent.SuspendLayout(); + + base.Dock = DockStyle.None; + + base.Anchor = AnchorStyles.Top | AnchorStyles.Left; + + _originalParent.Controls.Add(this); + + _originalParent.ResumeLayout(); + } + + _isFloating = false; } } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/Krypton.Toolkit.Suite.Extended.Floating.Toolbars 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/Krypton.Toolkit.Suite.Extended.Floating.Toolbars 2022.csproj index 1b35cf713..a2afa4ce8 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/Krypton.Toolkit.Suite.Extended.Floating.Toolbars 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Floating.Toolbars/Krypton.Toolkit.Suite.Extended.Floating.Toolbars 2022.csproj @@ -25,7 +25,8 @@ True StrongKrypton.snk true - en preview + en + preview enable 6 true @@ -73,25 +74,25 @@ - + - + - + - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Controls Visuals/VisualKryptonFormExtended.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Controls Visuals/VisualKryptonFormExtended.cs index 23aa77f5e..2dbaad306 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Controls Visuals/VisualKryptonFormExtended.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Controls Visuals/VisualKryptonFormExtended.cs @@ -1,4 +1,4 @@ -#region MIT License +#region MIT License /* * MIT License * @@ -771,6 +771,49 @@ public Color GetImageTransparentColor(PaletteState state) => // We never mark any color as transparent Color.Empty; + /// + /// Gets the overlay image used for showing on the title bar. + /// + /// Form state. + /// Overlay Image. + public Image? GetOverlayImage(PaletteState state) => + // We don't use overlay images on the form title bar + null; + + public Color GetOverlayImageTransparentColor(PaletteState state) + { + throw new NotImplementedException(); + } + + public OverlayImagePosition GetOverlayImagePosition(PaletteState state) + { + throw new NotImplementedException(); + } + + public OverlayImageScaleMode GetOverlayImageScaleMode(PaletteState state) + { + throw new NotImplementedException(); + } + + public float GetOverlayImageScaleFactor(PaletteState state) + { + throw new NotImplementedException(); + } + + Size IContentValues.GetOverlayImageFixedSize(PaletteState state) + { + throw new NotImplementedException(); + } + + /// + /// Gets the fixed size for the overlay image. + /// + /// Form state. + /// Fixed size for overlay image. + public Size? GetOverlayImageFixedSize(PaletteState state) => + // We don't use overlay images on the form title bar + null; + /// /// Gets the short text used as the main caption title. /// diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Krypton.Toolkit.Suite.Extended.Forms 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Krypton.Toolkit.Suite.Extended.Forms 2022.csproj index b01d6ed91..ac8e62f80 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Krypton.Toolkit.Suite.Extended.Forms 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Forms/Krypton.Toolkit.Suite.Extended.Forms 2022.csproj @@ -25,7 +25,8 @@ True StrongKrypton.snk true - en preview + en + preview enable 6 true @@ -73,25 +74,25 @@ - + - + - + - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Gages/Krypton.Toolkit.Suite.Extended.Gages 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Gages/Krypton.Toolkit.Suite.Extended.Gages 2022.csproj index c20dc12a9..36aed8aaf 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Gages/Krypton.Toolkit.Suite.Extended.Gages 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Gages/Krypton.Toolkit.Suite.Extended.Gages 2022.csproj @@ -25,7 +25,8 @@ True StrongKrypton.snk true - en true + en + true preview @@ -71,25 +72,25 @@ - + - + - + - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Global.Utilities/Classes/General/GlobalMethods.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Global.Utilities/Classes/General/GlobalMethods.cs index a20eecddb..dda7ae229 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Global.Utilities/Classes/General/GlobalMethods.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Global.Utilities/Classes/General/GlobalMethods.cs @@ -26,6 +26,8 @@ */ #endregion +using KryptonExceptionDialog = Krypton.Utilities.KryptonExceptionDialog; + namespace Krypton.Toolkit.Suite.Extended.Global.Utilities; /// diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Global.Utilities/Krypton.Toolkit.Suite.Extended.Global.Utilities 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Global.Utilities/Krypton.Toolkit.Suite.Extended.Global.Utilities 2022.csproj index 3475425a0..6d787d82e 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Global.Utilities/Krypton.Toolkit.Suite.Extended.Global.Utilities 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Global.Utilities/Krypton.Toolkit.Suite.Extended.Global.Utilities 2022.csproj @@ -24,7 +24,8 @@ false True StrongKrypton.snk - true preview + true + preview enable 6 true @@ -72,25 +73,25 @@ - + - + - + - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.IO/Krypton.Toolkit.Suite.Extended.IO 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.IO/Krypton.Toolkit.Suite.Extended.IO 2022.csproj index 7d5f05a1e..f6aa04311 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.IO/Krypton.Toolkit.Suite.Extended.IO 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.IO/Krypton.Toolkit.Suite.Extended.IO 2022.csproj @@ -25,7 +25,8 @@ True StrongKrypton.snk true - en preview + en + preview enable 6 true @@ -73,25 +74,25 @@ - + - + - + - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.InputBox/Krypton.Toolkit.Suite.Extended.InputBox 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.InputBox/Krypton.Toolkit.Suite.Extended.InputBox 2022.csproj index db1954e45..34f909288 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.InputBox/Krypton.Toolkit.Suite.Extended.InputBox 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.InputBox/Krypton.Toolkit.Suite.Extended.InputBox 2022.csproj @@ -25,7 +25,8 @@ True StrongKrypton.snk true - en preview + en + preview enable 6 true @@ -73,25 +74,25 @@ - + - + - + - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Language.Model/Krypton.Toolkit.Suite.Extended.Language.Model 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Language.Model/Krypton.Toolkit.Suite.Extended.Language.Model 2022.csproj index 711ae7855..c5c4beb86 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Language.Model/Krypton.Toolkit.Suite.Extended.Language.Model 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Language.Model/Krypton.Toolkit.Suite.Extended.Language.Model 2022.csproj @@ -24,7 +24,8 @@ false True StrongKrypton.snk - true preview + true + preview enable 6 true @@ -72,25 +73,25 @@ - + - + - + - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Memory.Box/Krypton.Toolkit.Suite.Extended.Memory.Box 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Memory.Box/Krypton.Toolkit.Suite.Extended.Memory.Box 2022.csproj index 6fa3f6769..790decf2f 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Memory.Box/Krypton.Toolkit.Suite.Extended.Memory.Box 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Memory.Box/Krypton.Toolkit.Suite.Extended.Memory.Box 2022.csproj @@ -25,7 +25,8 @@ True StrongKrypton.snk true - en preview + en + preview enable 6 true @@ -73,25 +74,25 @@ - + - + - + - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.MessageDialog/Krypton.Toolkit.Suite.Extended.MessageDialog.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.MessageDialog/Krypton.Toolkit.Suite.Extended.MessageDialog.csproj index 81d464d93..6d671d337 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.MessageDialog/Krypton.Toolkit.Suite.Extended.MessageDialog.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.MessageDialog/Krypton.Toolkit.Suite.Extended.MessageDialog.csproj @@ -25,7 +25,8 @@ True StrongKrypton.snk true - en preview + en + preview enable 6 true @@ -73,25 +74,25 @@ - + - + - + - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Toolkit/InternalKryptonButton.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Toolkit/InternalKryptonButton.cs index 1f64f2bdc..7d5ef3488 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Toolkit/InternalKryptonButton.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Toolkit/InternalKryptonButton.cs @@ -1,4 +1,4 @@ -#region MIT License +#region MIT License /* * MIT License * @@ -483,6 +483,41 @@ public virtual void SetFixedState(PaletteState state) /// Colour value. public Color GetImageTransparentColor(PaletteState state) => KryptonCommand?.ImageTransparentColor ?? Values.GetImageTransparentColor(state); + + /// + /// Gets the overlay image. + /// + /// The state for which the overlay image is needed. + /// Image value. + public Image? GetOverlayImage(PaletteState state) => null; + + public Color GetOverlayImageTransparentColor(PaletteState state) + { + throw new NotImplementedException(); + } + + public OverlayImagePosition GetOverlayImagePosition(PaletteState state) + { + throw new NotImplementedException(); + } + + /// + /// Gets the overlay image scale mode. + /// + /// The state for which the overlay image scale mode is needed. + /// Scale mode value. + public OverlayImageScaleMode GetOverlayImageScaleMode(PaletteState state) => OverlayImageScaleMode.None; + + public float GetOverlayImageScaleFactor(PaletteState state) + { + throw new NotImplementedException(); + } + + public Size GetOverlayImageFixedSize(PaletteState state) + { + throw new NotImplementedException(); + } + #endregion #region Protected Overrides diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Toolkit/KryptonMessageBoxExtended.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Toolkit/KryptonMessageBoxExtended.cs index e7373d348..5f4cc84a6 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Toolkit/KryptonMessageBoxExtended.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Toolkit/KryptonMessageBoxExtended.cs @@ -1,4 +1,4 @@ -#region MIT License +#region MIT License /* * MIT License * @@ -494,6 +494,71 @@ public static DialogResult Show(IWin32Window owner, string messageText, string c richTextBoxTextAlignment, messageTextBoxAlignment, useTimeOut, timeOut, timeOutInterval, timerResult); + /// Shows a with expandable footer. + /// The message text. + /// The caption. + /// The buttons. + /// The icon. + /// The text to display in the expandable footer. If null or empty, footer will not be shown (unless footerContentType is CheckBox). + /// If true, the footer will be expanded by default; otherwise, it will be collapsed. + /// The type of content to display in the footer (Text, CheckBox, or RichTextBox). + /// The height for the RichTextBox when footerContentType is RichTextBox. If null, uses default height. + /// The show control copy. + /// The message box typeface. + /// One of the System.Windows.Forms.DialogResult values. + public static DialogResult Show(string messageText, string caption = @"", + ExtendedMessageBoxButtons buttons = ExtendedMessageBoxButtons.OK, + ExtendedKryptonMessageBoxIcon icon = ExtendedKryptonMessageBoxIcon.None, + string? footerText = null, + bool footerExpanded = false, + ExtendedKryptonMessageBoxFooterContentType footerContentType = ExtendedKryptonMessageBoxFooterContentType.Text, + int? footerRichTextBoxHeight = null, + bool? showCtrlCopy = null, + Font? messageBoxTypeface = null) + => + ShowCore(null, messageText, caption, buttons, icon, KryptonMessageBoxDefaultButton.Button1, + 0, null, showCtrlCopy, messageBoxTypeface, null, null, null, + [Color.Empty, Color.Empty, Color.Empty, Color.Empty], + null, null, null, null, string.Empty, string.Empty, + string.Empty, string.Empty, string.Empty, + ExtendedKryptonMessageBoxMessageContainerType.Normal, + null, null, null, null, ContentAlignment.MiddleLeft, null, null, + null, null, null, null, + footerText, footerExpanded, footerContentType, footerRichTextBoxHeight); + + /// Shows a with expandable footer. + /// The owner. + /// The message text. + /// The caption. + /// The buttons. + /// The icon. + /// The text to display in the expandable footer. If null or empty, footer will not be shown (unless footerContentType is CheckBox). + /// If true, the footer will be expanded by default; otherwise, it will be collapsed. + /// The type of content to display in the footer (Text, CheckBox, or RichTextBox). + /// The height for the RichTextBox when footerContentType is RichTextBox. If null, uses default height. + /// The show control copy. + /// The message box typeface. + /// One of the System.Windows.Forms.DialogResult values. + public static DialogResult Show(IWin32Window owner, string messageText, string caption = @"", + ExtendedMessageBoxButtons buttons = ExtendedMessageBoxButtons.OK, + ExtendedKryptonMessageBoxIcon icon = ExtendedKryptonMessageBoxIcon.None, + string? footerText = null, + bool footerExpanded = false, + ExtendedKryptonMessageBoxFooterContentType footerContentType = ExtendedKryptonMessageBoxFooterContentType.Text, + int? footerRichTextBoxHeight = null, + bool? showCtrlCopy = null, + Font? messageBoxTypeface = null) + => + ShowCore(owner, messageText, caption, buttons, icon, KryptonMessageBoxDefaultButton.Button1, + 0, null, showCtrlCopy, messageBoxTypeface, null, null, null, + [Color.Empty, Color.Empty, Color.Empty, Color.Empty], + null, null, null, null, string.Empty, string.Empty, + string.Empty, string.Empty, string.Empty, + ExtendedKryptonMessageBoxMessageContainerType.Normal, + null, null, null, null, ContentAlignment.MiddleLeft, null, null, + null, null, null, null, + footerText, footerExpanded, footerContentType, footerRichTextBoxHeight); + #endregion #region Implementation @@ -529,7 +594,11 @@ internal static bool ShowCoreWithBoolResult(IWin32Window? owner, string text, st bool? useTimeOut, int? timeOut, int? timeOutInterval, - DialogResult? timerResult) + DialogResult? timerResult, + string? footerText = null, + bool footerExpanded = false, + ExtendedKryptonMessageBoxFooterContentType footerContentType = ExtendedKryptonMessageBoxFooterContentType.Text, + int? footerRichTextBoxHeight = null) { IWin32Window? showOwner = ValidateOptions(owner, options, helpInfo); @@ -566,7 +635,11 @@ internal static bool ShowCoreWithBoolResult(IWin32Window? owner, string text, st useOptionalCheckBoxThreeState, useTimeOut, timeOut, - timerResult); + timerResult, + footerText, + footerExpanded, + footerContentType, + footerRichTextBoxHeight); return true; } @@ -607,7 +680,11 @@ internal static bool ShowCoreWithBoolResult(IWin32Window? owner, string text, st useTimeOut, timeOut, timeOutInterval, - timerResult); + timerResult, + footerText, + footerExpanded, + footerContentType, + footerRichTextBoxHeight); kmbe.Show(); @@ -689,7 +766,11 @@ internal static CheckState ShowCoreWithCheckStateResult(IWin32Window? owner, str bool? useTimeOut, int? timeOut, int? timeOutInterval, - DialogResult? timerResult) + DialogResult? timerResult, + string? footerText = null, + bool footerExpanded = false, + ExtendedKryptonMessageBoxFooterContentType footerContentType = ExtendedKryptonMessageBoxFooterContentType.Text, + int? footerRichTextBoxHeight = null) { IWin32Window? showOwner = ValidateOptions(owner, options, helpInfo); @@ -726,7 +807,11 @@ internal static CheckState ShowCoreWithCheckStateResult(IWin32Window? owner, str useOptionalCheckBoxThreeState, useTimeOut, timeOut, - timerResult); + timerResult, + footerText, + footerExpanded, + footerContentType, + footerRichTextBoxHeight); return CheckState.Unchecked; } @@ -767,7 +852,11 @@ internal static CheckState ShowCoreWithCheckStateResult(IWin32Window? owner, str useTimeOut, timeOut, timeOutInterval, - timerResult); + timerResult, + footerText, + footerExpanded, + footerContentType, + footerRichTextBoxHeight); kmbe.Show(); @@ -837,7 +926,11 @@ internal static DialogResult ShowCore(IWin32Window? owner, string text, string c bool? useTimeOut, int? timeOut, int? timeOutInterval, - DialogResult? timerResult) + DialogResult? timerResult, + string? footerText = null, + bool footerExpanded = false, + ExtendedKryptonMessageBoxFooterContentType footerContentType = ExtendedKryptonMessageBoxFooterContentType.Text, + int? footerRichTextBoxHeight = null) { IWin32Window? showOwner = ValidateOptions(owner, options, helpInfo); @@ -874,7 +967,11 @@ internal static DialogResult ShowCore(IWin32Window? owner, string text, string c null, useTimeOut, timeOut, - timerResult); + timerResult, + footerText, + footerExpanded, + footerContentType, + footerRichTextBoxHeight); return kmbertl.ShowDialog(showOwner); } @@ -915,7 +1012,11 @@ internal static DialogResult ShowCore(IWin32Window? owner, string text, string c useTimeOut, timeOut, timeOutInterval, - timerResult); + timerResult, + footerText, + footerExpanded, + footerContentType, + footerRichTextBoxHeight); return kmbe.ShowDialog(showOwner); } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Visuals/Left to Right/VisualMessageBoxExtendedForm.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Visuals/Left to Right/VisualMessageBoxExtendedForm.Designer.cs index 3642a59a5..bc5c84e32 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Visuals/Left to Right/VisualMessageBoxExtendedForm.Designer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Visuals/Left to Right/VisualMessageBoxExtendedForm.Designer.cs @@ -1,4 +1,4 @@ -#region MIT License +#region MIT License /* * MIT License * @@ -64,6 +64,12 @@ private void InitializeComponent() this._button1 = new Krypton.Toolkit.Suite.Extended.Messagebox.MessageButton(); this._button2 = new Krypton.Toolkit.Suite.Extended.Messagebox.MessageButton(); this._messageIcon = new System.Windows.Forms.PictureBox(); + this._panelFooter = new Krypton.Toolkit.KryptonPanel(); + this._footerBorderEdge = new Krypton.Toolkit.KryptonBorderEdge(); + this._footerToggleButton = new Krypton.Toolkit.KryptonButton(); + this._footerWrapLabel = new Krypton.Toolkit.KryptonWrapLabel(); + this._footerCheckBox = new Krypton.Toolkit.KryptonCheckBox(); + this._footerRichTextBox = new Krypton.Toolkit.KryptonRichTextBox(); this.kpnlContent = new Krypton.Toolkit.KryptonPanel(); this.klwlblMessageText = new Krypton.Toolkit.KryptonLinkWrapLabel(); this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); @@ -76,6 +82,8 @@ private void InitializeComponent() ((System.ComponentModel.ISupportInitialize)(this._panelButtons)).BeginInit(); this._panelButtons.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this._messageIcon)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this._panelFooter)).BeginInit(); + this._panelFooter.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.kpnlContent)).BeginInit(); this.kpnlContent.SuspendLayout(); this.tableLayoutPanel2.SuspendLayout(); @@ -100,14 +108,15 @@ private void InitializeComponent() this.tableLayoutPanel1.Controls.Add(this._panelButtons, 0, 1); this.tableLayoutPanel1.Controls.Add(this._messageIcon, 0, 0); this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel2, 1, 0); + this.tableLayoutPanel1.Controls.Add(this._panelFooter, 0, 2); this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0); this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(2); this.tableLayoutPanel1.Name = "tableLayoutPanel1"; - this.tableLayoutPanel1.RowCount = 2; + this.tableLayoutPanel1.RowCount = 3; this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanel1.Size = new System.Drawing.Size(196, 96); this.tableLayoutPanel1.TabIndex = 0; // @@ -197,6 +206,57 @@ private void InitializeComponent() this._button2.Values.Text = "B2"; this._button2.Visible = false; // + // _panelFooter + // + this.tableLayoutPanel1.SetColumnSpan(this._panelFooter, 2); + this._panelFooter.Controls.Add(this._footerBorderEdge); + this._panelFooter.Controls.Add(this._footerToggleButton); + this._panelFooter.Controls.Add(this._footerWrapLabel); + this._panelFooter.Controls.Add(this._footerCheckBox); + this._panelFooter.Controls.Add(this._footerRichTextBox); + this._panelFooter.Dock = System.Windows.Forms.DockStyle.Fill; + this._panelFooter.Location = new System.Drawing.Point(0, 96); + this._panelFooter.Margin = new System.Windows.Forms.Padding(0); + this._panelFooter.Name = "_panelFooter"; + this._panelFooter.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; + this._panelFooter.Size = new System.Drawing.Size(196, 0); + this._panelFooter.TabIndex = 2; + this._panelFooter.Visible = false; + // + // _footerBorderEdge + // + this._footerBorderEdge.BorderStyle = Krypton.Toolkit.PaletteBorderStyle.HeaderPrimary; + this._footerBorderEdge.Dock = System.Windows.Forms.DockStyle.Top; + this._footerBorderEdge.Location = new System.Drawing.Point(0, 0); + this._footerBorderEdge.Margin = new System.Windows.Forms.Padding(2); + this._footerBorderEdge.Name = "_footerBorderEdge"; + this._footerBorderEdge.Size = new System.Drawing.Size(196, 1); + this._footerBorderEdge.Text = "kryptonBorderEdge2"; + // + // _footerToggleButton + // + this._footerToggleButton.AutoSize = true; + this._footerToggleButton.Location = new System.Drawing.Point(10, 5); + this._footerToggleButton.Margin = new System.Windows.Forms.Padding(0); + this._footerToggleButton.Name = "_footerToggleButton"; + this._footerToggleButton.Size = new System.Drawing.Size(100, 25); + this._footerToggleButton.TabIndex = 0; + this._footerToggleButton.Values.Text = "Show details"; + this._footerToggleButton.Click += new System.EventHandler(this.FooterToggleButton_Click); + // + // _footerWrapLabel + // + this._footerWrapLabel.AutoSize = false; + this._footerWrapLabel.Location = new System.Drawing.Point(10, 35); + this._footerWrapLabel.Margin = new System.Windows.Forms.Padding(0); + this._footerWrapLabel.Name = "_footerWrapLabel"; + this._footerWrapLabel.Size = new System.Drawing.Size(176, 50); + this._footerWrapLabel.StateCommon.Font = new System.Drawing.Font("Segoe UI", 9F); + this._footerWrapLabel.StateCommon.TextColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91))))); + this._footerWrapLabel.LabelStyle = Krypton.Toolkit.LabelStyle.NormalPanel; + this._footerWrapLabel.Text = "Footer Text"; + this._footerWrapLabel.Visible = false; + // // _messageIcon // this._messageIcon.BackColor = System.Drawing.Color.Transparent; @@ -303,6 +363,9 @@ private void InitializeComponent() this._panelButtons.ResumeLayout(false); this._panelButtons.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this._messageIcon)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this._panelFooter)).EndInit(); + this._panelFooter.ResumeLayout(false); + this._panelFooter.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.kpnlContent)).EndInit(); this.kpnlContent.ResumeLayout(false); this.kpnlContent.PerformLayout(); @@ -323,6 +386,12 @@ private void InitializeComponent() private MessageButton _button1; private MessageButton _button2; private PictureBox _messageIcon; + private KryptonPanel _panelFooter; + private KryptonBorderEdge _footerBorderEdge; + private KryptonButton _footerToggleButton; + private KryptonWrapLabel _footerWrapLabel; + private KryptonCheckBox _footerCheckBox; + private KryptonRichTextBox _footerRichTextBox; private TableLayoutPanel tableLayoutPanel2; private KryptonCheckBox kcbOptionalCheckBox; private KryptonPanel kpnlContent; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Visuals/Left to Right/VisualMessageBoxExtendedForm.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Visuals/Left to Right/VisualMessageBoxExtendedForm.cs index f418bb351..0398f74e1 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Visuals/Left to Right/VisualMessageBoxExtendedForm.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Visuals/Left to Right/VisualMessageBoxExtendedForm.cs @@ -1,4 +1,4 @@ -#region MIT License +#region MIT License /* * MIT License * @@ -141,6 +141,14 @@ internal partial class VisualMessageBoxExtendedForm : KryptonForm private readonly PaletteRelativeAlign _richTextBoxTextAlignment; + private readonly string? _footerText; + + private readonly bool _footerExpanded; + + private readonly ExtendedKryptonMessageBoxFooterContentType _footerContentType; + + private readonly int? _footerRichTextBoxHeight; + #endregion #region Identity @@ -188,7 +196,11 @@ internal VisualMessageBoxExtendedForm(IWin32Window? showOwner, string text, stri bool? useTimeOut, int? timeOut, int? timeOutInterval, - DialogResult? timerResult) + DialogResult? timerResult, + string? footerText = null, + bool footerExpanded = false, + ExtendedKryptonMessageBoxFooterContentType footerContentType = ExtendedKryptonMessageBoxFooterContentType.Text, + int? footerRichTextBoxHeight = null) { // Store incoming values _text = text; @@ -237,6 +249,10 @@ internal VisualMessageBoxExtendedForm(IWin32Window? showOwner, string text, stri _initialDoNotShowAgainCheckState = initialDoNotShowAgainCheckBoxCheckState ?? CheckState.Unchecked; _checkBoxText = optionalCheckBoxText ?? string.Empty; _useOptionalCheckBoxThreeState = useOptionalCheckBoxThreeState ?? false; + _footerText = footerText; + _footerExpanded = footerExpanded; + _footerContentType = footerContentType; + _footerRichTextBoxHeight = footerRichTextBoxHeight; // Create the form contents InitializeComponent(); @@ -255,6 +271,8 @@ internal VisualMessageBoxExtendedForm(IWin32Window? showOwner, string text, stri SetupOptionalCheckBox(); + SetupFooter(_footerText, _footerExpanded, _footerContentType, _footerRichTextBoxHeight); + // Finally calculate and set form sizing UpdateSizing(showOwner); @@ -1141,10 +1159,37 @@ private void UpdateSizing(IWin32Window? showOwner) { Size messageSizing = UpdateMessageSizing(showOwner); Size buttonsSizing = UpdateButtonsSizing(); + Size footerSizing = UpdateFooterSizing(); // Size of window is calculated from the client area - ClientSize = new Size(Math.Max(messageSizing.Width, buttonsSizing.Width), - messageSizing.Height + buttonsSizing.Height); + ClientSize = new Size(Math.Max(Math.Max(messageSizing.Width, buttonsSizing.Width), footerSizing.Width), + messageSizing.Height + buttonsSizing.Height + footerSizing.Height); + } + + /// + /// Updates the footer panel sizing based on its content and expanded state. + /// + /// The size of the footer panel. + private Size UpdateFooterSizing() + { + if (!_panelFooter.Visible) + { + return Size.Empty; + } + + // Calculate width to match message box width + int footerWidth = Math.Max(UpdateMessageSizing(Owner).Width, UpdateButtonsSizing().Width); + + // Height is already set in UpdateFooterExpandedState, but ensure minimum width + _panelFooter.Width = footerWidth; + int contentWidth = footerWidth - 20; // Account for padding + + // Update width for all content controls + _footerWrapLabel.Width = contentWidth; + _footerCheckBox.Width = contentWidth; + _footerRichTextBox.Width = contentWidth; + + return new Size(footerWidth, _panelFooter.Height); } private Size UpdateMessageSizing(IWin32Window? showOwner) @@ -1475,6 +1520,149 @@ private void SetupOptionalCheckBox() kcbOptionalCheckBox.ThreeState = _useOptionalCheckBoxThreeState; } + /// + /// Sets up the expandable footer with the specified content and initial expanded state. + /// + /// The text content to display in the footer. If null or empty, footer will not be shown. + /// If true, the footer will be expanded initially; otherwise, it will be collapsed. + /// The type of content to display in the footer (Text, CheckBox, or RichTextBox). + /// The height for the RichTextBox when contentType is RichTextBox. If null, uses default height. + private void SetupFooter(string? footerText, bool expanded, ExtendedKryptonMessageBoxFooterContentType contentType, int? richTextBoxHeight) + { + bool showFooter = !string.IsNullOrEmpty(footerText) || contentType == ExtendedKryptonMessageBoxFooterContentType.CheckBox; + _panelFooter.Visible = showFooter; + _footerToggleButton.Visible = showFooter; + + if (!showFooter) + { + _panelFooter.Height = 0; + return; + } + + // Hide all footer content controls initially + _footerWrapLabel.Visible = false; + _footerCheckBox.Visible = false; + _footerRichTextBox.Visible = false; + + // Configure based on content type + switch (contentType) + { + case ExtendedKryptonMessageBoxFooterContentType.Text: + _footerWrapLabel.Text = footerText ?? string.Empty; + if (_messageBoxTypeface != null) + { + _footerWrapLabel.StateCommon.Font = _messageBoxTypeface; + } + break; + + case ExtendedKryptonMessageBoxFooterContentType.CheckBox: + _footerCheckBox.Text = footerText ?? string.Empty; + if (_messageBoxTypeface != null) + { + _footerCheckBox.StateCommon.ShortText.Font = _messageBoxTypeface; + } + break; + + case ExtendedKryptonMessageBoxFooterContentType.RichTextBox: + _footerRichTextBox.Text = footerText ?? string.Empty; + if (_messageBoxTypeface != null) + { + _footerRichTextBox.StateCommon.Content.Font = _messageBoxTypeface; + } + // Set RichTextBox height if specified + if (richTextBoxHeight.HasValue && richTextBoxHeight.Value > 0) + { + _footerRichTextBox.Height = richTextBoxHeight.Value; + } + break; + } + + // Set initial expanded state + UpdateFooterExpandedState(expanded, contentType); + } + + /// + /// Updates the footer expanded state, adjusting visibility and toggle button text. + /// + /// If true, footer is expanded; otherwise, collapsed. + /// The type of content displayed in the footer. + private void UpdateFooterExpandedState(bool expanded, ExtendedKryptonMessageBoxFooterContentType contentType) + { + if (!_panelFooter.Visible) + { + return; + } + + // Hide all content controls first + _footerWrapLabel.Visible = false; + _footerCheckBox.Visible = false; + _footerRichTextBox.Visible = false; + + // Show the appropriate content control based on type and expanded state + if (expanded) + { + switch (contentType) + { + case ExtendedKryptonMessageBoxFooterContentType.Text: + _footerWrapLabel.Visible = true; + break; + case ExtendedKryptonMessageBoxFooterContentType.CheckBox: + _footerCheckBox.Visible = true; + break; + case ExtendedKryptonMessageBoxFooterContentType.RichTextBox: + _footerRichTextBox.Visible = true; + break; + } + } + + // Update toggle button text + _footerToggleButton.Values.Text = expanded ? @"Hide details" : @"Show details"; + + // Calculate footer height based on expanded state and content type + if (expanded) + { + int contentHeight = 0; + switch (contentType) + { + case ExtendedKryptonMessageBoxFooterContentType.Text: + // Measure the footer text to determine required height + using (Graphics g = CreateGraphics()) + { + Font footerFont = _footerWrapLabel.Font ?? _messageBoxTypeface ?? KryptonManager.CurrentGlobalPalette.BaseFont; + SizeF textSize = g.MeasureString(_footerWrapLabel.Text, footerFont, _footerWrapLabel.Width); + contentHeight = (int)Math.Ceiling(textSize.Height); + } + break; + case ExtendedKryptonMessageBoxFooterContentType.CheckBox: + contentHeight = _footerCheckBox.Height; + break; + case ExtendedKryptonMessageBoxFooterContentType.RichTextBox: + contentHeight = _footerRichTextBox.Height; + break; + } + int footerHeight = contentHeight + 40; // Add padding for toggle button and borders + _panelFooter.Height = Math.Max(footerHeight, 50); // Minimum height + } + else + { + // Collapsed state - just show the toggle button + _panelFooter.Height = 30; + } + + // Recalculate form size (owner can be null, UpdateSizing handles it) + IWin32Window? owner = Owner; + UpdateSizing(owner); + } + + /// + /// Handles the footer toggle button click event to expand or collapse the footer. + /// + private void FooterToggleButton_Click(object sender, EventArgs e) + { + bool currentExpanded = _footerWrapLabel.Visible || _footerCheckBox.Visible || _footerRichTextBox.Visible; + UpdateFooterExpandedState(!currentExpanded, _footerContentType); + } + internal static bool ReturnCheckBoxCheckedValue() { VisualMessageBoxExtendedForm messageBoxExtendedForm = new VisualMessageBoxExtendedForm(); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Visuals/Right to Left/VisualMessageBoxExtendedRtlAwareForm.Designer.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Visuals/Right to Left/VisualMessageBoxExtendedRtlAwareForm.Designer.cs index 05f00d68c..a23ee4464 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Visuals/Right to Left/VisualMessageBoxExtendedRtlAwareForm.Designer.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Visuals/Right to Left/VisualMessageBoxExtendedRtlAwareForm.Designer.cs @@ -1,4 +1,4 @@ -namespace Krypton.Toolkit.Suite.Extended.Messagebox +namespace Krypton.Toolkit.Suite.Extended.Messagebox { partial class VisualMessageBoxExtendedRtlAwareForm { @@ -37,6 +37,12 @@ private void InitializeComponent() this._button1 = new Krypton.Toolkit.Suite.Extended.Messagebox.MessageButton(); this._button2 = new Krypton.Toolkit.Suite.Extended.Messagebox.MessageButton(); this._messageIcon = new System.Windows.Forms.PictureBox(); + this._panelFooter = new Krypton.Toolkit.KryptonPanel(); + this._footerBorderEdge = new Krypton.Toolkit.KryptonBorderEdge(); + this._footerToggleButton = new Krypton.Toolkit.KryptonButton(); + this._footerWrapLabel = new Krypton.Toolkit.KryptonWrapLabel(); + this._footerCheckBox = new Krypton.Toolkit.KryptonCheckBox(); + this._footerRichTextBox = new Krypton.Toolkit.KryptonRichTextBox(); this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); this.kcbOptionalCheckBox = new Krypton.Toolkit.KryptonCheckBox(); this.kpnlContent = new Krypton.Toolkit.KryptonPanel(); @@ -49,6 +55,8 @@ private void InitializeComponent() ((System.ComponentModel.ISupportInitialize)(this._panelButtons)).BeginInit(); this._panelButtons.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this._messageIcon)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this._panelFooter)).BeginInit(); + this._panelFooter.SuspendLayout(); this.tableLayoutPanel2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.kpnlContent)).BeginInit(); this.kpnlContent.SuspendLayout(); @@ -73,14 +81,15 @@ private void InitializeComponent() this.tableLayoutPanel1.Controls.Add(this._panelButtons, 0, 1); this.tableLayoutPanel1.Controls.Add(this._messageIcon, 0, 0); this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel2, 1, 0); + this.tableLayoutPanel1.Controls.Add(this._panelFooter, 0, 2); this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0); this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(2); this.tableLayoutPanel1.Name = "tableLayoutPanel1"; - this.tableLayoutPanel1.RowCount = 2; + this.tableLayoutPanel1.RowCount = 3; this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanel1.Size = new System.Drawing.Size(200, 100); this.tableLayoutPanel1.TabIndex = 0; // @@ -170,6 +179,57 @@ private void InitializeComponent() this._button2.Values.Text = "B2"; this._button2.Visible = false; // + // _panelFooter + // + this.tableLayoutPanel1.SetColumnSpan(this._panelFooter, 2); + this._panelFooter.Controls.Add(this._footerBorderEdge); + this._panelFooter.Controls.Add(this._footerToggleButton); + this._panelFooter.Controls.Add(this._footerWrapLabel); + this._panelFooter.Controls.Add(this._footerCheckBox); + this._panelFooter.Controls.Add(this._footerRichTextBox); + this._panelFooter.Dock = System.Windows.Forms.DockStyle.Fill; + this._panelFooter.Location = new System.Drawing.Point(0, 100); + this._panelFooter.Margin = new System.Windows.Forms.Padding(0); + this._panelFooter.Name = "_panelFooter"; + this._panelFooter.PanelBackStyle = Krypton.Toolkit.PaletteBackStyle.PanelAlternate; + this._panelFooter.Size = new System.Drawing.Size(200, 0); + this._panelFooter.TabIndex = 2; + this._panelFooter.Visible = false; + // + // _footerBorderEdge + // + this._footerBorderEdge.BorderStyle = Krypton.Toolkit.PaletteBorderStyle.HeaderPrimary; + this._footerBorderEdge.Dock = System.Windows.Forms.DockStyle.Top; + this._footerBorderEdge.Location = new System.Drawing.Point(0, 0); + this._footerBorderEdge.Margin = new System.Windows.Forms.Padding(2); + this._footerBorderEdge.Name = "_footerBorderEdge"; + this._footerBorderEdge.Size = new System.Drawing.Size(200, 1); + this._footerBorderEdge.Text = "kryptonBorderEdge2"; + // + // _footerToggleButton + // + this._footerToggleButton.AutoSize = true; + this._footerToggleButton.Location = new System.Drawing.Point(10, 5); + this._footerToggleButton.Margin = new System.Windows.Forms.Padding(0); + this._footerToggleButton.Name = "_footerToggleButton"; + this._footerToggleButton.Size = new System.Drawing.Size(100, 25); + this._footerToggleButton.TabIndex = 0; + this._footerToggleButton.Values.Text = "Show details"; + this._footerToggleButton.Click += new System.EventHandler(this.FooterToggleButton_Click); + // + // _footerWrapLabel + // + this._footerWrapLabel.AutoSize = false; + this._footerWrapLabel.Location = new System.Drawing.Point(10, 35); + this._footerWrapLabel.Margin = new System.Windows.Forms.Padding(0); + this._footerWrapLabel.Name = "_footerWrapLabel"; + this._footerWrapLabel.Size = new System.Drawing.Size(180, 50); + this._footerWrapLabel.StateCommon.Font = new System.Drawing.Font("Segoe UI", 9F); + this._footerWrapLabel.StateCommon.TextColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(57)))), ((int)(((byte)(91))))); + this._footerWrapLabel.LabelStyle = Krypton.Toolkit.LabelStyle.NormalPanel; + this._footerWrapLabel.Text = "Footer Text"; + this._footerWrapLabel.Visible = false; + // // _messageIcon // this._messageIcon.BackColor = System.Drawing.Color.Transparent; @@ -276,6 +336,9 @@ private void InitializeComponent() this._panelButtons.ResumeLayout(false); this._panelButtons.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this._messageIcon)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this._panelFooter)).EndInit(); + this._panelFooter.ResumeLayout(false); + this._panelFooter.PerformLayout(); this.tableLayoutPanel2.ResumeLayout(false); this.tableLayoutPanel2.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.kpnlContent)).EndInit(); @@ -296,6 +359,12 @@ private void InitializeComponent() private MessageButton _button1; private MessageButton _button2; private PictureBox _messageIcon; + private KryptonPanel _panelFooter; + private KryptonBorderEdge _footerBorderEdge; + private KryptonButton _footerToggleButton; + private KryptonWrapLabel _footerWrapLabel; + private KryptonCheckBox _footerCheckBox; + private KryptonRichTextBox _footerRichTextBox; private TableLayoutPanel tableLayoutPanel2; private KryptonCheckBox kcbOptionalCheckBox; private KryptonPanel kpnlContent; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Visuals/Right to Left/VisualMessageBoxExtendedRtlAwareForm.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Visuals/Right to Left/VisualMessageBoxExtendedRtlAwareForm.cs index c0bed9f74..3c3fdcd87 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Visuals/Right to Left/VisualMessageBoxExtendedRtlAwareForm.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Controls Visuals/Right to Left/VisualMessageBoxExtendedRtlAwareForm.cs @@ -1,4 +1,4 @@ -#region MIT License +#region MIT License /* * MIT License * @@ -130,6 +130,14 @@ internal partial class VisualMessageBoxExtendedRtlAwareForm : KryptonForm private readonly PaletteRelativeAlign _richTextBoxTextAlignment; + private readonly string? _footerText; + + private readonly bool _footerExpanded; + + private readonly ExtendedKryptonMessageBoxFooterContentType _footerContentType; + + private readonly int? _footerRichTextBoxHeight; + #endregion #region Identity @@ -175,7 +183,11 @@ internal VisualMessageBoxExtendedRtlAwareForm(IWin32Window? showOwner, string te bool? useOptionalCheckBoxThreeState, bool? useTimeOut, int? timeOut, - DialogResult? timerResult) + DialogResult? timerResult, + string? footerText = null, + bool footerExpanded = false, + ExtendedKryptonMessageBoxFooterContentType footerContentType = ExtendedKryptonMessageBoxFooterContentType.Text, + int? footerRichTextBoxHeight = null) { // Store incoming values _text = text; @@ -221,6 +233,10 @@ internal VisualMessageBoxExtendedRtlAwareForm(IWin32Window? showOwner, string te _optionalCheckBoxChecked = optionalCheckBoxChecked ?? false; _checkBoxText = optionalCheckBoxText ?? string.Empty; _useOptionalCheckBoxThreeState = useOptionalCheckBoxThreeState ?? false; + _footerText = footerText; + _footerExpanded = footerExpanded; + _footerContentType = footerContentType; + _footerRichTextBoxHeight = footerRichTextBoxHeight; // Create the form contents InitializeComponent(); @@ -239,6 +255,8 @@ internal VisualMessageBoxExtendedRtlAwareForm(IWin32Window? showOwner, string te SetupOptionalCheckBox(); + SetupFooter(_footerText, _footerExpanded, _footerContentType, _footerRichTextBoxHeight); + // Finally calculate and set form sizing UpdateSizing(showOwner); @@ -692,10 +710,37 @@ private void UpdateSizing(IWin32Window? showOwner) { Size messageSizing = UpdateMessageSizing(showOwner); Size buttonsSizing = UpdateButtonsSizing(); + Size footerSizing = UpdateFooterSizing(); // Size of window is calculated from the client area - ClientSize = new Size(Math.Max(messageSizing.Width, buttonsSizing.Width), - messageSizing.Height + buttonsSizing.Height); + ClientSize = new Size(Math.Max(Math.Max(messageSizing.Width, buttonsSizing.Width), footerSizing.Width), + messageSizing.Height + buttonsSizing.Height + footerSizing.Height); + } + + /// + /// Updates the footer panel sizing based on its content and expanded state. + /// + /// The size of the footer panel. + private Size UpdateFooterSizing() + { + if (!_panelFooter.Visible) + { + return Size.Empty; + } + + // Calculate width to match message box width + int footerWidth = Math.Max(UpdateMessageSizing(Owner).Width, UpdateButtonsSizing().Width); + + // Height is already set in UpdateFooterExpandedState, but ensure minimum width + _panelFooter.Width = footerWidth; + int contentWidth = footerWidth - 20; // Account for padding + + // Update width for all content controls + _footerWrapLabel.Width = contentWidth; + _footerCheckBox.Width = contentWidth; + _footerRichTextBox.Width = contentWidth; + + return new Size(footerWidth, _panelFooter.Height); } private Size UpdateMessageSizing(IWin32Window? showOwner) @@ -1027,6 +1072,149 @@ private void SetupOptionalCheckBox() kcbOptionalCheckBox.ThreeState = _useOptionalCheckBoxThreeState; } + /// + /// Sets up the expandable footer with the specified content and initial expanded state. + /// + /// The text content to display in the footer. If null or empty, footer will not be shown (unless footerContentType is CheckBox). + /// If true, the footer will be expanded initially; otherwise, it will be collapsed. + /// The type of content to display in the footer (Text, CheckBox, or RichTextBox). + /// The height for the RichTextBox when contentType is RichTextBox. If null, uses default height. + private void SetupFooter(string? footerText, bool expanded, ExtendedKryptonMessageBoxFooterContentType contentType, int? richTextBoxHeight) + { + bool showFooter = !string.IsNullOrEmpty(footerText) || contentType == ExtendedKryptonMessageBoxFooterContentType.CheckBox; + _panelFooter.Visible = showFooter; + _footerToggleButton.Visible = showFooter; + + if (!showFooter) + { + _panelFooter.Height = 0; + return; + } + + // Hide all footer content controls initially + _footerWrapLabel.Visible = false; + _footerCheckBox.Visible = false; + _footerRichTextBox.Visible = false; + + // Configure based on content type + switch (contentType) + { + case ExtendedKryptonMessageBoxFooterContentType.Text: + _footerWrapLabel.Text = footerText ?? string.Empty; + if (_messageBoxTypeface != null) + { + _footerWrapLabel.StateCommon.Font = _messageBoxTypeface; + } + break; + + case ExtendedKryptonMessageBoxFooterContentType.CheckBox: + _footerCheckBox.Text = footerText ?? string.Empty; + if (_messageBoxTypeface != null) + { + _footerCheckBox.StateCommon.ShortText.Font = _messageBoxTypeface; + } + break; + + case ExtendedKryptonMessageBoxFooterContentType.RichTextBox: + _footerRichTextBox.Text = footerText ?? string.Empty; + if (_messageBoxTypeface != null) + { + _footerRichTextBox.StateCommon.Content.Font = _messageBoxTypeface; + } + // Set RichTextBox height if specified + if (richTextBoxHeight.HasValue && richTextBoxHeight.Value > 0) + { + _footerRichTextBox.Height = richTextBoxHeight.Value; + } + break; + } + + // Set initial expanded state + UpdateFooterExpandedState(expanded, contentType); + } + + /// + /// Updates the footer expanded state, adjusting visibility and toggle button text. + /// + /// If true, footer is expanded; otherwise, collapsed. + /// The type of content displayed in the footer. + private void UpdateFooterExpandedState(bool expanded, ExtendedKryptonMessageBoxFooterContentType contentType) + { + if (!_panelFooter.Visible) + { + return; + } + + // Hide all content controls first + _footerWrapLabel.Visible = false; + _footerCheckBox.Visible = false; + _footerRichTextBox.Visible = false; + + // Show the appropriate content control based on type and expanded state + if (expanded) + { + switch (contentType) + { + case ExtendedKryptonMessageBoxFooterContentType.Text: + _footerWrapLabel.Visible = true; + break; + case ExtendedKryptonMessageBoxFooterContentType.CheckBox: + _footerCheckBox.Visible = true; + break; + case ExtendedKryptonMessageBoxFooterContentType.RichTextBox: + _footerRichTextBox.Visible = true; + break; + } + } + + // Update toggle button text + _footerToggleButton.Values.Text = expanded ? @"Hide details" : @"Show details"; + + // Calculate footer height based on expanded state and content type + if (expanded) + { + int contentHeight = 0; + switch (contentType) + { + case ExtendedKryptonMessageBoxFooterContentType.Text: + // Measure the footer text to determine required height + using (Graphics g = CreateGraphics()) + { + Font footerFont = _footerWrapLabel.Font ?? _messageBoxTypeface ?? KryptonManager.CurrentGlobalPalette.BaseFont; + SizeF textSize = g.MeasureString(_footerWrapLabel.Text, footerFont, _footerWrapLabel.Width); + contentHeight = (int)Math.Ceiling(textSize.Height); + } + break; + case ExtendedKryptonMessageBoxFooterContentType.CheckBox: + contentHeight = _footerCheckBox.Height; + break; + case ExtendedKryptonMessageBoxFooterContentType.RichTextBox: + contentHeight = _footerRichTextBox.Height; + break; + } + int footerHeight = contentHeight + 40; // Add padding for toggle button and borders + _panelFooter.Height = Math.Max(footerHeight, 50); // Minimum height + } + else + { + // Collapsed state - just show the toggle button + _panelFooter.Height = 30; + } + + // Recalculate form size (owner can be null, UpdateSizing handles it) + IWin32Window? owner = Owner; + UpdateSizing(owner); + } + + /// + /// Handles the footer toggle button click event to expand or collapse the footer. + /// + private void FooterToggleButton_Click(object sender, EventArgs e) + { + bool currentExpanded = _footerWrapLabel.Visible || _footerCheckBox.Visible || _footerRichTextBox.Visible; + UpdateFooterExpandedState(!currentExpanded, _footerContentType); + } + internal static bool ReturnCheckBoxCheckedValue() { VisualMessageBoxExtendedRtlAwareForm messageBoxExtendedForm = new VisualMessageBoxExtendedRtlAwareForm(); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/General/Definitions.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/General/Definitions.cs index ff8b52c0f..c7afbfe0b 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/General/Definitions.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/General/Definitions.cs @@ -1,4 +1,4 @@ -#region MIT License +#region MIT License /* * MIT License * @@ -130,6 +130,23 @@ public enum ExtendedKryptonMessageBoxMessageContainerType #endregion +#region Enum ExtendedKryptonMessageBoxFooterContentType + +/// Specifies the content type for the footer in . +public enum ExtendedKryptonMessageBoxFooterContentType +{ + /// Footer displays text using a KryptonWrapLabel (default). + Text = 0, + + /// Footer displays a KryptonCheckBox. + CheckBox = 1, + + /// Footer displays a KryptonRichTextBox. + RichTextBox = 2 +} + +#endregion + #region Enum ExtendedMessageBoxButtons /// Specifies the button layout in the . diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Krypton.Toolkit.Suite.Extended.Messagebox 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Krypton.Toolkit.Suite.Extended.Messagebox 2022.csproj index 8e44c080d..5e8de8fea 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Krypton.Toolkit.Suite.Extended.Messagebox 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Messagebox/Krypton.Toolkit.Suite.Extended.Messagebox 2022.csproj @@ -25,7 +25,8 @@ True StrongKrypton.snk true - en preview + en + preview enable 6 true @@ -73,25 +74,25 @@ - + - + - + - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Krypton.Toolkit.Suite.Extended.Navi.Suite 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Krypton.Toolkit.Suite.Extended.Navi.Suite 2022.csproj index f553170c5..344e391e2 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Krypton.Toolkit.Suite.Extended.Navi.Suite 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navi.Suite/Krypton.Toolkit.Suite.Extended.Navi.Suite 2022.csproj @@ -25,7 +25,8 @@ True StrongKrypton.snk true - en preview + en + preview enable 6 true @@ -73,25 +74,25 @@ - + - + - + - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Controls/KryptonTabControl.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Controls/KryptonTabControl.cs index 0dd4f0337..3d14d0afa 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Controls/KryptonTabControl.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Controls/KryptonTabControl.cs @@ -27,6 +27,8 @@ // ReSharper disable RedundantOverriddenMember // ReSharper disable UnusedMember.Local +using Krypton.Toolkit.Suite.Extended.Drawing; + namespace Krypton.Toolkit.Suite.Extended.Navigator; /// diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Krypton.Toolkit.Suite.Extended.Navigator 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Krypton.Toolkit.Suite.Extended.Navigator 2022.csproj index 635a43efc..af0ce7208 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Krypton.Toolkit.Suite.Extended.Navigator 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Navigator/Krypton.Toolkit.Suite.Extended.Navigator 2022.csproj @@ -25,7 +25,8 @@ True StrongKrypton.snk true - en preview + en + preview enable 6 true @@ -69,94 +70,42 @@ - - - preview - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - preview - - - - - - - - - - - - preview - - - - - - - - - - - - preview - - - - - - - - - - - - preview - - - - - - - - - - - - preview - - - - - - - - - - - - preview - - - - - + - + - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Classes/Network Utility/NetStat.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Classes/Network Utility/NetStat.cs index 86493f636..814308241 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Classes/Network Utility/NetStat.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Classes/Network Utility/NetStat.cs @@ -25,6 +25,8 @@ */ #endregion +using KryptonExceptionDialog = Krypton.Utilities.KryptonExceptionDialog; + namespace Krypton.Toolkit.Suite.Extended.Networking; internal class NetStat diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Krypton.Toolkit.Suite.Extended.Networking 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Krypton.Toolkit.Suite.Extended.Networking 2022.csproj index 4aaacc219..23e0a3918 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Krypton.Toolkit.Suite.Extended.Networking 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Networking/Krypton.Toolkit.Suite.Extended.Networking 2022.csproj @@ -25,7 +25,8 @@ True StrongKrypton.snk true - en preview + en + preview enable 6 true @@ -73,25 +74,25 @@ - + - + - + - + @@ -104,7 +105,7 @@ - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Classes/Alternative/Alert.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Classes/Alternative/Alert.cs index 691a10284..e29a35dc5 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Classes/Alternative/Alert.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Classes/Alternative/Alert.cs @@ -1,4 +1,4 @@ -#region MIT License +#region MIT License /* * MIT License * @@ -41,17 +41,25 @@ public class Alert private static readonly int IntervalDefault = 1850; #endregion + #region ShowMessage + /// Shows a message with an optional header/title. + /// The message text. + /// Optional header or title text. + public static void ShowMessage(string message, string? headerText = null) => ShowInformationMessage(message, headerText); + #endregion + #region Success /// Displays a success message. /// The message. /// The header text. - public static void DisplaySuccessMessage(string message, string? headerText = null) => DisplaySuccessMessage(message, IntervalDefault, headerText); + /// Optional parent window. When provided, the alert is positioned within the owner's bounds and owned by it. + public static void DisplaySuccessMessage(string message, string? headerText = null, IWin32Window? owner = null) => DisplaySuccessMessage(message, IntervalDefault, headerText, owner); - private static void DisplaySuccessMessage(string message, int interval, string? headerText = null) + private static void DisplaySuccessMessage(string message, int interval, string? headerText = null, IWin32Window? owner = null) { KryptonAlertWindow alertWindow = new KryptonAlertWindow(); - alertWindow.DisplayAlert(message, AlertType.Success, interval, headerText: headerText); + alertWindow.DisplayAlert(message, AlertType.Success, interval, headerText: headerText, owner: owner); } #endregion @@ -60,13 +68,14 @@ private static void DisplaySuccessMessage(string message, int interval, string? /// Shows a information message. /// The message. /// The header text. - public static void ShowInformationMessage(string message, string? headerText = null) => ShowInformationMessage(message, IntervalDefault, headerText); + /// Optional parent window. When provided, the alert is positioned within the owner's bounds and owned by it. + public static void ShowInformationMessage(string message, string? headerText = null, IWin32Window? owner = null) => ShowInformationMessage(message, IntervalDefault, headerText, owner); - private static void ShowInformationMessage(string message, int interval, string? headerText = null) + private static void ShowInformationMessage(string message, int interval, string? headerText = null, IWin32Window? owner = null) { KryptonAlertWindow alertWindow = new KryptonAlertWindow(); - alertWindow.DisplayAlert(message, AlertType.Information, interval, headerText: headerText); + alertWindow.DisplayAlert(message, AlertType.Information, interval, headerText: headerText, owner: owner); } #endregion @@ -76,13 +85,14 @@ private static void ShowInformationMessage(string message, int interval, string? /// Shows a warning message. /// The message. /// The header text. - public static void ShowWarningMessage(string message, string? headerText = null) => ShowWarningMessage(message, IntervalDefault, headerText); + /// Optional parent window. When provided, the alert is positioned within the owner's bounds and owned by it. + public static void ShowWarningMessage(string message, string? headerText = null, IWin32Window? owner = null) => ShowWarningMessage(message, IntervalDefault, headerText, owner); - private static void ShowWarningMessage(string message, int interval, string? headerText = null) + private static void ShowWarningMessage(string message, int interval, string? headerText = null, IWin32Window? owner = null) { KryptonAlertWindow alertWindow = new KryptonAlertWindow(); - alertWindow.DisplayAlert(message, AlertType.Warning, interval, headerText: headerText); + alertWindow.DisplayAlert(message, AlertType.Warning, interval, headerText: headerText, owner: owner); } #endregion @@ -92,13 +102,14 @@ private static void ShowWarningMessage(string message, int interval, string? hea /// Shows a error message. /// The message. /// The header text. - public static void ShowErrorMessage(string message, string? headerText = null) => ShowErrorMessage(message, IntervalDefault, headerText); + /// Optional parent window. When provided, the alert is positioned within the owner's bounds and owned by it. + public static void ShowErrorMessage(string message, string? headerText = null, IWin32Window? owner = null) => ShowErrorMessage(message, IntervalDefault, headerText, owner); - private static void ShowErrorMessage(string message, int interval, string? headerText = null) + private static void ShowErrorMessage(string message, int interval, string? headerText = null, IWin32Window? owner = null) { KryptonAlertWindow alertWindow = new KryptonAlertWindow(); - alertWindow.DisplayAlert(message, AlertType.Error, interval, headerText: headerText); + alertWindow.DisplayAlert(message, AlertType.Error, interval, headerText: headerText, owner: owner); } #endregion @@ -111,13 +122,14 @@ private static void ShowErrorMessage(string message, int interval, string? heade /// The back colour. /// The text colour. /// The header text. - public static void ShowCustomMessage(string message, Image? image = null, Color backColour = default, Color textColour = default, string? headerText = null) => ShowCustomMessage(message, IntervalDefault, image, backColour, textColour, headerText); + /// Optional parent window. When provided, the alert is positioned within the owner's bounds and owned by it. + public static void ShowCustomMessage(string message, Image? image = null, Color backColour = default, Color textColour = default, string? headerText = null, IWin32Window? owner = null) => ShowCustomMessage(message, IntervalDefault, image, backColour, textColour, headerText, owner); - private static void ShowCustomMessage(string message, int interval, Image? image = null, Color backColour = default, Color textColour = default, string? headerText = null) + private static void ShowCustomMessage(string message, int interval, Image? image = null, Color backColour = default, Color textColour = default, string? headerText = null, IWin32Window? owner = null) { KryptonAlertWindow alertWindow = new KryptonAlertWindow(); - alertWindow.DisplayAlert(message, AlertType.Custom, interval, image, backColour == default ? Color.FromArgb(83, 92, 104) : backColour, textColour == default ? Color.White : textColour, headerText); + alertWindow.DisplayAlert(message, AlertType.Custom, interval, image, backColour == default ? Color.FromArgb(83, 92, 104) : backColour, textColour == default ? Color.White : textColour, headerText, owner); } #endregion diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Krypton.Toolkit.Suite.Extended.Notifications 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Krypton.Toolkit.Suite.Extended.Notifications 2022.csproj index 7e6f1920b..bc31e0a64 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Krypton.Toolkit.Suite.Extended.Notifications 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/Krypton.Toolkit.Suite.Extended.Notifications 2022.csproj @@ -25,7 +25,8 @@ True StrongKrypton.snk true - en preview + en + preview enable 6 true @@ -73,25 +74,25 @@ - + - + - + - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/UX/Alternative/KryptonAlertWindow.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/UX/Alternative/KryptonAlertWindow.cs index befbf9fef..9d5e0bf99 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/UX/Alternative/KryptonAlertWindow.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Notifications/UX/Alternative/KryptonAlertWindow.cs @@ -1,4 +1,4 @@ -#region MIT License +#region MIT License /* * MIT License * @@ -58,12 +58,20 @@ public KryptonAlertWindow() /// The back colour. /// The text colour. /// Define the header text. - internal void DisplayAlert(string message, AlertType alertType, int interval, Image? image = null, Color backColour = default, Color textColour = default, string headerText = "") + /// Optional parent window. When provided, the alert is positioned within the owner's bounds and owned by it. + internal void DisplayAlert(string message, AlertType alertType, int interval, Image? image = null, Color backColour = default, Color textColour = default, string headerText = "", IWin32Window? owner = null) { Opacity = 0.0; StartPosition = FormStartPosition.Manual; + Rectangle referenceBounds = GetReferenceBounds(owner); + + if (owner is Form ownerForm) + { + Owner = ownerForm; + } + for (int i = 1; i < 10; i++) { var windowName = $"Alert {i}"; @@ -74,9 +82,8 @@ internal void DisplayAlert(string message, AlertType alertType, int interval, Im { Name = windowName; - _positionX = Screen.PrimaryScreen.WorkingArea.Width - Width - 5; - - _positionY = Screen.PrimaryScreen.WorkingArea.Height - Height * i - 5 * i; + _positionX = Math.Max(referenceBounds.Left, referenceBounds.Right - Width - 5); + _positionY = Math.Min(referenceBounds.Bottom - Height - 5, Math.Max(referenceBounds.Top, referenceBounds.Bottom - Height * i - 5 * i)); Location = new Point(_positionX, _positionY); @@ -84,7 +91,7 @@ internal void DisplayAlert(string message, AlertType alertType, int interval, Im } } - _positionX = Screen.PrimaryScreen.WorkingArea.Width - Width - 5; + _positionX = Math.Max(referenceBounds.Left, referenceBounds.Right - Width - 5); switch (alertType) { @@ -141,6 +148,44 @@ internal void DisplayAlert(string message, AlertType alertType, int interval, Im Show(); } + /// Gets the rectangle to position the alert within. Uses owner bounds when provided, otherwise the active form, or the primary screen. + private static Rectangle GetReferenceBounds(IWin32Window? owner) + { + if (owner is Form form) + { + return form.Bounds; + } + + if (owner is Control control) + { + Form? parentForm = control.FindForm(); + return parentForm?.Bounds ?? control.RectangleToScreen(control.DisplayRectangle); + } + + if (owner != null) + { + Control? ctrl = Control.FromHandle(owner.Handle); + if (ctrl is Form ownerForm) + { + return ownerForm.Bounds; + } + + if (ctrl != null) + { + Form? parentForm = ctrl.FindForm(); + return parentForm?.Bounds ?? ctrl.RectangleToScreen(ctrl.DisplayRectangle); + } + } + + Form? activeForm = Form.ActiveForm; + if (activeForm != null) + { + return activeForm.Bounds; + } + + return Screen.PrimaryScreen.WorkingArea; + } + private void ChangeColour(Color backColour, Color textColour) { // Form Colour diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/General/KryptonOutlookGrid.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/General/KryptonOutlookGrid.cs index a7c8073da..a240deab7 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/General/KryptonOutlookGrid.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/General/KryptonOutlookGrid.cs @@ -1,4 +1,4 @@ -#region BSD License +#region BSD License /* * Use of this source code is governed by a BSD-style * license or other governing licenses that can be found in the LICENSE.md file or at @@ -179,13 +179,22 @@ public KryptonOutlookGrid() //Update StaticValues //ColumnHeadersHeight = (int)(ColumnHeadersHeight * factorY); //No need already done in KryptonDataGridView - StaticValues.DefaultGroupRowHeight = (int)(StaticValues.DefaultGroupRowHeight * _factorY); - StaticValues._2013GroupRowHeight = (int)(StaticValues._2013GroupRowHeight * _factorY); - StaticValues.DefaultOffsetHeight = (int)(StaticValues.DefaultOffsetHeight * _factorY); - StaticValues._2013OffsetHeight = (int)(StaticValues.DefaultOffsetHeight * _factorY); - StaticValues.ImageOffsetwidth = (int)(StaticValues.ImageOffsetwidth * _factorX); - StaticValues.GroupLevelMultiplier = (int)(StaticValues.GroupLevelMultiplier * _factorX); - StaticValues.GroupImageSide = (int)(StaticValues.GroupImageSide * _factorX); + // Store original values before scaling to avoid using already-scaled values + const int originalDefaultGroupRowHeight = 34; + const int original2013GroupRowHeight = 24; + const int originalDefaultOffsetHeight = 22; + const int original2013OffsetHeight = 11; + const int originalImageOffsetwidth = 18; + const int originalGroupLevelMultiplier = 15; + const int originalGroupImageSide = 16; + + StaticValues.DefaultGroupRowHeight = (int)(originalDefaultGroupRowHeight * _factorY); + StaticValues._2013GroupRowHeight = (int)(original2013GroupRowHeight * _factorY); + StaticValues.DefaultOffsetHeight = (int)(originalDefaultOffsetHeight * _factorY); + StaticValues._2013OffsetHeight = (int)(original2013OffsetHeight * _factorY); + StaticValues.ImageOffsetwidth = (int)(originalImageOffsetwidth * _factorX); + StaticValues.GroupLevelMultiplier = (int)(originalGroupLevelMultiplier * _factorX); + StaticValues.GroupImageSide = (int)(originalGroupImageSide * _factorX); //Strings = KryptonOutlookGrid.Strings; @@ -1071,6 +1080,24 @@ private void OnSortBySummary(object sender, EventArgs e) Fill(); } + /// + /// Gets the display text for a DateInterval enum name. + /// + /// The name of the DateInterval enum value. + /// The localized display text. + private static string GetDateIntervalDisplayText(string intervalName) + { + return intervalName switch + { + nameof(DateInterval.Day) => KryptonOutlookGridLanguageManager.GeneralStrings.Day, + nameof(DateInterval.Month) => KryptonOutlookGridLanguageManager.GeneralStrings.Month, + nameof(DateInterval.Quarter) => KryptonOutlookGridLanguageManager.GeneralStrings.Quarter, + nameof(DateInterval.Year) => KryptonOutlookGridLanguageManager.GeneralStrings.Year, + nameof(DateInterval.Smart) => KryptonOutlookGridLanguageManager.GeneralStrings.Smart, + _ => intervalName + }; + } + private void OnGroupIntervalClick(object sender, EventArgs e) { KryptonContextMenuItem? item = (KryptonContextMenuItem)sender; @@ -1876,7 +1903,8 @@ private void ShowColumnHeaderContextMenu(int columnIndex) KryptonContextMenuItemBase[] arrayOptions = new KryptonContextMenuItemBase[names.Length]; for (int i = 0; i < names.Length; i++) { - it = new KryptonContextMenuItem(LanguageManager.Instance.GetString(names[i])); + string displayText = GetDateIntervalDisplayText(names[i]); + it = new KryptonContextMenuItem(displayText); it.Tag = names[i]; it.Click += OnGroupIntervalClick; arrayOptions[i] = it; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/General/OutlookGridRow.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/General/OutlookGridRow.cs index 7f038a18a..4958f5ef3 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/General/OutlookGridRow.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Classes/General/OutlookGridRow.cs @@ -1,4 +1,4 @@ -#region BSD License +#region BSD License /* * Use of this source code is governed by a BSD-style * license or other governing licenses that can be found in the LICENSE.md file or at @@ -258,6 +258,10 @@ protected override void Paint(Graphics graphics, Rectangle clipBounds, Rectangle int rowHeadersWidth = grid.RowHeadersVisible ? grid.RowHeadersWidth : 0; int groupLevelIndentation = _group.Level * StaticValues.GroupLevelMultiplier; + // Calculate DPI scaling factors for proper rendering at different DPI settings + float factorX = graphics.DpiX > 96 ? graphics.DpiX / 96f : 1f; + float factorY = graphics.DpiY > 96 ? graphics.DpiY / 96f : 1f; + int gridwidth = grid.Columns.GetColumnsWidth(DataGridViewElementStates.Visible); Rectangle myRowBounds = rowBounds; myRowBounds.Width = gridwidth; @@ -311,9 +315,10 @@ protected override void Paint(Graphics graphics, Rectangle clipBounds, Rectangle } else { + int borderHeight = (int)(2 * factorY); using (SolidBrush br = new(paletteBorder.GetBorderColor1(state))) { - graphics.FillRectangle(br, rowBounds.Left + rowHeadersWidth - grid.HorizontalScrollingOffset, rowBounds.Bottom - 2, gridwidth + 1, 2); + graphics.FillRectangle(br, rowBounds.Left + rowHeadersWidth - grid.HorizontalScrollingOffset, rowBounds.Bottom - borderHeight, gridwidth + 1, borderHeight); } } @@ -327,26 +332,31 @@ protected override void Paint(Graphics graphics, Rectangle clipBounds, Rectangle } //Set the icon and lines according to the renderer + // Scale icon positioning and size based on DPI + int iconLeftOffset = (int)(4 * factorX); + int iconBottomOffset = (int)(18 * factorY); + int iconSize = (int)(11 * factorX); + if (_group.Collapsed) { if (KryptonManager.CurrentGlobalPalette.GetRenderer() == KryptonManager.RenderOffice2010 || KryptonManager.CurrentGlobalPalette.GetRenderer() == KryptonManager.RenderOffice2013) { - graphics.DrawImage(Resources.OutlookGridImageResources.CollapseIcon2010, rowBounds.Left + rowHeadersWidth - grid.HorizontalScrollingOffset + 4 + groupLevelIndentation, rowBounds.Bottom - 18, 11, 11); + graphics.DrawImage(Resources.OutlookGridImageResources.CollapseIcon2010, rowBounds.Left + rowHeadersWidth - grid.HorizontalScrollingOffset + iconLeftOffset + groupLevelIndentation, rowBounds.Bottom - iconBottomOffset, iconSize, iconSize); } else { - graphics.DrawImage(Resources.OutlookGridImageResources.ExpandIcon, rowBounds.Left + rowHeadersWidth - grid.HorizontalScrollingOffset + 4 + groupLevelIndentation, rowBounds.Bottom - 18, 11, 11); + graphics.DrawImage(Resources.OutlookGridImageResources.ExpandIcon, rowBounds.Left + rowHeadersWidth - grid.HorizontalScrollingOffset + iconLeftOffset + groupLevelIndentation, rowBounds.Bottom - iconBottomOffset, iconSize, iconSize); } } else { if (KryptonManager.CurrentGlobalPalette.GetRenderer() == KryptonManager.RenderOffice2010 || KryptonManager.CurrentGlobalPalette.GetRenderer() == KryptonManager.RenderOffice2013) { - graphics.DrawImage(Resources.OutlookGridImageResources.ExpandIcon2010, rowBounds.Left + rowHeadersWidth - grid.HorizontalScrollingOffset + 4 + groupLevelIndentation, rowBounds.Bottom - 18, 11, 11); + graphics.DrawImage(Resources.OutlookGridImageResources.ExpandIcon2010, rowBounds.Left + rowHeadersWidth - grid.HorizontalScrollingOffset + iconLeftOffset + groupLevelIndentation, rowBounds.Bottom - iconBottomOffset, iconSize, iconSize); } else { - graphics.DrawImage(Resources.OutlookGridImageResources.CollapseIcon, rowBounds.Left + rowHeadersWidth - grid.HorizontalScrollingOffset + 4 + groupLevelIndentation, rowBounds.Bottom - 18, 11, 11); + graphics.DrawImage(Resources.OutlookGridImageResources.CollapseIcon, rowBounds.Left + rowHeadersWidth - grid.HorizontalScrollingOffset + iconLeftOffset + groupLevelIndentation, rowBounds.Bottom - iconBottomOffset, iconSize, iconSize); } } @@ -367,15 +377,24 @@ protected override void Paint(Graphics graphics, Rectangle clipBounds, Rectangle } //Draw text, using the current grid font - int offsetText = rowHeadersWidth - grid.HorizontalScrollingOffset + 18 + imageoffset + groupLevelIndentation; + // Scale text offset based on DPI + int textLeftOffset = (int)(18 * factorX); + int offsetText = rowHeadersWidth - grid.HorizontalScrollingOffset + textLeftOffset + imageoffset + groupLevelIndentation; + if (KryptonManager.CurrentGlobalPalette.GetRenderer() == KryptonManager.RenderOffice2013) { - TextRenderer.DrawText(graphics, _group.Text, grid.GridPalette.GetContentShortTextFont(PaletteContentStyle.LabelBoldControl, state), new Rectangle(offsetText, rowBounds.Bottom - StaticValues._2013OffsetHeight, rowBounds.Width - offsetText, rowBounds.Height), grid.GridPalette.GetContentShortTextColor1(PaletteContentStyle.LabelNormalControl, state), + // Fix text rectangle: use proper height based on offset, not full row height + int textY = rowBounds.Bottom - StaticValues._2013OffsetHeight; + int textHeight = StaticValues._2013OffsetHeight; + TextRenderer.DrawText(graphics, _group.Text, grid.GridPalette.GetContentShortTextFont(PaletteContentStyle.LabelBoldControl, state), new Rectangle(offsetText, textY, rowBounds.Width - offsetText, textHeight), grid.GridPalette.GetContentShortTextColor1(PaletteContentStyle.LabelNormalControl, state), TextFormatFlags.EndEllipsis | TextFormatFlags.SingleLine | TextFormatFlags.PreserveGraphicsClipping); } else { - TextRenderer.DrawText(graphics, _group.Text, grid.GridPalette.GetContentShortTextFont(PaletteContentStyle.LabelBoldControl, state), new Rectangle(offsetText, rowBounds.Bottom - StaticValues.DefaultOffsetHeight, rowBounds.Width - offsetText, rowBounds.Height), grid.GridPalette.GetContentShortTextColor1(PaletteContentStyle.LabelNormalControl, state), + // Fix text rectangle: use proper height based on offset, not full row height + int textY = rowBounds.Bottom - StaticValues.DefaultOffsetHeight; + int textHeight = StaticValues.DefaultOffsetHeight; + TextRenderer.DrawText(graphics, _group.Text, grid.GridPalette.GetContentShortTextFont(PaletteContentStyle.LabelBoldControl, state), new Rectangle(offsetText, textY, rowBounds.Width - offsetText, textHeight), grid.GridPalette.GetContentShortTextColor1(PaletteContentStyle.LabelNormalControl, state), TextFormatFlags.EndEllipsis | TextFormatFlags.SingleLine | TextFormatFlags.PreserveGraphicsClipping); } @@ -621,15 +640,29 @@ internal bool IsIconHit(DataGridViewCellMouseEventArgs e) KryptonOutlookGrid grid = (KryptonOutlookGrid)DataGridView; Rectangle rowBounds = grid.GetRowDisplayRectangle(Index, false); - int rowHeadersWidth = grid.RowHeadersVisible ? grid.RowHeadersWidth : 0; - int l = e.X + grid.GetCellDisplayRectangle(e.ColumnIndex, e.RowIndex, false).Left; - if (_isGroupRow && - l >= rowBounds.Left + rowHeadersWidth - grid.HorizontalScrollingOffset + 4 + _group.Level * StaticValues.GroupLevelMultiplier && - l <= rowBounds.Left + rowHeadersWidth - grid.HorizontalScrollingOffset + 4 + _group.Level * StaticValues.GroupLevelMultiplier + 11 && - e.Y >= rowBounds.Height - 18 && - e.Y <= rowBounds.Height - 7) + // Calculate DPI scaling factors for proper hit testing at different DPI settings + using (Graphics g = grid.CreateGraphics()) { - return true; + float factorX = g.DpiX > 96 ? g.DpiX / 96f : 1f; + float factorY = g.DpiY > 96 ? g.DpiY / 96f : 1f; + + int rowHeadersWidth = grid.RowHeadersVisible ? grid.RowHeadersWidth : 0; + int l = e.X + grid.GetCellDisplayRectangle(e.ColumnIndex, e.RowIndex, false).Left; + + // Scale hardcoded values based on DPI + int iconLeftOffset = (int)(4 * factorX); + int iconSize = (int)(11 * factorX); + int iconBottomOffset = (int)(18 * factorY); + int iconTopOffset = (int)(7 * factorY); + + if (_isGroupRow && + l >= rowBounds.Left + rowHeadersWidth - grid.HorizontalScrollingOffset + iconLeftOffset + _group.Level * StaticValues.GroupLevelMultiplier && + l <= rowBounds.Left + rowHeadersWidth - grid.HorizontalScrollingOffset + iconLeftOffset + _group.Level * StaticValues.GroupLevelMultiplier + iconSize && + e.Y >= rowBounds.Height - iconBottomOffset && + e.Y <= rowBounds.Height - iconTopOffset) + { + return true; + } } return false; @@ -681,25 +714,37 @@ internal bool IsGroupImageHit(DataGridViewCellMouseEventArgs e) KryptonOutlookGrid grid = (KryptonOutlookGrid)DataGridView; Rectangle rowBounds = grid.GetRowDisplayRectangle(Index, false); - int rowHeadersWidth = grid.RowHeadersVisible ? grid.RowHeadersWidth : 0; - int l = e.X + grid.GetCellDisplayRectangle(e.ColumnIndex, e.RowIndex, false).Left; - int offsetHeight; - if (KryptonManager.CurrentGlobalPalette.GetRenderer() == KryptonManager.RenderOffice2013) + // Calculate DPI scaling factors for proper hit testing at different DPI settings + using (Graphics g = grid.CreateGraphics()) { - offsetHeight = StaticValues._2013OffsetHeight; - } - else - { - offsetHeight = StaticValues.DefaultOffsetHeight; - } + float factorX = g.DpiX > 96 ? g.DpiX / 96f : 1f; + float factorY = g.DpiY > 96 ? g.DpiY / 96f : 1f; - if (_isGroupRow && - l >= rowBounds.Left + rowHeadersWidth - grid.HorizontalScrollingOffset + 18 + _group.Level * StaticValues.GroupLevelMultiplier && - l <= rowBounds.Left + rowHeadersWidth - grid.HorizontalScrollingOffset + 18 + _group.Level * StaticValues.GroupLevelMultiplier + 16 && - e.Y >= rowBounds.Height - offsetHeight && - e.Y <= rowBounds.Height - 6) - { - return true; + int rowHeadersWidth = grid.RowHeadersVisible ? grid.RowHeadersWidth : 0; + int l = e.X + grid.GetCellDisplayRectangle(e.ColumnIndex, e.RowIndex, false).Left; + int offsetHeight; + if (KryptonManager.CurrentGlobalPalette.GetRenderer() == KryptonManager.RenderOffice2013) + { + offsetHeight = StaticValues._2013OffsetHeight; + } + else + { + offsetHeight = StaticValues.DefaultOffsetHeight; + } + + // Scale hardcoded values based on DPI + int imageLeftOffset = (int)(18 * factorX); + int imageSize = (int)(16 * factorX); + int imageBottomOffset = (int)(6 * factorY); + + if (_isGroupRow && + l >= rowBounds.Left + rowHeadersWidth - grid.HorizontalScrollingOffset + imageLeftOffset + _group.Level * StaticValues.GroupLevelMultiplier && + l <= rowBounds.Left + rowHeadersWidth - grid.HorizontalScrollingOffset + imageLeftOffset + _group.Level * StaticValues.GroupLevelMultiplier + imageSize && + e.Y >= rowBounds.Height - offsetHeight && + e.Y <= rowBounds.Height - imageBottomOffset) + { + return true; + } } return false; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Krypton.Toolkit.Suite.Extended.Outlook.Grid 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Krypton.Toolkit.Suite.Extended.Outlook.Grid 2022.csproj index fb4ee09fa..e90152945 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Krypton.Toolkit.Suite.Extended.Outlook.Grid 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/Krypton.Toolkit.Suite.Extended.Outlook.Grid 2022.csproj @@ -25,7 +25,8 @@ true - en preview + en + preview enable 6 true @@ -73,25 +74,25 @@ - + - + - + - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/User Control/KryptonOutlookGridGroupBox.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/User Control/KryptonOutlookGridGroupBox.cs index 5e0b7c6d6..1974cbdb8 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/User Control/KryptonOutlookGridGroupBox.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Outlook.Grid/User Control/KryptonOutlookGridGroupBox.cs @@ -1,4 +1,4 @@ -#region BSD License +#region BSD License /* * Use of this source code is governed by a BSD-style * license or other governing licenses that can be found in the LICENSE.md file or at @@ -901,6 +901,24 @@ private void KryptonOutlookGridGroupBox_DragEnter(object sender, DragEventArgs e #region Methods + /// + /// Gets the display text for a DateInterval enum name. + /// + /// The name of the DateInterval enum value. + /// The localized display text. + private static string GetDateIntervalDisplayText(string intervalName) + { + return intervalName switch + { + nameof(DateInterval.Day) => KryptonOutlookGridLanguageManager.GeneralStrings.Day, + nameof(DateInterval.Month) => KryptonOutlookGridLanguageManager.GeneralStrings.Month, + nameof(DateInterval.Quarter) => KryptonOutlookGridLanguageManager.GeneralStrings.Quarter, + nameof(DateInterval.Year) => KryptonOutlookGridLanguageManager.GeneralStrings.Year, + nameof(DateInterval.Smart) => KryptonOutlookGridLanguageManager.GeneralStrings.Smart, + _ => intervalName + }; + } + /// Creates the group box. /// The column. /// Type of the grouping. @@ -989,7 +1007,8 @@ private void ShowColumnBoxContextMenu() KryptonContextMenuItemBase[] arrayOptions = new KryptonContextMenuItemBase[names.Length]; for (int i = 0; i < names.Length; i++) { - it = new KryptonContextMenuItem(LanguageManager.Instance.GetString(names[i])); + string displayText = GetDateIntervalDisplayText(names[i]); + it = new KryptonContextMenuItem(displayText); it.Tag = names[i]; it.Click += OnGroupIntervalClick; arrayOptions[i] = it; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.PDF/Krypton.Toolkit.Suite.Extended.PDF 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.PDF/Krypton.Toolkit.Suite.Extended.PDF 2022.csproj index 0bb443017..be391e489 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.PDF/Krypton.Toolkit.Suite.Extended.PDF 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.PDF/Krypton.Toolkit.Suite.Extended.PDF 2022.csproj @@ -25,7 +25,8 @@ True StrongKrypton.snk true - en true + en + true preview @@ -71,25 +72,25 @@ - + - + - + - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Palette.Selectors/Krypton.Toolkit.Suite.Extended.Palette.Selectors 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Palette.Selectors/Krypton.Toolkit.Suite.Extended.Palette.Selectors 2022.csproj index 177284b23..4d4fb69ab 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Palette.Selectors/Krypton.Toolkit.Suite.Extended.Palette.Selectors 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Palette.Selectors/Krypton.Toolkit.Suite.Extended.Palette.Selectors 2022.csproj @@ -25,7 +25,8 @@ True StrongKrypton.snk true - en true + en + true preview @@ -71,25 +72,25 @@ - + - + - + - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Panels/Krypton.Toolkit.Suite.Extended.Panels 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Panels/Krypton.Toolkit.Suite.Extended.Panels 2022.csproj index 8035a8219..5a199ccce 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Panels/Krypton.Toolkit.Suite.Extended.Panels 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Panels/Krypton.Toolkit.Suite.Extended.Panels 2022.csproj @@ -25,7 +25,8 @@ True StrongKrypton.snk true - en preview + en + preview enable 6 true @@ -73,25 +74,25 @@ - + - + - + - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Resources/Krypton.Toolkit.Suite.Extended.Resources 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Resources/Krypton.Toolkit.Suite.Extended.Resources 2022.csproj index 86982b034..e326a3c12 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Resources/Krypton.Toolkit.Suite.Extended.Resources 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Resources/Krypton.Toolkit.Suite.Extended.Resources 2022.csproj @@ -24,7 +24,8 @@ false True StrongKrypton.snk - true preview + true + preview enable 6 true @@ -72,25 +73,25 @@ - + - + - + - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Ribbon/Krypton.Toolkit.Suite.Extended.Ribbon 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Ribbon/Krypton.Toolkit.Suite.Extended.Ribbon 2022.csproj index 3ddb94ac6..947cc39d3 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Ribbon/Krypton.Toolkit.Suite.Extended.Ribbon 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Ribbon/Krypton.Toolkit.Suite.Extended.Ribbon 2022.csproj @@ -25,7 +25,8 @@ True StrongKrypton.snk true - en preview + en + preview enable 6 true @@ -69,88 +70,36 @@ - - - preview - - - - - - - - - - - - preview - - - - - - - - - - - - preview - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - preview - - - - - - - - - - - - preview - - - - - - - - - - - - preview - - - - - - - - - - - - preview - - - - - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Scintilla.NET/Krypton.Toolkit.Suite.Extended.Scintilla.NET 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Scintilla.NET/Krypton.Toolkit.Suite.Extended.Scintilla.NET 2022.csproj index 2d78edf5f..1f1608519 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Scintilla.NET/Krypton.Toolkit.Suite.Extended.Scintilla.NET 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Scintilla.NET/Krypton.Toolkit.Suite.Extended.Scintilla.NET 2022.csproj @@ -25,7 +25,8 @@ True StrongKrypton.snk true - en true + en + true preview @@ -71,25 +72,25 @@ - + - + - + - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Security/Krypton.Toolkit.Suite.Extended.Security 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Security/Krypton.Toolkit.Suite.Extended.Security 2022.csproj index 3f6e35189..0c34234ba 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Security/Krypton.Toolkit.Suite.Extended.Security 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Security/Krypton.Toolkit.Suite.Extended.Security 2022.csproj @@ -25,7 +25,8 @@ True StrongKrypton.snk true - en true + en + true preview @@ -71,25 +72,25 @@ - + - + - + - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Other/ExtendedKryptonMessageBox.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Other/ExtendedKryptonMessageBox.cs index 2a979b155..6ebce3873 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Other/ExtendedKryptonMessageBox.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Other/ExtendedKryptonMessageBox.cs @@ -1,4 +1,4 @@ -#region MIT License +#region MIT License /* * * MIT License @@ -52,6 +52,10 @@ private void InitialiseComponent() _button1 = new(); _button2 = new(); _doNotShowAgainOption = new(); + _panelFooter = new(); + _footerBorderEdge = new(); + _footerText = new(); + _footerToggleLink = new(); ((ISupportInitialize)_panelMessage).BeginInit(); _panelMessage.SuspendLayout(); ((ISupportInitialize)_panelMessageText).BeginInit(); @@ -198,11 +202,57 @@ private void InitialiseComponent() _doNotShowAgainOption.TabIndex = 1; _doNotShowAgainOption.Values.Text = @"&Do not show this again"; // + // _panelFooter + // + _panelFooter.Dock = DockStyle.Top; + _panelFooter.Location = new(0, 78); + _panelFooter.Margin = new(0); + _panelFooter.Name = "_panelFooter"; + _panelFooter.PanelBackStyle = PaletteBackStyle.PanelAlternate; + _panelFooter.Size = new(156, 0); + _panelFooter.TabIndex = 1; + _panelFooter.Visible = false; + // + // _footerBorderEdge + // + _footerBorderEdge.BorderStyle = PaletteBorderStyle.HeaderPrimary; + _footerBorderEdge.Dock = DockStyle.Top; + _footerBorderEdge.Location = new(0, 0); + _footerBorderEdge.Name = "_footerBorderEdge"; + _footerBorderEdge.Size = new(156, 1); + _footerBorderEdge.Text = @"kryptonBorderEdge2"; + _panelFooter.Controls.Add(_footerBorderEdge); + _panelFooter.Controls.Add(_footerText); + _panelFooter.Controls.Add(_footerToggleLink); + // + // _footerText + // + _footerText.AutoSize = false; + _footerText.Location = new(10, 25); + _footerText.Margin = new(0); + _footerText.Name = "_footerText"; + _footerText.Size = new(136, 50); + _footerText.StateCommon.Font = new(@"Segoe UI", 9F); + _footerText.StateCommon.TextColor = Color.FromArgb(30, 57, 91); + _footerText.LabelStyle = LabelStyle.NormalPanel; + _footerText.Text = @"Footer Text"; + // + // _footerToggleLink + // + _footerToggleLink.AutoSize = true; + _footerToggleLink.Location = new(10, 5); + _footerToggleLink.Margin = new(0); + _footerToggleLink.Name = "_footerToggleLink"; + _footerToggleLink.Size = new(100, 25); + _footerToggleLink.Values.Text = @"Show details"; + _footerToggleLink.Click += FooterToggleLink_Click; + // // KryptonMessageBox // AutoScaleDimensions = new(6F, 13F); AutoScaleMode = AutoScaleMode.Font; ClientSize = new(156, 78); + Controls.Add(_panelFooter); Controls.Add(_panelButtons); Controls.Add(_panelMessage); FormBorderStyle = FormBorderStyle.FixedDialog; @@ -256,6 +306,10 @@ private void InitialiseComponent() private string _doNotShowAgainOptionText; private bool _doNotShowAgainOptionResult, _showDoNotShowAgainOption, _useTimeOutOption; private DialogResult _defaultTimeOutResponse; + private KryptonPanel _panelFooter; + private KryptonBorderEdge _footerBorderEdge; + private KryptonWrapLabel _footerText; + private KryptonButton _footerToggleLink; #endregion #region Static Fields @@ -794,6 +848,7 @@ public static DialogResult Show(string text, string caption, return InternalShow(null, text, caption, buttons, KryptonMessageBoxIcon.None, MessageBoxDefaultButton.Button1, 0, null, showCtrlCopy, topMost, messageboxTypeface, false, NULL_TEXT, false, 60, 250, DialogResult.OK, button1Text, button2Text, button3Text); } + /// /// Displays a message box in front of the specified object and with the specified text, caption, buttons, icon, default button, and options. /// @@ -1646,5 +1701,11 @@ private void TimeOutTimer_Tick(object sender, EventArgs e) Hide(); // May need to find a more elegant solution } } + + private void FooterToggleLink_Click(object sender, EventArgs e) + { + // Toggle footer visibility + _panelFooter.Visible = !_panelFooter.Visible; + } #endregion } \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/Colours/AllMergedColourSettingsManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/Colours/AllMergedColourSettingsManager.cs index e3c476ad0..9fe39ab0e 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/Colours/AllMergedColourSettingsManager.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/Colours/AllMergedColourSettingsManager.cs @@ -26,6 +26,8 @@ */ #endregion +using KryptonExceptionDialog = Krypton.Utilities.KryptonExceptionDialog; + namespace Krypton.Toolkit.Suite.Extended.Settings; public class AllMergedColourSettingsManager diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/Colours/CustomColourSettingsManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/Colours/CustomColourSettingsManager.cs index ec4bf2ffb..6c395ceb9 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/Colours/CustomColourSettingsManager.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/Colours/CustomColourSettingsManager.cs @@ -26,6 +26,8 @@ */ #endregion +using KryptonExceptionDialog = Krypton.Utilities.KryptonExceptionDialog; + namespace Krypton.Toolkit.Suite.Extended.Settings; public class CustomColourSettingsManager diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/Colours/StandardControlTextColourSettingsManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/Colours/StandardControlTextColourSettingsManager.cs index 8ff2f9f4a..92d7926da 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/Colours/StandardControlTextColourSettingsManager.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Classes/Palette Explorer/Colours/StandardControlTextColourSettingsManager.cs @@ -26,6 +26,8 @@ */ #endregion +using KryptonExceptionDialog = Krypton.Utilities.KryptonExceptionDialog; + namespace Krypton.Toolkit.Suite.Extended.Settings; public class StandardControlTextColourSettingsManager diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Krypton.Toolkit.Suite.Extended.Settings 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Krypton.Toolkit.Suite.Extended.Settings 2022.csproj index 1866ba26d..bb7c183df 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Krypton.Toolkit.Suite.Extended.Settings 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Settings/Krypton.Toolkit.Suite.Extended.Settings 2022.csproj @@ -24,7 +24,8 @@ false True StrongKrypton.snk - true preview + true + preview enable 6 true @@ -72,25 +73,25 @@ - + - + - + - + @@ -179,7 +180,7 @@ - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/General/ToolTipManager.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/General/ToolTipManager.cs index 218c2effa..23910aa23 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/General/ToolTipManager.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/General/ToolTipManager.cs @@ -1,4 +1,4 @@ -#region MIT License +#region MIT License /* * * MIT License @@ -26,6 +26,7 @@ */ #endregion + namespace Krypton.Toolkit.Suite.Extended.Shared; /// @@ -231,9 +232,9 @@ public void MouseLeave(ViewBase? targetElement, Control c, ViewBase? next) _stopTimer.Stop(); _stopTimer.Start(); } - catch (Exception e) + catch { - KryptonExceptionDialog.Show(e, null, null); + // ignored } } } diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/Krypton.Toolkit.Suite.Extended.Shared 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/Krypton.Toolkit.Suite.Extended.Shared 2022.csproj index bfe20a8a5..f95077b11 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/Krypton.Toolkit.Suite.Extended.Shared 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Shared/Krypton.Toolkit.Suite.Extended.Shared 2022.csproj @@ -24,7 +24,8 @@ false True StrongKrypton.snk - true preview + true + preview enable 6 true @@ -72,25 +73,25 @@ - + - + - + - + @@ -102,6 +103,7 @@ + ..\..\..\Bin\$(configuration)\Krypton.Toolkit.Suite.Extended.Common\Krypton.Toolkit.Suite.Extended.Shared.xml diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Software.Updater.Core/Krypton.Toolkit.Suite.Extended.Software.Updater.Core 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Software.Updater.Core/Krypton.Toolkit.Suite.Extended.Software.Updater.Core 2022.csproj index 28d23681b..223e712c0 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Software.Updater.Core/Krypton.Toolkit.Suite.Extended.Software.Updater.Core 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Software.Updater.Core/Krypton.Toolkit.Suite.Extended.Software.Updater.Core 2022.csproj @@ -24,7 +24,8 @@ false True StrongKrypton.snk - true preview + true + preview enable 6 true @@ -68,116 +69,36 @@ - - - preview - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - preview - - - - - - - - - - - - - - - - preview - - - - - - - - - - - - - - - - preview - - - - - - - - - - - - - - - - preview - - - - - - - - - - - - - - - - preview - - - - - - - - - - - - - - - - preview - - - - - - - - - + @@ -193,7 +114,7 @@ - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Software.Updater/Krypton.Toolkit.Suite.Extended.Software.Updater 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Software.Updater/Krypton.Toolkit.Suite.Extended.Software.Updater 2022.csproj index acf0802ce..d4e6cb610 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Software.Updater/Krypton.Toolkit.Suite.Extended.Software.Updater 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Software.Updater/Krypton.Toolkit.Suite.Extended.Software.Updater 2022.csproj @@ -25,7 +25,8 @@ True StrongKrypton.snk true - en preview + en + preview enable 6 true @@ -73,25 +74,25 @@ - + - + - + - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs 2022.csproj index c74b93822..68d95e86e 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs/Krypton.Toolkit.Suite.Extended.Specialised.Dialogs 2022.csproj @@ -25,7 +25,8 @@ True StrongKrypton.snk true - en preview + en + preview enable 6 true @@ -73,25 +74,25 @@ - + - + - + - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TaskDialogs/Krypton.Toolkit.Suite.Extended.TaskDialogs 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TaskDialogs/Krypton.Toolkit.Suite.Extended.TaskDialogs 2022.csproj index 6721df069..a3b9c98f3 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TaskDialogs/Krypton.Toolkit.Suite.Extended.TaskDialogs 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TaskDialogs/Krypton.Toolkit.Suite.Extended.TaskDialogs 2022.csproj @@ -25,7 +25,8 @@ True StrongKrypton.snk true - en true + en + true preview @@ -71,25 +72,25 @@ - + - + - + - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/Krypton.Toolkit.Suite.Extended.Theme.Switcher 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/Krypton.Toolkit.Suite.Extended.Theme.Switcher 2022.csproj index 9702b758b..07e6acb91 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/Krypton.Toolkit.Suite.Extended.Theme.Switcher 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Theme.Switcher/Krypton.Toolkit.Suite.Extended.Theme.Switcher 2022.csproj @@ -25,7 +25,8 @@ True StrongKrypton.snk true - en preview + en + preview enable 6 true @@ -69,94 +70,42 @@ - - - preview - - - - - - - - - - - - preview - - - - - - - - - - - - preview - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - preview - - - - - - - - - - - - preview - - - - - - - - - - - - preview - - - - - - - - - - - - preview - - - - - + - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Themes/Krypton.Toolkit.Suite.Extended.Themes 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Themes/Krypton.Toolkit.Suite.Extended.Themes 2022.csproj index 648f4c848..dc9b27539 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Themes/Krypton.Toolkit.Suite.Extended.Themes 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Themes/Krypton.Toolkit.Suite.Extended.Themes 2022.csproj @@ -24,7 +24,8 @@ false True StrongKrypton.snk - true true + true + true preview @@ -70,25 +71,25 @@ - + - + - + - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Krypton.Toolkit.Suite.Extended.ToastNotification 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Krypton.Toolkit.Suite.Extended.ToastNotification 2022.csproj index b1e11c892..7999afd97 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Krypton.Toolkit.Suite.Extended.ToastNotification 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ToastNotification/Krypton.Toolkit.Suite.Extended.ToastNotification 2022.csproj @@ -23,7 +23,8 @@ false true - en preview + en + preview enable 6 true @@ -71,25 +72,25 @@ - + - + - + - + @@ -102,9 +103,9 @@ - + - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Krypton.Toolkit.Suite.Extended.Toggle.Switch 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Krypton.Toolkit.Suite.Extended.Toggle.Switch 2022.csproj index 85629e34b..e0f3a313b 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Krypton.Toolkit.Suite.Extended.Toggle.Switch 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Krypton.Toolkit.Suite.Extended.Toggle.Switch 2022.csproj @@ -25,7 +25,8 @@ True StrongKrypton.snk true - en preview + en + preview enable 6 true @@ -69,74 +70,36 @@ - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - preview - - - - - - - - - - preview - - - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Readme.md b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Readme.md index e69de29bb..3e8a67c55 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Readme.md +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Toggle.Switch/Readme.md @@ -0,0 +1,137 @@ +# Krypton Toolkit Suite Extended Toggle Switch Package + +## Overview + +The **Toggle Switch Package** provides customizable toggle switch controls for Windows Forms applications, extending the Krypton Standard Toolkit with modern toggle switch functionality. + +## What's Included + +This package includes: + +- **KryptonToggleSwitchVersion1** - Original toggle switch control +- **KryptonToggleSwitchVersion2** - Enhanced toggle switch control +- Multiple renderer styles (Metro, Modern, iOS, Android, OSX, Carbon, Fancy, Brushed Metal, Plain and Simple) +- Support for both Krypton-themed and vanilla rendering modes +- Customizable appearance, animations, and behavior + +## Supported Frameworks + +- .NET Framework 4.6.2 +- .NET Framework 4.7.2 +- .NET Framework 4.8 +- .NET Framework 4.8.1 +- .NET 8 (Windows) +- .NET 9 (Windows) +- .NET 10 (Windows) + +## Installation + +### From NuGet + +**Stable Release:** +```powershell +Install-Package Krypton.Toolkit.Suite.Extended.Toggle.Switch +``` + +**Canary (Beta) Release:** +```powershell +Install-Package Krypton.Toolkit.Suite.Extended.Toggle.Switch.Canary +``` + +**Nightly (Alpha) Release:** +```powershell +Install-Package Krypton.Toolkit.Suite.Extended.Toggle.Switch.Nightly +``` + +### Using .NET CLI + +```bash +dotnet add package Krypton.Toolkit.Suite.Extended.Toggle.Switch +``` + +## Usage + +Once installed, add the necessary using directive: + +```csharp +using Krypton.Toolkit.Suite.Extended.Toggle.Switch; +``` + +### Basic Example + +```csharp +// Create a toggle switch control +var toggleSwitch = new KryptonToggleSwitchVersion1 +{ + Checked = false, + Style = ToggleSwitchStyle.Metro, + UseAnimation = true +}; + +// Handle checked changed event +toggleSwitch.CheckedChanged += (sender, e) => +{ + MessageBox.Show($"Toggle switch is now: {toggleSwitch.Checked}"); +}; + +// Add to form +this.Controls.Add(toggleSwitch); +``` + +## Features + +### Multiple Renderer Styles +- Metro +- Modern +- iOS 5 +- iPhone +- Android +- OSX +- Carbon +- Fancy +- Brushed Metal +- Plain and Simple + +### Customization Options +- Animation support with configurable intervals and steps +- Custom text for on/off states +- Custom images for buttons and sides +- Alignment options +- Color customization +- Threshold percentage for toggle behavior +- Krypton-themed or vanilla rendering modes + +## Dependencies + +This package requires: +- Krypton.Toolkit (Standard Toolkit) + +Version matching is automatic based on your build configuration (Release/Canary/Nightly). + +## Build Configurations + +The package is available in three build configurations: + +| Configuration | Suffix | Description | +|--------------|---------|-------------| +| **Release** | *(none)* | Stable production release | +| **Canary** | `-beta` | Beta preview with latest features | +| **Nightly** | `-alpha` | Daily builds with cutting-edge features | + +## Support + +- **Documentation**: [Extended Toolkit Docs](https://github.com/Krypton-Suite/Extended-Toolkit) +- **Issues**: [GitHub Issues](https://github.com/Krypton-Suite/Extended-Toolkit/issues) +- **Discussions**: [GitHub Discussions](https://github.com/Krypton-Suite/Extended-Toolkit/discussions) + +## License + +MIT License + +Copyright Ā© 2017-2026, Krypton Suite + +See LICENSE file for details. + +## Version Information + +To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Krypton.Toolkit.Suite.Extended.Tool.Box 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Krypton.Toolkit.Suite.Extended.Tool.Box 2022.csproj index 79fe53b2b..7c66d13aa 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Krypton.Toolkit.Suite.Extended.Tool.Box 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Box/Krypton.Toolkit.Suite.Extended.Tool.Box 2022.csproj @@ -25,7 +25,8 @@ True StrongKrypton.snk true - en preview + en + preview enable 6 true @@ -69,74 +70,36 @@ - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - preview - - - - - - - - - - preview - - - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/Internal/KryptonSliderButton.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/Internal/KryptonSliderButton.cs index 3c1c5d32e..a9ef90e61 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/Internal/KryptonSliderButton.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/Internal/KryptonSliderButton.cs @@ -473,6 +473,37 @@ public string GetLongText() { return string.Empty; } + + public Image? GetOverlayImage(PaletteState state) + { + throw new NotImplementedException(); + } + + public Color GetOverlayImageTransparentColor(PaletteState state) + { + throw new NotImplementedException(); + } + + public OverlayImagePosition GetOverlayImagePosition(PaletteState state) + { + throw new NotImplementedException(); + } + + public OverlayImageScaleMode GetOverlayImageScaleMode(PaletteState state) + { + throw new NotImplementedException(); + } + + public float GetOverlayImageScaleFactor(PaletteState state) + { + throw new NotImplementedException(); + } + + public Size GetOverlayImageFixedSize(PaletteState state) + { + throw new NotImplementedException(); + } + public string GetShortText() { return string.Empty; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/Internal/KryptonToolbarSlider.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/Internal/KryptonToolbarSlider.cs index fdff79136..5af0e2dd9 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/Internal/KryptonToolbarSlider.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Controls/Internal/KryptonToolbarSlider.cs @@ -721,6 +721,37 @@ public string GetLongText() { return string.Empty; } + + public Image? GetOverlayImage(PaletteState state) + { + throw new NotImplementedException(); + } + + public Color GetOverlayImageTransparentColor(PaletteState state) + { + throw new NotImplementedException(); + } + + public OverlayImagePosition GetOverlayImagePosition(PaletteState state) + { + throw new NotImplementedException(); + } + + public OverlayImageScaleMode GetOverlayImageScaleMode(PaletteState state) + { + throw new NotImplementedException(); + } + + public float GetOverlayImageScaleFactor(PaletteState state) + { + throw new NotImplementedException(); + } + + public Size GetOverlayImageFixedSize(PaletteState state) + { + throw new NotImplementedException(); + } + public string GetShortText() { return string.Empty; diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items 2022.csproj index ce53dd481..10eaf166b 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items/Krypton.Toolkit.Suite.Extended.Tool.Strip.Items 2022.csproj @@ -25,7 +25,8 @@ True StrongKrypton.snk true - en preview + en + preview enable 6 true @@ -69,74 +70,36 @@ - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - preview - - - - - - - - - - preview - - - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tools/Krypton.Toolkit.Suite.Extended.Tools 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tools/Krypton.Toolkit.Suite.Extended.Tools 2022.csproj index dbd23dee3..6337bd200 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tools/Krypton.Toolkit.Suite.Extended.Tools 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Tools/Krypton.Toolkit.Suite.Extended.Tools 2022.csproj @@ -24,7 +24,8 @@ false True StrongKrypton.snk - true true + true + true preview @@ -70,25 +71,25 @@ - + - + - + - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/Krypton.Toolkit.Suite.Extended.TreeGridView 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/Krypton.Toolkit.Suite.Extended.TreeGridView 2022.csproj index caf97b6b2..0cebc9ae1 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/Krypton.Toolkit.Suite.Extended.TreeGridView 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/Krypton.Toolkit.Suite.Extended.TreeGridView 2022.csproj @@ -28,7 +28,8 @@ true latest - en preview + en + preview enable 6 true @@ -72,74 +73,36 @@ - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - preview - - - - - - - - - - preview - - - + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/KryptonTreeGridView.cs b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/KryptonTreeGridView.cs index ed7063341..8b05e64a1 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/KryptonTreeGridView.cs +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.TreeGridView/KryptonTreeGridView.cs @@ -1,4 +1,4 @@ -#region MIT License +#region MIT License /* * MIT License * @@ -672,10 +672,10 @@ protected internal virtual bool CollapseNode(KryptonTreeGridNodeRow node) _inExpandCollapse = true; node.IsExpanded = false; - foreach (KryptonTreeGridNodeRow? childNode in node.Nodes) + // Optimized: Batch remove all child nodes efficiently + if (node.Nodes.Count > 0) { - Debug.Assert(childNode.RowIndex != -1, @"Row is NOT in the grid."); - UnSiteNode(childNode); + UnSiteNodes(node.Nodes); } var exped = new CollapsedEventArgs(node); @@ -798,6 +798,150 @@ protected internal virtual void SiteNode(KryptonTreeGridNodeRow? node, int index } } + /// + /// Optimized method to batch insert multiple child nodes efficiently. + /// Calculates the insertion position once and inserts all nodes sequentially. + /// + /// Collection of nodes to insert + /// Parent node after which to insert the children + protected internal virtual void SiteNodes(TreeGridNodeCollection nodes, KryptonTreeGridNodeRow parentNode) + { + if (nodes.Count == 0) + { + return; + } + + // Calculate the insertion position once (right after the parent node) + int insertIndex = parentNode.RowIndex + 1; + + // Insert all child nodes sequentially + // Since we're inserting sequentially, each insertion shifts subsequent indices by 1 + foreach (KryptonTreeGridNodeRow? childNode in nodes) + { + Debug.Assert(childNode.RowIndex == -1, @"Row is already in the grid."); + + childNode.Grid = this; + + // Insert at the calculated position + if (insertIndex < base.Rows.Count) + { + base.Rows.Insert(insertIndex, childNode); + } + else + { + base.Rows.Add(childNode); + } + + // Mark as sited + childNode.Sited(); + + // Increment index for next sibling insertion + insertIndex++; + + // If this node is expanded, recursively site its children + // After recursive insertion, update insertIndex to account for all inserted descendants + if (childNode.IsExpanded && childNode.Nodes.Count > 0) + { + int beforeInsert = insertIndex - 1; // The current childNode's index + SiteNodes(childNode.Nodes, childNode); + // After recursive insertion, find the last descendant row index + // The next sibling should be inserted after all descendants + insertIndex = FindLastDescendantRowIndex(childNode) + 1; + } + } + } + + /// + /// Finds the row index of the last descendant of the given node. + /// + /// Node to find the last descendant for + /// Row index of the last descendant, or the node's own row index if it has no descendants + private int FindLastDescendantRowIndex(KryptonTreeGridNodeRow node) + { + if (!node.IsExpanded || node.Nodes.Count == 0) + { + return node.RowIndex; + } + + // Find the last child + KryptonTreeGridNodeRow? lastChild = node.Nodes[node.Nodes.Count - 1]; + + // Recursively find the last descendant of the last child + return FindLastDescendantRowIndex(lastChild); + } + + /// + /// Optimized method to batch remove multiple child nodes efficiently. + /// Collects all descendant nodes and removes them in reverse order to avoid index shifting issues. + /// + /// Collection of nodes to remove + protected internal virtual void UnSiteNodes(TreeGridNodeCollection nodes) + { + if (nodes.Count == 0) + { + return; + } + + // Collect all rows to remove (including descendants) + // We need to remove in reverse order (bottom-up) to avoid index shifting issues + var rowsToRemove = new List(); + + foreach (KryptonTreeGridNodeRow? childNode in nodes) + { + CollectDescendantRows(childNode, rowsToRemove); + } + + // Sort by row index in descending order for safe removal + // This ensures we remove from bottom to top, preventing index shifts + rowsToRemove.Sort((a, b) => b.RowIndex.CompareTo(a.RowIndex)); + + // Remove rows in reverse order using Remove() which is safer than RemoveAt() + foreach (KryptonTreeGridNodeRow? row in rowsToRemove) + { + if (row.IsSited && row.RowIndex >= 0) + { + try + { + base.Rows.Remove(row); + row.UnSited(); + } + catch + { + // Row may have already been removed or index may be invalid + // This can happen if nodes are being manipulated concurrently + } + } + } + } + + /// + /// Recursively collects all descendant rows that need to be removed. + /// + /// Node to start collecting from + /// List to add rows to + private void CollectDescendantRows(KryptonTreeGridNodeRow? node, List rowsToRemove) + { + if (node == null || !node.IsSited) + { + return; + } + + // Add all expanded children first (they need to be removed before their parent) + if (node.IsExpanded) + { + foreach (KryptonTreeGridNodeRow? childNode in node.Nodes) + { + CollectDescendantRows(childNode, rowsToRemove); + } + } + + // Add this node to the removal list + if (node.RowIndex >= 0) + { + rowsToRemove.Add(node); + } + } + protected internal virtual bool ExpandNode(KryptonTreeGridNodeRow node) { if (!node.IsExpanded || VirtualNodes) @@ -811,12 +955,10 @@ protected internal virtual bool ExpandNode(KryptonTreeGridNodeRow node) _inExpandCollapse = true; node.IsExpanded = true; - //TODO Convert this to a InsertRange - foreach (KryptonTreeGridNodeRow? childNode in node.Nodes) + // Optimized: Batch insert all child nodes efficiently + if (node.Nodes.Count > 0) { - Debug.Assert(childNode.RowIndex == -1, @"Row is already in the grid."); - - SiteNode(childNode); + SiteNodes(node.Nodes, node); } var exped = new ExpandedEventArgs(node); diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Ultimate.Lite/Krypton.Toolkit.Suite.Extended.Ultimate.Lite 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Ultimate.Lite/Krypton.Toolkit.Suite.Extended.Ultimate.Lite 2022.csproj index fb715256f..1af43ee65 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Ultimate.Lite/Krypton.Toolkit.Suite.Extended.Ultimate.Lite 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Ultimate.Lite/Krypton.Toolkit.Suite.Extended.Ultimate.Lite 2022.csproj @@ -11,7 +11,8 @@ True ..\_shared-assets\StrongKrypton.snk True - true preview + true + preview enable 6 true @@ -28,23 +29,27 @@ Krypton.Toolkit.Suite.Extended.Ultimate.Lite.Canary + Krypton Canary.png Krypton.Toolkit.Suite.Extended.Ultimate.Lite.Nightly + Krypton Nightly.png Krypton.Toolkit.Suite.Extended.Ultimate.Lite + Krypton Stable.png Krypton.Toolkit.Suite.Extended.Ultimate.Lite + Krypton Stable.png @@ -73,7 +78,6 @@ To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md - Krypton Stable.png README.md @@ -81,37 +85,25 @@ - - - - + - - - - + - - - - + - - - - + @@ -164,7 +156,7 @@ - + @@ -208,9 +200,11 @@ + + - + @@ -262,6 +256,46 @@ false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Ultimate/Krypton.Toolkit.Suite.Extended.Ultimate 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Ultimate/Krypton.Toolkit.Suite.Extended.Ultimate 2022.csproj index c26ca5833..10d88e1f7 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Ultimate/Krypton.Toolkit.Suite.Extended.Ultimate 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Ultimate/Krypton.Toolkit.Suite.Extended.Ultimate 2022.csproj @@ -1,4 +1,4 @@ - + @@ -12,7 +12,8 @@ True ..\_shared-assets\StrongKrypton.snk True - true preview + true + preview enable 6 true @@ -29,23 +30,27 @@ Krypton.Toolkit.Suite.Extended.Ultimate.Canary + Krypton Canary.png Krypton.Toolkit.Suite.Extended.Ultimate.Nightly + Krypton Nightly.png Krypton.Toolkit.Suite.Extended.Ultimate + Krypton Stable.png Krypton.Toolkit.Suite.Extended.Ultimate + Krypton Stable.png @@ -69,7 +74,6 @@ To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md - Krypton Stable.png README.md @@ -78,37 +82,25 @@ - - - - + - - - - + - - - - + - - - - + @@ -161,7 +153,7 @@ - + @@ -205,9 +197,11 @@ + + - + @@ -259,6 +253,46 @@ false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Krypton.Toolkit.Suite.Extended.Utilities 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Krypton.Toolkit.Suite.Extended.Utilities 2022.csproj index 721cdd07f..2f414e4c8 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Krypton.Toolkit.Suite.Extended.Utilities 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Utilities/Krypton.Toolkit.Suite.Extended.Utilities 2022.csproj @@ -24,7 +24,8 @@ false True StrongKrypton.snk - true preview + true + preview enable 6 true @@ -72,25 +73,25 @@ - + - + - + - + @@ -101,7 +102,6 @@ - ..\..\..\Bin\$(configuration)\Krypton.Toolkit.Suite.Extended.Utilities\Krypton.Toolkit.Suite.Extended.Utilities.xml diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView/Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView/Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView 2022.csproj index a9059594d..1341f9b7c 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView/Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView/Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView 2022.csproj @@ -1,101 +1,102 @@ - - - - + + + + $(ActiveExtendedToolkitTFMs) - - - - - - + + + + + + $(ActiveExtendedToolkitTFMs) - - - - - - true - Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView - Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView - - false - True - StrongKrypton.snk - en preview - enable - 6 - true - - - - - - - Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView.Canary - - - - - - Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView.Nightly - - - - - - Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView - - - - - Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView - - - - - - - - - - - - An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 8 - 10. This package implements items to create a 'virtual tree column view' for your applications. - - This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 8 - 10. - Also, all libraries are included targeting each specific framework version for performance purposes. - - To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md - - + + + + + + true + Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView + Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView + + false + True + StrongKrypton.snk + en + preview + enable + 6 + true + + + + + + + Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView.Canary + + + + + + Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView.Nightly + + + + + + Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView + + + + + Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView + + + + + + + + + + + + An extension to the Standard Toolkit, which supports .NET Framework 4.6.2 - 4.8.1, .NET 8 - 10. This package implements items to create a 'virtual tree column view' for your applications. + + This package supports all .NET Framework versions starting .NET Framework 4.6.2 - 4.8.1, .NET 8 - 10. + Also, all libraries are included targeting each specific framework version for performance purposes. + + To view all of the extended toolkit package latest version information, please visit: https://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard/blob/main/Documents/Modules/Extended/Krypton-Toolkit-Suite-Extended-Modules.md + + - + - + - + - + @@ -107,73 +108,73 @@ - - - True - 4.0.0.0 - True - - - True - 5.0.0.0 - True - - - True - 6.0.0.0 - True - - - - - - - - ..\..\..\Bin\$(configuration)\Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView\Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView.xml - ..\..\..\Bin\$(configuration)\Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView\ - True - enable - - - - - - - - - - - - - - true - - - - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - + + + True + 4.0.0.0 + True + + + True + 5.0.0.0 + True + + + True + 6.0.0.0 + True + + + + + + + + ..\..\..\Bin\$(configuration)\Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView\Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView.xml + ..\..\..\Bin\$(configuration)\Krypton.Toolkit.Suite.Extended.VirtualTreeColumnView\ + True + enable + + + + + + + + + + + + + + true + + + + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + \ No newline at end of file diff --git a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Krypton.Toolkit.Suite.Extended.Wizard 2022.csproj b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Krypton.Toolkit.Suite.Extended.Wizard 2022.csproj index a24434246..46c8ce907 100644 --- a/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Krypton.Toolkit.Suite.Extended.Wizard 2022.csproj +++ b/Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Wizard/Krypton.Toolkit.Suite.Extended.Wizard 2022.csproj @@ -25,7 +25,8 @@ True StrongKrypton.snk true - en preview + en + preview enable 6 true @@ -69,74 +70,36 @@ - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - - - - - - preview - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - preview - - - - - - - - - - preview - - - + diff --git a/Source/Krypton Toolkit/ZipExtractor/ZipExtractor.csproj b/Source/Krypton Toolkit/ZipExtractor/ZipExtractor.csproj index c81a3af6f..a837ff690 100644 --- a/Source/Krypton Toolkit/ZipExtractor/ZipExtractor.csproj +++ b/Source/Krypton Toolkit/ZipExtractor/ZipExtractor.csproj @@ -5,7 +5,8 @@ net481;net8.0-windows enable true - enable preview + enable + preview enable 6 true @@ -17,25 +18,25 @@ - + - + - + - +