Page 1 of 1
[Module] [MacOS and now Windows] FormDesigner and property editor
Posted: Wed Aug 28, 2024 6:45 pm
by pjsmith67
For your programming pleasure I submit the following modules...
FormDesigner - a basic form designer you can incorporate into your programs
PropEd - a companion property editor
Please note that the FormDesigner has been developed and tested on MacOS. I do have some Windows specific code in some places where necessary but I have not really tested that. The biggest thing being canvas transparency. Also, some stuff like bringing an object to the front, simply will not work on Windows.
Consider these modules to be very much alpha as they are not feature complete and subject to change so use at your own risk. Both modules have examples embedded into them. The FormDesigner shows how to use the the property editor with it. One major feature still missing is code generation so you can't do a whole lot with it yet except play with it.
So everything is still kinda crude but you may be able to use it as a basis for your own GUI Designer.
Bugs? Most definitely.
I just wanted to get this out early to see how much interest there is in this.
Download here:
https://filedn.com/lHJwd7m6TKKuPoeDaPqWKjJ
Thanks!
Phil
Re: [Module] FormDesigner and property editor
Posted: Thu Aug 29, 2024 8:30 am
by dige
I would give it a try, but there are some missing constants like: #nil, #PB_Menu_Quit
Re: [Module] FormDesigner and property editor
Posted: Thu Aug 29, 2024 1:00 pm
by spikey
dige wrote: Thu Aug 29, 2024 8:30 am
I would give it a try, but there are some missing constants like: #nil, #PB_Menu_Quit
Replace all #nil with #Null. Either comment out the #PB_Menu_Quit lines or wrap them in a
Code: Select all
CompilerIf #PB_Compiler_OS = #PB_OS_MacOS
CompilerEndIf
block, as this is a Mac specific item.
pjsmith67 wrote: Wed Aug 28, 2024 6:45 pm
Bugs? Most definitely.
Yup. Clicking on the grid in the form designer causes the property editor to go into an infinite refresh/redraw loop! (Windows 11, PB 6.11 X64).
Re: [Module] FormDesigner and property editor
Posted: Thu Aug 29, 2024 2:24 pm
by Kiffi
A screenshot would be nice. Thanks in advance.
Re: [Module] FormDesigner and property editor
Posted: Thu Aug 29, 2024 4:45 pm
by pjsmith67
Yup. Clicking on the grid in the form designer causes the property editor to go into an infinite refresh/redraw loop! (Windows 11, PB 6.11 X64).
Yeah, not surprised as I haven't tested it much under windows. I'll take a look at it today.
Thanks!
Phil
Re: [Module] FormDesigner and property editor
Posted: Thu Aug 29, 2024 5:00 pm
by pjsmith67
Kiffi wrote: Thu Aug 29, 2024 2:24 pm
A screenshot would be nice. Thanks in advance.
formdesginer.png
Re: [Module] FormDesigner and property editor
Posted: Thu Aug 29, 2024 7:42 pm
by PBJim
Well done Phil, it looks good. Forgive me for asking, not having had chance to look properly myself, but is the output from the designer a set of parameters, or code? Jim
Re: [Module] FormDesigner and property editor
Posted: Thu Aug 29, 2024 8:17 pm
by pjsmith67
PBJim wrote: Thu Aug 29, 2024 7:42 pm
Well done Phil, it looks good. Forgive me for asking, not having had chance to look properly myself, but is the output from the designer a set of parameters, or code? Jim
Thanks you.
At the moment it only outputs to json. Code generation is on my list of things to do.
Phil
Re: [Module] FormDesigner and property editor
Posted: Thu Aug 29, 2024 10:19 pm
by pjsmith67
ok, serious problem with the Windows version, for some reason this code to make the canvas transparent, while it works, make the canvas not respond to events. So, until this is solved, unfortunately, this module will be MacOS only.
Code: Select all
Define hwCanvas = GadgetID(canvas)
Define transparentColor = RGB(255, 255, 255) ;white transparent
Define opacity = 0
SetWindowLong_(hwcanvas, #GWL_EXSTYLE, #WS_EX_LAYERED)
SetLayeredWindowAttributes_(hwCanvas, transparentColor, opacity, #LWA_COLORKEY)
Re: [Module] [MacOS and now Windows!] FormDesigner and property editor
Posted: Tue Sep 03, 2024 3:17 pm
by pjsmith67
Just uploaded a new version. It should be working much better under Windows now, though not perfectly.
Please note: You only need to download filedesigner3.pb and property_editor.pb
https://filedn.com/lHJwd7m6TKKuPoeDaPqWKjJ
Thanks!
Phil
Re: [Module] [MacOS and now Windows] FormDesigner and property editor
Posted: Tue Sep 24, 2024 8:10 pm
by pjsmith67
Finally have a new version ready. This one adds a textButtonItem which replaces how colors were chosen. Demo now has a font property using the new textButtonTiem and loading/saving forms is now supported. Next up is code generation so that this can, hopefully, be somewhat useful.
You now need to download three files
formdesigner3.pb
property_editor.pb
TextButtonEx.pb
https://filedn.com/lHJwd7m6TKKuPoeDaPqWKjJ
Phil