Audacity 3.2.0
Public Member Functions | Private Attributes | List of all members
internal::PlugFrame Class Referencefinal

Dispatches window resize events from VST PlugView to the wxWindow. More...

#include <PlugFrame.h>

Inheritance diagram for internal::PlugFrame:
[legend]
Collaboration diagram for internal::PlugFrame:
[legend]

Public Member Functions

 PlugFrame (wxWindow *window)
 
virtual ~PlugFrame ()
 
void init (Steinberg::IPlugView *view, Steinberg::ViewRect *size)
 
Steinberg::tresult PLUGIN_API resizeView (Steinberg::IPlugView *view, Steinberg::ViewRect *newSize) override
 

Private Attributes

wxWeakRef< wxWindow > mWindow
 
bool mInitialized {false}
 

Detailed Description

Dispatches window resize events from VST PlugView to the wxWindow.

Definition at line 22 of file PlugFrame.h.

Constructor & Destructor Documentation

◆ PlugFrame()

internal::PlugFrame::PlugFrame ( wxWindow *  window)

Definition at line 16 of file PlugFrame.cpp.

17 : mWindow(window)
18{
19 FUNKNOWN_CTOR
20}
wxWeakRef< wxWindow > mWindow
Definition: PlugFrame.h:24

◆ ~PlugFrame()

internal::PlugFrame::~PlugFrame ( )
virtual

Definition at line 22 of file PlugFrame.cpp.

23{
24 FUNKNOWN_DTOR;
25}

Member Function Documentation

◆ init()

void internal::PlugFrame::init ( Steinberg::IPlugView *  view,
Steinberg::ViewRect *  size 
)

Definition at line 27 of file PlugFrame.cpp.

28{
29 if(!mInitialized)
30 resizeView(view, size);
31}
Steinberg::tresult PLUGIN_API resizeView(Steinberg::IPlugView *view, Steinberg::ViewRect *newSize) override
Definition: PlugFrame.cpp:33

References size.

◆ resizeView()

Steinberg::tresult internal::PlugFrame::resizeView ( Steinberg::IPlugView *  view,
Steinberg::ViewRect *  newSize 
)
override

Definition at line 33 of file PlugFrame.cpp.

34{
35 if(auto window = mWindow.get())
36 {
37 auto topWindow = wxGetTopLevelParent(window);
38
39 wxWindowUpdateLocker windowUpdateLocker(topWindow);
40
41 window->SetInitialSize({newSize->getWidth(), newSize->getHeight() });
42
43 topWindow->SetMinSize(wxDefaultSize);
44 topWindow->Fit();
45 topWindow->SetMinSize(topWindow->GetSize());
46
47 if(!mInitialized)
48 {
49 mInitialized = true;
50 topWindow->Center();
51 }
52 return view->onSize(newSize);
53 }
54 return Steinberg::kResultFalse;
55}

Member Data Documentation

◆ mInitialized

bool internal::PlugFrame::mInitialized {false}
private

Definition at line 25 of file PlugFrame.h.

◆ mWindow

wxWeakRef<wxWindow> internal::PlugFrame::mWindow
private

Definition at line 24 of file PlugFrame.h.


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