Closed GrahamNZ closed 10 months ago
Hello.
Strange, I cannot reproduce (or I miss something).
When you have opened a project and choose to load a other with the icon "Open Project" ( the icon with magenta inside), without to close the previous project, do you get the same problem?
To switch from form <> code, you may use the F12 key or the icon "Toggle Form <> Unit" on the right of the "Commander" panel.
For example, if you have selected main.pas in the editor. You may also use the right button of the mouse and click a form and choose to have the form in code in the editor.
Yes. If I alternate between samples\widgets\layouts\layout.prj and samples\widgets\tabwidgetskin\tabwidgetskin.prj it opens the wrong main.pas and form in each project. I then need to close main.pas (which closes the form too), and use Open to open main.pas for the current project (having changed folder, as it defaults to the folder from the previous project). It doesn't seem to make a difference closing the projects before opening the next one.
The F12 works for swapping between the two, even if it's the wrong form displayed.
Also, I found there the fpgui style code is: it's in main.mfm which isn't normally displayed, although I have had cases where that shows instead of the form and then I get an error that main.mfm already exists. I don't know if main.mfm can be edited but I'll leave that test for another day!
Hello.
Ok, I get it, indeed there is a problem with Windows.
I have to confess that I do not use Windows anymore and did not extended test. I have found today a Windows 11 machine and indeed there is the problem you showed.
Thanks to note it and sorry for the disagreement.
I will jump into it this week, write you later.
Fre;D
Re-hello.
Aaargh, now that I am back to the Windows 11 machine, all works normally, only the files form the project are loaded, not the files of the previous project loaded.
I am lost, I cannot reproduce your problem anymore, I miss something that has done the problem (I have seen it previously), so I dont know what to debug.
When you close all the units that comes form previous project and save it and then reload a other project already saved without units form a previous project on your machine, does the problem still appear? Or does it occur always when loading a other project? Or only if you load a project for the first time from mseuniverse demos (so not saved yet by your machine)?
;-(
Also, I found there the fpgui style code is: it's in main.mfm which isn't normally displayed, although I have had cases where that shows instead of the form and then I get an error that main.mfm already exists. I don't know if main.mfm can be edited but I'll leave that test for another day!
Yes, you may edit main.mfm if you prefer to do it by code vs Object Inspector:
To do it, right click on the form you want to edit and on the menu click on "Show as text":
You may edit-change what you want. If you want to come back to the form and see the modifs, right-click on the main.mfm in the editor and in the menu click on "Show as form".
I'm glad you were able to see the problem, even though it was only for a while!
As a test I copied two of the MSEuniverse samples (layout and tabwidgetskin) to another directory and at first they seemed OK, but then they went wrong again. So I manually edited layout.prj and made sure everything pointed to the right folder [Copy1] and opened it in ideU. It was fine, so I closed it and re-opened. Still fine [Copy2]. So I closed it, opened tabwidgetskin, closed that and then reopened layout. Now it was wrong, with the wrong form shown even though the source edit screen shows the correct layout.pas and main.pas files. Using the "Show as form/text" options you gave above swaps between the tabskin form and the tabskin mfm files, not the layout ones.
Then I compared the three files (using BeyondCompare). The significant change seems to be in Copy3 where lines 352 and 669 now show the wrong file path for the modules. If I manually edit the prj file and change those two lines back again it works properly.
So then I tried opening layout, closing it and then exiting ideU. I restarted ideU, opened tabwidgetskin, closed it and exited ideU. When I started ideU and opened layout it was OK! So something about the module path is being stored in memory, and swapping between projects while ideU is still open corrupts the prj file module path. If ideU is closed in between swapping projects it works fine.
I don't know if that helps but maybe it gives you a clue where to look?
(I had to rename the prj files to txt to upload them here).
Many thanks for your explanation, I will try to get the error back.
Using the "Show as form/text" options you gave above swaps between the tabskin form and the tabskin mfm files, not the layout ones.
I will check that demos.
Write you later.
Fre;D
Hello.
I have try with ideU 2.12.0 Win64 to jump, like you explained from:
/mseuniverse-main/samples/widgets/layout/layout.prj to /mseuniverse-main/samples/widgets/tabwidgetskin/tabwidgetskin.prj
But here I have always only one unit in the code editor, tabwidgetskin.pas for tabwidgetskin.prj and layout.pas for layout.prj. But I trust you, I did have it last day.
Note that those demos are very old and not yet retested. It is possible that the prj is from a old version that maybe has some trouble. When saving the project, it should be converted to last prj format.
All the demos that dont have a /units directory to store the pre-compiled files are not re-tested. I have try some and fixed things but there are a lot and it needs lot of time to re-test all that samples.
You may also use ideU Win32, it can also compile projects using fpc 64 bit or 32 bit. In Config Compilers you may add 10 different compilers, 32 or 64 bit, of different version. Maybe ideU 32 bit works better in Windows.
In Project-Options, each type of compilation (0 to 10) can use his custom compiler.
About the problem of memory not cleaned, ideU uses cmem as memory manager. Maybe changing for the default of fpc would help?
If you have energy and begin to understand how to use msegui-ideU, you may recompile ideU.prj changing the memory manager.
For this, simply edit ideU.pas
and in uses section, remove the first unit: cmem, then recompile ideU and paste ideU.exe in the directory of the release, erasing the old one.
program ideU;
...
uses
// cmem, // Comment or remove that line
{$ifdef FPC} {$ifdef unix}
cthreads, {$endif} {$endif}
Re-hello.
Note too that the layout of the project used by those old demos is more suitable for the "compact" layout of MSEide.
If you use ideU, you may change the layout, click on "Layout" menu-item and choose the one you prefer:
And to see the form, in the code editor, in layout.pas, hold "Ctrl" key and click on "main" in "uses" section, it will load the form and the code.
The same for each component in the code editor, hold "Ctrl" and click on the word, it will jump to the declaration. Use the green triangle button to switch back.
And for the form, click on a widget and it will load the Object Inspector and change what you desire.
Hello.
In last commit was removed cmem for Windows and a check-remove all modules is done before to load a new project. Hope it helps.
Hi Fred,
Thanks for your messages, and sorry for the delay in replying. I tried the Win32 version of ideU but it had the same problem, so when I get time I will try compiling the new source and see if that helps. I'm going to be busy for a couple of weeks though, so it might not be for a while.
Thanks.
Hello.
No, I get still the error for Windows. I search for the cause. Sorry for the disagreement and thanks to have noted it. Write you later when I have good news.
OK, I get it. It should be fixed in last commit.
Here binary of ideU.exe of Win32 and Win64. Just unzip it and paste-replace it in the root directory of ideU release.
ideU_64.exe.zip ideU_32.exe.zip
Thanks to point it.
Hi Fred,
Yes, that looks like it's OK now. Well done!
Thanks.
Ok, nice, I am happy it is solved. I close then the issue.
I'm learning how to use MSEgui and ideU having spent most of my time in Lazarus with LCL and fpgui. I found MSEide hard to use because of the default fonts.
To do this I'm looking through the MSEuniverse sample files, opening a project, compiling it, maybe trying a few changes and then moving on to another project. To change project I select Project > Close and then Project > Open and select a different project. The problem is that when I open the new project it opens the source file for that project but shows the form related to the previous project, not the new one. Somehow I have to close that form and open the correct one, but that isn't always successful as there doesn't seem to be the equivalent of the Lazarus menu option Project > Forms screen in ideU. Opening main_mfm.pas doesn't help as that just shows an objdata record with loads of bytes (although in one attempt it did show source code for the screen like in fpgui which was great - I just don't know how I did it!).
I must be missing something.... (This is in Win10 64bit with ideU_win64 2.12.0)