Skip to content

Commit 5c311b0

Browse files
author
donald
committed
v0.4.0
1 parent 8991c70 commit 5c311b0

32 files changed

+1786
-2128
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ thumbs.db
55
*.sln
66
.DS_Store
77
.Rhistory
8+
publish.ps1
9+
publish/

AnyBox.psd1

Lines changed: 75 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,110 +1,110 @@
11
@{
2-
# Script module or binary module file associated with this manifest.
3-
ModuleToProcess = 'AnyBox.psm1'
2+
# Script module or binary module file associated with this manifest.
3+
ModuleToProcess = 'AnyBox.psm1'
44

5-
# Version number of this module.
6-
ModuleVersion = '0.3.4'
5+
# Version number of this module.
6+
ModuleVersion = '0.4.0'
77

8-
# Supported PSEditions
9-
# CompatiblePSEditions = 'Desktop'
8+
# Supported PSEditions
9+
# CompatiblePSEditions = 'Desktop'
1010

11-
# ID used to uniquely identify this module
12-
GUID = '2d4d8fd0-36c3-48e9-b6ac-48df0f9bc7ab'
11+
# ID used to uniquely identify this module
12+
GUID = '2d4d8fd0-36c3-48e9-b6ac-48df0f9bc7ab'
1313

14-
# Author of this module
15-
Author = 'Donald Mellenbruch'
14+
# Author of this module
15+
Author = 'Donald Mellenbruch'
1616

17-
# Company or vendor of this module
18-
# CompanyName = 'Unknown'
17+
# Company or vendor of this module
18+
# CompanyName = 'Unknown'
1919

20-
# Copyright statement for this module
21-
Copyright = '(c) 2019 Donald Mellenbruch. All rights reserved.'
20+
# Copyright statement for this module
21+
Copyright = '(c) 2019 Donald Mellenbruch. All rights reserved.'
2222

23-
# Description of the functionality provided by this module
24-
Description = 'Designed to facilitate script input/output with an easily customizable WPF window.'
23+
# Description of the functionality provided by this module
24+
Description = 'Designed to facilitate script input/output with an easily customizable WPF window.'
2525

26-
# Minimum version of the PowerShell engine required by this module
27-
PowerShellVersion = '3.0'
26+
# Minimum version of the PowerShell engine required by this module
27+
PowerShellVersion = '3.0'
2828

29-
# Name of the PowerShell host required by this module
30-
# PowerShellHostName = ''
29+
# Name of the PowerShell host required by this module
30+
# PowerShellHostName = ''
3131

32-
# Minimum version of the PowerShell host required by this module
33-
# PowerShellHostVersion = ''
32+
# Minimum version of the PowerShell host required by this module
33+
# PowerShellHostVersion = ''
3434

35-
# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
36-
# DotNetFrameworkVersion = ''
35+
# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
36+
# DotNetFrameworkVersion = ''
3737

38-
# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
39-
# CLRVersion = ''
38+
# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
39+
# CLRVersion = ''
4040

41-
# Processor architecture (None, X86, Amd64) required by this module
42-
# ProcessorArchitecture = ''
41+
# Processor architecture (None, X86, Amd64) required by this module
42+
# ProcessorArchitecture = ''
4343

44-
# Modules that must be imported into the global environment prior to importing this module
45-
# RequiredModules = @()
44+
# Modules that must be imported into the global environment prior to importing this module
45+
# RequiredModules = @()
4646

47-
# Assemblies that must be loaded prior to importing this module
48-
RequiredAssemblies = 'System.Windows.Forms.dll', 'System.Drawing.dll', 'PresentationFramework.dll', 'PresentationCore.dll', 'WindowsBase.dll'
47+
# Assemblies that must be loaded prior to importing this module
48+
RequiredAssemblies = 'System.Windows.Forms.dll', 'System.Drawing.dll', 'PresentationFramework.dll', 'PresentationCore.dll', 'WindowsBase.dll'
4949

50-
# Script files (.ps1) that are run in the caller's environment prior to importing this module.
51-
# ScriptsToProcess = ''
50+
# Script files (.ps1) that are run in the caller's environment prior to importing this module.
51+
# ScriptsToProcess = ''
5252

53-
# Type files (.ps1xml) to be loaded when importing this module
54-
# TypesToProcess = @()
53+
# Type files (.ps1xml) to be loaded when importing this module
54+
# TypesToProcess = @()
5555

56-
# Format files (.ps1xml) to be loaded when importing this module
57-
# FormatsToProcess = @()
56+
# Format files (.ps1xml) to be loaded when importing this module
57+
# FormatsToProcess = @()
5858

59-
# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
60-
# NestedModules = @()
59+
# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
60+
# NestedModules = @()
6161

62-
# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
63-
FunctionsToExport = @('Get-Base64', 'New-AnyBoxPrompt', 'New-AnyBoxButton', 'Show-AnyBox')
62+
# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
63+
FunctionsToExport = @('Get-Base64', 'New-AnyBoxPrompt', 'New-AnyBoxButton', 'Show-AnyBox')
6464

65-
# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
66-
CmdletsToExport = @()
65+
# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
66+
CmdletsToExport = @()
6767

68-
# Variables to export from this module
69-
VariablesToExport = @()
68+
# Variables to export from this module
69+
VariablesToExport = @()
7070

71-
# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
72-
AliasesToExport = @('New-Prompt', 'New-Button')
71+
# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
72+
AliasesToExport = @('New-Prompt', 'New-Button')
7373

74-
# DSC resources to export from this module
75-
# DscResourcesToExport = @()
74+
# DSC resources to export from this module
75+
# DscResourcesToExport = @()
7676

77-
# List of all modules packaged with this module
78-
# ModuleList = @()
77+
# List of all modules packaged with this module
78+
# ModuleList = @()
7979

80-
# List of all files packaged with this module
81-
FileList = 'AnyBox.psd1', 'AnyBox.psm1', 'Types\AnyBox.ps1',
82-
'Public\Show-AnyBox.ps1', 'Public\New-AnyBoxPrompt.ps1', 'Public\New-AnyBoxButton.ps1', 'Public\Get-Base64.ps1',
83-
'Private\ConvertTo-BitmapImage.ps1', 'Private\ConvertTo-Long.ps1', 'Private\New-TextBlock.ps1', 'Private\Test-ValidInput.ps1'
80+
# List of all files packaged with this module
81+
FileList = 'AnyBox.psd1', 'AnyBox.psm1', 'Types\AnyBox.ps1',
82+
'Public\Show-AnyBox.ps1', 'Public\New-AnyBoxPrompt.ps1', 'Public\New-AnyBoxButton.ps1', 'Public\Get-Base64.ps1',
83+
'Private\ConvertTo-BitmapImage.ps1', 'Private\ConvertTo-Long.ps1', 'Private\New-TextBlock.ps1', 'Private\Test-ValidInput.ps1'
8484

85-
# HelpInfo URI of this module
86-
HelpInfoURI = 'https://www.donaldmellenbruch.com/project/anybox'
85+
# HelpInfo URI of this module
86+
HelpInfoURI = 'https://github.com/dm3ll3n/AnyBox'
8787

88-
# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
89-
PrivateData = @{
90-
PSData = @{
91-
# Tags applied to this module. These help with module discovery in online galleries.
92-
Tags = 'GUI', 'WPF', 'Forms'
88+
# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
89+
PrivateData = @{
90+
PSData = @{
91+
# Tags applied to this module. These help with module discovery in online galleries.
92+
Tags = 'GUI', 'WPF', 'Forms'
9393

94-
# A URL to the license for this module.
95-
# LicenseUri = ''
94+
# A URL to the license for this module.
95+
LicenseUri = 'https://raw.githubusercontent.com/dm3ll3n/AnyBox/master/LICENSE'
9696

97-
# A URL to the main website for this project.
98-
ProjectUri = 'https://www.donaldmellenbruch.com/project/anybox'
97+
# A URL to the main website for this project.
98+
ProjectUri = 'https://github.com/dm3ll3n/AnyBox'
9999

100-
# A URL to an icon representing this module.
101-
# IconUri = ''
100+
# A URL to an icon representing this module.
101+
# IconUri = ''
102102

103-
# ReleaseNotes of this module
104-
ReleaseNotes = 'https://www.donaldmellenbruch.com/project/anybox'
105-
} # End of PSData hashtable
106-
} # End of PrivateData hashtable
103+
# ReleaseNotes of this module
104+
ReleaseNotes = 'https://github.com/dm3ll3n/AnyBox'
105+
} # End of PSData hashtable
106+
} # End of PrivateData hashtable
107107

108-
# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
109-
# DefaultCommandPrefix = ''
108+
# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
109+
# DefaultCommandPrefix = ''
110110
}

