SweetyVD (Visual Designer)

Share your advanced PureBasic knowledge/code with the community.
User avatar
ChrisR
Addict
Addict
Posts: 1127
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: SweetyVD (Visual Designer)

Post by ChrisR »

I have updated SweetyVD.
The model was revised to manage both real gadgets in designer (as before) and now also internal draw gadgets.
- Containers (Container, Panel, ScrollArea) and the Frame Gadget are now drawn to avoid overlay problems.
Without the overlap concern, containers management (Parents / Children) with displacements grouped, may be envisaged. And, if needed, other gadgets can be drawn later.

The Drawing area is now a canvas container, so PB 5.60 is required.

Gadget Templates are now loaded from a customizable JSON file.
- If SweetyVD.JSON does not exist in current directory, it is automatically created from internal templates, for a next customization.
- Stargâte's TabBarGadget.pbi Is included by default in SweetyVD http://www.unionbytes.de/includes/tabbargadget/
- A start to add custom gadgets, by adding the gadget template to the JSON file above. The type must be 50. There is an OnOffButton custom gadget example in SweetyVD github CustomGadget_Example folder

Thanks for your feedback, tests
:)
User avatar
blueb
Addict
Addict
Posts: 1041
Joined: Sat Apr 26, 2003 2:15 pm
Location: Cuernavaca, Mexico

Re: SweetyVD (Visual Designer)

Post by blueb »

The Drawing area is now a canvas container, so PB 5.60 is required.
Need to clarify... VD won't start with 5.60(x86)... only x64.

Started SweetyVD and placed a button on blank screen gives an error....

Code: Select all

