From 42df313efad155ca10dcf4200312bfde8a0045df Mon Sep 17 00:00:00 2001 From: jules Date: Tue, 30 Oct 2007 14:33:09 +0000 Subject: [PATCH] --- .../formats/RTAS/juce_RTASUtilities.cpp | 3 ++ .../wrapper/formats/RTAS/juce_RTASWrapper.cpp | 31 ++++++++++++++++--- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/extras/audio plugins/wrapper/formats/RTAS/juce_RTASUtilities.cpp b/extras/audio plugins/wrapper/formats/RTAS/juce_RTASUtilities.cpp index acaf0e8924..786d442609 100644 --- a/extras/audio plugins/wrapper/formats/RTAS/juce_RTASUtilities.cpp +++ b/extras/audio plugins/wrapper/formats/RTAS/juce_RTASUtilities.cpp @@ -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, diff --git a/extras/audio plugins/wrapper/formats/RTAS/juce_RTASWrapper.cpp b/extras/audio plugins/wrapper/formats/RTAS/juce_RTASWrapper.cpp index 812d8c8217..460b284ef0 100644 --- a/extras/audio plugins/wrapper/formats/RTAS/juce_RTASWrapper.cpp +++ b/extras/audio plugins/wrapper/formats/RTAS/juce_RTASWrapper.cpp @@ -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)