CHANGELOG.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
11
# Changelog
22

3-
All notable changes to this project will be documented in this file.
3+
## v0.4.0 - 2019-06-11
44

5-
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
5+
### Added
6+
7+
- Added ability to show indeterminant progress bar with switch parameter `-ProgressBar`.
8+
- Added ability to show window only while a condition is `$true` with scriptblock parameter `-While`.
9+
- Requires the `ThreadJob` module.
10+
- Added `-WindowStartupLocation` parameter to open window in a predefined location.
11+
- When a path is provided as the default value for prompts of type `FileOpen`, `FileSave`, or `FolderOpen`, the dialog opens to the parent directory of the provided path.
12+
13+
### Fixed
14+
15+
- Fixed ability to display a base64-encoded image passed to the `-Image` parameter.
16+
- Fixed selection return when `-SelectionMode` is `SingleCell`.
617

718
## v0.3.4 - 2019-03-08
819

Private/ConvertTo-BitmapImage.ps1

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
function ConvertTo-BitmapImage {
22
<#
3-
.SYNOPSIS
4-
Converts a base64 string to a BitmapImage object.
5-
.DESCRIPTION
6-
Used by 'Show-AnyBox' to convert a base64 string into a [System.Windows.Media.Imaging.BitmapImage].
7-
.PARAMETER base64
8-
The base64 string representing an image.
9-
.INPUTS
10-
The base64 string representing an image.
11-
.OUTPUTS
12-
A [System.Windows.Media.Imaging.BitmapImage] object.
13-
#>
3+
.SYNOPSIS
4+
Converts a base64 string to a BitmapImage object.
5+
.DESCRIPTION
6+
Used by 'Show-AnyBox' to convert a base64 string into a [System.Windows.Media.Imaging.BitmapImage].
7+
.PARAMETER base64
8+
The base64 string representing an image.
9+
.INPUTS
10+
The base64 string representing an image.
11+
.OUTPUTS
12+
A [System.Windows.Media.Imaging.BitmapImage] object.
13+
#>
1414
param([
1515
Parameter(ValueFromPipeline = $true)]
1616
[string[]]$base64

Private/ConvertTo-Long.ps1

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
function ConvertTo-Long {
22
<#
3-
.SYNOPSIS
4-
"Melts" object(s) into an array of key-value pairs.
5-
.DESCRIPTION
6-
Converts object(s) wide objects into a long array object for better display.
7-
.PARAMETER obj
8-
The object(s) to melt.
9-
.PARAMETER KeyName
10-
The name of the resulting key column; defaults to "Name".
11-
.PARAMETER obj
12-
The name of the resulting value column; defaults to "Value".
13-
.INPUTS
14-
One or more objects.
15-
.OUTPUTS
16-
An array of objects with properties "$KeyName" and "$ValueName".
17-
#>
3+
.SYNOPSIS
4+
"Melts" object(s) into an array of key-value pairs.
5+
.DESCRIPTION
6+
Converts object(s) wide objects into a long array object for better display.
7+
.PARAMETER obj
8+
The object(s) to melt.
9+
.PARAMETER KeyName
10+
The name of the resulting key column; defaults to "Name".
11+
.PARAMETER obj
12+
The name of the resulting value column; defaults to "Value".
13+
.INPUTS
14+
One or more objects.
15+
.OUTPUTS
16+
An array of objects with properties "$KeyName" and "$ValueName".
17+
#>
1818
param(
1919
[Parameter(ValueFromPipeline = $true)]
2020
[object[]]$obj,
@@ -23,7 +23,7 @@ function ConvertTo-Long {
2323
[ValidateNotNullOrEmpty()]
2424
[string]$ValueName = 'Value'
2525
)
26-
26+
2727
process {
2828
foreach ($o in $obj) {
2929
$o.psobject.Properties | foreach { [pscustomobject]@{ $KeyName = $_.Name; $ValueName = $_.Value } }

Private/New-TextBlock.ps1

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
11
function New-TextBlock
22
{
3-
param(
4-
[ref]$RefForm,
5-
$Text,
6-
$Name,
7-
$FontFamily,
8-
$FontSize,
9-
$FontColor,
10-
$ContentAlignment,
11-
$Margin = "0, 10, 0, 0"
12-
)
3+
param(
4+
[ref]$RefForm,
5+
$Text,
6+
$Name,
7+
$FontFamily,
8+
$FontSize,
9+
$FontColor,
10+
$ContentAlignment,
11+
$Margin = "0, 10, 0, 0"
12+
)
1313

14-
$txtBlk = $null
14+
$txtBlk = $null
1515

16-
if ($text -and (-not [string]::IsNullOrEmpty($text.Trim()))) {
17-
$txtBlk = New-Object System.Windows.Controls.TextBlock
18-
$txtBlk.Text = $Text
19-
$txtBlk.FontFamily = $FontFamily
20-
$txtBlk.FontSize = $FontSize
21-
$txtBlk.Foreground = $FontColor
22-
$txtBlk.TextWrapping = 'Wrap'
23-
$txtBlk.VerticalAlignment = 'Center'
24-
$txtBlk.HorizontalAlignment = $ContentAlignment
25-
$txtBlk.TextAlignment = $ContentAlignment
26-
$txtBlk.Margin = $Margin
16+
if ($text -and (-not [string]::IsNullOrEmpty($text.Trim()))) {
17+
$txtBlk = New-Object System.Windows.Controls.TextBlock
18+
$txtBlk.Text = $Text
19+
$txtBlk.FontFamily = $FontFamily
20+
$txtBlk.FontSize = $FontSize
21+
$txtBlk.Foreground = $FontColor
22+
$txtBlk.TextWrapping = 'Wrap'
23+
$txtBlk.VerticalAlignment = 'Center'
24+
$txtBlk.HorizontalAlignment = $ContentAlignment
25+
$txtBlk.TextAlignment = $ContentAlignment
26+
$txtBlk.Margin = $Margin
2727

28-
if ($name) {
29-
$txtBlk.Name = $Name
30-
$RefForm.Value.Add($txtBlk.Name, $txtBlk)
31-
}
32-
}
28+
if ($name) {
29+
$txtBlk.Name = $Name
30+
$RefForm.Value.Add($txtBlk.Name, $txtBlk)
31+
}
32+
}
3333

34-
return $txtBlk
34+
return $txtBlk
3535
}

0 commit comments

Comments
 (0)