Page 29 of 49

Re: IceDesign GUI designer

Posted: Tue Jan 10, 2023 3:09 am
by ChrisR
I made a small update, to fix an indentation problem I didn't have before, a required line deleted by mistake during last cleanup.

Re: IceDesign GUI designer

Posted: Tue Jan 17, 2023 4:49 pm
by ChrisR
IceDesign has been updated in version 1.8.6
  • Improved gadget selection, it is much faster.
  • Borders taken into account to display really in the center with the options Lock center & middle.
  • Added a Pressed Image property for the ButtonImage Gadget, to define the image displayed when the Button is pressed.
    To be used with the #PB_Button_Toggle constant to create a toggle button.
  • Added a Resize Image option for ButtonImage and ImageGadget to automatically resize images to the size of the Gadgets when they are resized.
  • When resizing, use the Shift key to scale the other side of the gadget.
small demo:

Image

Re: IceDesign GUI designer

Posted: Tue Jan 17, 2023 4:55 pm
by jacdelad
Chris, I bought it too long ago and never used it yet. Shame on me...I'm really planning on using it.

There's one thing that always bugs me with every dialog designer (or I just never found that feature): Using a buttonimage/image... I need an image, obviously. None of the editors is able to include this image as DataSection into the code. Is this possible with your designer? Or maybe a really bad idea?

Also, using dialogues for most of my projects now I really appreciate them. This would be extraordinary great, if you had such a functionality. But I guess this would require a complete new designer...

Re: IceDesign GUI designer

Posted: Tue Jan 17, 2023 5:25 pm
by ChrisR
Hi jacdelad,

The option to load an image from the DataSection is already here at the bottom of the settings.

Image

With the following generated code (Not with Bin2Data):

Code: Select all

