SweetyVD (Visual Designer)

Share your advanced PureBasic knowledge/code with the community.
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: SweetyVD (Visual Designer)

Post by JHPJHP »

Hi ChrisR,

I've been following your progress, really great work; with each new update SweetyVD keeps getting better.

A few small things:
1. Insert a TabBar Gadget, switch to Preview mode, click on the gadget
-- I am getting an error at line 2065
2. Change the BackColor of a Window, switch to Preview mode
-- BackColor is not changed
3. Unless there is a reason for it the following setting isn't needed: Compiler--Compiler Options--Use Compiler
-- I need to remove it before the code can be executed

Keep up the great work :!:
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 »

Yes, I've noticed the same things JHPJHP.
(Win10Pro x86 and x64)
- 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 JHPJHP,
I just reproduce for the tabBar gadget resized on preview.
I will correct it, not to write dimensions in the preview mode.
Edit: done

It was wanted for the window background color for the grid color in the designer.
But yes, I will try to get it in the preview mode, perhaps not just right now.

For the Compiler--Compiler Options--Use Compiler,
It is surely better. I will try to think about it to uncheck the option before uploading.
Thanks :)
User avatar
ChrisR
Addict
Addict
Posts: 1127
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: SweetyVD (Visual Designer)

Post by ChrisR »

SweetyVD Update version 1.9.2
Gadget can be selected, moved wherever it is clicked now on Mac OS.
Repaint the gadgets after they have been moved or resized, on Left Click released, to avoid unwanted overlay.
Add an ini file for SweetyVD settings and customizations. The SweetyVD.ini file is created at first launch.
. To note that the drawing area size (OpenWindow) is defined in the Gadget templates. In SweetyVD.json file.

Current SweetyVD.ini
I'm not sure that the CustomAddition section are really useful

Code: Select all

; The size of the drawing area (OpenWindow) is defined in the Gadget templates: SweetyVD.json file
; 
[Designer]
SaveOnExit = 1
Designer_Width = 1000
Designer_Height = 660
Designer_Maximize = 0
ScrollArea_MaxWidth = 1920
ScrollArea_MaxHeight = 1020
Drag_Space = 10
Show_Grid = 1
Grid_Size = 20

[CodeCreate]
Include_TitleBlock = 1
Include_Enumeration = 1
Variable = 0
Include_StatusBar = 0
Include_EventLoop = 1
Include_CustomAddition = 0

[TitleBlock]
; Use FormatDate (%yyyy, %yy, %mm, %dd + Separator) to format the current date, variable: %Date%
; The Key name must start with "Line"
FormatDate = %yyyy-%mm-%dd
Line01 = ; -----------------------------------------------------------------------------
Line02 = ;           Name:
Line03 = ;    Description:
Line04 = ;         Author:
Line05 = ;           Date: %Date%
Line06 = ;        Version:
Line07 = ;     PB-Version:
Line08 = ;             OS:
Line09 = ;         Credit:
Line10 = ;          Forum:
Line11 = ;     Created by: SweetyVD
Line12 = ; -----------------------------------------------------------------------------

[CustomAddition]
; Include a dot "." as first character To include spaces at the beginning of a Line (eg: indentation)
; The Key name must start with "Line"

[CustomAddition_Include]
Line01 = 

[CustomAddition_Constante]
Line01 = 

[CustomAddition_Structure]
Line01 = 

[CustomAddition_Variable]
Line01 = 

[CustomAddition_Declare]
Line01 = 

[CustomAddition_Procedure]
Line01 = 

[CustomAddition_Init]
Line01 = 

[CustomAddition_Main]
Line01 = 

[CustomAddition_Exit]
Line01 = 
User avatar
ChrisR
Addict
Addict
Posts: 1127
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: SweetyVD (Visual Designer)

Post by ChrisR »

JHPJHP wrote: 2. Change the BackColor of a Window, switch to Preview mode
-- BackColor is not changed
Good to have :)
Done for the Preview mode and also with show grid disabled. It is updated on latest release on github v1.9.21
tester
User
User
Posts: 30
Joined: Sun Dec 28, 2014 1:12 pm

Re: SweetyVD (Visual Designer)

Post by tester »

ChrisR wrote:...@tester, thanks however it is is not really required here, for the Popup menu...
Thanks ChrisR, but with your correction

Code: Select all

Case 1 To ArraySize(ModelGadget())   ;Popup menu for creating gadgets
not working adding ButtonGadget via popup menu.
Correct code:

