r/PowerShell • u/baturmo • Jun 13 '20
PS WinForms Creator
4
u/nepronen Jun 15 '20
Awesome project u/baturmo !
I really like a lot of ideas you have put into your work
I can see it is under MIT License, so you wouldn't mind if I ported the XAML for Winforms for my own gui designer, poshgui?
2
u/nascentt Jun 15 '20
You did poshgui? Thank you so much if so. It's been a life saver. Would be excellent to see you benefit with op on each others projects.
3
u/nepronen Jun 15 '20
I did, and I'm glad it was helpful :)
I think this PS WinForms Creator is a great tool and with MIT license I will be able to improve on PoshGui
but not in the near future, as I'm right before a big release (in 2 weeks you'll get WPF)
After that, sure, I especially like XAML for Winforms idea
It's great that new tools like this one get developed, as I am gearing future development more towards ease of use, out of the box theming, posh specific controls and more collaboration on public repositories
While this tool will be better for people that want access to all controls and all properties, so they can create more from scratch
3
u/baturmo Jun 16 '20
I never expected a developer of one of the main designers out there to comment, much less ask to use my code! Thank you!
I did see you were working on WPF when visiting POSHGUI recently. Will be cool to see that! It's one of the things I was thinking about... until I started researching LOL. So kudos!
3
u/nepronen Jun 16 '20
I'm just a guy doing it for fun after work :)
You did an awesome job for the community and you deserve the recognition for it!
I know what you mean about WPF :) I didn't really like to develop WPF in the beginning, for the very same reasons you've mentioned, and my designer is a web app... adding even more to the complexity of it
but that's what the users requested the most so I gave it a shot. We'll see if it's any good
1
3
u/BeginByLettingGo Jun 13 '20 edited Mar 17 '24
I have chosen to overwrite this comment. See you all on Lemmy!
4
u/baturmo Jun 13 '20
You are most welcome! I'm really liking the positive feedback. Thank you all so much!
3
2
u/nascentt Jun 13 '20 edited Jun 13 '20
This is very cool, I like the effort you put into it. I've been using poshgui for a while now, but this looks pretty on par with functionality.
My immediate suggestion though is to allow the window to be maximized. The maximize button is removed. There's a resize form control, which is better than nothing, but considering how many options there are in these lists, everyone's going to want this thing maximum size. And allow the panes be resized, I cant make the properties pane be narrower, or the project pane be narrower.
Also, the form preview is a very important part of the program but is tucked away. In a way, I feel it should be part of the default view, maybe even mdi. Also, being able to drag controls into the form preview would be amazing.
The ui to me looks a lot like the VB gui editor which is a good thing, it was a RAD Rapid Application Development design approach, so is optimal for designing application interfaces rapidly.
But note the form preview is in the middle, it makes more sense to me.
Edit:
This is the sort of thing I meant: Prototype
3
u/baturmo Jun 15 '20
Wow a lot of feedback! Thanks! I hope I don't miss anything...
The inability to maximize is because I docked the Toolbox and Events forms to the left side when visible, without an option to float. If you maximize you don't see the subforms and with the way the UI is setup now it just makes the TreeView really big.
I really like your screen shots you made up and the reference for MDI. I haven't done anything with MDI forms and initially thought having the separate non-modal subform would be a cool idea so I went that route. I like it, but I can see others being used to the MDI form. The UI does not feel quite right to me either. I just couldn't put my finger on why, and you've given me some good ideas for that.
Not showing the preview form initially... I thought, 'Why show a blank form that can get lost behind other windows while you add to it or change things that you don't need to see right away?' I wasn't completely sure on this decision in the first place so if it's something I hear again I'll be changing it. Of course I might be going MDI and that could be the answer for that as well.
There are a couple reasons I decided not to implement drag/drop functionality. It would be rather difficult to implement, yes, but possible I think. It's determining the parent to place the control on that I figured would be the most difficult part of that (when container controls overlap). One of the reasons I switched to a TreeView was to provide more granular control placement and drag/drop would affect that.
The UI is seeming to be the biggest feedback point people have had so far. I will definitely be putting some effort towards this in the future.
Thanks again for the detailed and well thought out feedback. I really do appreciate it!
1
u/nascentt Jun 16 '20 edited Jun 17 '20
No problem. Glad you found it useful.
I understand how the grouping of controls/parent-child structure could be a challenge for form preview control placement. I think it'd be an acceptable compromise if you allow control placement into the form but require structuring the hierarchy via the treeview
2
2
u/BestGermanEver Jun 15 '20
I agree with the maximize window control needing to be there. I would love "Drag & Drop" functionality as the most "natural" way to create a form, but kind of fear in just Powershell this is will be tough to code?
2
u/nascentt Jun 15 '20
He managed the drag and drop from the control list to the form design, so it might be possible for him to use similar code for the form preview.
2
u/northendtrooper Jun 13 '20
Quick glance at it, does it only provide in a single thread form?
Do you have plans to implement run space features in the future?
2
u/baturmo Jun 13 '20
Yes. Most of the time there are ways around doing actual multi-threading within the STA runspace, and most of the time it's unnecessary. I've learned that unless you're an experienced developer who really knows their stuff, and I'm not quite at that point either, you should just stay away. If I can't get something done on the STA thread without it causing a performance issue I offload it to a job. It sacrifices a little time, but much easier to manage. Good catch on no synchronized hashtable! I will put learning more about runspaces on the list of things to think about in the future though. Thanks!
2
u/BestGermanEver Jun 14 '20
You actually filled somewhat of a "void" for me with this. I'm just trying to get more into Powershell scripting and creating forms was a real no-go for me so far without a WYSIWYG tool to create the base form with in the first place. I never understood why MS doesn't provide a native GUI-driven tool to create a WinForm with outside of paying for Visual Studio Pro.
Also, paying around 100 Bucks to see if Powershell Pro Tools is any good in the long run seems a bit stiff just to play around with forms initially.
Thanks for sharing your work, appreciate it!
Wish I could contribute, but I'm nowhere near that level of proficiency yet.
3
u/baturmo Jun 14 '20
I'm really glad I could help you out! You are exactly the audience I thought would appreciate something like this. I'm glad I wasn't wrong. Thank you!
2
1

8
u/crushcrush1954 Jun 13 '20
Unser which license did you place the script? The ps1 doesn't contain any legal information in the header. MIT license may be a good choice if you want to use one easy to read and convenient for the users. Maybe you want to upload your script to powershellgallery.com to give it more visibility?