Form Designer 5.10

You need some new stunning features ? Tell us here.
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

Re: Form Designer for Mac/Windows/Linux - beta 4

Post by Polo »

Err, to be honest that's sounds complicated! How should I store easily the flags then? :oops:

I'm making progress on the new save/load function - the Designer is already able to load the following code :)

Code: Select all

  Window_0 = OpenWindow(#PB_Any, 0, 0, 600, 400, "", #PB_Window_SystemMenu)
  ListViewGadget(#ListView_0, 10, 10, 170, 380)
  Checkbox_0 = CheckBoxGadget(#PB_Any, 200, 20, 240, 30, "")
  Option_0 = OptionGadget(#PB_Any, 200, 60, 240, 30, "")
  String_0 = StringGadget(#PB_Any, 200, 100, 260, 30, "")
  Panel_0 = PanelGadget(#PB_Any, 190, 160, 340, 230)
  AddGadgetItem(Panel_0, -1, "Tab 1")
  Combo_0 = ComboBoxGadget(#PB_Any, 40, 19, 210, 60)
  AddGadgetItem(Panel_0, -1, "Item 2")
  IP_0 = IPAddressGadget(#PB_Any, 40, 29, 230, 30)
  ScrollArea_0 = ScrollAreaGadget(#PB_Any, 40, 69, 260, 110, 460, 460,1)
  Spin_0 = SpinGadget(#PB_Any, 40, 30, 140, 30, 0, 0)
  CloseGadgetList()
  Option_0 = OptionGadget(#PB_Any, 80, 179, 150, 20, "")
  CloseGadgetList()
luciano
Enthusiast
Enthusiast
Posts: 151
Joined: Wed Mar 09, 2011 8:25 pm

Re: Form Designer for Mac/Windows/Linux - beta 4

Post by luciano »

As present version of Form designer is working now, if I remove all flags from the window option and then I just add #PB_Window_MinimizeGadget, I get after a while also #PB_Window_SystemMenu, #PB_Window_MaximizeGadget, #PB_Window_SizeGadget and #PB_Window_TitleBar (and the window returns re-sizable, among other features...).

My solutions
1-Reading from a saved file; if you parse PB source code as agreed with Fred then you should have no problems since flags are written down as text

2-Temporary use of flags in the application; I would use "virtual constants" whith "round" binary values e.g.:
#PB_Window_MinimizeGadget =%1000000....
#PB_Window_MaximizeGadget =%0100000....
#PB_Window_SizeGadget= %0010000....
and then you can use "&" to retrieve the flag back from an integer number and you can store 32 flags and this way you also avoid the problem ( which was pointed out by Fred, too) that real constants may have different numeric values in different OS's.
Ciao
Luciano
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

Re: Form Designer for Mac/Windows/Linux - beta 4

Post by Polo »

Good idea, I'll do something like this once I finish working on the loader :)
jesperbrannmark
Enthusiast
Enthusiast
Posts: 536
Joined: Mon Feb 16, 2009 10:42 am
Location: sweden
Contact:

Re: Form Designer for Mac/Windows/Linux - beta 4

Post by jesperbrannmark »

I would suggest a simple text field at the end of the object properties in Form Designer which could be added as optional flags within gadget definition in PB code
Here could be a way to make this:
1. Start the code with the globals
2. Put the openwindow in procedures
3. Put a Includefile "program.pb"
4. Do the mainloop

Each gadget right now is included in the main loop like select Eventgadget() - case #mygadget. In the editor maybe could select which eventtypes to look for as well. And upon these events a procedure in the "program.pb" can be called.
Like

Code: Select all

Select EventGadget()
  Case #mygadget
    Select EventType()
      Case #PB_EventType_LeftClick
        mygadget_leftclick()    
    EndSelect
EndSelect
The program.pb code can hold this mygadget_leftclick() procedure. This would mean that you can modify the behavour of the leftclick on mygadget without having to mess with the code generated by the form designer.
Even ideal would be to with a quick click in the form designer - be able to open up the mygadget_leftclick procedure in the program.pb file in the normal Purebasic code editor.

Hope I am not complicating things... just brainstorming here..
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

Re: Form Designer for Mac/Windows/Linux - beta 4

Post by Polo »

I'm happy to say that should be possible - I'm working on the new file format and it should be great !!

I'm actually including the .pbf file into a purebasic project, editing the pbf file into the Form Designer, and see the changes in the purebasic project without changing a single line of code :)
(you can also make some small changes through editing the pbf code into the Purebasic IDE :0
DoctorLove
User
User
Posts: 85
Joined: Sat Mar 06, 2010 2:55 pm

Re: Form Designer for Mac/Windows/Linux - beta 4

Post by DoctorLove »

Well,

maybe a good idea is to put in resizing gadgets.
Like for a gadget;

lock_left = true
lock_right = true
Lock_Bottom = False

There are some great examples (cross platform) here on the forum.
Would be great that this will be output together with gui code.

Keep up the good work!
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

Re: Form Designer for Mac/Windows/Linux - beta 4

Post by Polo »

DoctorLove wrote:Well,

maybe a good idea is to put in resizing gadgets.
Like for a gadget;

lock_left = true
lock_right = true
Lock_Bottom = False

There are some great examples (cross platform) here on the forum.
Would be great that this will be output together with gui code.

Keep up the good work!
You mean so that window resizing is done according to these parameters? If yes I've planned to add some kind of feature like that, but not right now :)
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

Re: Form Designer for Mac/Windows/Linux - beta 4

Post by Polo »

Beta 6 is up!
http://www.gdpcomputing.co.uk/formdesigner.html

This showcase the (very early) file format. I included a dirty example I've used for testing. Feel free to test the save/open functions :)
ATM you should not add any code yourself to the pbf file as it might get ignored when opening it in Form Designer.
If modifying you should not use Procedures at all in the parameters. All format recommendations will be included as comments in the final file format!
Currently custom gadgets won't be opened (but should be saved). All event handling code is ignored when opened.
There might be plenty of bugs in my code parser!

Next on the list: event handling!
luciano
Enthusiast
Enthusiast
Posts: 151
Joined: Wed Mar 09, 2011 8:25 pm

Re: Form Designer for Mac/Windows/Linux - beta 6

Post by luciano »

I have tested it for a while, very good.
Form Designer is progressing really quickly!
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

Re: Form Designer for Mac/Windows/Linux - beta 6

Post by Polo »

luciano wrote:I have tested it for a while, very good.
Form Designer is progressing really quickly!
Thanks! I can't wait to have the event handling working, this will ease a lot developing new software :)
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: Form Designer for Mac/Windows/Linux - beta 6

Post by srod »

Wow, beta 6. You're really going 'hammer-and-tongs' at this Polo! :)
I may look like a mule, but I'm not a complete ass.
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

Re: Form Designer for Mac/Windows/Linux - beta 6

Post by Polo »

srod wrote:Wow, beta 6. You're really going 'hammer-and-tongs' at this Polo! :)
:lol: I'm trying ;)
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

Re: Form Designer for Mac/Windows/Linux - beta 6

Post by Polo »

Haven't started on event handling yet, though I added full gadget/window color support to the drawing area, so it's closer to a WYSIWYG as possible. Will be available on the next beta!
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

Re: Form Designer for Mac/Windows/Linux - beta 6

Post by Polo »

Beta 7 is up!
http://www.gdpcomputing.co.uk/formdesigner.html

I changed the file hosting so hopefully the download should be less paintful.

Major change in the way the file format works: one pbf file will now store one window. Opening file containing more than one window can lead to problems so I suggest you do not try ;)
I removed the Code Viewer, instead there's a switch between Design View and Code View, so that you can see the code for all opened windows. The Tab bar now works much like the PB IDE, one tab = one pbf file.

The generated code has now a procedure which will be used to store the events when they are actually implemented in the Form Designer. The Repeat loop will probably be deleted in the coming versions.

As said before, full colouring (not fonts) should be visible in the drawing area, let me know if something's missing.

The project's source code is now on Fred's SVN, if no bugs are found on this beta, it should make the PB 4.70 release.
Version 4.80 should include event handling :)
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3942
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: Form Designer for Mac/Windows/Linux - beta 6

Post by wilbert »

Polo wrote:if no bugs are found on this beta, it should make the PB 4.70 release.
Version 4.80 should include event handling :)
:D

Any new on the OS X version ?
Will it also be ready in time for 4.70 ?
:?:
Post Reply