Page 6 of 45

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

Posted: Sat Aug 18, 2012 3:16 pm
by Polo
jesperbrannmark wrote:If I make a Frame3D-gadget, usually this is to then later make buttons, strings and other gadgets in this - but if i have a big frame3dgadget it will only select that instead of insert a new one.
Fixed for next beta.

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

Posted: Sat Aug 18, 2012 3:47 pm
by Perkin
Using it on XP so may be different on Vista/Win7+, resizing the main window causes really bad flashing/redrawing.

If using ScintillaGadget, could you also create the InitScintilla() prerequisite , I believe it's now available crossplatform (as dummy function) so isn't now OS dependent.

Works nicely so far, more testing when I can.

Very good work.

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

Posted: Sat Aug 18, 2012 4:02 pm
by luciano
Hi Polo,
I made some tests with latest beta regarding trackbar and I noticed that I could not fix a maximum value; it happens that the minimum value becomes the max and the min reverts to 0 when you select other gadgets before returning to the original object. (e.g. min=3 max=20, reverts to min=0 max=3)

Note that making different copies of the same object causes a repetion of the same name:

Code: Select all

Enumeration
  #Window_0
EndEnumeration

Enumeration
  #TrackBar_0
  #TrackBar_0_Copy
  #TrackBar_0_Copy
EndEnumeration

