Page 22 of 49

Re: IceDesign GUI designer

Posted: Thu Mar 31, 2022 11:00 am
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.

Re: IceDesign GUI designer

Posted: Thu Mar 31, 2022 12:32 pm
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 !

Re: IceDesign GUI designer

Posted: Thu Mar 31, 2022 5:59 pm
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

Re: IceDesign GUI designer

Posted: Thu Mar 31, 2022 7:39 pm
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

Re: IceDesign GUI designer

Posted: Fri Apr 01, 2022 10:43 am
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:

Re: IceDesign GUI designer

Posted: Fri Apr 01, 2022 1:52 pm
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.

Re: IceDesign GUI designer

Posted: Fri Apr 01, 2022 4:19 pm
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? ;)

Re: IceDesign GUI designer

Posted: Fri Apr 01, 2022 4:58 pm
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!

Re: IceDesign GUI designer

Posted: Wed Apr 06, 2022 8:00 pm
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!!!

Re: IceDesign GUI designer

Posted: Wed Apr 06, 2022 8:47 pm
by ShadowStorm
Yes, it's true that his software is good, I'm impressed.

Re: IceDesign GUI designer

Posted: Thu Apr 07, 2022 12:32 pm
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 :)

Re: IceDesign GUI designer

Posted: Thu Apr 07, 2022 2:44 pm
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

Re: IceDesign GUI designer

Posted: Thu Apr 07, 2022 3:19 pm
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

Re: IceDesign GUI designer

Posted: Thu Apr 07, 2022 3:56 pm
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.

Re: IceDesign GUI designer

Posted: Thu Apr 07, 2022 4:10 pm
by ChrisR
Hmm, A little too fast, I just re-uploaded it.