Page 19 of 49
Re: IceDesign GUI designer
Posted: Thu Dec 16, 2021 9:15 pm
by Jeromyal
Hi ChrisR,
I just purchased this, and I think it is wonderful, but I do have a problem I hope you can help me with.
I use PureBasic in portable mode using a special application I wrote with PureBasic.
Code: Select all
fix$ = GetPathPart(ProgramFilename())
Path$ = fix$ + "PureBasic\PureBasic.exe"
Working$ = fix$ + "PureBasic\"
arg$ = ProgramParameter() + Chr(32)
Param$ = "/P " + Chr(34) + fix$ + "Preferences\PureBasic.prefs" + Chr(34) +
"/T " + Chr(34) + fix$ + "Preferences\Templates.prefs" + Chr(34) +
"/H " + Chr(34) + fix$ + "Preferences\History.db" + Chr(34) +
"/A " + Chr(34) + fix$ + "Preferences\Tools.prefs" + Chr(34) +
"/NOEXT" + Chr(34)
If Not RunProgram(Path$, arg$ + Param$, Working$)
MessageRequester("PureBasic Application Not Found..","Please be sure that PureBasic is installed in the correct location.", #PB_MessageRequester_Warning | #PB_MessageRequester_Ok)
;Result = RunProgram(Filename$ [, Parameter$, WorkingDirectory$ [, Flags [, SenderProgram]]])
EndIf
This is an application that serves me well even with mapping file associations to it, to load a PureBasic file into it from the desktop.
Your application, with a manual editing of its .ini file will run using relative path to find my launcher. Thus making it close to a fully functional portable companion.
however, my launcher does not know what to pass to PureBasic when it launches it via request by your application. Breaking the functionality of your applications integration with PureBasic.
Re: IceDesign GUI designer
Posted: Thu Dec 16, 2021 11:56 pm
by ChrisR
Hi Jeromyal,
Thank you for your purchase, I'm glad you like it
I don't know why you don't simply use the /PORTABLE switch but your code looks good
I have just changed: arg$ = Chr(34) + ProgramParameter() + Chr(34) + Chr(32) required if there is a space in the .pb source path.
It works here.
For the preview, it needs pbcompiler.exe in the Compilers subfolder
You can try with this code, to compile in "Path_to Your_Purebasic_Launcher\Compilers\pbcompiler.exe"
Code: Select all
; To Compile in PB_Launcher_Path\Compilers\pbcompiler.exe"
fix$ = GetPathPart(ProgramFilename())
Path$ = fix$ + "..\PureBasic\Compilers\pbcompiler.exe"
For I = 0 To CountProgramParameters() - 1
If FindString(ProgramParameter(I), Chr(32))
arg$ + Chr(34) + ProgramParameter(I) + Chr(34) + Chr(32)
Else
arg$ + ProgramParameter(I) + Chr(32)
EndIf
Next
;If Not RunProgram(Path$, arg$, "", #PB_Program_Hide | #PB_Program_Wait)
; MessageRequester("PureBasic Compiler Not Found..","Please be sure that PureBasic is installed in the correct location.", #PB_MessageRequester_Warning | #PB_MessageRequester_Ok)
; End 1
;EndIf
Compiler = RunProgram(Path$, arg$, "", #PB_Program_Hide | #PB_Program_Open | #PB_Program_Read)
If Compiler
While ProgramRunning(Compiler)
If AvailableProgramOutput(Compiler)
LastProgramString$ = ReadProgramString(Compiler)
EndIf
Wend
If ProgramExitCode(Compiler) <> 0
CloseProgram(Compiler)
MessageRequester("Warning", "Fail to compile:" +#CRLF$+ "PBcompiler.exe " + arg$ + #CRLF$+#CRLF$+ LastProgramString$, #PB_MessageRequester_Warning|#PB_MessageRequester_Ok)
End 1
Else
CloseProgram(Compiler)
End 0
EndIf
Else
MessageRequester("Warning", "Fail to compile:" +#CRLF$+ "PBcompiler.exe " + arg$, #PB_MessageRequester_Warning|#PB_MessageRequester_Ok)
End 1
EndIf
Re: IceDesign GUI designer
Posted: Fri Dec 17, 2021 12:32 am
by ChrisR
Otherwise, if needed, here's how they are launched.
PBIDEpath = Path to Purebasic.exe or PureBasic_Path in IceDesign.ini
sFilePath = Path to the generated source code.
PreviewProgramName = Path to the compiled generated source
For options open in a new tab:
Code: Select all
PBRegCommand = ReadRegSZKey(#HKEY_CLASSES_ROOT, "PureBasic.exe\shell\open\command", "")
If PBRegCommand = ""
RunProgram(PBIDEpath, #DQUOTE$+ sFilePath +#DQUOTE$, "")
Else
ShellExecute_(#Null, @"open", @sFilePath, #Null, #Null, #SW_SHOWNORMAL) ; Use the association. It seems better to open the code in the same Purebasic Window
EndIf
For the preview, it's compiled with:
Code: Select all
CompilerPath = GetPathPart(PBIDEpath) + "Compilers\pbcompiler.exe"
If EnableDPIAware
Compiler = RunProgram(CompilerPath, #DQUOTE$+ sFilePath +#DQUOTE$+ " /EXE " +#DQUOTE$+ PreviewProgramName +#DQUOTE$+ " /XP /DPIAWARE", "", #PB_Program_Hide | #PB_Program_Open | #PB_Program_Read)
Else
Compiler = RunProgram(CompilerPath, #DQUOTE$+ sFilePath +#DQUOTE$+ " /EXE " +#DQUOTE$+ PreviewProgramName +#DQUOTE$+ " /XP", "", #PB_Program_Hide | #PB_Program_Open | #PB_Program_Read)
EndIf
.....
RunProgram(PreviewProgramName, "", "", #PB_Program_Open)
Unrelated, but as I have not written it anywhere and I think about it,
The sources generated in the %Temp% folder (Open a Temp File in a New Tab) are kept for 2 days.
Older sources are deleted at IceDesign startup : DelOldFiles(GetTemporaryDirectory(), "~IceDesign*.pb", 2)
Re: IceDesign GUI designer
Posted: Fri Dec 17, 2021 2:26 am
by Jeromyal
Thank you so very much for this rather exhaustive bit of information. I will try to see what I can do.
For the reason I don't use the \portable parameter is because I wanted to isolate everything from the install as well as have it portable. This way when updating I just need to concern myself with the PureBasic folder thus leaving preferences and tool folder intact outside of that directory.
As follows:
PureBasic (folder)
| Preferences (folder)
| | History.db
| | PureBasic.prefs
| | Templates.prefs
| | Tools.prefs
|
| Projects (folder)
| PureBasic (folder) <-- the actual install
| Tools (folder) <-- editor tool menu can relative path too ! commandline: "..\tools\atool.exe"
| PureBasic Portable.pb
| PureBasic.exe <--- launcher
| Purebasic_Portable.ico
Re: IceDesign GUI designer
Posted: Fri Dec 17, 2021 3:56 am
by Jeromyal
I now have it working. As long as my purebasic ide is already running. I thank you so much. I will work on it further perhaps I will get lucky. but for now, it works fantastic with only the slight quark.
I added your program parameter routine into mine.
created a phony compilers folder and compiled your first suggestion as pbcompiler.exe inside.
Now directory looks like this:
PureBasic (folder)
| Compilers (folder) <-- with pbcompiler.exe launcher inside.
| Preferences (folder)
| | History.db
| | PureBasic.prefs
| | Templates.prefs
| | Tools.prefs
|
| Projects (folder)
| PureBasic (folder) <-- the actual install
| Tools (folder) <-- editor tool menu can relative path too ! commandline: "..\tools\atool.exe"
| PureBasic Portable.pb
| PureBasic.exe <--- launcher
| Purebasic_Portable.ico
Re: IceDesign GUI designer
Posted: Fri Dec 17, 2021 5:38 am
by dmontaine
Two questions: 1) how much of IceDesign code is WIndows specific? What are the barriers to the program being compiled for Linux or the Mac? 2) Have you tried compiling it using the new C compiler? If so, did you run into any problems or differences? Thanks for your great work.
Re: IceDesign GUI designer
Posted: Fri Dec 17, 2021 7:12 am
by ShadowStorm
Hi, according to this short test, not finished, it's not bad at all

On the other hand it's annoying, when we click on a tab the panel moves, it's not good, try to improve that if you can.
Otherwise the improvement is impressive, it's good !
I think you can do better, but it's good already, good job
I continue my tests, thanks to you !
https://drive.google.com/file/d/1e5IHnW ... sp=sharing
Re: IceDesign GUI designer
Posted: Fri Dec 17, 2021 8:18 am
by Mindphazer
ShadowStorm wrote: Fri Dec 17, 2021 7:12 am
I think you can do better
I don't know how you should take this

Re: IceDesign GUI designer
Posted: Fri Dec 17, 2021 12:05 pm
by ShadowStorm
you or me?
I say it's great, and that you can do even better? ^^
Re: IceDesign GUI designer
Posted: Fri Dec 17, 2021 12:28 pm
by ChrisR
I don't know either how to take it! It's Shadow
do you also reproduce this panel move in a normal use or due to your extended tests, looks good here
I'm behind on other things, so I won't have much time for IceDesign these next days
Re: IceDesign GUI designer
Posted: Fri Dec 17, 2021 12:30 pm
by ChrisR
dmontaine wrote: Fri Dec 17, 2021 5:38 am
Two questions: 1) how much of IceDesign code is WIndows specific? What are the barriers to the program being compiled for Linux or the Mac? 2) Have you tried compiling it using the new C compiler? If so, did you run into any problems or differences? Thanks for your great work.
IceDesign runs only under Windows but the generated code is 100% compatible with Linux or MacOS, it is cross-platform, ready to be recompiled.
Except a few Windows control styles that should not be selected to be cross-platform. They are well marked in the constants list for this, they are at the bottom and they start with a # (ex: #BS_Bottom, #BS_Top)
For the C compiler, the project is compiled successfully since beta 5

Everything seems to work normally and I don't notice any improvement or degradation when using it.
They seem to be identical. I don't know how I could measure a possible performance gain with the C compiler!
Re: IceDesign GUI designer
Posted: Fri Dec 17, 2021 3:02 pm
by Mindphazer
ShadowStorm wrote: Fri Dec 17, 2021 12:05 pm
you or me?
I say it's great, and that you can do even better? ^^
Chris has understood what i was meaning

Re: IceDesign GUI designer
Posted: Fri Dec 17, 2021 3:22 pm
by ShadowStorm
Nothing bad, I said that it was very good, and that I think that maybe you will improve again!
No but this behavior is not normal, in fact if you click on the tab and move it (the mouse) even by a little, it does this.
Try it, create a panel with say 4 or 5 elements (it doesn't matter but a certain number), click on each one, there is necessarily a moment where you will also move your mouse without doing it on purpose, and the panel will move!
So you have two solutions, in addition to yours that you will surely find ^^
1 the panels (Panelgadget) can only be moved by a small icon on top of it, when you click on this icon you can move the panel.
2 Add a function to lock the gadgets, it can be several things, either lock them all and you can't move or change the size, or nothing else, or just move, or move and resize, so it's up to you
Or you can plan a small time delay when you click on a panel, if during this short time the mouse is moved, nothing will happen.
like 100, 200ms.
You can also put in the parameters, the time of inactivity .....
In short, it's up to you
Or you can move the panel (panelgadget) only when you are on the panelgadget border !
Another point, an idea of passage, it would be nice to be able to copy a tab and to paste it on the same panelgadget or on another ^^
Re: IceDesign GUI designer
Posted: Fri Dec 17, 2021 7:40 pm
by ChrisR
ShadowStorm wrote: Fri Dec 17, 2021 3:22 pm
Nothing bad, I said that it was very good, and that I think that maybe you will improve again!
Of course, if you noticed, that's what I've been doing since the first release.
There has been a lot of functionality added, to make it even better.
It seems to me really complete, actually
#
About the Panel Move:
The panel's behavior seems normal to me:
The tab change is normally done when the Panel Container is opened, to create gadgets, move them, resize...
There will be no movement if you change the tab, in this case.
I have opened the possibility to change the tab from the previous level, as you do, but it is just to see the inside of another tab.
In this case, 1 click on another tab is the same as changing the tab and selecting the panel ready to be moved. As when you select the panel by clicking inside
So it responds to the mouse's movements (#PB_EventType_MouseMove event), it is intended and normal.
ShadowStorm wrote: Fri Dec 17, 2021 3:22 pm
2 Add a function to lock the gadgets,
It is already here, look in the Panel properties
ShadowStorm wrote: Fri Dec 17, 2021 3:22 pm
Another point, an idea of passage, it would be nice to be able to copy a tab and to paste it on the same panelgadget or on another ^^
I'm not sure if I'll take your idea of cloning a tab but I note it.
It is not something done frequently and it is something quite easy to do manually:
Ctrl+A: to select all Gadgets
Ctrl+C: to copy them
Create a new Tab
Ctrl+V: to paste the copy Gadgets
Re: IceDesign GUI designer
Posted: Fri Dec 17, 2021 9:23 pm
by VB6_to_PBx
Chris ,
could you add the option or ability to select and de-select a Gadget's "Parent" ?
by "Parent" ... meaning a Window or any of the other Container style Gadgets