I am somewhat obsessive compulsive and like to impart some structure to my coding directories. One thing I find difficult in Arduino is including files from other locations.
For instance, I am currently developing several screens for a capacitive touch TFT display. These screens will be used by other parts of my Arduino code for user input or displaying status data. I would like to have the screens organized in a sub-folder of my project something like this...
this seems to work, but if I mover to another computer, it will not work.
Is there a way to get something working with a relative path like in the first example above, or am I stuck with a single level project or with defining the entire path as in the second example.
Newer versions of the IDE will look in sketch/src for additional include directories. Aside from that, trying to enforce your own hierarchy will result in lots of tearing your hair out, due to the way the Arduino build process works.
You might want to look at using VisualStudio (with the VisualMicro plug-in), or VisualStudio Code as your IDE instead of the Arduino IDE. They give you a LOT more flexibility, as well as a VASTLY more capable editor and IDE.
If UiElements contains code files, put that folder under src too.
You might need to adjust some of the #include directives in the other files too. For example, let's say you have this line in MainStatusScreen.cpp:
#include <MainStatusScreen.h>
Although not best practices, that works when MainStatusScreen is installed to one of the Arduino IDE's standard libraries folders, but it won't work in this usage. You only need to change it to: