Namespaces | |
juce | |
Macros | |
#define | JUCE_LIVE_CONSTANT(initialValue) (juce::LiveConstantEditor::getValue (__FILE__, __LINE__ - 1, initialValue).get()) |
This macro wraps a primitive constant value in some cunning boilerplate code that allows its value to be interactively tweaked in a popup window while your application is running. More... | |
#define JUCE_LIVE_CONSTANT | ( | initialValue | ) | (juce::LiveConstantEditor::getValue (__FILE__, __LINE__ - 1, initialValue).get()) |
This macro wraps a primitive constant value in some cunning boilerplate code that allows its value to be interactively tweaked in a popup window while your application is running.
In a release build, this macro disappears and is replaced by only the constant that it wraps, but if JUCE_ENABLE_LIVE_CONSTANT_EDITOR is enabled, it injects a class wrapper that automatically pops-up a window containing an editor that allows the value to be tweaked at run-time. The editor window will also force all visible components to be resized and repainted whenever a value is changed, so that if you use this to wrap a colour or layout parameter, you'll be able to immediately see the effects of changing it.
The editor will also load the original source-file that contains each JUCE_LIVE_CONSTANT macro, and will display a preview of the modified source code as you adjust the values.
Things to note:
e.g. in this example the colours, font size, and text used in the paint method can all be adjusted live: