VSTGUI 4.10 Graphical User Interface Framework not only for VST plugins

Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
Customization Class Reference
Standalone Library

Customization helper for an UIDesc window. More...

`#include <customization.h>`

Inheritance diagram for Customization:

## Public Types
using | CreateViewControllerFunc

## Public Member Functions
void | addCreateViewControllerFunc (const UTF8String &name, CreateViewControllerFunc func)
IController * | createController (const UTF8StringView &name, IController *parent, const IUIDescription *uiDesc) override
| Create a sub controller.
Public Member Functions inherited from CustomizationAdapter
IController * | createController (const UTF8StringView &name, IController *parent, const IUIDescription *uiDesc) override
| Create a sub controller.
void | onUIDescriptionParsed (const IUIDescription *uiDesc) override
| Notification that the UIDescription was sucessfully parsed.
Public Member Functions inherited from Interface
virtual | ~Interface () noexcept
| Interface ()=default
| Interface (const Interface &)=delete
| Interface (Interface &&)=delete
Interface & | operator= (const Interface &)=delete
Interface & | operator= (Interface &&)=delete
template<typename T>
const auto | dynamicCast () const
template<typename T>
auto | dynamicCast ()

## 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);
});
UIDesc::Config config;
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 ();
VSTGUI::Standalone::UIDesc::Customization::make
static std::shared_ptr< Customization > make()
Definition customization.h:70
VSTGUI::Standalone::UIDesc::makeWindow
WindowPtr makeWindow(const Config &config)
Create a window with an UIDescription.
VSTGUI::Standalone
Standalone Library
Definition appinit.h:11
VSTGUI::Standalone::UIDesc::Config
Configuration for an UIDescription window.
Definition iuidescwindow.h:70
VSTGUI::Standalone::UIDesc::Config::customization
CustomizationPtr customization
Optional UI customization
Definition iuidescwindow.h:94
VSTGUI::Standalone::UIDesc::Config::uiDescFileName
UTF8String uiDescFileName
Filename of the UIDescription xml file.
Definition iuidescwindow.h:72
VSTGUI::Standalone::UIDesc::Config::viewName
UTF8String viewName
Template name of the view in the uidesc file to show in the window.
Definition iuidescwindow.h:75
VSTGUI::Standalone::UIDesc::Config::windowConfig
WindowConfiguration windowConfig
Window configuration.
Definition iuidescwindow.h:78
VSTGUI::Standalone::WindowConfiguration::title
UTF8String title
Window title.
Definition iwindow.h:145
VSTGUI::Standalone::WindowConfiguration::style
WindowStyle style
Window style.
Definition iwindow.h:141
VSTGUI::Standalone::WindowStyle::border
WindowStyle & border()
Definition iwindow.h:89
VSTGUI::Standalone::WindowStyle::centered
WindowStyle & centered()
Definition iwindow.h:114
VSTGUI::Standalone::WindowStyle::close
WindowStyle & close()
Definition iwindow.h:94
VSTGUI::Standalone::WindowStyle::size
WindowStyle & size()
Definition iwindow.h:99

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

## ◆ CreateViewControllerFunc

using CreateViewControllerFunc

Initial value:
std::function<IController*(
const UTF8StringView& name, IController* parent, const IUIDescription* uiDesc)>
VSTGUI::IController
extension to IControlListener used by UIDescription
Definition icontroller.h:20
VSTGUI::IUIDescription
Definition iuidescription.h:20
VSTGUI::UTF8StringView
a view on a null terminated UTF-8 String
Definition cstring.h:182

## Member Function Documentation

## ◆ addCreateViewControllerFunc()

void addCreateViewControllerFunc | ( | const UTF8String & | name,
|  | CreateViewControllerFunc | func )
| inline

## ◆ createController()

IController * createController | ( | const UTF8StringView & | name,
|  | IController * | parent,
|  | const IUIDescription * | uiDesc )
| inline override virtual

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

  name | name of the sub controller
  parent | the parent controller
  uiDesc | the UIDescription instance

Implements ICustomization.

## ◆ make()

static std::shared_ptr< Customization > make | ( |  | ) |
| inline static

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

- customization.h