]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/cocoa/nonownedwnd.mm
Add wxTLW::SetModified to allow apps to set the TLW's dirty state. On Mac this gives...
[wxWidgets.git] / src / osx / cocoa / nonownedwnd.mm
index fd0b0a3648eb3ae27c62a8c47492d0b83f50d60b..10098f74f53f32471c798f445e7929b508cd60dc 100644 (file)
@@ -132,6 +132,14 @@ typedef void (*wxOSX_NoResponderHandlerPtr)(NSView* self, SEL _cmd, SEL selector
     }
 }
 
+// We need this for borderless windows, i.e. shaped windows or windows without  
+// a title bar. For more info, see:
+// http://lists.apple.com/archives/cocoa-dev/2008/May/msg02091.html
+- (BOOL)canBecomeKeyWindow
+{
+    return YES;
+}
+
 @end
 
 @interface wxNSPanel : NSPanel
@@ -482,7 +490,7 @@ void wxNonOwnedWindowCocoaImpl::Lower()
 
 void wxNonOwnedWindowCocoaImpl::ShowWithoutActivating()
 {
-    [m_macWindow orderBack:nil];
+    [m_macWindow orderFront:nil];
     [[m_macWindow contentView] setNeedsDisplay: YES];
 }
 
@@ -719,6 +727,16 @@ bool wxNonOwnedWindowCocoaImpl::IsActive()
     return [m_macWindow isKeyWindow];
 }
 
+void wxNonOwnedWindowCocoaImpl::SetModified(bool modified)
+{
+    [m_macWindow setDocumentEdited:modified];
+}
+
+bool wxNonOwnedWindowCocoaImpl::GetModified() const
+{
+    return [m_macWindow isDocumentEdited];
+}
+
 wxNonOwnedWindowImpl* wxNonOwnedWindowImpl::CreateNonOwnedWindow( wxNonOwnedWindow* wxpeer, wxWindow* parent, const wxPoint& pos, const wxSize& size,
     long style, long extraStyle, const wxString& name )
 {