VSTGUI  4.10
Graphical User Interface Framework not only for VST plugins
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Customization Class Reference

Customization helper for an UIDesc window. More...

+ Inheritance diagram for Customization:

Public Types

using CreateViewControllerFunc = std::function< IController *(const UTF8StringView &name, IController *parent, const IUIDescription *uiDesc)>
 

Public Member Functions

void addCreateViewControllerFunc (const UTF8String &name, CreateViewControllerFunc func)
 
IControllercreateController (const UTF8StringView &name, IController *parent, const IUIDescription *uiDesc) override
 Create a sub controller.
 
- Public Member Functions inherited from CustomizationAdapter
void onUIDescriptionParsed (const IUIDescription *uiDesc) override
 Notification that the UIDescription was sucessfully parsed.
 

Static Public Member Functions

static std::shared_ptr
< Customization
make ()
 

Detailed Description

Customization helper for an UIDesc window.

Use this class to create controllers for your views

Example:

using namespace VSTGUI::Standalone;
auto customization = UIDesc::Customization::make ();
customization->addCreateViewControllerFunc (
"MyFirstViewController", [] (const auto& name, auto parent, const auto uiDesc) {
return new MyFirstViewController (parent);
});
customization->addCreateViewControllerFunc (
"MySecondViewController", [] (const auto& name, auto parent, const auto uiDesc) {
return new MySecondViewController (parent);
});
config.uiDescFileName = "Window.uidesc";
config.viewName = "Window";
config.customization = customization;
config.windowConfig.title = "MyWindow";
config.windowConfig.style.border ().close ().size ().centered ();
if (auto window = UIDesc::makeWindow (config))
window->show ();

The view controller MyFirstViewController will be created when the sub-controller attribute of a view is equal to "MyFirstController" and the same for "MySecondViewController".

Member Typedef Documentation

using CreateViewControllerFunc = std::function<IController*( const UTF8StringView& name, IController* parent, const IUIDescription* uiDesc)>

Member Function Documentation

void addCreateViewControllerFunc ( const UTF8String name,
CreateViewControllerFunc  func 
)
inline
IController* createController ( const UTF8StringView name,
IController parent,
const IUIDescription uiDesc 
)
inlineoverridevirtual

Create a sub controller.

A sub controller can be defined in the UI editor for a view and will be responsible as a controller for the view and its children.

The controller will be automatically destroyed when the view is destroyed. You should always create a new controller instance here and do not cache it.

Parameters
namename of the sub controller
parentthe parent controller
uiDescthe UIDescription instance

Reimplemented from CustomizationAdapter.

static std::shared_ptr<Customization> make ( )
inlinestatic

The documentation for this class was generated from the following file: