]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/toplevel_osx.cpp
Fix discrepancy between different ways of measuring text extents under Mac.
[wxWidgets.git] / src / osx / toplevel_osx.cpp
index 738b5d607d38f899c0fe7b3a7f2889393379748d..0e646c5f697bd1ade572fa674dd47664f3b96cee 100644 (file)
@@ -73,7 +73,10 @@ bool wxTopLevelWindowMac::Create(wxWindow *parent,
                                  long style,
                                  const wxString& name)
 {
                                  long style,
                                  const wxString& name)
 {
-    if ( !wxNonOwnedWindow::Create(parent, id, pos, size, style, name) )
+    int w = WidthDefault(size.x);
+    int h = HeightDefault(size.y);
+
+    if ( !wxNonOwnedWindow::Create(parent, id, pos, wxSize(w,h), style, name) )
         return false;
 
     wxWindow::SetLabel( title ) ;
         return false;
 
     wxWindow::SetLabel( title ) ;
@@ -145,7 +148,8 @@ wxPoint wxTopLevelWindowMac::GetClientAreaOrigin() const
 void wxTopLevelWindowMac::SetTitle(const wxString& title)
 {
     wxWindow::SetLabel( title ) ;
 void wxTopLevelWindowMac::SetTitle(const wxString& title)
 {
     wxWindow::SetLabel( title ) ;
-    m_nowpeer->SetTitle(title, GetFont().GetEncoding() );
+    if ( m_nowpeer )
+        m_nowpeer->SetTitle(title, GetFont().GetEncoding() );
 }
 
 wxString wxTopLevelWindowMac::GetTitle() const
 }
 
 wxString wxTopLevelWindowMac::GetTitle() const
@@ -153,6 +157,11 @@ wxString wxTopLevelWindowMac::GetTitle() const
     return wxWindow::GetLabel();
 }
 
     return wxWindow::GetLabel();
 }
 
+void wxTopLevelWindowMac::ShowWithoutActivating()
+{
+    return m_nowpeer->ShowWithoutActivating();
+}
+
 bool wxTopLevelWindowMac::ShowFullScreen(bool show, long style)
 {
     return m_nowpeer->ShowFullScreen(show, style);
 bool wxTopLevelWindowMac::ShowFullScreen(bool show, long style)
 {
     return m_nowpeer->ShowFullScreen(show, style);
@@ -167,3 +176,8 @@ void wxTopLevelWindowMac::RequestUserAttention(int flags)
 {
     return m_nowpeer->RequestUserAttention(flags);
 }
 {
     return m_nowpeer->RequestUserAttention(flags);
 }
+
+bool wxTopLevelWindowMac::IsActive()
+{
+    return m_nowpeer->IsActive();
+}