Code: Select all

Case 0 To ArraySize(ModelGadget())   ;Popup menu for creating gadgets
User avatar
ChrisR
Addict
Addict
Posts: 1127
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: SweetyVD (Visual Designer)

Post by ChrisR »

Hi tester
Add Debug EventMenu() in line 1650 after Case 0 To...
and you will see that the 1st element "ButtonGadget" of the popup menu is 1, not 0.

Code: Select all

          Case 0 To ArraySize(ModelGadget())   ;Popup menu for creating gadgets
            Debug EventMenu()
tester
User
User
Posts: 30
Joined: Sun Dec 28, 2014 1:12 pm

Re: SweetyVD (Visual Designer)

Post by tester »

ChrisR wrote:Hi tester
Add Debug EventMenu() in line 1650 after Case 0 To...
and you will see that the 1st element "ButtonGadget" of the popup menu is 1, not 0.

Code: Select all

          Case 0 To ArraySize(ModelGadget())   ;Popup menu for creating gadgets
            Debug EventMenu()
Try running the compiled version and maybe you'll be surprised.
Add ButtonGadget not worked and TabBarGadget disappears from the Popup menu.

Update: Sorry my mistake - the old SweetyVD.json was to blame. :(
User avatar
ChrisR
Addict
Addict
Posts: 1127
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: SweetyVD (Visual Designer)

Post by ChrisR »

No worries, Indeed SweetyVD.json has changed a bit.
It is probably better to delete it and also SweetyVD.ini, before an update. Or save it, in case of personalization.

There is a small fix and update, v1.9.22, to be able to run on Mac OS. Thanks Mindphazer :)
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 »

Hi Chris,

Some projects require the Form to be an odd size, and I sometimes need more than one.
example: 640 x 480 or 1024 x 768

For me, it would be preferable to start SweetyVD with the 'last used' form size, like SweetyVD itself.

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
blueb
Addict
Addict
Posts: 1041
Joined: Sat Apr 26, 2003 2:15 pm
Location: Cuernavaca, Mexico

Re: SweetyVD (Visual Designer)

Post by blueb »

Small wish about colors..

I created a form with a nice 'Minty' color for a Background, a ContainerGadget, and a couple of buttons and placed it in the PB Editor.

When I went to modify the ContainerGadget's background color (I wanted to pick a color using PureBasic's Color Picker Tool),
I found this...
SetWindowColor(#Window_0, 15269864)

I realize that SetWindowColor(#Window_0, 15269864) is: Hex(15269864); $E8FFE8

PureBasic's Color Picker Tool gives use a choice of either..
#1 - Insert Hex number ($E8FFE8)
#2 - Insert RGB (RGB(232, 255, 232))

Could we have SweetyVD place #1 or #2 in the color parameter of all inserted code?

Most "new users" would likely be familar with RGB(232, 255, 232) rather than $E8FFE8, but that's only an opinion.
- 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 »

Hi Blueb,
I also asked myself about the 'last used' form size.
I did not do it in a first time because the dimensions are also defined in the Gadgets models. SweetyVD.json > OpenWindow
With your request in addition, I agree, I will add it, like SweetyVD itself.
User avatar
ChrisR
Addict
Addict
Posts: 1127
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: SweetyVD (Visual Designer)

Post by ChrisR »

About Color, for now it is done simply with ButtonImageGadget and ColorRequester()
To choose the color and draw that color on the 2 buttons for the front and back colors.
Do it like this, allows me to gain some space for the properties and to stay in the simplest way.

In future, I will probably need other properties like values for AddGadgetItem(s), X/Y Scroll position for ScrollareaGadget, Add Tab with active tab for PanelGadget.
If it's possible, I beleive it is better if all the properties can be seen without the need of section (+/-).
Thanks for the proposal, I keep the idea but I'm not sure right now. To see
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: For me, it would be preferable to start SweetyVD with the 'last used' form size, like SweetyVD itself.
Done, UserScreen_Width and Height are save now in SweetyVD.ini. v1.9.23
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:Small wish about colors..
Could we have SweetyVD place #1 or #2 in the color parameter of all inserted code?
Sorry for my misunderstanding blueb :oops:
I added now the color value in RGB or hexadecimal format in the generated code.
With a new setting in SweetyVD.ini: Hexa_Color = 0/1, default value = 0 > RGB
To get this new parameter in the ini file, you must remove the old SweetyVD.ini if it exists.
Updated version 1.9.24
Post Reply