diff --git a/bazaar/Controls4U_Demo/Controls4U_Demo.h b/bazaar/Controls4U_Demo/Controls4U_Demo.h index 6e8a8f373..0ee0157e2 100644 --- a/bazaar/Controls4U_Demo/Controls4U_Demo.h +++ b/bazaar/Controls4U_Demo/Controls4U_Demo.h @@ -8,7 +8,7 @@ class EditFileFolder_Demo : public WithEditFileFolder { public: typedef EditFileFolder_Demo CLASSNAME; EditFileFolder_Demo(); - void OnNewFile(); + bool OnNewFile(); void ChangeProperties(); }; diff --git a/bazaar/Controls4U_Demo/Controls4U_Demo_win.h b/bazaar/Controls4U_Demo/Controls4U_Demo_win.h index 37b5f16d4..3c84f9cae 100644 --- a/bazaar/Controls4U_Demo/Controls4U_Demo_win.h +++ b/bazaar/Controls4U_Demo/Controls4U_Demo_win.h @@ -41,7 +41,7 @@ public: typedef VLC_Demo CLASSNAME; VLC_Demo(); - void Load(); + bool Load(); void Play(); void Pause(); void Stop(); diff --git a/bazaar/Controls4U_Demo/main.cpp b/bazaar/Controls4U_Demo/main.cpp index 62c8d3f2d..3de329940 100644 --- a/bazaar/Controls4U_Demo/main.cpp +++ b/bazaar/Controls4U_Demo/main.cpp @@ -1,8 +1,8 @@ #include +#include using namespace Upp; -#include #if defined(PLATFORM_WIN32) #include "Controls4U_Demo_win.h" @@ -84,13 +84,17 @@ EditFileFolder_Demo::EditFileFolder_Demo() { back.Set(Images::paper()); } -void EditFileFolder_Demo::OnNewFile() { +bool EditFileFolder_Demo::OnNewFile() { if (!clipImage.Set(~FileName)) { - if (FileExists(~FileName)) + if (FileExists(~FileName)) { Exclamation("File not found"); - else + return false; + } else { Exclamation("File format is not supported"); + return false; + } } + return true; } void EditFileFolder_Demo::ChangeProperties() { clipImage.SetAngle(~angleList); diff --git a/bazaar/Controls4U_Demo/main_win.cpp b/bazaar/Controls4U_Demo/main_win.cpp index 2f2e8aa9b..04000a60d 100644 --- a/bazaar/Controls4U_Demo/main_win.cpp +++ b/bazaar/Controls4U_Demo/main_win.cpp @@ -3,6 +3,7 @@ using namespace Upp; + #if defined(PLATFORM_WIN32) #include "Controls4U_Demo_win.h" @@ -209,10 +210,13 @@ void VLC_Demo::SwitchOn() { } } -void VLC_Demo::Load() { - if (!player.IsLoaded()) +bool VLC_Demo::Load() { + if (!player.IsLoaded()) { Exclamation("Sorry. ActiveX or program not available"); + return false; + } player.AddTarget(~file); + return true; } void VLC_Demo::Play() {