// even when the programmer explicitly wants to hide it.
- (NSRect)constrainFrameRect:(NSRect)frameRect toScreen:(NSScreen *)screen
{
+ wxUnusedVar(screen);
return frameRect;
}
wxNonOwnedWindowCocoaImpl::~wxNonOwnedWindowCocoaImpl()
{
- [m_macWindow setImplementation:nil];
- [m_macWindow setDelegate:nil];
- [m_macWindow release];
+ if ( !m_wxPeer->IsNativeWindowWrapper() )
+ {
+ [m_macWindow setImplementation:nil];
+ [m_macWindow setDelegate:nil];
+ [m_macWindow release];
+ }
}
void wxNonOwnedWindowCocoaImpl::WillBeDestroyed()
{
- [m_macWindow setDelegate:nil];
+ if ( !m_wxPeer->IsNativeWindowWrapper() )
+ {
+ [m_macWindow setDelegate:nil];
+ }
}
void wxNonOwnedWindowCocoaImpl::Create( wxWindow* WXUNUSED(parent), const wxPoint& pos, const wxSize& size,
[m_macWindow setDelegate:controller];
[m_macWindow setAcceptsMouseMovedEvents: YES];
+
+ if ( ( style & wxFRAME_SHAPED) )
+ {
+ [m_macWindow setOpaque:NO];
+ [m_macWindow setAlphaValue:1.0];
+ }
}
+void wxNonOwnedWindowCocoaImpl::Create( wxWindow* WXUNUSED(parent), WXWindow nativeWindow )
+{
+ m_macWindow = nativeWindow;
+}
WXWindow wxNonOwnedWindowCocoaImpl::GetWXWindow() const
{
bool wxNonOwnedWindowCocoaImpl::IsMaximized() const
{
- return [m_macWindow isZoomed];
+ if (([m_macWindow styleMask] & NSResizableWindowMask) != 0)
+ {
+ return [m_macWindow isZoomed];
+ }
+ else
+ {
+ NSRect rectScreen = [[NSScreen mainScreen] visibleFrame];
+ NSRect rectWindow = [m_macWindow frame];
+ return (rectScreen.origin.x == rectWindow.origin.x &&
+ rectScreen.origin.y == rectWindow.origin.y &&
+ rectScreen.size.width == rectWindow.size.width &&
+ rectScreen.size.height == rectWindow.size.height);
+ }
}
bool wxNonOwnedWindowCocoaImpl::IsIconized() const
return [m_macWindow isDocumentEdited];
}
+wxNonOwnedWindowImpl* wxNonOwnedWindowImpl::CreateNonOwnedWindow( wxNonOwnedWindow* wxpeer, wxWindow* parent, WXWindow nativeWindow)
+{
+ wxNonOwnedWindowCocoaImpl* now = new wxNonOwnedWindowCocoaImpl( wxpeer );
+ now->Create( parent, nativeWindow );
+ return now;
+}
+
wxNonOwnedWindowImpl* wxNonOwnedWindowImpl::CreateNonOwnedWindow( wxNonOwnedWindow* wxpeer, wxWindow* parent, const wxPoint& pos, const wxSize& size,
long style, long extraStyle, const wxString& name )
{