Browse Source

Made native OSX windows call ComponentBoundsConstrainer::resizeStart() and resizeEnd()

tags/2021-05-28
jules 12 years ago
parent
commit
1f90f380b3
1 changed files with 26 additions and 0 deletions
  1. +26
    -0
      modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm

+ 26
- 0
modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm View File

@@ -861,6 +861,18 @@ public:
window = [view window];
}
void liveResizingStart()
{
if (constrainer != nullptr)
constrainer->resizeStart();
}
void liveResizingEnd()
{
if (constrainer != nullptr)
constrainer->resizeEnd();
}
NSRect constrainRect (NSRect r)
{
if (constrainer != nullptr
@@ -1683,6 +1695,8 @@ struct JuceNSWindowClass : public ObjCClass <NSWindow>
addMethod (@selector (windowWillResize:toSize:), windowWillResize, @encode (NSSize), "@:@", @encode (NSSize));
addMethod (@selector (zoom:), zoom, "v@:@");
addMethod (@selector (windowWillMove:), windowWillMove, "v@:@");
addMethod (@selector (windowWillStartLiveResize:), windowWillStartLiveResize, "v@:@");
addMethod (@selector (windowDidEndLiveResize:), windowDidEndLiveResize, "v@:@");
#if defined (MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
addProtocol (@protocol (NSWindowDelegate));
@@ -1767,6 +1781,18 @@ private:
if (owner->hasNativeTitleBar())
owner->sendModalInputAttemptIfBlocked();
}
static void windowWillStartLiveResize (id self, SEL, NSNotification*)
{
if (NSViewComponentPeer* const owner = getOwner (self))
owner->liveResizingStart();
}
static void windowDidEndLiveResize (id self, SEL, NSNotification*)
{
if (NSViewComponentPeer* const owner = getOwner (self))
owner->liveResizingEnd();
}
};
NSView* NSViewComponentPeer::createViewInstance()


Loading…
Cancel
Save