diff --git a/include/wx/mediactrl.h b/include/wx/mediactrl.h index 17b359dc15..ff159817ee 100644 --- a/include/wx/mediactrl.h +++ b/include/wx/mediactrl.h @@ -37,6 +37,8 @@ #include "wx/control.h" #include "wx/uri.h" +#define wxMC_NO_AUTORESIZE 0x0001 + // ============================================================================ // Declarations // ============================================================================ diff --git a/interface/wx/mediactrl.h b/interface/wx/mediactrl.h index 27eb3b0761..4287ab8588 100644 --- a/interface/wx/mediactrl.h +++ b/interface/wx/mediactrl.h @@ -5,6 +5,8 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// +#define wxMC_NO_AUTORESIZE 0x0001 + /** Describes the current state of the media. @@ -225,6 +227,16 @@ public: wxActiveXContainer documentation. + @beginStyleTable + @style{wxMC_NO_AUTORESIZE} + By default, the control will automatically adjust its size to + exactly fit the size of a loaded video as soon as a video is loaded. + If this flag is given, the control will not change its size + automatically and must be done manually (if desired) using Layout(). + It is strongly recommended to use this flag and handle control + resizing manually. + @endStyleTable + @library{wxmedia} @category{media} diff --git a/src/common/mediactrlcmn.cpp b/src/common/mediactrlcmn.cpp index 70413a28ca..e4bc3f2a7e 100644 --- a/src/common/mediactrlcmn.cpp +++ b/src/common/mediactrlcmn.cpp @@ -466,6 +466,9 @@ void wxMediaCtrl::DoMoveWindow(int x, int y, int w, int h) void wxMediaBackendCommonBase::NotifyMovieSizeChanged() { + if ( m_ctrl->HasFlag(wxMC_NO_AUTORESIZE) ) + return; + // our best size changed after opening a new file m_ctrl->InvalidateBestSize(); m_ctrl->SetSize(m_ctrl->GetSize());