]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/mediactrlcmn.cpp
wxDataViewChoiceRenderer's editor control should have the same size as the cell.
[wxWidgets.git] / src / common / mediactrlcmn.cpp
index 79e6799352b7a2ced070b34f03f87dfde25ccf47..555c6e71e3a28b01d6a1bbca6c7f04d8f4bcd0f9 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        src/common/mediactrl.cpp
+// Name:        src/common/mediactrlcmn.cpp
 // Purpose:     wxMediaCtrl common code
 // Author:      Ryan Norton <wxprojects@comcast.net>
 // Modified by:
 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
 IMPLEMENT_CLASS(wxMediaCtrl, wxControl)
-wxDEFINE_EVENT( wxEVT_MEDIA_STATECHANGED, wxMediaEvent )
-wxDEFINE_EVENT( wxEVT_MEDIA_PLAY, wxMediaEvent )
-wxDEFINE_EVENT( wxEVT_MEDIA_PAUSE, wxMediaEvent )
+wxDEFINE_EVENT( wxEVT_MEDIA_STATECHANGED, wxMediaEvent );
+wxDEFINE_EVENT( wxEVT_MEDIA_PLAY, wxMediaEvent );
+wxDEFINE_EVENT( wxEVT_MEDIA_PAUSE, wxMediaEvent );
 IMPLEMENT_CLASS(wxMediaBackend, wxObject)
 IMPLEMENT_DYNAMIC_CLASS(wxMediaEvent, wxEvent)
-wxDEFINE_EVENT( wxEVT_MEDIA_FINISHED, wxMediaEvent )
-wxDEFINE_EVENT( wxEVT_MEDIA_LOADED, wxMediaEvent )
-wxDEFINE_EVENT( wxEVT_MEDIA_STOP, wxMediaEvent )
+wxDEFINE_EVENT( wxEVT_MEDIA_FINISHED, wxMediaEvent );
+wxDEFINE_EVENT( wxEVT_MEDIA_LOADED, wxMediaEvent );
+wxDEFINE_EVENT( wxEVT_MEDIA_STOP, wxMediaEvent );
 
 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 //
@@ -107,8 +107,7 @@ bool wxMediaCtrl::Create(wxWindow* parent, wxWindowID id,
         {
             if (!Load(fileName))
             {
-                delete m_imp;
-                m_imp = NULL;
+                wxDELETE(m_imp);
                 return false;
             }
         }
@@ -124,7 +123,6 @@ bool wxMediaCtrl::Create(wxWindow* parent, wxWindowID id,
 
         while((classInfo = NextBackend(&it)) != NULL)
         {
-            wxLogMessage( classInfo->GetClassName() );
             if(!DoCreate(classInfo, parent, id,
                          pos, size, style, validator, name))
                 continue;
@@ -172,8 +170,7 @@ bool wxMediaCtrl::Create(wxWindow* parent, wxWindowID id,
 
         if (!Load(location))
         {
-            delete m_imp;
-            m_imp = NULL;
+            wxDELETE(m_imp);
             return false;
         }
 
@@ -513,13 +510,13 @@ bool wxMediaBackendCommonBase::SendStopEvent()
 {
     wxMediaEvent theEvent(wxEVT_MEDIA_STOP, m_ctrl->GetId());
 
-    return !m_ctrl->ProcessEvent(theEvent) || theEvent.IsAllowed();
+    return !m_ctrl->GetEventHandler()->ProcessEvent(theEvent) || theEvent.IsAllowed();
 }
 
 void wxMediaBackendCommonBase::QueueEvent(wxEventType evtType)
 {
     wxMediaEvent theEvent(evtType, m_ctrl->GetId());
-    m_ctrl->AddPendingEvent(theEvent);
+    m_ctrl->GetEventHandler()->AddPendingEvent(theEvent);
 }
 
 void wxMediaBackendCommonBase::QueuePlayEvent()