Support wxGenericAnimationCtrl by the animation control XRC handler
This commit is contained in:
committed by
Vadim Zeitlin
parent
cc5fb63bf7
commit
2cdcd84928
@@ -52,6 +52,7 @@
|
||||
#include "objrefdlg.h"
|
||||
// For functions to manipulate the corresponding controls.
|
||||
#include "wx/animate.h"
|
||||
#include "wx/generic/animate.h"
|
||||
#include "wx/infobar.h"
|
||||
#include "wx/treectrl.h"
|
||||
#include "wx/listctrl.h"
|
||||
@@ -206,14 +207,17 @@ void MyFrame::OnAnimationCtrlPlay(wxCommandEvent& event)
|
||||
|
||||
wxWindow *win = btn->GetParent();
|
||||
wxAnimationCtrl *ctrl = XRCCTRL(*win, "controls_animation_ctrl", wxAnimationCtrl);
|
||||
wxGenericAnimationCtrl *generic =
|
||||
XRCCTRL(*win, "controls_generic_animation_ctrl", wxGenericAnimationCtrl);
|
||||
if (ctrl->IsPlaying())
|
||||
{
|
||||
ctrl->Stop();
|
||||
generic->Stop();
|
||||
btn->SetLabel("Play");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ctrl->Play())
|
||||
if ( ctrl->Play() && generic->Play() )
|
||||
btn->SetLabel("Stop");
|
||||
else
|
||||
wxLogError("Cannot play the animation...");
|
||||
|
Reference in New Issue
Block a user