CatchImage(#Imag_0, ?Imag_0)

DataSection
  Imag_0: : IncludeBinary "D:\Users\ChrisR\Pictures\PureBasic.bmp"
EndDataSection

#
For the Dialogs library, DialogDesign0R is a very good tool, I will certainly not compete with HeX0R and it would be too much work :wink:
But hey, with all the lock options and the proportional resizing options, IceDesign handles resizing just as well.
And the classic interfaces are in my opinion easier to use but of course, it's a question of taste or habits :)

Re: IceDesign GUI designer

Posted: Tue Jan 17, 2023 5:40 pm
by jacdelad
ChrisR wrote: Tue Jan 17, 2023 5:25 pm Hi jacdelad,

The option to load an image from the DataSection is already here at the bottom of the settings.

Image

With the following generated code (Not with Bin2Data):

Code: Select all

CatchImage(#Imag_0, ?Imag_0)

DataSection
  Imag_0: : IncludeBinary "D:\Users\ChrisR\Pictures\PureBasic.bmp"
EndDataSection
Now, that's what I wanted to hear! I will try it out as soon as possible! Thx!

Re: IceDesign GUI designer

Posted: Tue Jan 17, 2023 6:09 pm
by ShadowStorm
DialogDesign0R ??? :?

Re: IceDesign GUI designer

Posted: Tue Jan 17, 2023 6:38 pm
by ChrisR
It is pinned in the Applications - Feedback and Discussion section. A very nice free tool for the Dialogs library.
Maybe one day Fred will also Pin my tool (no jealousy at all) :wink:
I think they are good complements to PureBasic, Pureform, not as competition but as additional tools, as a showcase :)

Re: IceDesign GUI designer

Posted: Wed Jan 18, 2023 12:46 pm
by ChrisR
I redid a series of tests this morning and in the latest version there is a regression bug. It is fixed now and it is online. Sorry for those who have already downloaded :oops:

Re: IceDesign GUI designer

Posted: Wed Jan 18, 2023 7:09 pm
by Caronte3D
ChrisR, the proportional positión "Prop X" and "Prop Y" is calculated from the upper left corner of the gadgets, so the more you scale the container, more displaced the empty space at the end of the parent container :?

I don't have time to search for an example code, but could be somethig like:
Use the gadget position + half the size of the gadget for calculations, then subtract that half size to get the x and y

https://drive.google.com/file/d/1nyfM-S ... PH3Wu/view

Thanks!

Re: IceDesign GUI designer

Posted: Thu Jan 19, 2023 11:47 am
by ChrisR
I think you are right Caronte3D, it is better indeed if the proportionality is done on the center of the Gadgets, in this case.
But it also means that it would be managed in two different ways depending on whether the Proportional Width (and/or Height) option is enabled or not.

Proportional X would give :
- With Proportional Width . . : X = ScaleX * InitX
- Without Proportional Width : X= ScaleX * (InitX + InitWidth/2) - InitWidth/2

It would give a code like this, if it suits you ?

Code: Select all

EnableExplicit

Enumeration Window
  #Window_0
EndEnumeration

Enumeration Gadgets
  #Cont_1
  #Btn_Prop_X_1
  #Btn_Prop_X_2
  #Btn_Prop_X_3
  #Btn_Prop_X_Width_1
  #Btn_Prop_X_Width_2
  #Btn_Prop_X_Width_3
EndEnumeration

Declare Resize_Window_0()
Declare Open_Window_0(X = 0, Y = 0, Width = 600, Height = 260)

Procedure Resize_Window_0()
  Protected ScaleX.f, ScaleY.f, Width, Height
  Static Window_0_WidthIni, Window_0_HeightIni
  Static Cont_1_WidthIni, Cont_1_HeightIni
  If Window_0_WidthIni = 0
    Window_0_WidthIni = WindowWidth(#Window_0) : Window_0_HeightIni = WindowHeight(#Window_0)
    Cont_1_WidthIni = GadgetWidth(#Cont_1) : Cont_1_HeightIni = GadgetHeight(#Cont_1)
  EndIf

  ScaleX = WindowWidth(#Window_0) / Window_0_WidthIni : ScaleY = WindowHeight(#Window_0) / Window_0_HeightIni
  Width = ScaleX * (Window_0_WidthIni - 40) : Height = ScaleY * (Window_0_HeightIni - 40)
  ResizeGadget(#Cont_1, ScaleX * 20, ScaleY * 20, Width, Height)
  
  ScaleX = GadgetWidth(#Cont_1) / Cont_1_WidthIni : ScaleY = GadgetHeight(#Cont_1) / Cont_1_HeightIni
  ResizeGadget(#Btn_Prop_X_1, ScaleX * (20 +  80) - 80, ScaleY * (20 + 40) - 40, 160, 80)
  ResizeGadget(#Btn_Prop_X_2, ScaleX * (200 + 80) - 80, ScaleY * (20 + 40) - 40, 160, 80)
  ResizeGadget(#Btn_Prop_X_3, ScaleX * (380 + 80) - 80, ScaleY * (20 + 40) - 40, 160, 80)
  
  Width = ScaleX * (Cont_1_WidthIni - 400) : Height = ScaleY * (Cont_1_HeightIni - 140)
  ResizeGadget(#Btn_Prop_X_Width_1, ScaleX * 20, ScaleY * 120, Width, Height)
  Width = ScaleX * (Cont_1_WidthIni - 400) : Height = ScaleY * (Cont_1_HeightIni - 140)
  ResizeGadget(#Btn_Prop_X_Width_2, ScaleX * 200, ScaleY * 120, Width, Height)
  Width = ScaleX * (Cont_1_WidthIni - 400) : Height = ScaleY * (Cont_1_HeightIni - 140)
  ResizeGadget(#Btn_Prop_X_Width_3, ScaleX * 380, ScaleY * 120, Width, Height)
EndProcedure

Procedure Open_Window_0(X = 0, Y = 0, Width = 600, Height = 260)
  If OpenWindow(#Window_0, X, Y, Width, Height, "Title", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_SizeGadget | #PB_Window_ScreenCentered)
    ContainerGadget(#Cont_1, 20, 20, 560, 220, #PB_Container_Flat)
      ButtonGadget(#Btn_Prop_X_1, 20, 20, 160, 80, "Prop_X_1")
      ButtonGadget(#Btn_Prop_X_2, 200, 20, 160, 80, "Prop_X_2")
      ButtonGadget(#Btn_Prop_X_3, 380, 20, 160, 80, "Prop_X_3")
      ButtonGadget(#Btn_Prop_X_Width_1, 20, 120, 160, 80, "Prop_X_Width_1")
      ButtonGadget(#Btn_Prop_X_Width_2, 200, 120, 160, 80, "Prop_X_Width_2")
      ButtonGadget(#Btn_Prop_X_Width_3, 380, 120, 160, 80, "Prop_X_Width_3")
    CloseGadgetList()   ; #Cont_1

    BindEvent(#PB_Event_SizeWindow, @Resize_Window_0(), #Window_0)
    PostEvent(#PB_Event_SizeWindow, #Window_0, 0)
  EndIf
EndProcedure

Open_Window_0()

Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow

Re: IceDesign GUI designer

Posted: Thu Jan 19, 2023 1:03 pm
by Caronte3D
Thi's perfect! 😍

Re: IceDesign GUI designer

Posted: Thu Jan 19, 2023 6:19 pm
by ChrisR
IceDesign has been updated in version 1.8.7
  • New option in the settings: Maxi Design in 4K (3840x2160)
    The maximum Design size will be 4K (3840x2160) vs 2K (2560x1440) by default which is lighter in memory and faster. It was in 3840x2160 currently.
    Here with 10 Containers, opened then closed, it uses ~ 160 Mb in memory in 2k against ~300 Mb in 4k
    For info, the drawing areas of the closed containers are drawn at the maximum size in order to be able to enlarge it while keeping the grid.
  • To improve the proportional rendering, the X (and/or Y) position is now based on the center of the Gadgets if the Proportional Width option (and/or Height) is disabled (X= ScaleX * (InitX + InitWidth/2) - InitWidth/2)
    No change if Proportional Width is enabled, the X position is based on the initial X position (X = ScaleX * InitX)

Re: IceDesign GUI designer

Posted: Thu Jan 19, 2023 11:20 pm
by Cruster
Fantastic job! You're the man :-)

Re: IceDesign GUI designer

Posted: Fri Jan 20, 2023 1:50 am
by ChrisR
Thanks Cruster, I really appreciate it :)
I have some free time right now so I'm trying to move on.
It will be more complicated soon, in March. I leave for 6 months with my wife for a tour of Europe in a camper van 8)
So report any bugs now, if you see any, it will be more difficult later.

About bug, I just saw that I broke in v1.8.6, the auto-scroll feature in Properties, Grrr :oops:
It's fixed now, keeping the improved speed up loading and it's online..

Image

Re: IceDesign GUI designer

Posted: Fri Jan 20, 2023 7:24 am
by Kuron
@ChrisR I am really proud of you for still going so strong on this. I am very glad to see that kind of dedication and support of the community.