I’m moving to custom container controls for some of my more complex layouts that are used in multiple projects.
I’ve created a Container layout, added the default content, set the “Inspector Behavior …” to expose default settings in the inspector and named the customer container as TGCCSettinsgContainer.
I save the project and reload it.
However, the TGCCSettingsContainer does not show up as an available Super type when I add a new ContaiinerControl or generic Class to my project.
Shouldn’t this show up in a sublist entry for ContainerControl in the class list popup when I click the edit button for the new control/class’ Super?
Further follow-up - why doesn’t the Inspector show the properties that I marked under “Inspector Behavior …” for the Template Container? Does that only work with sub-classible items?
[quote=347368:@Tim Jones]Okay, so I have to duplicate my “Template” CC and then create a separate control based on the differences between the controls.
Same result in the long run, just a slightly different design workflow.[/quote]
or just create a container that is “the common bits”
then for each unique controls put an instance of that + the unique bits
Here’s the layout with the Properties displayed. As in the above, the StartingHeight, HeaderTitle, and HeaderIcon are all checked to be exposed in the Inspector under “Behavior”.
Have you reloaded the project and added a new instance of the container to the designer after enabling those properties to be exposed / displayed? That usually fixes things for me. I had custom properties working with HTML Edit so I know they should be working on a ContainerControl.
4 times at this point. I have seen the Inspector Behaviors settings work before, Just not in 17r2 where I’m doing all of this new work. I’ll step back a couple of releases and determine if it’s this release.
[quote=347372:@Tim Jones]Further follow-up - why doesn’t the Inspector show the properties that I marked under “Inspector Behavior …” for the Template Container? Does that only work with sub-classible items?
Edit (Paul): Fixed DropBox image link per forum post formatting tips.[/quote]
The properties exposed in the inspector behavior show up for instances of the control on other layouts. Not in the control class itself.
Discovered that in my discussions with Norman. Thanks.
However, the current User Guide entry is less than helpful on this functionality:
Inspector Behavior
When creating custom controls, you may want to make some of your properties so they can be set at design time in the Inspector. Using the LinkLabel example above, it would be better if you could set the URL property in the Inspector for the control on the layout rather than having to put code in the Open event.
To do this, open the contextual menu for LinkLabel in the Navigator and select Inspector Behavior. This opens the Inspector Behavior dialog. In this dialog, you can control all the properties that appear in the Inspector, including any new ones that you add. If you scroll down, you will see the URL parameter. Check the box next to its name and click OK to have the property displayed in the Inspector for the control when it is on a layout. Now you can specify the URL in the Inspector and remove the Open event from the LinkLabel.
Other Features of the Inspector Behavior Dialog
The Inspector Behavior dialog allows you to control all aspects of what appears in the Inspector. You can:
Add or remove group headings: Use the + or - buttons below the list or use the contextual menu.
Change the order of the properties, including moving them to different groups: Drag properties around as needed.
Set or modify default values: Double-click in the Default Value column for the property to set or modify the default value.
Change whether a property is shown or hidden: Check the property to display it; uncheck it to hide it.
Add enumerations: Use the Enumerations control on the right to add values that the user can select from a list.
[quote=347510:@Norman Palardy]The relevant line Check the box next to its name and click OK to have the property displayed in the Inspector for the controlwhen it is on a layout.[/quote]
And - now that I know that and have seen it demonstrated, that line makes sense. Before I KNEW the way it worked, that line didn’t provide much in the way of explanation since I reviewed that page multiple times before I originally posted and didn’t take away how the actual mechanism worked. How about expanding it to something like this:
To see this in action:
Create your customer control
Select the proper Inspector Behavior entries to expose in the IDE
Drag and drop an instance of the control onto your layout
Scroll the inspector to the Behaviors section to see your exposed properties.