Adding inherited class to a GUI class managed by Introjucer


#1

I have created a GUI class using Introjucer and called it EditorCompoent.

Then I added a button to it and I see that Intojucer added public ButtonListener to the class definition:

class EditorComponent  : public Component,
                         public ButtonListener

Then I went and added GenericComponent and changed its class to FilenameComponent and set its constructor params.

When I compile and run the app, filename chooser works ok.

Issue here is that I want to add abstract class FilenameComponentListener to the Editor component like so:

class EditorComponent  : public Component,
                         public ButtonListener,
                         public FilenameComponentListener


in order to implement filenameComponentChanged().

Problem with adding this manually is that it will be removed by Introjucer (since it autogenerates this part of the component code) every time I change something.

Is there a way to add another inherited class for a component in Introjucer, in this case FilenameComponentListener, so that Intorjucer is aware of that class and does not remove it?

 


#2

I rarely use the IJ's GUI designer nowadays, but I thought it had a field for adding extra base classes to the main class?


#3

There is Parent classes field on the Class tab, you can add you own extra base classes here.
Responses like this make me worry sometimes Jules, is the fact that you are not using the GUI designer yourself so much the reason it's not getting any love?
I use it daily and i think are quite a few Juce users that do as well, do you have any schedule or thoughts whatsoever on the future of the GUI editor? During the JUCE summit i also got the idea it's not a top priority. On this site you metion JUCE is there to makes things fast. A proper, easy to use GUI editor can save developers a lot of of time. I like the editor, but it could be so much better still. 
Just my two cents, but i would like to see more development on this part of JUCE.

 


#4

Oh, it says "Parent classes" (as in plural :) )

I set the field to:

public Component, public FilenameComponentListener

and now FilenameComponentListener shows up in EditorComponent class declaration. Thanks!

 

I also like the GUI editor and I undestand that for someone who is expert and very fluent in JUCE, it might be much more convenient to code UI by hand. On the other side, for beginners it is pure gold and to make any "simple" GUI it is just very valuable tool.

For any more complex designs, and especially for completely custom made GUIs, it may be good for initial layout and design with custom components), but after that, it is best to just remove GUI editor specific comments and proceed with manual editing/building.

In any case, IMO, GUI editor is a valuable tool.