Setting the number of items per column

A user interface toolkit mainly for audio plug-ins (VST, AudioUnit, etc).
Post Reply
MarkusK
Posts: 53
Joined: Thu Oct 22, 2020 9:11 am

Setting the number of items per column

Post by MarkusK »

In VSTGUI 3.6 i simply did call myCoptionmenu->setNbItemsPerColumn(32) on openening the editor (::open) to group rows of 32 items in list selectors (Windows).

VST SDK 3.7 now uses the .uidesc file to build the editor.
IPlugView* PLUGIN_API T2Audio::createView(const char* name)
{
...
viewpointer = new VSTGUI::VST3Editor(this, "view", "FireBird.uidesc");
...
How can I access the COptionmenu for a given tag to call ->setNbItemsPerColumn(32) ?
How can I access the GUI part of a knob or control in general?

Thank you,
Markus

MarkusK
Posts: 53
Joined: Thu Oct 22, 2020 9:11 am

Re: Setting the number of items per collum

Post by MarkusK »

I tried this code, but it doesn't work. The pointer is incorrect
VSTGUI::COptionMenu *mymen;
mymen = (VSTGUI::COptionMenu*)(EditController::getParameterObject(kPatchSelect));
mymen->setNbItemsPerColumn(32);

Arne Scheffler
Posts: 417
Joined: Mon Jun 20, 2016 7:53 am

Re: Setting the number of items per collum

Post by Arne Scheffler »

Sorry, I don't think that you can get access to it that easy. You have to write your own controller code for it.

MarkusK
Posts: 53
Joined: Thu Oct 22, 2020 9:11 am

Re: Setting the number of items per collum

Post by MarkusK »

So it is not possible to have access to the GUI elemets which have been added to the frame?

Arne Scheffler
Posts: 417
Joined: Mon Jun 20, 2016 7:53 am

Re: Setting the number of items per collum

Post by Arne Scheffler »

If you like you can iterate thru all views in the frame if you like. But if you want to make this a case by case decision you should write a controller (IController) for that UI object.

MarkusK
Posts: 53
Joined: Thu Oct 22, 2020 9:11 am

Re: Setting the number of items per column

Post by MarkusK »

Thank you Arne,

can you please give me a short code snippet how do I can iterate through the views in the frame?

Markus

MarkusK
Posts: 53
Joined: Thu Oct 22, 2020 9:11 am

Re: Setting the number of items per column

Post by MarkusK »

nevermind. I was able to find a proper and clean solution for myself:
class MyController : public VSTGUI::IController
{
public:

MyController(IController* _parentController, T2Audio* synpointer, VSTGUI::VST3Editor* editorpointer)
{
parentController = _parentController; // --- save the parent listener
syn = synpointer;
editor = editorpointer;
}


//--- is called when a view is created -----
VSTGUI::CView* verifyView (VSTGUI::CView* view, const VSTGUI::UIAttributes& ,const VSTGUI::IUIDescription* ) override
{
if (VSTGUI::COptionMenu* om = dynamic_cast<VSTGUI::COptionMenu*> (view))
{
om->setNbItemsPerColumn(32);
}
return view;
}

Post Reply