[Module] [MacOS and now Windows] FormDesigner and property editor

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
pjsmith67
User
User
Posts: 48
Joined: Thu Apr 26, 2018 3:09 pm

[Module] [MacOS and now Windows] FormDesigner and property editor

Post 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. :-D

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
Last edited by pjsmith67 on Tue Sep 03, 2024 3:33 pm, edited 2 times in total.
dige
Addict
Addict
Posts: 1391
Joined: Wed Apr 30, 2003 8:15 am
Location: Germany
Contact:

Re: [Module] FormDesigner and property editor

Post by dige »

I would give it a try, but there are some missing constants like: #nil, #PB_Menu_Quit
"Daddy, I'll run faster, then it is not so far..."
User avatar
spikey
Enthusiast
Enthusiast
Posts: 750
Joined: Wed Sep 22, 2010 1:17 pm
Location: United Kingdom

Re: [Module] FormDesigner and property editor

Post 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. :-D
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).
User avatar
Kiffi
Addict
Addict
Posts: 1485
Joined: Tue Mar 02, 2004 1:20 pm
Location: Amphibios 9

Re: [Module] FormDesigner and property editor

Post by Kiffi »

A screenshot would be nice. Thanks in advance.
Hygge
pjsmith67
User
User
Posts: 48
Joined: Thu Apr 26, 2018 3:09 pm

Re: [Module] FormDesigner and property editor

Post 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
pjsmith67
User
User
Posts: 48
Joined: Thu Apr 26, 2018 3:09 pm

Re: [Module] FormDesigner and property editor

Post by pjsmith67 »

Kiffi wrote: Thu Aug 29, 2024 2:24 pm A screenshot would be nice. Thanks in advance.
formdesginer.png
PBJim
Enthusiast
Enthusiast
Posts: 294
Joined: Fri Jan 19, 2024 11:56 pm

Re: [Module] FormDesigner and property editor

Post 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
pjsmith67
User
User
Posts: 48
Joined: Thu Apr 26, 2018 3:09 pm

Re: [Module] FormDesigner and property editor

Post 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
pjsmith67
User
User
Posts: 48
Joined: Thu Apr 26, 2018 3:09 pm

Re: [Module] FormDesigner and property editor

Post 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)
pjsmith67
User
User
Posts: 48
Joined: Thu Apr 26, 2018 3:09 pm

Re: [Module] [MacOS and now Windows!] FormDesigner and property editor

Post 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
pjsmith67
User
User
Posts: 48
Joined: Thu Apr 26, 2018 3:09 pm

Re: [Module] [MacOS and now Windows] FormDesigner and property editor

Post 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
Post Reply