IceDesign GUI designer

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

Re: IceDesign GUI designer

Post by ChrisR »

Thanks for your support guys, I appreciate
Caronte3D wrote: Wed Mar 30, 2022 3:43 pm I think enhance the proportional scaling to work relative to her parent container, instead of only the whole window, could be a nice one, so we can do more complex interfaces where parts stay at same size.
I agree, I will look at how I can do it, trying to keep the generated sources simple.
thanos wrote: Thu Mar 31, 2022 6:24 am A significant feature, at least for me, it might be the "Translate from Source" option, which converts and loads to IceDesign a piece of source code.
I was already asked to import and convert from a PB source but I slowed down to get into it.
The translation from a source is always something quite complicated to do, not to miss anything between the fonts, the images loaded or in datasection, all the gadgets with their properties...
It is a bit difficult to do it well and complete, it is often easier to redo the design.
But it would be a good exercise for my spare time.
thanos wrote: Thu Mar 31, 2022 6:24 am This feature was built in at Gnozal's PureFORM designer.
I didn't have the pleasure of knowing Gnozal, but it is sure that I am very far from his knowledge and development skills.
ShadowStorm
Enthusiast
Enthusiast
Posts: 237
Joined: Tue Feb 14, 2017 12:07 pm

Re: IceDesign GUI designer

Post by ShadowStorm »

Caronte3D wrote: Thu Mar 31, 2022 10:20 am
ShadowStorm wrote: Thu Mar 31, 2022 7:25 am...my project Editors Factory, a very interesting project, but nobody is interested, and I still don't understand why :?
If you post enough examples (simple ones) and several cases of use, Is far more probable the users would be interested. Some projects are easier than others to understand her fully potential :wink:
But there are already plenty of examples !
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: 1124
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: IceDesign GUI designer

Post by ChrisR »

Caronte3D wrote: Wed Mar 30, 2022 3:43 pm I think enhance the proportional scaling to work relative to her parent container, instead of only the whole window, could be a nice one, so we can do more complex interfaces where parts stay at same size.
It could generate a source like this:
Exemple here with the Panel Locked at Left, Top and Bottom, the Container Locked at Right, Top and Bottom and the others, the 2 buttons and the editor are proportional.
It uses static variables to save the containers initial sizes. Let me know what you think, before I change my code ?

Code: Select all

EnableExplicit

Enumeration Window
  #MainWindow
EndEnumeration

Enumeration Gadgets
  #Panel
  #Edit
  #Cont
  #Btn_OK
  #Btn_Cancel
EndEnumeration

Declare Resize_MainWindow()
Declare Open_MainWindow(X = 0, Y = 0, Width = 650, Height = 440)

