PropertyPanel additions

Hi Jules,

How would you feel about adding some insert and remove functionality to PropertyPanel?

I have a Property Panel which contains a ChoicePropertyComponent and depending on it’s valueChanged I would like to change the Panel properties and or sections…

Methods like…

    /** Inserts a set of properties to the panel.
     
     
    */
    
    void insertSection (const String& sectionTitle,
                        const Array <PropertyComponent*>& newProperties,
                        int indextToInsertAt,
                        const bool shouldSectionInitiallyBeOpen = true);
    
    void insertSection (const String& sectionTitle,
                        const Array <PropertyComponent*>& newProperties,
                        const String& insertAfterSectionTitle,
                        const bool shouldSectionInitiallyBeOpen = true);
    
    /** Inserts a set of Property Components to the panel.
     
     
    */
    
    void insertComponent (const String& sectionName,
                          const String& insertAfterPropertyName,
                          Array<PropertyComponent*>& newPropertyComponents);

    /** Remove one of the sections using the section index.
        The index is from 0 up to the number of items returned by getSectionNames().
    */
     
    void removeSection (int sectionIndex);
    
    /** Remove one of the sections using the section name.
        The sectionName must be found in the StringArray returned by getSectionNames().
     
        It assumes sectionName isn't repeated or it'll remove the first occurence.
    */
    
    void removeSection (const String& sectionName);
    
    /** Remove one of the components using the property name and sectionName.
        The sectionName must be found in the StringArray returned by getSectionNames().
     
        It assumes sectionName isn't repeated.
    */
    
    void removeComponent (const String& sectionName, const String& propertyName);

Implementation .h and .cpp files at: http://tinyurl.com/m3t66z2

Thanks,

Rail

+1

+1

I've added a parameter to insert at a given index, and a removeSection method, mainly because I noticed that the whole class needed a bit of DRYing internally. I thought that all the other methods you added seemed excessive, but if you want to make some more concise suggestions based on the version I've committed now, I'd be open to that.