Page 29 of 45

Re: Form Designer 5.00 beta 2.2

Posted: Sun Sep 09, 2012 9:01 pm
by luciano
Hi,
I cannot remove the colors from the gadgets in the following code in FD:

Code: Select all

; Form Designer for Purebasic - 5.0
; Warning: this file uses a strict syntax, if you edit it, make sure to respect the Form Designer limitation or it won't be opened again.

Global Window_0

Global Container_0, Editor_0, ListIcon_0, ScrollArea_0, String_0, Text_0, Tree_0

Declare ResizeGadgetsWindow_0()

Procedure InitWindow_0()
  Protected WindowWidth, WindowHeight
  Window_0 = OpenWindow(#PB_Any, 0, 0, 600, 400, "", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_SizeGadget)
  WindowWidth = WindowWidth(Window_0)
  WindowHeight = WindowHeight(Window_0)
  Container_0 = ContainerGadget(#PB_Any, 0, 0, WindowWidth - 0, 80)
  SetGadgetColor(Container_0, #PB_Gadget_BackColor,RGB(64,128,128))
  CloseGadgetList()
  Editor_0 = EditorGadget(#PB_Any, 20, 100, 90, 70)
  SetGadgetColor(Editor_0, #PB_Gadget_FrontColor,RGB(128,0,128))
  SetGadgetColor(Editor_0, #PB_Gadget_BackColor,RGB(128,128,128))
  ListIcon_0 = ListIconGadget(#PB_Any, 120, 100, 270, 150, "", 100)
  SetGadgetColor(ListIcon_0, #PB_Gadget_FrontColor,RGB(0,0,64))
  SetGadgetColor(ListIcon_0, #PB_Gadget_BackColor,RGB(128,128,64))
  ScrollArea_0 = ScrollAreaGadget(#PB_Any, 420, 110, 150, 190, 350, 390,1)
  SetGadgetColor(ScrollArea_0, #PB_Gadget_FrontColor,RGB(0,0,64))
  SetGadgetColor(ScrollArea_0, #PB_Gadget_BackColor,RGB(64,0,64))
  CloseGadgetList()
  String_0 = StringGadget(#PB_Any, 30, 290, 210, 60, "", #PB_String_BorderLess)
  SetGadgetColor(String_0, #PB_Gadget_FrontColor,RGB(0,128,192))
  SetGadgetColor(String_0, #PB_Gadget_BackColor,RGB(255,128,255))
  Text_0 = TextGadget(#PB_Any, 260, 330, 110, 50, "")
  SetGadgetColor(Text_0, #PB_Gadget_FrontColor,RGB(128,0,64))
  SetGadgetColor(Text_0, #PB_Gadget_BackColor,RGB(128,128,128))
  Tree_0 = TreeGadget(#PB_Any, 410, 320, 150, 70)
  SetGadgetColor(Tree_0, #PB_Gadget_FrontColor,RGB(192,192,192))
  SetGadgetColor(Tree_0, #PB_Gadget_BackColor,RGB(64,128,128))
EndProcedure

Procedure ResizeGadgetsWindow_0()
  Protected WindowWidth, WindowHeight
  WindowWidth = WindowWidth(Window_0)
  WindowHeight = WindowHeight(Window_0)
  ResizeGadget(Container_0, 0, 0, WindowWidth - 0, 80)
  ResizeGadget(Editor_0, 20, 100, 90, 70)
  ResizeGadget(ListIcon_0, 120, 100, 270, 150)
  ResizeGadget(ScrollArea_0, 420, 110, 150, 190)
  ResizeGadget(String_0, 30, 290, 210, 60)
  ResizeGadget(Text_0, 260, 330, 110, 50)
  ResizeGadget(Tree_0, 410, 320, 150, 70)
EndProcedure

Procedure Window_0_Events(event)
  Select event
    Case #PB_Event_Gadget
      Select EventGadget()
      EndSelect
  EndSelect
EndProcedure

Re: Form Designer 5.00 beta 2.2

Posted: Sun Sep 09, 2012 9:14 pm
by Polo
luciano wrote:Hi,
I cannot remove the colors from the gadgets in the following code in FD:
Oops! Fixed :)

Re: Form Designer 5.00 beta 2.2

Posted: Sun Sep 09, 2012 9:36 pm
by Warmonger
Polo wrote:
Warmonger wrote:Also lastly, im not sure if its OS specific but on Windows XP the 3DFrame captions are black (im guessing the background) so you cant even view the text. Example below.
Fixed.

Thanks for all your testing and suggestions. Scrollbars being not live is due to PB Event Handling, might add a workaround.
I've added all you said to my list and will try to see what can be done :)
The scroll bars are disabled and hidden by default until the inner scroll area exceeds beyond the scrollarea gadget. So I wouldn't imagine it to be no more then a 30 second fix. :)

Re: Form Designer 5.00 beta 2.2

Posted: Sun Sep 09, 2012 9:48 pm
by Polo
Warmonger wrote:
Polo wrote:
Warmonger wrote:Also lastly, im not sure if its OS specific but on Windows XP the 3DFrame captions are black (im guessing the background) so you cant even view the text. Example below.
Fixed.

Thanks for all your testing and suggestions. Scrollbars being not live is due to PB Event Handling, might add a workaround.
I've added all you said to my list and will try to see what can be done :)
The scroll bars are disabled and hidden by default until the inner scroll area exceeds beyond the scrollarea gadget. So I wouldn't imagine it to be no more then a 30 second fix. :)
I'm not using a ScrollArea ;)

Added level support to TreeGadget items.

Re: Form Designer 5.00 beta 2.2

Posted: Sun Sep 09, 2012 11:40 pm
by Polo
Here's a new beta (5.00b2.3) as I'll probably won't be able to make a new release next week ;)
http://www.gdpcomputing.co.uk/formdesigner.html

(sorry, I forgot one more time to compile in Unicode on Windows, next time will be the one!)

Re: Form Designer 5.00 beta 2.2

Posted: Mon Sep 10, 2012 3:03 am
by Warmonger
Polo wrote:Here's a new beta (5.00b2.3) as I'll probably won't be able to make a new release next week ;)
http://www.gdpcomputing.co.uk/formdesigner.html

(sorry, I forgot one more time to compile in Unicode on Windows, next time will be the one!)
Bugs,
- When re-sizing the design window larger then the design field, the scroll bars appear then disappear.
- When res-sizing the design window smaller then the design field, the scroll bars disappear but leave a grey mark where they existed (design field needing an update or something).
- When scrolling in the Properties box, the contents do not scroll along with the scroll bar.

Other then that the toolbox could use some more fancy touches to make things a bit more user friendly (visually). After that its only cosmetics like coming up with a re-size gadgets function etc.

Re: Form Designer 5.00 beta 2.3

Posted: Mon Sep 10, 2012 8:21 am
by luciano
Gaetan,
wonderful work
systembar, color problems, etc. all solved.

Listicon Edit with right click is very useful, one problem here; "AddGadgetColumn" puts a negative number and the compiler (windows at least) requires a positive one,
quite strange as "AddGadgetItem" requires a negative one.

replacing the two -1 with 1 and 2 solved it

Code: Select all

  AddGadgetColumn(ListIcon_0, 1, "Column 2", 100)
  AddGadgetColumn(ListIcon_0, 2, "Column 3", 100)
Original code

Code: Select all

; Form Designer for Purebasic - 5.0
; Warning: this file uses a strict syntax, if you edit it, make sure to respect the Form Designer limitation or it won't be opened again.

Global Window_0

Global ListIcon_0

Declare ResizeGadgetsWindow_0()

Procedure InitWindow_0()
  Protected WindowWidth, WindowHeight
  Window_0 = OpenWindow(#PB_Any, 0, 0, 600, 400, "", #PB_Window_SystemMenu)
  WindowWidth = WindowWidth(Window_0)
  WindowHeight = WindowHeight(Window_0)
  ListIcon_0 = ListIconGadget(#PB_Any, 70, 40, 350, 160, "Column 1", 100)

  AddGadgetColumn(ListIcon_0, -1, "Column 2", 100)
  AddGadgetColumn(ListIcon_0, -1, "Column 3", 100)

  AddGadgetItem(ListIcon_0, -1, "T1" + Chr(10) + "T2" + Chr(10) + "T3")
  AddGadgetItem(ListIcon_0, -1, "U1" + Chr(10) + "U2" + Chr(10) + "U3")
EndProcedure

Procedure ResizeGadgetsWindow_0()
  Protected WindowWidth, WindowHeight
  WindowWidth = WindowWidth(Window_0)
  WindowHeight = WindowHeight(Window_0)
  ResizeGadget(ListIcon_0, 70, 40, 350, 160)
EndProcedure

Procedure Window_0_Events(event)
  Select event
    Case #PB_Event_Gadget
      Select EventGadget()
      EndSelect
  EndSelect
EndProcedure

Re: Form Designer 5.00 beta 2.3

Posted: Mon Sep 10, 2012 8:24 am
by falsam
it is possible to draw a gadget without selecting a model.

= #PB_Any, 340, 120, 150, 40)

Code: Select all

Procedure InitWindow_0()
  Protected WindowWidth, WindowHeight
  Window_0 = OpenWindow(#PB_Any, 0, 0, 600, 400, "", #PB_Window_SystemMenu)
  WindowWidth = WindowWidth(Window_0)
  WindowHeight = WindowHeight(Window_0)
   = #PB_Any, 340, 120, 150, 40)
EndProcedure

Re: Form Designer 5.00 beta 2.3

Posted: Mon Sep 10, 2012 9:04 am
by Polo
Falsam - Can you tell the steps to do that?
Thanks for the testing I'll fix those bugs during the week when I'm back home :)

Re: Form Designer 5.00 beta 2.3

Posted: Mon Sep 10, 2012 9:16 am
by falsam
Polo wrote:Falsam - Can you tell the steps to do that?
Yes i can :)

1-Run Form Designer
2-Forgets to select a model gadget.
3-Draw the gadget
4-Say "Ooops !!! , I forgot to select a model"
5-Look at the generated code.

Re: Form Designer 5.00 beta 2.3

Posted: Mon Sep 10, 2012 10:44 am
by Mindphazer
To complete Falsam's answer :
What he describes happens in Windows only (I don't have a linux VM to check)
I don't have this problem on OS X....

Re: Form Designer 5.00 beta 2.3

Posted: Mon Sep 10, 2012 11:19 am
by ts-soft
The generated Enumeration is false!

Code: Select all

Enumeration #PB_Compiler_EnumerationValue ; false
  #Window_0
EndEnumeration

Enumeration #PB_Compiler_EnumerationValue
  #Button_0
EndEnumeration

Debug #Button_0 ; should 0!
Please, remove the #PB_Compiler_EnumerationValue, the enumeration should start for all objects with 0!

I would add a comment like this:

Code: Select all

Enumeration ; Windows
  #Window_0
EndEnumeration

Enumeration ; Gadgets
  #Button_0
EndEnumeration
Greetings - Thomas

Re: Form Designer 5.00 beta 2.3

Posted: Mon Sep 10, 2012 11:31 am
by Polo
Imagine you're including 2 or more .pbf files in your project ;)
The #PB constant had been added for a reason ;)

Re: Form Designer 5.00 beta 2.3

Posted: Mon Sep 10, 2012 2:51 pm
by captain_skank
1st up - this is an awesome piece of work polo.

Is there any intention to include a compile/preview mode ?

Going further would it be possible to allow the user to type in code in the code window - maybe prefix typed in code with a symbol to show it's user added ??

For me, this would make this the 'killer' pb app.

As an aside - is each of the available 'gadgets' a canvas gadget in disguise ?

Re: Form Designer 5.00 beta 2.3

Posted: Mon Sep 10, 2012 3:32 pm
by Polo
The whole thing is one canvas, then everything's drawn onto it.
Live code editing is absolutely possible - though it will be added once it is included in the IDE - not now, thus!
For the same reason preview mode won't be added yet. ;)