IceDesign GUI designer

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
User avatar
ChrisR
Addict
Addict
Posts: 1127
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: IceDesign GUI designer

Post 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.
User avatar
ChrisR
Addict
Addict
Posts: 1127
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: IceDesign GUI designer

Post 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
Last edited by ChrisR on Tue Jan 17, 2023 6:13 pm, edited 1 time in total.
User avatar
jacdelad
Addict
Addict
Posts: 1432
Joined: Wed Feb 03, 2021 12:46 pm
Location: Planet Riesa
Contact:

Re: IceDesign GUI designer

Post 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...
PureBasic 6.04/XProfan X4a/Embarcadero RAD Studio 11/Perl 5.2/Python 3.10
Windows 11/Ryzen 5800X/32GB RAM/Radeon 7770 OC/3TB SSD/11TB HDD
Synology DS1821+/36GB RAM/130TB
Synology DS920+/20GB RAM/54TB
Synology DS916+ii/8GB RAM/12TB
User avatar
ChrisR
Addict
Addict
Posts: 1127
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: IceDesign GUI designer

Post 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 :)
User avatar
jacdelad
Addict
Addict
Posts: 1432
Joined: Wed Feb 03, 2021 12:46 pm
Location: Planet Riesa
Contact:

Re: IceDesign GUI designer

Post 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!
PureBasic 6.04/XProfan X4a/Embarcadero RAD Studio 11/Perl 5.2/Python 3.10
Windows 11/Ryzen 5800X/32GB RAM/Radeon 7770 OC/3TB SSD/11TB HDD
Synology DS1821+/36GB RAM/130TB
Synology DS920+/20GB RAM/54TB
Synology DS916+ii/8GB RAM/12TB
ShadowStorm
Enthusiast
Enthusiast
Posts: 237
Joined: Tue Feb 14, 2017 12:07 pm

Re: IceDesign GUI designer

Post by ShadowStorm »

DialogDesign0R ??? :?
I am French, I do not speak English.
My apologies for the mistakes.

I have sometimes problems of expression
I am sometimes quite clumsy, please excuse me and let me know.
User avatar
ChrisR
Addict
Addict
Posts: 1127
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: IceDesign GUI designer

Post 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 :)
User avatar
ChrisR
Addict
Addict
Posts: 1127
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: IceDesign GUI designer

Post 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:
User avatar
Caronte3D
Addict
Addict
Posts: 1027
Joined: Fri Jan 22, 2016 5:33 pm
Location: Some Universe

Re: IceDesign GUI designer

Post 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!
User avatar
ChrisR
Addict
Addict
Posts: 1127
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: IceDesign GUI designer

Post 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
Last edited by ChrisR on Thu Jan 19, 2023 2:05 pm, edited 1 time in total.
User avatar
Caronte3D
Addict
Addict
Posts: 1027
Joined: Fri Jan 22, 2016 5:33 pm
Location: Some Universe

Re: IceDesign GUI designer

Post by Caronte3D »

Thi's perfect! 😍
User avatar
ChrisR
Addict
Addict
Posts: 1127
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: IceDesign GUI designer

Post 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)
User avatar
Cruster
User
User
Posts: 96
Joined: Fri Jan 23, 2004 12:05 am

Re: IceDesign GUI designer

Post by Cruster »

Fantastic job! You're the man :-)
PureBasic 4.3 registered user
User avatar
ChrisR
Addict
Addict
Posts: 1127
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: IceDesign GUI designer

Post 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
User avatar
Kuron
Addict
Addict
Posts: 1626
Joined: Sat Oct 17, 2009 10:51 pm
Location: Pacific Northwest

Re: IceDesign GUI designer

Post 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.
Post Reply