Comments (6)
Thank you for bringing these issues to my attention. Some of these issues are the result of typos in the documentation, while others are bugs. I went through each of the issue you presented in the code below:
# Show-AnyBox -Message 'Provide your name:' -Prompt @{} -Comment 'First name only' -Buttons 'OK'
#-- error "Item has already been added. Key in dictionary: 'txt_Explain' Key being added: 'txt_Explain'"
#-- removing comment removes error
# bug fixed by removing duplicate creation of txt_Explain (pending upload)
# Show-AnyBox -Title 'AnyBox Demo' -Message 'Select a number:' -Buttons @(1..9) -ButtonRows 3
#--comes back with name value pair 1-9
#--The number that is selected is in the list twice - is that desired result
# *** bug fixed by casting all button keys to string: (pending upload). Workaround like so:
$ans = Show-AnyBox -Title 'AnyBox Demo' -Message 'Select a number:' -Buttons (@(1..9) -as [string[]]) -ButtonRows 3
#--If so how would you recommend testing to figure out what buttons was pressed?
$btn_pressed = $ans.GetEnumerator() | where Value -eq $true | select -ExpandProperty Name
# $prompt = New-AnyBoxPrompt -Name 'test' -Message 'Enter any number between 0 and 100:' -ValidateScript { $_ -ge 0 -and $_ -le 100 }
# Show-AnyBox -Prompt $prompt -Buttons 'Submit'
#--even if I type 9 in I never get out of loop
# *** need to correct typos in documentation; use:
$prompt = New-AnyBoxPrompt -Message 'Enter any number between 0 and 100:' -ValidateScript { [int]$_ -ge 0 -and [int]$_ -le 100}
Show-AnyBox -Prompt $prompt -Buttons 'Submit'
#Show-AnyBox -MinWidth 350 -Buttons 'Cancel', 'Submit' -Prompt @(
#(New-AnyBoxPrompt -InputType 'FileOpen' -Message 'Open File:', ReadOnly=$true),
#(New-AnyBoxPrompt -InputType 'FileSave' -Message 'Save File:', ReadOnly=$true)
#)
#--could not get this to work at all
# *** need to correct typos in documentation; use:
Show-AnyBox -MinWidth 350 -Buttons 'Cancel', 'Submit' -Prompt @(
(New-AnyBoxPrompt -InputType 'FileOpen' -Message 'Open File:' -ReadOnly),
(New-AnyBoxPrompt -InputType 'FileSave' -Message 'Save File:' -ReadOnly)
)
#Show-AnyBox -Icon 'Question' -Buttons 'Cancel', 'Ignore' -Message 'An error occurred. (Code=123)'
#-Prompt (New-AnyBoxPrompt -InputType 'Checkbox' -Message "Don't ask again." -DefaultValue=$true)
#-- had to remove defaultvalue=$true
# *** need to correct types in documentation; use:
Show-AnyBox -Icon 'Question' -Buttons 'Cancel', 'Ignore' -Message 'An error occurred. (Code=123)' `
-Prompts (New-AnyBoxPrompt -InputType 'Checkbox' -Message "Don't ask again." -DefaultValue $true)
# Show-AnyBox -Buttons 'OK' -MinWidth 200 -Prompt @(
# (New-AnyBoxPrompt -InputType 'Link' -Message = 'My Files' -DefaultValue $env:USERPROFILE),
# (New-AnyBoxPrompt -InputType 'Link' -Message = 'Reddit' -DefaultValue 'www.reddit.com' -ValidateNotEmpty),
# (New-AnyBoxPrompt -InputType 'Link' -Message = 'Notepad' -DefaultValue 'notepad.exe')
# )
# got error - WARNING: Name must start with a letter or the underscore character (_), and must contain only letters, digits, or underscores.
# The link showed as Equal signs with underlines.
# *** need to correct types in documentation; use:
Show-AnyBox -Buttons 'OK' -MinWidth 200 -Prompt @(
(New-AnyBoxPrompt -InputType 'Link' -Message 'My Files' -DefaultValue $env:USERPROFILE),
(New-AnyBoxPrompt -InputType 'Link' -Message 'Reddit' -DefaultValue 'www.reddit.com' -ValidateNotEmpty),
(New-AnyBoxPrompt -InputType 'Link' -Message 'Notepad' -DefaultValue 'notepad.exe')
)
I will keep this issue open until I upload the latest revision.
Also, I will look into the possibility of implementing double-click support for the data grid.
Thank you for the suggestion and the review.
- Donald
from anybox.
I have tried all the commands and still have an issue with the following:
Show-AnyBox -Icon 'Question' -Buttons 'Cancel', 'Ignore' -Message 'An error occurred. (Code=123)' `
-Prompts (New-AnyBoxPrompt -InputType 'Checkbox' -Message "Don't ask again." -DefaultValue $true)
The dialog box comes up but I get the red text:
Unable to find type [System.Drawing.SystemIcons].
I have tried on work desktop as well as personal laptop. If I copy and paste "[System.Drawing.SystemIcons]" into a powershell window it works so I believe I have the proper "files" on the machine
Thanks for you response
from anybox.
I just published v0.3.1 to the Powershell Gallery. Please install the latest version and let me know if any of your original issues persist.
Thank you,
Donald
from anybox.
I have updated the module and things appear to be working.
When following the examples on (https://www.donaldmellenbruch.com/post/introducing-the-anybox/)
When I try the example:
Show-AnyBox -Message 'Enter anything:' -Prompt (New-AnyBoxPrompt -ValidateNotEmpty)
-Buttons 'Cancel', 'Submit' -CancelButton 'Cancel' -DefaultButton 'Submit'
-- No Buttons Show up.
All other commands are working. Thanks for the updates.
from anybox.
Ah, that's an easy one to fix. My example is apparently missing the line-continuation character, `.
You can enter it all on one line, or add the line-continuation character yourself.
Thanks for the help in identifying the bugs and typos!
from anybox.
Yes that fixed it. Please feel free to use me in the future as a test subject if you like.
Thanks again this is helping make some of the script that I am working on be more user friendly.
from anybox.
Related Issues (20)
- Lost Scroll Bar HOT 2
- Order of prompt groups HOT 2
- CheckBox? HOT 1
- Default DataGrid sorting column HOT 1
- ^ Cannot find type [AnyBox.AnyBox]: verify that the assembly containing this type is loaded. HOT 1
- Powershell 7 Support HOT 8
- Button to copy HOT 1
- 2 Columns HOT 1
- dataGrid strange console output on exit HOT 2
- Resize HOT 2
- After DataGrid search, can't sort columns
- Missing Messages And Comments With Version 0.5.0 Using New-Object HOT 2
- Include 'please wait' window processing and ability to highlight one part of -Message HOT 3
- Docs not found 404 HOT 8
- Error as "cannot call a method on a null-valued expression"
- DataGrid Button? - Select All. HOT 1
- Status? HOT 3
- Probable AnyBox resource leak
- Resize the Form messes up tab groups HOT 1
- Double Click and Copy? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from anybox.