+void MyFrame::OnSetNullAnimation(wxCommandEvent& WXUNUSED(event))
+{
+ m_animationCtrl->SetAnimation(wxNullAnimation);
+}
+
+void MyFrame::OnSetInactiveBitmap(wxCommandEvent& event)
+{
+ if (event.IsChecked())
+ {
+ // set a dummy bitmap as the inactive bitmap
+ wxBitmap bmp = wxArtProvider::GetBitmap(wxART_MISSING_IMAGE);
+ m_animationCtrl->SetInactiveBitmap(bmp);
+ }
+ else
+ m_animationCtrl->SetInactiveBitmap(wxNullBitmap);
+}
+
+void MyFrame::OnSetNoAutoResize(wxCommandEvent& event)
+{
+ // recreate the control with the new flag if necessary
+ long style = wxAC_DEFAULT_STYLE |
+ (event.IsChecked() ? wxAC_NO_AUTORESIZE : 0);
+
+ if (style != m_animationCtrl->GetWindowStyle())
+ {
+ // save status of the control before destroying it
+ wxAnimation curr = m_animationCtrl->GetAnimation();
+ wxBitmap inactive = m_animationCtrl->GetInactiveBitmap();
+ wxColour bg = m_animationCtrl->GetBackgroundColour();
+
+ // destroy & rebuild
+ wxAnimationCtrl *old = m_animationCtrl;
+ m_animationCtrl = new wxAnimationCtrl(this, wxID_ANY, curr,
+ wxDefaultPosition, wxDefaultSize,
+ style);
+
+ GetSizer()->Replace(old, m_animationCtrl);
+ delete old;
+
+ // load old status in new control
+ m_animationCtrl->SetInactiveBitmap(inactive);
+ m_animationCtrl->SetBackgroundColour(bg);
+
+ GetSizer()->Layout();
+ }
+}
+
+void MyFrame::OnSetBgColor(wxCommandEvent& WXUNUSED(event))
+{
+ wxColour clr = wxGetColourFromUser(this, m_animationCtrl->GetBackgroundColour(),
+ wxT("Choose the background colour"));
+
+ if (clr.IsOk())
+ m_animationCtrl->SetBackgroundColour(clr);
+}
+