Why is Jucer form MetaData not added to projects created in Projucer?


#1

I have noticed that when you Create New Project for a GUI Application and select the option to Create a Main.cpp and a basic window the hello world .h is created however none of the metadata for Jucer is added, leaving you with no ability to use the GUI Editor for that form.

If I copy and paste a simple version like below from a previous component creation, save, then relaunch, everything works as expected. Is this by design? If I add a new component I get the .cpp and .h with GUI editing capabilities so I’m failing to see the benefit of not including the metadata in new project creations.

//==============================================================================
#if 0
/*  -- Projucer information section --

    This is where the Projucer stores the metadata that describe this GUI layout, so
    make changes in here at your peril!

BEGIN_JUCER_METADATA

<JUCER_COMPONENT documentType="Component" className="MainContentComponent" componentName=""
                 parentClasses="public Component" constructorParams="" variableInitialisers=""
                 snapPixels="8" snapActive="1" snapShown="1" overlayOpacity="0.330"
                 fixedSize="0" initialWidth="600" initialHeight="400">
  <BACKGROUND backgroundColour="ffffffff"/>
</JUCER_COMPONENT>

END_JUCER_METADATA
*/
#endif

#2

IIRC we thought about adding this, it could certainly be done that way.

We just didn’t really want to steer people towards the GUI editor as being the default way to build components, as in most real-world code you’ll probably end-up hand-coding things instead. Also didn’t want to make it look to more experienced coders that all juce components have to come with this GUI editor baggage. But sure, I guess that if you’re a beginner it’d be helpful to have it use the GUI builder for this. Maybe we should have two different project templates for a manual GUI or an edited one.


#3

Thanks Jules… that makes complete sense. This seems to also explain the Main vs MainComponent classes/files I see in various places. I think when I see “wizards” I assume a non-pro path is coming my way but pushing towards best practices is always better.

I’m mainly coming from a long past with Delphi and VB and my near-newbie status with C++ (mainly the IDE) has me back in first grade on some stuff. In the past I focused my C efforts on header conversions to get stuff to work in Delphi. I also briefly dabbled in FLEX and the JUCER component markup is fairly close to that. So thank goodness for experience. :wink:

I will say that I’ve had more success in the past few days “out of the box” with Juce than weeks of equivalent work on other platforms so I’m hoping this becomes my new home. Big thanks to all for the effort put into this library.