Page 1 of 45

Form Designer 5.10

Posted: Fri Aug 03, 2012 10:21 pm
by Polo
A free Form Designer for Purebasic Mac, Windows and Linux.
The Form Designer is now integrated in the Purebasic IDE, please use this forum section to request features or ask questions regarding the designer, and report bugs in the appropriate OS sub forum.

Latest version available in the Purebasic package:

Make a donation to support the development:

http://www.gdpcomputing.co.uk/formdesigner.html

Re: Form Designer for Mac - Coming soon!

Posted: Fri Aug 03, 2012 10:35 pm
by J. Baker
Looks great so far! ;)

Re: Form Designer for Mac - Coming soon!

Posted: Sat Aug 04, 2012 12:05 am
by Lost
Nice!

Re: Form Designer for Mac - Coming soon!

Posted: Sat Aug 04, 2012 12:54 am
by Bisonte
Do you thinkin about convert it to Linux and Windows as well ?

The screenshots looks very good...

Re: Form Designer for Mac - Coming soon!

Posted: Sat Aug 04, 2012 5:07 am
by Fangbeast
Looks good.

Re: Form Designer for Mac - Coming soon!

Posted: Sat Aug 04, 2012 8:09 am
by jesperbrannmark
Oh. I give my right arm for that.
Wishlist:
* Separate list with all gadgets so I can drag-and-drop to change Z-order.
* Ability to link in custom gadgets (like your spreadsheetgadget (wrong name, but you know what i mean), texteditorgadget, my calendargadget etc).
* As in Gfa32 (or vb) ability to have a list of possible triggers (like button.lbuttondown) and a doubleclick brings that up in the code editor (I would also give my left arm for this). (so a direct connection with code editor and visual/form designer, could have them on separate screens and work so efficient)
* Inline / include images for both things like buttons, imagegadgets but also for the window background itself.
* Ability to edit text on the buttons/gadgets in multiple languages in the same editor.

I also see some special things like the scaling and stuff at the bottom of the windows, this is cocoa specific code? Looks very very nice!

I dont mean to give you a :evil: feeling with the wishlist, love your work so far and if you are looking for betas... you know where to find me.

Re: Form Designer for Mac - Coming soon!

Posted: Sat Aug 04, 2012 10:16 am
by Polo
Thanks for the comments!

Thanks for the suggestions Jesper, for ImageGadget and Button Image there's already an image selector, not for background window as it requires 2DDrawing I think, and I'm not sure WindowOutput is supported on OSX.
I'll have a look at what can be done for the other suggestions :)
jesperbrannmark wrote:I also see some special things like the scaling and stuff at the bottom of the windows, this is cocoa specific code? Looks very very nice!
No, all the windows/menu/etc editing is actually just a Canvas :oops:
Bisonte wrote:Do you thinkin about convert it to Linux and Windows as well ?
It should work on Windows straight out the box as I do not use any API, but would have the OSX look on the editing part.

I use my grid gadget and textedit gadget for the code viewer, which is Windows/Mac compatible too.
Might work on Linux too, no idea ;)

Re: Form Designer for Mac - Coming soon!

Posted: Sat Aug 04, 2012 12:29 pm
by jamirokwai
Wow, Looks great!

Re: Form Designer for Mac - Coming soon!

Posted: Sat Aug 04, 2012 12:47 pm
by Polo
jesperbrannmark wrote:* Separate list with all gadgets so I can drag-and-drop to change Z-order.
Added (not drag and drop though). The program checks for consistency with parent gadgets as well, and move the the children items with the parent.

Image

Re: Form Designer for Mac - Coming soon!

Posted: Sat Aug 04, 2012 3:26 pm
by Polo
jesperbrannmark wrote: * Ability to link in custom gadgets (like your spreadsheetgadget (wrong name, but you know what i mean), texteditorgadget, my calendargadget etc).
Added that as well. You basically create a template with init code and creation code in the preference panel, then use it as a custom gadget in the editor.

I'm not sure I'll add multi language ability as there's too many ways to do handle multiple languages in an app.

For event handling the code viewer doesn't generate anything but WaitWindowEvent().
What exactly would you like to have? Just a mean to set the procedure to be called when an event is fired?

Re: Form Designer for Mac - Coming soon!

Posted: Sat Aug 04, 2012 5:38 pm
by jesperbrannmark
Oh, this month seem like x-mas. New cocoa version and now this.
Added that as well. You basically create a template with init code and creation code in the preference panel, then use it as a custom gadget in the editor.
Super duper, love to hear that.
I'm not sure I'll add multi language ability as there's too many ways to do handle multiple languages in an app.
When I handle this myself, I use a csv file. Fist column is name, then comes all the languages. I load everything in to a map and then use it like:

