Hello,
to work correctly, the buttons and the Outline have to exist within the same GUI component. You could do following:
Approach 1 (programmatically):
a.) Implement a generic ToolBox component containing the Outline view and all other ToolBox specific decorations.
b.) Wherever you want the ToolBox to be used embedd an instance of the ToolBox component. Except its decorations, it is empty at this moment.
c.) The buttons, you want to arrange in the ToolBox have to be added directly to the ToolBox instance. Create the button instances dynamically and use the methode Add() of the ToolBox component to add the buttons to it. Depending on the configuration of the Outline view within the ToolBox, the buttons will be arranged horizontally or vertically accoring the order in which you add them. Following is the code how you would add a new button instance to the ToolBox component:
// Create new instance of a button
var YourUnit::YourButton button = new YourUnit::YourButton;
// Configure the button
button.Caption = "Caption";
button.Icon = SomeUnit::SomeBitmap;
button.OnAction = SomeSlotMethode;
// Now add the button to the ToolBox component
ToolBox.Add( button, 0 );
Approach 2:
a.) Implement a generic ToolBox component containing the Outline view and all other ToolBox specific decorations.
b.) For every ToolBox variant derive a new class from your ToolBox component. So you will get e.g. an OpenToolBox, EditToolBox, ProjectToolBox, etc. Every ToolBox will be specialized to contain the particular buttons.
c.) Edit and fill the derived classes with all the necessary buttons by Drag&Drop instances of the button components directly in Composer.
d.) In every derived ToolBox class add properties to connect slot methods from the outside of the ToolBox. If the ToolBox has e.g. three buttons (New, Open and Close), add three properties so you can then connect three slot methods with the ToolBox. Assigning a value to the property should store it in the OnAction property of the corresponding button. Accordingly, when the user activates the button 'Open', the button will fire a signal to the slot property assigned previously to the corresponding property in the ToolBox component. This is implemented in OnSet methods corresponding to the property. For example, the property OnOpen would be intended to connect a slot method with the Open button:
if ( value == pure OnOpen )
return;
pure OnOpen = value;
OpenButton.OnAction = value;
d.) Finally embed instances of the adequate ToolBox class wherever you want the ToolBox to be used. Connect the slot methods to the corresponding properties, so activating the buttons will signal the slot methods.
I hope it helps you further.
Best regards
Paul Banach