Currently, to allow a user to select a relative path within a Path control, you must either:
1. Easy (but glitchy) method:
- Catch the value change event on the Path control;
- Compare the NewVal with your base path with "Compare Two Paths.vi";
- In case the path is relative to your base path, rewrite the relative path to the control using a local variable;
-> This results in a visual glitch because the value is updated twice.
2. Recommended (but complicated and not very clean) method:
- Take a first Path control, move the "path box" out of view, but keep its browse button visible;
- Put a secondary Path control next to it, with its own browse button invisible;
- Similar to method 1: catch event on first path, update secondary path;
-> No visual glitch, but difficult to adapt to paths inside arrays, clusters and combinations of both.
For both methods, additional logic may be needed in case the user is typing in the path box directly.
So the idea would be to add a "Base Path" property to the Path control, so that when the user clicks the browse button and selects a path that is relative to that base path, the control would get the relative path value instead of the absolute one.
In case the selected path is not relative to that base path, the control would still have the normal behaviour and get the absolute path value.
By default, this property would be set to "Not A Path" (or empty path) to keep the current behaviour.
Also, it would be the developer's duty to correctly treat relative path values and inform the user to what base path it is relative to.