Procedure Resize_MainWindow()
  Protected.f FactorX, FactorY
  Static WinWidthIni, WinHeightIni
  Static Panel_WidthIni, Panel_HeightIni
  Static Cont_WidthIni, Cont_HeightIni
  If WinWidthIni = 0
    WinWidthIni = WindowWidth(#MainWindow) : WinHeightIni = WindowHeight(#MainWindow)
    Panel_WidthIni = GadgetWidth(#Panel) : Panel_HeightIni = GetGadgetAttribute(#Panel, #PB_Panel_ItemHeight)
    Cont_WidthIni = GadgetWidth(#Cont) : Cont_HeightIni = GadgetHeight(#Cont)
    ProcedureReturn
  EndIf
  
  ResizeGadget(#Panel, 20, 20, WindowWidth(#MainWindow) - 230, WindowHeight(#MainWindow) - 40)
  FactorX = GadgetWidth(#Panel) / Panel_WidthIni : FactorY = GetGadgetAttribute(#Panel, #PB_Panel_ItemHeight) / Panel_HeightIni
  ResizeGadget(#Edit, FactorX * 10, FactorY * 10, FactorX * (Panel_WidthIni - 30), FactorY * (Panel_HeightIni - 16))
  ResizeGadget(#Cont, WindowWidth(#MainWindow) - 200, 20, 190, WindowHeight(#MainWindow) - 40)
  FactorX = GadgetWidth(#Cont) / Cont_WidthIni : FactorY = GadgetHeight(#Cont) / Cont_HeightIni
  ResizeGadget(#Btn_OK, FactorX * 10, FactorY * 20, FactorX * (Cont_WidthIni - 30), FactorY * (Cont_HeightIni - 350))
  ResizeGadget(#Btn_Cancel, FactorX * 10, FactorY * 90, FactorX * (Cont_WidthIni - 30), FactorY * (Cont_HeightIni - 350))
EndProcedure

Procedure Open_MainWindow(X = 0, Y = 0, Width = 650, Height = 440)
  If OpenWindow(#MainWindow, X, Y, Width, Height, "Proportional Resize based on Containers", #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_ScreenCentered)
    PanelGadget(#Panel, 20, 20, 420, 400)                             ; Lock Left, Top, Bottom
      AddGadgetItem(#Panel, -1, "Tab_0")
      EditorGadget(#Edit, 10, 10, 390, 355)                           ; Proportional
      SetGadgetColor(#Edit, #PB_Gadget_BackColor, $D8FFFF)
      AddGadgetItem(#Edit, -1, "Editor Line 1")
      AddGadgetItem(#Panel, -1, "Tab_1")
    CloseGadgetList()   ; #Panel_1
    ContainerGadget(#Cont, 450, 20, 190, 400, #PB_Container_Raised)   ; Lock Right, Top, Bottom
      SetGadgetColor(#Cont, #PB_Gadget_BackColor, $C0C0C0)
      ButtonGadget(#Btn_OK, 10, 20, 160, 50, "OK")                    ; Proportional
      ButtonGadget(#Btn_Cancel, 10, 90, 160, 50, "Cancel")            ; Proportional
    CloseGadgetList()   ; #Cont
    
    BindEvent(#PB_Event_SizeWindow, @Resize_MainWindow(), #MainWindow)
    PostEvent(#PB_Event_SizeWindow, #MainWindow, 0)
    WindowBounds(#MainWindow, 420, 200, #PB_Ignore, #PB_Ignore)
  EndIf
EndProcedure

Open_MainWindow()

Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
User avatar
Caronte3D
Addict
Addict
Posts: 1014
Joined: Fri Jan 22, 2016 5:33 pm
Location: Some Universe

Re: IceDesign GUI designer

Post by Caronte3D »

ChrisR wrote: Thu Mar 31, 2022 5:59 pmLet me know what you think, before I change my code
Looks exactly what I asked for :D
Implement it please :wink:
Thanks CrisR
User avatar
Caronte3D
Addict
Addict
Posts: 1014
Joined: Fri Jan 22, 2016 5:33 pm
Location: Some Universe

Re: IceDesign GUI designer

Post by Caronte3D »

About what Thanos was wrote...

In my case, I have a very complex window with hundreds of gadgets so now I can only edit the interface by code.
My major problem is to position and resize every gadget when I need to add a new one, so I think a way to only move and resize the gadgets in the source code would be great, even if you only can do that and do the rest by code.

Something like:

1.- Load source code in IceDesign.
2.- Show the gadgets in the editor (generic ones, without customization).
3.- Let me move and resize the gadgets.
4.- Save to the source code again, where nothing changed except the size and position.

It's like a limited mode of operation :wink:
User avatar
ChrisR
Addict
Addict
Posts: 1124
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: IceDesign GUI designer

Post by ChrisR »

It' s an interesting idea, a first step towards a more complete loading from a PB source file.
I'm not promising anything but I'll think about it.

Instead of reading a PB source, maybe it could be done at Runtime with a calling program, with

Code: Select all

PB_Object_EnumerateStart(PB_Gadget_Objects)
While PB_Object_EnumerateNext(PB_Gadget_Objects, @Gadget)
    Debug "Gadget: " + Str(Gadget) + " Type: " + Str(GadgetType(Gadget)) + " ..."
Wend
But, then, I don't know how to get the links between parents and children or get the tabs from there to build the hierarchical structure.
Bitblazer
Enthusiast
Enthusiast
Posts: 730
Joined: Mon Apr 10, 2017 6:17 pm
Location: Germany
Contact:

Re: IceDesign GUI designer

Post by Bitblazer »

Personally i think it would be more universal to dissect a displayed win32/64 window and traverse the control element list to create a editable form that can be used in IceDesign. A bit like a universal decompiler for windows UI ;)

That way you could achieve the same result but not only for purebasic but for 90% of all windows applications.

Yes, it would be a big load of work, but probably comparable to the idea of source parsing.
Both ways are possible to achieve the same kind of result.

Inspirational thoughts (check spy++, inspect and uispy too).

How much lifetime do you want to invest? ;)
webpage - discord chat links -> purebasic GPT4All
thanos
Enthusiast
Enthusiast
Posts: 422
Joined: Sat Jan 12, 2008 3:25 pm
Location: Greece
Contact:

Re: IceDesign GUI designer

Post by thanos »

Caronte3D wrote: Fri Apr 01, 2022 10:43 am About what Thanos was wrote...

In my case, I have a very complex window with hundreds of gadgets so now I can only edit the interface by code.
My major problem is to position and resize every gadget when I need to add a new one, so I think a way to only move and resize the gadgets in the source code would be great, even if you only can do that and do the rest by code.

Something like:

1.- Load source code in IceDesign.
2.- Show the gadgets in the editor (generic ones, without customization).
3.- Let me move and resize the gadgets.
4.- Save to the source code again, where nothing changed except the size and position.

It's like a limited mode of operation :wink:
💯!!!!!!!!
I faced the same and the limited mode you suggest is more than enough!
» myPersonal Banker :: Because you do not need to have a master degree in economics in order to organize your finances!
User avatar
Cruster
User
User
Posts: 96
Joined: Fri Jan 23, 2004 12:05 am

Re: IceDesign GUI designer

Post by Cruster »

Wow! Just found this. Superb job!! :D It took me all of one minute to decide to purchase the full version. Well done!!!
PureBasic 4.3 registered user
ShadowStorm
Enthusiast
Enthusiast
Posts: 237
Joined: Tue Feb 14, 2017 12:07 pm

Re: IceDesign GUI designer

Post by ShadowStorm »

Yes, it's true that his software is good, I'm impressed.
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: 1124
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: IceDesign GUI designer

Post by ChrisR »

Cruster wrote: Wed Apr 06, 2022 8:00 pm Wow! Just found this. Superb job!! :D It took me all of one minute to decide to purchase the full version. Well done!!!
Thanks for your purchase and your great comment, enjoy 8)
Thank you also Shadow :)
User avatar
ChrisR
Addict
Addict
Posts: 1124
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: IceDesign GUI designer

Post by ChrisR »

IceDesign has been updated in version 1.6.5

New features
  • As for locked to Left, Right, Up or Down, the proportional resizing is now based on the parent container size.
    Whether it is itself in proportional resizing or locked. You can play in all directions 8)
  • Constants can be updated in a grouped way, for the same models selected.
  • Fix the ideal size for the checkbox length (#PB_Gadget_RequiredSize) with 150% or up scale factor.
  • Add a custom gagdet, JellyButton. It allows to add a "modern" touch to PureBasics existing stuff.
    Syntax: Result = JellyButton((#Gadget, x, y, Width, Height, Text$, BackColor, TextColor [, Flags])
    It is a ButtonGadget, modernized. So, It behaves like a ButtonGadget with the same functions SetGadgetText(), SetGadgetState(), GetGadget...
    and also SetJellyColor((#Gadget, ColorType, Color) with ColorType = #PB_Gadget_FrontColor Or #PB_Gadget_BackColor.
    Thanks for this nice module Justin Jack, blueb. For the need, I made some additions (WM_Print, Flags,...), I really appreciate it :)

Image
ShadowStorm
Enthusiast
Enthusiast
Posts: 237
Joined: Tue Feb 14, 2017 12:07 pm

Re: IceDesign GUI designer

Post by ShadowStorm »

Well, I think we seriously need to do something...
You make your program, you break your head and paf, this appears, you lose all your work because you forgot to save!

You should set up something.
This is not acceptable I think.

It happened when I wanted to paste gadgets.

You should set up an auto save as soon as it changes, the code updates as soon as it changes, so find something...

The problem is still with the PbEdit module...
Otherwise nice work !
Windows: 10 x64
IceDesign Version: 1.6.5
Source Code File: PBEdit.pbi
Source Code Line: 9641

Error Message: Invalid memory access
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: 1124
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: IceDesign GUI designer

Post by ChrisR »

The 2nd time for you, I have never reproduced here!
The error in PBEdit is related to the timer event, it is used for cursor blinking.
I updated silently, same version number 1.6.5, by disabling (Un)BindEvent and the timer which are not really required here, in read only mode.
Let me know if you reproduce it or any other error.
User avatar
ChrisR
Addict
Addict
Posts: 1124
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: IceDesign GUI designer

Post by ChrisR »

Hmm, A little too fast, I just re-uploaded it.
Post Reply