Can I create composite controls from existing composite controls


#1

Lets say i create a composit control... Something simple like a text box and a button... It represents a file path and open button.   I save that as say MyFileComponent... 

Then within the same project, I wanted to create another control... An XML file viewer control.  This control would be a composit control that contained both a large text box as well as the "MyFileComponent" control.

Is this possible in Introjucer?  I just tried something like that out but didn't see anything that supported this concept.

 

Thanks
Rick


#2

Yes - that's what the "Introjucer component" type is for.


#3

Do you happen to have a tutorial for this, I seem to be doing something wrong.  I'll outline the steps I went went throught... 

I created a new project called FilePicker. It has

  • Main.cpp
  • MainComponent.cpp
  • MainComponent.h
  • FilePicker.cpp
  • FilePicker.h

FilePicker is the "New Gui Component"..  
I placed a text box and a button on it.
Resized the control size down to 400x40.  
I then saved the files, saved the project and closed the project.

-------------------------------------------

I then created a new project named "TestingMultiComp"
Added a "New Gui Component"
Named new gui component "Parent"
Opened "Parent.cpp"
Right clicked to bring up menu, chose "New Introjucer Component"
Over to the right in the properties panel I clicked on Jucer File and chose the "FilePicker.jucer" file
 

After that, the New Introjucer Component just shows "No Files Loaded". 
For grins, I went a head and opened "TestingMultiComp" in Visual Studio, I could see varioius places where FilePicker was imbedded in the code, but, none of the "FilePicker" source code files were exported out into the Visual Studio project. 

 

Any help will be greatly appreciated! :)
Rick


#4

Over to the right in the properties panel I clicked on Jucer File and chose the "FilePicker.jucer" file

It's the cpp file containing the component that you want, not the entire jucer project!


#5

Ah, ok.... That works!  Thanks Jules!!