Procedure Open_Window_0(X = 0, Y = 0, Width = 600, Height = 500)
  If OpenWindow(#Window_0, X, Y, Width, Height, "Window_0", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_SizeGadget | #PB_Window_ScreenCentered)
    (#Button_1, 330, 350, 100, 20, "Button_1")  ; <<<<<<<<<<<<<<<<<<<<<<<<< error
  EndIf
EndProcedure
Also it would be a nice addition to use a preference file that remembered your "last used" settings:
- SweetVD screen size (I have a 3840 X 2160 monitor) and have to constantly change settings
- Generated window size (e.g. I prefer 1024 X 768)
- drag space
- grid size
etc.

Even if the user had to modify the generated 'Preference file' manually, that would be acceptable.

Thanks in advance
--blueb
- It was too lonely at the top.

System : PB 6.10 Beta 9 (x64) and Win Pro 11 (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem
User avatar
ChrisR
Addict
Addict
Posts: 1127
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: SweetyVD (Visual Designer)

Post by ChrisR »

blueb wrote:Need to clarify... VD won't start with 5.60(x86)... only x64.
I just tested with PB IDE and x86 compiler, it looks good here
I don't understand what's wrong for you.
blueb wrote:Started SweetyVD and placed a button on blank screen gives an error....
Indeed, I need to add a control to create the gadget only if the cursor is in the drawing area.
I'll look now.
blueb wrote:Also it would be a nice addition to use a preference file that remembered your "last used" settings
Yep, It will be in the next update, maybe you or others have a code allready done to save at least the position and size of the window in a pref (ini) file, with the loading then.
User avatar
blueb
Addict
Addict
Posts: 1041
Joined: Sat Apr 26, 2003 2:15 pm
Location: Cuernavaca, Mexico

Re: SweetyVD (Visual Designer)

Post by blueb »

I don't understand what's wrong for you.
Just found it... apparently the compiler flag was set for x64. I removed it and all is well. :)

I'll look and see if I have a suitable Preference starter file.
- It was too lonely at the top.

System : PB 6.10 Beta 9 (x64) and Win Pro 11 (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem
User avatar
ChrisR
Addict
Addict
Posts: 1127
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: SweetyVD (Visual Designer)

Post by ChrisR »

blueb wrote:Started SweetyVD and placed a button on blank screen gives an error....
It's fixed now, minor change in line 1529

Code: Select all

Case #PB_Event_GadgetDrop
  If EventGadget() = #ScrollDrawArea
==>

Code: Select all

Case #PB_Event_GadgetDrop
  If EventGadget() = #ScrollDrawArea And ClickHoverDrawArea() = #True
User avatar
blueb
Addict
Addict
Posts: 1041
Joined: Sat Apr 26, 2003 2:15 pm
Location: Cuernavaca, Mexico

Re: SweetyVD (Visual Designer)

Post by blueb »

Nope... just changed the code to your suggestion.

The generated code error remains the same... sorry. :(
- It was too lonely at the top.

System : PB 6.10 Beta 9 (x64) and Win Pro 11 (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem
User avatar
ChrisR
Addict
Addict
Posts: 1127
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: SweetyVD (Visual Designer)

Post by ChrisR »

Don't be sorry, it is good to fix bugs I did not see :wink:

Got it, in Line 1008 change

Code: Select all

For J=1 To ArraySize(ModelGadget()) 
==>

Code: Select all

For J=0 To ArraySize(ModelGadget())
I did not see it first because in my JSON file, OpenWindow (Type=0) was at the beginning => ModelGadget() array element 0.

However, the previous modification is not really useful, you can go back. I answered too quickly.
When Draging a gadget on blank screen, it is automatically moved into the drawing area, no worry on that.
User avatar
blueb
Addict
Addict
Posts: 1041
Joined: Sat Apr 26, 2003 2:15 pm
Location: Cuernavaca, Mexico

Re: SweetyVD (Visual Designer)

Post by blueb »

Chris,
Sent you a PM concerning sample preference file. :D
- It was too lonely at the top.

System : PB 6.10 Beta 9 (x64) and Win Pro 11 (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem
User avatar
ChrisR
Addict
Addict
Posts: 1127
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: SweetyVD (Visual Designer)

Post by ChrisR »

Thanks Bob,
I have not yet played with the preferences files.
It seems roughly the same as ini files but with suitable PB functions.
It's a 3 day WE, here in France, Labar day.
I'll look as soon as I have some free time to make good use of it.
Little_man
Enthusiast
Enthusiast
Posts: 143
Joined: Fri Mar 29, 2013 4:55 pm
Location: The Netherland

Re: SweetyVD (Visual Designer)

Post by Little_man »

Have you tried your program;

If I use a ButtonGadget and drag it to the window, click somewhere in the window, then click on the Buttongadget, the buttongadget disappears.

The same with:
- OptionGadget.
- ImageGadget.
- ButtonImageGadget.
Etc.

Little_man.
User avatar
blueb
Addict
Addict
Posts: 1041
Joined: Sat Apr 26, 2003 2:15 pm
Location: Cuernavaca, Mexico

Re: SweetyVD (Visual Designer)

Post by blueb »

Not seeing it here.

I'm using PB 5.60 x64 on Win10 Pro.
- It was too lonely at the top.

System : PB 6.10 Beta 9 (x64) and Win Pro 11 (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem
User avatar
ChrisR
Addict
Addict
Posts: 1127
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: SweetyVD (Visual Designer)

Post by ChrisR »

Little_man wrote:Have you tried your program;
No, I always publish without testing, it's so funny, lol :lol:

Seriously, no worries here either.
It is tested here with PB 5.60 x86/x64 in Win10 x64 but also tested in VMware: ubuntu 16.04 64-bits and Windows XP.
I do not understand how you have that, is your button is displayed above another gadget, in overlay ? what is your environment ?
User avatar
Lord
Addict
Addict
Posts: 847
Joined: Tue May 26, 2009 2:11 pm

Re: SweetyVD (Visual Designer)

Post by Lord »

ChrisR wrote:
Little_man wrote:Have you tried your program;
No, I always publish without testing, it's so funny, lol :lol:
...
He's going the Microsoft way. :wink: :D
Image
User avatar
ChrisR
Addict
Addict
Posts: 1127
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: SweetyVD (Visual Designer)

Post by ChrisR »

:D
Yep, the best way for me, I do not have 1/100th of Steve Jobs's marketing skills :)
Little_man
Enthusiast
Enthusiast
Posts: 143
Joined: Fri Mar 29, 2013 4:55 pm
Location: The Netherland

Re: SweetyVD (Visual Designer)

Post by Little_man »

Problem solved

Removed and reinstalled purebasic 5.60.

Little_man
Last edited by Little_man on Tue May 02, 2017 1:13 pm, edited 1 time in total.
Post Reply