- updated
git-svn-id: http://moon:8086/svn/software/trunk/projects/mpsk_rx_gui@117 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
@@ -111,7 +111,8 @@ public:
|
||||
// NB: must not put this in the initialiser list, as it invokes a callback,
|
||||
// which will fail if the peer is only half-constructed.
|
||||
view = GlobalRef (android.activity.callObjectMethod (JuceAppActivity.createNewView,
|
||||
component.isOpaque(), (jlong) this));
|
||||
(jboolean) component.isOpaque(),
|
||||
(jlong) this));
|
||||
|
||||
if (isFocused())
|
||||
handleFocusGain();
|
||||
@@ -584,7 +585,7 @@ ComponentPeer* Component::createNewPeer (int styleFlags, void*)
|
||||
|
||||
jobject createOpenGLView (ComponentPeer* peer)
|
||||
{
|
||||
jobject parentView = static_cast <jobject> (peer->getNativeHandle());
|
||||
jobject parentView = static_cast<jobject> (peer->getNativeHandle());
|
||||
return getEnv()->CallObjectMethod (parentView, ComponentPeerView.createGLView);
|
||||
}
|
||||
|
||||
|
||||
@@ -172,10 +172,10 @@ void FileChooser::showPlatformDialog (Array<File>& results,
|
||||
[panel setDirectoryURL: [NSURL fileURLWithPath: juceStringToNS (directory)]];
|
||||
[panel setNameFieldStringValue: juceStringToNS (filename)];
|
||||
|
||||
if ([panel runModal] == NSOKButton)
|
||||
if ([panel runModal] == 1 /*NSModalResponseOK*/)
|
||||
#else
|
||||
if ([panel runModalForDirectory: juceStringToNS (directory)
|
||||
file: juceStringToNS (filename)] == NSOKButton)
|
||||
file: juceStringToNS (filename)] == 1 /*NSModalResponseOK*/)
|
||||
#endif
|
||||
{
|
||||
if (isSaveDialogue)
|
||||
|
||||
@@ -411,9 +411,9 @@ public:
|
||||
if (NSWindow* const viewWindow = [view window])
|
||||
{
|
||||
const NSRect windowFrame = [viewWindow frame];
|
||||
const NSPoint windowPoint = [view convertPoint: NSMakePoint (localPos.x, localPos.y) toView: nil];
|
||||
const NSPoint windowPoint = [view convertPoint: NSMakePoint (localPos.x, viewFrame.size.height - localPos.y) toView: nil];
|
||||
const NSPoint screenPoint = NSMakePoint (windowFrame.origin.x + windowPoint.x,
|
||||
windowFrame.origin.y + windowFrame.size.height - windowPoint.y);
|
||||
windowFrame.origin.y + windowPoint.y);
|
||||
|
||||
if (! isWindowAtPoint (viewWindow, screenPoint))
|
||||
return false;
|
||||
@@ -574,7 +574,15 @@ public:
|
||||
{
|
||||
currentModifiers = currentModifiers.withoutMouseButtons();
|
||||
|
||||
if (isWindowAtPoint ([ev window], [[ev window] convertBaseToScreen: [ev locationInWindow]]))
|
||||
NSPoint windowPos = [ev locationInWindow];
|
||||
|
||||
#if defined (MAC_OS_X_VERSION_10_7) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7
|
||||
NSPoint screenPos = [[ev window] convertRectToScreen: NSMakeRect (windowPos.x, windowPos.y, 1.0f, 1.0f)].origin;
|
||||
#else
|
||||
NSPoint screenPos = [[ev window] convertBaseToScreen: windowPos];
|
||||
#endif
|
||||
|
||||
if (isWindowAtPoint ([ev window], screenPos))
|
||||
sendMouseEvent (ev);
|
||||
else
|
||||
// moved into another window which overlaps this one, so trigger an exit
|
||||
@@ -1786,7 +1794,9 @@ private:
|
||||
|
||||
static void windowDidExitFullScreen (id, SEL, NSNotification*)
|
||||
{
|
||||
#if defined (MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
|
||||
[NSApp setPresentationOptions: NSApplicationPresentationDefault];
|
||||
#endif
|
||||
}
|
||||
|
||||
static void zoom (id self, SEL, id sender)
|
||||
|
||||
@@ -164,37 +164,29 @@ bool DragAndDropContainer::performExternalDragDropOfFiles (const StringArray& fi
|
||||
|
||||
JUCE_AUTORELEASEPOOL
|
||||
{
|
||||
NSView* view = (NSView*) sourceComp->getWindowHandle();
|
||||
if (NSView* view = (NSView*) sourceComp->getWindowHandle())
|
||||
{
|
||||
if (NSEvent* event = [[view window] currentEvent])
|
||||
{
|
||||
NSPoint eventPos = [event locationInWindow];
|
||||
NSRect dragRect = [view convertRect: NSMakeRect (eventPos.x - 16.0f, eventPos.y - 16.0f, 32.0f, 32.0f)
|
||||
fromView: nil];
|
||||
|
||||
if (view == nil)
|
||||
return false;
|
||||
for (int i = 0; i < files.size(); ++i)
|
||||
{
|
||||
if (! [view dragFile: juceStringToNS (files[i])
|
||||
fromRect: dragRect
|
||||
slideBack: YES
|
||||
event: event])
|
||||
return false;
|
||||
}
|
||||
|
||||
NSPasteboard* pboard = [NSPasteboard pasteboardWithName: NSDragPboard];
|
||||
[pboard declareTypes: [NSArray arrayWithObject: NSFilenamesPboardType]
|
||||
owner: nil];
|
||||
|
||||
NSMutableArray* filesArray = [NSMutableArray arrayWithCapacity: 4];
|
||||
for (int i = 0; i < files.size(); ++i)
|
||||
[filesArray addObject: juceStringToNS (files[i])];
|
||||
|
||||
[pboard setPropertyList: filesArray
|
||||
forType: NSFilenamesPboardType];
|
||||
|
||||
NSPoint dragPosition = [view convertPoint: [[[view window] currentEvent] locationInWindow]
|
||||
fromView: nil];
|
||||
dragPosition.x -= 16;
|
||||
dragPosition.y -= 16;
|
||||
|
||||
[view dragImage: [[NSWorkspace sharedWorkspace] iconForFile: juceStringToNS (files[0])]
|
||||
at: dragPosition
|
||||
offset: NSMakeSize (0, 0)
|
||||
event: [[view window] currentEvent]
|
||||
pasteboard: pboard
|
||||
source: view
|
||||
slideBack: YES];
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool DragAndDropContainer::performExternalDragDropOfText (const String& /*text*/)
|
||||
@@ -340,13 +332,13 @@ public:
|
||||
const_cast <Desktop::Displays&> (Desktop::getInstance().getDisplays()).refresh();
|
||||
}
|
||||
|
||||
juce_DeclareSingleton_SingleThreaded_Minimal (DisplaySettingsChangeCallback);
|
||||
juce_DeclareSingleton_SingleThreaded_Minimal (DisplaySettingsChangeCallback)
|
||||
|
||||
private:
|
||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (DisplaySettingsChangeCallback)
|
||||
};
|
||||
|
||||
juce_ImplementSingleton_SingleThreaded (DisplaySettingsChangeCallback);
|
||||
juce_ImplementSingleton_SingleThreaded (DisplaySettingsChangeCallback)
|
||||
|
||||
static Rectangle<int> convertDisplayRect (NSRect r, CGFloat mainScreenBottom)
|
||||
{
|
||||
|
||||
@@ -1226,7 +1226,7 @@ private:
|
||||
|
||||
LPCTSTR getWindowClassName() const noexcept { return (LPCTSTR) MAKELONG (atom, 0); }
|
||||
|
||||
juce_DeclareSingleton_SingleThreaded_Minimal (WindowClassHolder);
|
||||
juce_DeclareSingleton_SingleThreaded_Minimal (WindowClassHolder)
|
||||
|
||||
private:
|
||||
ATOM atom;
|
||||
@@ -1749,10 +1749,13 @@ private:
|
||||
|
||||
doMouseMove (position);
|
||||
|
||||
updateModifiersFromWParam (wParam);
|
||||
isDragging = true;
|
||||
if (isValidPeer (this))
|
||||
{
|
||||
updateModifiersFromWParam (wParam);
|
||||
isDragging = true;
|
||||
|
||||
doMouseEvent (position);
|
||||
doMouseEvent (position);
|
||||
}
|
||||
}
|
||||
|
||||
void doMouseUp (Point<float> position, const WPARAM wParam)
|
||||
@@ -2936,7 +2939,7 @@ ComponentPeer* createNonRepaintingEmbeddedWindowsPeer (Component& component, voi
|
||||
}
|
||||
|
||||
|
||||
juce_ImplementSingleton_SingleThreaded (HWNDComponentPeer::WindowClassHolder);
|
||||
juce_ImplementSingleton_SingleThreaded (HWNDComponentPeer::WindowClassHolder)
|
||||
|
||||
|
||||
//==============================================================================
|
||||
|
||||
Reference in New Issue
Block a user