]> git.saurik.com Git - wxWidgets.git/commitdiff
fix a loading bug - set size if movie is passed into ctor
authorRyan Norton <wxprojects@comcast.net>
Wed, 24 Nov 2004 19:10:44 +0000 (19:10 +0000)
committerRyan Norton <wxprojects@comcast.net>
Wed, 24 Nov 2004 19:10:44 +0000 (19:10 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30757 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

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;