From b1096e457376f243fcf99384aa760563cf4869d0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?W=C5=82odzimierz=20Skiba?= Date: Wed, 24 Nov 2004 15:43:56 +0000 Subject: [PATCH] wxMediaCtrl in wxSplashScreen presentation. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30752 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/splash/press.mpg | Bin 0 -> 416 bytes samples/splash/press.pov | 80 ++++++++++++++++++++++++++++++++++++++ samples/splash/splash.bkl | 3 +- samples/splash/splash.cpp | 12 +++++- 4 files changed, 92 insertions(+), 3 deletions(-) create mode 100644 samples/splash/press.mpg create mode 100644 samples/splash/press.pov diff --git a/samples/splash/press.mpg b/samples/splash/press.mpg new file mode 100644 index 0000000000000000000000000000000000000000..2f46c38434cd62a1aa2029d6f5d88436361f36e4 GIT binary patch literal 416 zcmZQzVBE~gU?cqh|AQqA42(M%I2as&Gy?>gGB5?(bRgM~A&s#V?2`F|A}VC=!@-;)AH-dSM}(MWz*O zOAZOTPMv)BTE-5OSpgEdJ@y<8s~mY`3|KRj4us4Sl5p}^-?ZuguZN3Lx90ENpA!To zoNN^dUQqFa>w`0ggYv&mx|KX!Y)O|kPuRhpV9j&1_CisD?36`<=KYclmL19EiaD1g=Z24J#Acc$`@JFWE58 zbZkgz2`kH+WZzK6yzR(>GfXamuO4V0 }; + #declare Objects[ Items ] = + #if ( Counter = 0 | Counter = Items ) + object{ + #else + union{ + object{ Objects[ Items ] translate y*1.1 } + #end + object{ Objects[ Counter ] } + }; + + #declare X0=Counter/(Items+1); + #declare Y0=0; + #declare X1=(Counter+1)/(Items+1); + #declare Y1=1; + #declare X2=(Counter+2)/(Items+1); + #declare Y2=0; + + #declare increase=f_line(clock,X0,Y0,X1,Y1); + #declare decrease=f_line(clock,X1,Y1,X2,Y2); + #declare change=min(increase,decrease); + #declare level=max(change,0); + + object{ + Objects[ Counter ] + pigment{ rgb level transmit 1-level } + } + #declare Counter = Counter + 1; +#end + diff --git a/samples/splash/splash.bkl b/samples/splash/splash.bkl index 856b3c4528..44b52eb4e4 100644 --- a/samples/splash/splash.bkl +++ b/samples/splash/splash.bkl @@ -10,11 +10,12 @@ adv core base + media ../sample.rc - splash.png + splash.png press.mpg diff --git a/samples/splash/splash.cpp b/samples/splash/splash.cpp index 4791c1f4c0..290058ca79 100644 --- a/samples/splash/splash.cpp +++ b/samples/splash/splash.cpp @@ -32,6 +32,7 @@ #include "wx/image.h" #include "wx/splash.h" +#include "wx/mediactrl.h" // ---------------------------------------------------------------------------- // resources @@ -194,16 +195,23 @@ void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { wxImage image = bitmap.ConvertToImage(); image.Rescale( bitmap.GetWidth()/2, bitmap.GetHeight()/2 ); - bitmap = wxBitmap(image); + bitmap = wxBitmap(image); wxSplashScreen *splash = new wxSplashScreen(bitmap, wxSPLASH_CENTRE_ON_PARENT | wxSPLASH_NO_TIMEOUT, 0, this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSIMPLE_BORDER|wxSTAY_ON_TOP); - wxStaticText *text = new wxStaticText( splash->GetSplashWindow(), wxID_EXIT, _T("click somewhere\non image"), wxPoint(13,11) ); + wxWindow *win = splash->GetSplashWindow(); +#if wxUSE_MEDIACTRL + wxMediaCtrl *media = new wxMediaCtrl( win, wxID_EXIT, _T("press.mpg"), wxPoint(2,2)); + media->SetSize(wxSize(80,60)); + media->Play(); +#else + wxStaticText *text = new wxStaticText( win, wxID_EXIT, _T("click somewhere\non image"), wxPoint(13,11) ); text->SetBackgroundColour(*wxWHITE); text->SetForegroundColour(*wxBLACK); wxFont font = text->GetFont(); font.SetPointSize(2*font.GetPointSize()/3); text->SetFont(font); +#endif } } -- 2.47.2