...use something like a SharedResourcePointer which creates your custom look, and then make your individual components reference that. Then when the projucer uses a component which uses this shared object, it'll get created and used.
I tried creating a container class with my custom LookAndFeel object as a member, then creating a SharedResourcePointer to the container class and setting the default LAF in my components via the SharedResourcePointer. It works when running the whole application, but not when running individual components in the Projucer as intended. The reasoning behind having a container class was to point all my application's components there, and in the container class handle runtime switching between variations of my LAF.
Any idea whether when Jules wrote "which creates your custom look", he might have meant either a) which points to a customised LookAndFeel object; or b) which points to a home-rolled class (one which does not inherit from Juce's LAF classes) to implement the drawing of your components?
Many thanks in advance for any guidance / suggestions!
Many thanks for the input @adamski, but on this occasion, my LookAndFeel class wants to inherit from MyComponent::LookAndFeelMethods - it’s not just the MyComponent& arguments in the LookAndFeel methods.
You can include the headers in the cpp instead of including one header in the next header.
As long as the needed include is placed before the header depending on the other one, it should work.
Whenever I run into forward declaration problems, mostly because of trying to forward declare an inner class, I end up using a pointer to the base class as member variable in the header and cast it to the actual class in the cpp file (If you use static_cast, you get away without runtime performance penalties).