2022-09-02 12:26 AM
When I delete a Screen in TouchGFX Designer, the screen is deleted in the designer and the base files are also deleted. But the view and presenter files are not deleted. When I delete my user code in view and presenter, then these files are indeed deleted.
Why are the view and presenter files not deleted as long as there is user code inside?
I'm using TouchGFX Designer 4.20 with Keil.
The problem is the same as
but there is no good solution.
2022-09-06 02:11 AM
Hello Pirol,
Yes you're right, when you create screens and then you delete them, some files (user code files) still remains. This is not a bug but made on purpose to don't erase accidentally any code that you might need to copy/move to another file. Indeed, the "generate code" purpose isn't to clean code, especially those written by the user. So if you delete screens, you'll need to do it manually.
/Osman
2022-09-06 05:08 AM
Hello Osman,
thanks for your answer.
Ok, I can delete the files by hand.
But why is it not enough to exclude the files from the Keil project? I would expect: when neither the files of a screen (view+presenter) are included in the uvprojx nor the screen is existent in the TouchGFX Designer, than the files should be ignored by the code generator of TouchGFX Designer. But they are not. A screen deleted in Designer and excluded from Keil pops up in Keil everytime I generate the code from the designer. Is that also on purpose?
2022-09-06 06:18 AM
Hi again,
I've just made the test on my side, and deleted screens files are not included in my Keil project. So I can't reproduce your issue. Which version of Keil are you using ? I'm working with uVision V5.32.0.0, and it works perfectly fine here. Do you have this kind of popup on Keil whenever you regenerate code on TouchGFX Designer ?
/Osman
2022-09-06 06:57 AM
Hello Osman,
I'm using Keil 5.29.0.0.
The pop up shows up most of the times, sometimes not. But the new code is there even without the pop up.
If I do the following steps, I get the strange behaviour. The project consists of four screens with very few widgets on them. There is some user code in screen4.
- Delete screen4 in the Designer and generate code.
- Remove screen4.cpp from Keil.
- Create a custom container in the Designer and add it to a screen; regenerate.
--> In Keil, both the container and Screen4 show up in the project tree.
- Remove Screen4 again and add some code to the custom container.
- Delete the custom container in the Designer (completely, not only on the screen); regenerate.
--> Screen4 shows up again and CustomContainer1 is still there.
Just to be clear: The files of screen4 are not recreated (I haven't deleted them in the previous steps). It's just the path in Keil that is recreated. When I delete the files of screen4, they do not show up again. So it's not a big problem, because I could just delete the files, but I found it quite strange.
2022-09-13 01:00 AM
Hey Pirol,
I tried the steps you wrote, I don't have the same behavior. When I delete the screen4 in designer, the screen4View.cpp and screen4Presenter.cpp will automatically be deleted from my Keil project tree (purpose of the popup asking for project reload). And if I add more widgets on my others screens, the sceen4 doesn't show up.
I don't have other idea than updating your Keil to version V5.32.0.0. Can you try with that ?
/Osman
2022-09-19 01:10 AM
Hello Osman,
thank you for trying it on your side.
I just noticed that I forgot to mention that there is some user code in screen4, and added it to the last post.
I don't know if I can get access to V5.32 at the moment, but I'll have a look.
Interestingly, I get the same behaviour when I copy view and presenter files (not base files) from another project to this project: They show up in Keil after regenerating. Maybe TouchGFX Designer looks around and adds everything to Keil that looks like a screen, even when it's not included in the .touchgfx-project?
The deleted screens and containers only show up again when there is a change in the designer that makes changes in the Keil paths necessary. (That makes sense as in all other cases, TouchGFX Designer probably does not change anything in the Keil paths.)
But it's not the most important issue here in the forum, so it's ok for me.