]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/mediactrlcmn.cpp
scrolling hack (always move our own scrollbars highest in z-order)
[wxWidgets.git] / src / common / mediactrlcmn.cpp
index 3d91560123e5f0196e6e1e351c65b574b9eb030a..0a6665b37330db8c92bffa367515ca8e7139e05f 100644 (file)
@@ -93,7 +93,7 @@ bool wxMediaCtrl::Create(wxWindow* parent, wxWindowID id,
 
         if (!fileName.empty())
         {
-            if (!m_imp->Load(fileName))
+            if (!Load(fileName))
             {
                 delete m_imp;
                 m_imp = NULL;
@@ -101,6 +101,7 @@ bool wxMediaCtrl::Create(wxWindow* parent, wxWindowID id,
             }
         }
 
+        SetBestFittingSize(size);
         return true;
     }
     else
@@ -117,13 +118,19 @@ bool wxMediaCtrl::Create(wxWindow* parent, wxWindowID id,
 
             if (!fileName.empty())
             {
-                if (m_imp->Load(fileName))
+                if (Load(fileName))
+                {
+                    SetBestFittingSize(size);
                     return true;
+                }
                 else
                     delete m_imp;
             }
             else
+            {
+                SetBestFittingSize(size);
                 return true;
+            }
 
             classInfo = NextBackend();
         }
@@ -151,13 +158,14 @@ bool wxMediaCtrl::Create(wxWindow* parent, wxWindowID id,
             return false;
         }
 
-        if (!m_imp->Load(location))
+        if (!Load(location))
         {
             delete m_imp;
             m_imp = NULL;
             return false;
         }
 
+        SetBestFittingSize(size);
         return true;
     }
     else
@@ -172,8 +180,11 @@ bool wxMediaCtrl::Create(wxWindow* parent, wxWindowID id,
                          pos, size, style, validator, name))
                 continue;
 
-            if (m_imp->Load(location))
+            if (Load(location))
+            {
+                SetBestFittingSize(size);
                 return true;
+            }
             else
                 delete m_imp;