Procedure InitWindow_0()
  OpenWindow(#Window_0, 0, 0, 600, 400, "", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_SizeGadget | #PB_Window_TitleBar)
  TrackBarGadget(#TrackBar_0, 70, 20, 40, 120, 0, 5, #PB_TrackBar_Ticks | #PB_TrackBar_Vertical)
  TrackBarGadget(#TrackBar_0_Copy, 110, 20, 40, 120, 0, 3, #PB_TrackBar_Ticks | #PB_TrackBar_Vertical)
  TrackBarGadget(#TrackBar_0_Copy, 150, 20, 40, 120, 0, 1, #PB_TrackBar_Ticks | #PB_TrackBar_Vertical)
EndProcedure

InitWindow_0()

Repeat
  event = WaitWindowEvent()
  
  Select event
    Case #PB_Event_Gadget
      Select EventGadget()
        Case #TrackBar_0
          
        Case #TrackBar_0_Copy
          
        Case #TrackBar_0_Copy
          
      EndSelect
    Case #PB_Event_CloseWindow
      Select EventWindow()
        Case #Window_0
          CloseWindow(#Window_0)
      EndSelect
  EndSelect
  
Until event = #PB_Event_CloseWindow
End

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

Posted: Sat Aug 18, 2012 4:21 pm
by luciano
jesperbrannmark wrote: A dream would be to be able to type code here straight away - so like if i create a button i can just rightclick - go to code and then start typing.
Good idea, if we could type some code directly, we might use OS-dependent styles (e.g. #TBS_LEFT or #TBS_BOTH) and as I did for the trackbar in the following modified code:

Code: Select all

Enumeration
  #Window_0
EndEnumeration

Enumeration
  #TrackBar_0
  #TrackBar_0_Copy
  #TrackBar_0_Copy1
EndEnumeration

Procedure InitWindow_0()
  OpenWindow(#Window_0, 0, 0, 600, 400, "", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_SizeGadget | #PB_Window_TitleBar)
  TrackBarGadget(#TrackBar_0, 70, 20, 40, 120, 0, 5, #PB_TrackBar_Ticks | #PB_TrackBar_Vertical|   #TBS_LEFT    )
  TrackBarGadget(#TrackBar_0_Copy, 110, 20, 40, 120, 0, 3, #PB_TrackBar_Ticks | #PB_TrackBar_Vertical|  #TBS_BOTH   )
  TrackBarGadget(#TrackBar_0_Copy1, 150, 20, 40, 120, 0, 1, #PB_TrackBar_Ticks | #PB_TrackBar_Vertical)
EndProcedure

InitWindow_0()

Repeat
  event = WaitWindowEvent()
  
  Select event
    Case #PB_Event_Gadget
      Select EventGadget()
        Case #TrackBar_0
          
        Case #TrackBar_0_Copy
          
        Case #TrackBar_0_Copy1
          
      EndSelect
    Case #PB_Event_CloseWindow
      Select EventWindow()
        Case #Window_0
          CloseWindow(#Window_0)
      EndSelect
  EndSelect
  
Until event = #PB_Event_CloseWindow
End

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

Posted: Sat Aug 18, 2012 4:47 pm
by jesperbrannmark
A dream would be to be able to type code here straight away - so like if i create a button i can just rightclick - go to code and then start typing.
Really I was picturing in my head that this is what the Purebasic editor could look like in future versions - with a visual editor seamless integrated.

I know PB is much bigger than making gadget-based applications, and I wouldn't want to reduce PB to just being a(nother) gadget-based developing tool/language. But actually using a .pbf or something similar, being able to include them and have simple(r) commands to control windows and gadgets would be really really nice. (this is something for feature request for pb in general, rather than Gaetan's Form Designer)

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

Posted: Sat Aug 18, 2012 5:06 pm
by luciano
jesperbrannmark wrote:
(this is something for feature request for pb in general, rather than Gaetan's Form Designer)
You are right, it would be the best solution, but I believe a bit too difficult to implement.
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

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

Posted: Sat Aug 18, 2012 5:40 pm
by Polo
All reported bugs fixed on beta 5:
http://www.gdpcomputing.co.uk/formdesigner.html

Please note that you won't be able to load old projects with this new beta. As we're still in beta stage the file format will change probably often, when the first "stable" version is released I'll keep compatibility with old projects, of course ;)

Please do test images as I recoded everything image related, in order to add an image manager. At the moment it will keep old images even if you don't use them anymore, I'll add a check later.

I've read your suggestions, I'm still thinking of it! :)

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

Posted: Sat Aug 18, 2012 6:02 pm
by luciano
Nice job really,
I tested with different images, copies, etc. and it all worked ok.
I suggest that the size of the image gadget self-adapts to picture size, it would be easier to visually align images.

by the way, I realized that window properties as minimize, maximize or sizegadget are not stored.

I will play again with the application when I come back home in the evening.

Luciano

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

Posted: Sat Aug 18, 2012 6:28 pm
by Polo
Polo wrote:I suggest that the size of the image gadget self-adapts to picture size, it would be easier to visually align images.
Yes I can do that!
luciano wrote:by the way, I realized that window properties as minimize, maximize or sizegadget are not stored.
Haven't really tried on Windows, but they are stored on the Mac. I store the flags in one single integer value, maybe the flags are not correctly defined on PB Windows?

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

Posted: Sat Aug 18, 2012 10:06 pm
by Polo
After a quick chat with Fred, we thought it'd be cool just to save the forms as a Purebasic code, and then parse it again to open it.
That means quite a lot of work, but then you can include the form directly into your project, plus make some small modifications without opening Form Designer.

I'm gonna see how far I can go with this, now I have quite some work to do :mrgreen:

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

Posted: Sat Aug 18, 2012 10:10 pm
by Fred
Polo wrote:
Polo wrote:I suggest that the size of the image gadget self-adapts to picture size, it would be easier to visually align images.
Yes I can do that!
luciano wrote:by the way, I realized that window properties as minimize, maximize or sizegadget are not stored.
Haven't really tried on Windows, but they are stored on the Mac. I store the flags in one single integer value, maybe the flags are not correctly defined on PB Windows?
The flags value can differ from one OS to another

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

Posted: Sat Aug 18, 2012 10:24 pm
by Polo
Fred wrote:The flags value can differ from one OS to another
I know, though it should be "safe" to store the flags like

flags.i = #PB_one | #PB_two

on one OS and expect to retrieve them with

if flags & #PB_one

?

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

Posted: Sat Aug 18, 2012 10:50 pm
by Josh
Polo, wouldn't be better, to create really windows and really gadgets instead painting on a canvasgadget? In this case, all properties would be shown correctly and you havn't problems with different os.

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

Posted: Sat Aug 18, 2012 11:00 pm
by Polo
Josh wrote:Polo, wouldn't be better, to create really windows and really gadgets instead painting on a canvasgadget? In this case, all properties would be shown correctly and you havn't problems with different os.
Basically, no. How would you resize them? select them? Move them? Have them inside one window so it looks cleaner?
The old visual editor used (I guess) real gadgets with a lot of API calls.
Using a canvas means everything is cross platform. In the end, I'll show up all properties in the drawing area, it's just a matter of doing it really ;)

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

Posted: Sat Aug 18, 2012 11:19 pm
by luciano
I know, though it should be "safe" to store the flags like

flags.i = #PB_one | #PB_two

on one OS and expect to retrieve them with

if flags & #PB_one
Gaetan,
I think it's not right since flags ar not "round" binary numbers (i.e. just one "1" and all other figures as "0"'s), but they have more "1"'s.
You can OR them (flags.i = #PB_one | #PB_two) , but you cannot get them back (if flags & #PB_one) ; test this code:

Code: Select all

Debug Bin(#PB_Window_MinimizeGadget)
Debug Bin(#PB_Window_TitleBar)
Debug Bin( #PB_Window_SizeGadget)
Debug Bin( #PB_Window_MaximizeGadget)
Debug Bin(#PB_Window_SystemMenu)
Luciano