Code: Select all

TextGadget(#gadget,0,0,100,24,language("Please_click_here"))
I found it to be a good way because you are not reffering to a number (like a array), which means you in that case need to look in several different places + if you accidently move stuff down a line in the array it becomes XXX'ed up.

Code: Select all

For event handling the code viewer doesn't generate anything but WaitWindowEvent().
What exactly would you like to have? Just a mean to set the procedure to be called when an event is fired?
I basicly use the same code for my main loop all the time:

Code: Select all

IncludeFile "define.pb" ;All enumurations, inits etc
IncludeFile "eventhandler.pb" ;-all handle_XXX()
Global EventID, EventGadget, EventWindow,EventType,EventMenu
;Main loop
Repeat
  EventID = WaitWindowEvent(50)
  EventGadget=EventGadget()
  EventWindow=EventWindow()
  EventType=EventType()
  EventMenu=EventMenu()
  Select EventWindow
    Case #login_window
      handle_login_window()
    Case #logout_window
      handle_logout_window()
    Case #main_window
      handle_main_window()
  EndSelect
  CompilerIf #PB_Compiler_OS=#PB_OS_MacOS
    If EventMenu=#PB_Menu_Quit
      CloseWindow(#main_window)
    EndIf
  CompilerEndIf
Until Not IsWindow(#main_window)
So in my define.pb I have all my enumurations on windows, gadgets etc. On my eventhandler.pb *try* to use something like this

Code: Select all

;Part of eventhandler.pb
Procedure handle_login_window()
  If EventGadget=#login_button1 And EventType=#PB_EventType_LeftClick And EventID=#PB_Event_Gadget
    login_button1_leftclick()
  ElseIf EventGadget=#login_button1 And EventType=#PB_EventType_RightClick And EventID=#PB_Event_Gadget
    login_button1_rightclick()
  ElseIf EventMenu=#login_timer And EventID=#PB_Event_Menu
    login_timer()
  EndIf
EndProcedure
Something like in Gfa32, where if you draw a button and then clicked on the event button1.click this automatically found the "sub button1.click()" in the code editor so you could just straight away start editing what action would happen when doing this.
The Visual Editor of PB I found good to design stuff, but stopped using it and started doing it all by hand, just because it doesnt make me faster when trying to find the actions/events linked to the gadgets.

Re: Form Designer for Mac - Coming soon!

Posted: Sat Aug 04, 2012 5:52 pm
by Polo
Yes, this is one of the way of handling the languages but as there is many it's always easier to add it afterwards I guess.

I see what you mean with the event handler now. I'll se how I can add that without getting it messy :)

Re: Form Designer for Mac - Coming soon!

Posted: Sun Aug 05, 2012 3:42 pm
by jesperbrannmark
Oh. One more thing to wishlist:
* When making a button, or optiongadget, or checkboxgadget - be able to in the caption of that have like "E&xit" (which will make ALT-X or CTRL-X or CMD-X via AddKeyboardShortcut() command a keyboardshortcut for that gadget).

Re: Form Designer for Mac - Coming soon!

Posted: Sun Aug 05, 2012 3:54 pm
by Polo
jesperbrannmark wrote:Oh. One more thing to wishlist:
* When making a button, or optiongadget, or checkboxgadget - be able to in the caption of that have like "E&xit" (which will make ALT-X or CTRL-X or CMD-X via AddKeyboardShortcut() command a keyboardshortcut for that gadget).
Any PB code example on how this would work out? :)

For multi language I think the easiest I could do is to add an option so that the caption is a variable instead of a string. You would put whatever in the caption ie language("my caption") and you handle the language before hand in your code :)
Haven't done it but it sounds like the best solution!

I need to look at the event handling but it seems a lot of work for a project like this, I'll see once it runs on Cocoa :)

Re: Form Designer for Mac - Coming soon!

Posted: Sun Aug 05, 2012 5:07 pm
by wilbert
On OS X multi language is usually done by putting different .strings files into the application bundle.
There's a special function for NSBundle named localizedStringForKey:value:table: to handle localization.
It's a key -> value approach like

"gold" = "goud"
"silver" = "zilver"

The first one is the key, the second one the value. By creating a different file for each language you can support multiple languages.
The thing that comes closest when using PureBasic code only is the Map .

Great work by the way !!! :D
A form designer for Mac 8)