mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-11 23:54:18 +00:00
This commit is contained in:
parent
e5dc936c5b
commit
42df313efa
2 changed files with 30 additions and 4 deletions
|
|
@ -67,6 +67,9 @@ void JUCE_CALLTYPE attachSubWindow (void* hostWindow,
|
|||
DWORD val = GetWindowLong (plugWnd, GWL_STYLE);
|
||||
val = (val & ~WS_POPUP) | WS_CHILD;
|
||||
SetWindowLong (plugWnd, GWL_STYLE, val);
|
||||
|
||||
val = GetWindowLong ((HWND) hostWindow, GWL_STYLE);
|
||||
SetWindowLong ((HWND) hostWindow, GWL_STYLE, val | WS_CLIPCHILDREN);
|
||||
}
|
||||
|
||||
void JUCE_CALLTYPE resizeHostWindow (void* hostWindow,
|
||||
|
|
|
|||
|
|
@ -77,6 +77,7 @@
|
|||
#include "CEffectTypeRTAS.h"
|
||||
#include "CPluginControl.h"
|
||||
#include "CPluginControl_OnOff.h"
|
||||
#include "FicProcessTokens.h"
|
||||
|
||||
//==============================================================================
|
||||
#ifdef _MSC_VER
|
||||
|
|
@ -171,12 +172,15 @@ public:
|
|||
}
|
||||
|
||||
//==============================================================================
|
||||
class JuceCustomUIView : public CCustomView
|
||||
class JuceCustomUIView : public CCustomView,
|
||||
public Timer
|
||||
{
|
||||
public:
|
||||
//==============================================================================
|
||||
JuceCustomUIView (AudioProcessor* const filter_)
|
||||
JuceCustomUIView (AudioProcessor* const filter_,
|
||||
JucePlugInProcess* const process_)
|
||||
: filter (filter_),
|
||||
process (process_),
|
||||
editorComp (0),
|
||||
wrapper (0)
|
||||
{
|
||||
|
|
@ -197,13 +201,30 @@ public:
|
|||
jassert (editorComp != 0);
|
||||
}
|
||||
|
||||
Rect oldRect;
|
||||
GetRect (&oldRect);
|
||||
|
||||
Rect r;
|
||||
r.left = 0;
|
||||
r.top = 0;
|
||||
r.right = editorComp->getWidth();
|
||||
r.bottom = editorComp->getHeight();
|
||||
|
||||
SetRect (&r);
|
||||
|
||||
if ((oldRect.right != r.right) || (oldRect.bottom != r.bottom))
|
||||
startTimer (50);
|
||||
}
|
||||
|
||||
void timerCallback()
|
||||
{
|
||||
if (! JUCE_NAMESPACE::Component::isMouseButtonDownAnywhere())
|
||||
{
|
||||
stopTimer();
|
||||
|
||||
// Send a token to the host to tell it about the resize
|
||||
SSetProcessWindowResizeToken token (process->fRootNameId, process->fRootNameId);
|
||||
FicSDSDispatchToken (&token);
|
||||
}
|
||||
}
|
||||
|
||||
void attachToWindow (GrafPtr port)
|
||||
|
|
@ -262,6 +283,7 @@ public:
|
|||
//==============================================================================
|
||||
private:
|
||||
AudioProcessor* const filter;
|
||||
JucePlugInProcess* const process;
|
||||
juce::Component* wrapper;
|
||||
AudioProcessorEditor* editorComp;
|
||||
|
||||
|
|
@ -450,6 +472,7 @@ public:
|
|||
|
||||
#if JUCE_WIN32
|
||||
resizeHostWindow (hostWindow, titleW, titleH, this);
|
||||
owner->updateSize();
|
||||
#else
|
||||
Rect r;
|
||||
GetWindowBounds ((WindowRef) hostWindow, kWindowContentRgn, &r);
|
||||
|
|
@ -533,7 +556,7 @@ public:
|
|||
|
||||
CPlugInView* CreateCPlugInView()
|
||||
{
|
||||
return new JuceCustomUIView (juceFilter);
|
||||
return new JuceCustomUIView (juceFilter, this);
|
||||
}
|
||||
|
||||
void SetViewPort (GrafPtr port)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue