diff --git a/Tutorial/Codegen.bat b/Tutorial/Codegen.bat index e6eab1ab..0ce376c0 100644 --- a/Tutorial/Codegen.bat +++ b/Tutorial/Codegen.bat @@ -42,6 +42,9 @@ popd pushd AddressBook\UI call Codegen.bat popd +pushd ProgressAndAsync\UI +call Codegen.bat +popd popd pushd GacUI_ControlTemplate pushd BlackSkin\UI diff --git a/Tutorial/GacUI_Controls/GacUI_Controls.sln b/Tutorial/GacUI_Controls/GacUI_Controls.sln index 32d04926..714815e1 100644 --- a/Tutorial/GacUI_Controls/GacUI_Controls.sln +++ b/Tutorial/GacUI_Controls/GacUI_Controls.sln @@ -15,32 +15,54 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ColorPicker", "ColorPicker\ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AddressBook", "AddressBook\AddressBook.vcxproj", "{7F92FCD2-8A1E-4C73-9949-91555BEF3832}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ProgressAndAsync", "ProgressAndAsync\ProgressAndAsync.vcxproj", "{32CC91B1-D3A5-4030-9355-EAE1B87E12AB}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 Release|Win32 = Release|Win32 + Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {0C211930-C5DA-4567-A752-1D847CADEC1C}.Debug|Win32.ActiveCfg = Debug|Win32 {0C211930-C5DA-4567-A752-1D847CADEC1C}.Debug|Win32.Build.0 = Debug|Win32 + {0C211930-C5DA-4567-A752-1D847CADEC1C}.Debug|x64.ActiveCfg = Debug|Win32 {0C211930-C5DA-4567-A752-1D847CADEC1C}.Release|Win32.ActiveCfg = Release|Win32 {0C211930-C5DA-4567-A752-1D847CADEC1C}.Release|Win32.Build.0 = Release|Win32 + {0C211930-C5DA-4567-A752-1D847CADEC1C}.Release|x64.ActiveCfg = Release|Win32 {96C559CA-9718-4BEC-A053-28A0AB6A8CA2}.Debug|Win32.ActiveCfg = Debug|Win32 {96C559CA-9718-4BEC-A053-28A0AB6A8CA2}.Debug|Win32.Build.0 = Debug|Win32 + {96C559CA-9718-4BEC-A053-28A0AB6A8CA2}.Debug|x64.ActiveCfg = Debug|Win32 {96C559CA-9718-4BEC-A053-28A0AB6A8CA2}.Release|Win32.ActiveCfg = Release|Win32 {96C559CA-9718-4BEC-A053-28A0AB6A8CA2}.Release|Win32.Build.0 = Release|Win32 + {96C559CA-9718-4BEC-A053-28A0AB6A8CA2}.Release|x64.ActiveCfg = Release|Win32 {66069A5E-F697-42E2-8D9E-7D6E82019838}.Debug|Win32.ActiveCfg = Debug|Win32 {66069A5E-F697-42E2-8D9E-7D6E82019838}.Debug|Win32.Build.0 = Debug|Win32 + {66069A5E-F697-42E2-8D9E-7D6E82019838}.Debug|x64.ActiveCfg = Debug|Win32 {66069A5E-F697-42E2-8D9E-7D6E82019838}.Release|Win32.ActiveCfg = Release|Win32 {66069A5E-F697-42E2-8D9E-7D6E82019838}.Release|Win32.Build.0 = Release|Win32 + {66069A5E-F697-42E2-8D9E-7D6E82019838}.Release|x64.ActiveCfg = Release|Win32 {FBBBA8BF-96A4-4096-8204-A92571100F0E}.Debug|Win32.ActiveCfg = Debug|Win32 {FBBBA8BF-96A4-4096-8204-A92571100F0E}.Debug|Win32.Build.0 = Debug|Win32 + {FBBBA8BF-96A4-4096-8204-A92571100F0E}.Debug|x64.ActiveCfg = Debug|Win32 {FBBBA8BF-96A4-4096-8204-A92571100F0E}.Release|Win32.ActiveCfg = Release|Win32 {FBBBA8BF-96A4-4096-8204-A92571100F0E}.Release|Win32.Build.0 = Release|Win32 + {FBBBA8BF-96A4-4096-8204-A92571100F0E}.Release|x64.ActiveCfg = Release|Win32 {7F92FCD2-8A1E-4C73-9949-91555BEF3832}.Debug|Win32.ActiveCfg = Debug|Win32 {7F92FCD2-8A1E-4C73-9949-91555BEF3832}.Debug|Win32.Build.0 = Debug|Win32 + {7F92FCD2-8A1E-4C73-9949-91555BEF3832}.Debug|x64.ActiveCfg = Debug|Win32 {7F92FCD2-8A1E-4C73-9949-91555BEF3832}.Release|Win32.ActiveCfg = Release|Win32 {7F92FCD2-8A1E-4C73-9949-91555BEF3832}.Release|Win32.Build.0 = Release|Win32 + {7F92FCD2-8A1E-4C73-9949-91555BEF3832}.Release|x64.ActiveCfg = Release|Win32 + {32CC91B1-D3A5-4030-9355-EAE1B87E12AB}.Debug|Win32.ActiveCfg = Debug|Win32 + {32CC91B1-D3A5-4030-9355-EAE1B87E12AB}.Debug|Win32.Build.0 = Debug|Win32 + {32CC91B1-D3A5-4030-9355-EAE1B87E12AB}.Debug|x64.ActiveCfg = Debug|x64 + {32CC91B1-D3A5-4030-9355-EAE1B87E12AB}.Debug|x64.Build.0 = Debug|x64 + {32CC91B1-D3A5-4030-9355-EAE1B87E12AB}.Release|Win32.ActiveCfg = Release|Win32 + {32CC91B1-D3A5-4030-9355-EAE1B87E12AB}.Release|Win32.Build.0 = Release|Win32 + {32CC91B1-D3A5-4030-9355-EAE1B87E12AB}.Release|x64.ActiveCfg = Release|x64 + {32CC91B1-D3A5-4030-9355-EAE1B87E12AB}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Tutorial/GacUI_Controls/ProgressAndAsync/Main.cpp b/Tutorial/GacUI_Controls/ProgressAndAsync/Main.cpp new file mode 100644 index 00000000..79180eba --- /dev/null +++ b/Tutorial/GacUI_Controls/ProgressAndAsync/Main.cpp @@ -0,0 +1,23 @@ +#define GAC_HEADER_USE_NAMESPACE +#include "UI/Source/Demo.h" +#include + +using namespace vl::collections; +using namespace vl::stream; + +int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int CmdShow) +{ + return SetupWindowsDirect2DRenderer(); +} + +void GuiMain() +{ + { + FileStream fileStream(L"../UIRes/ProgressAndAsync.bin", FileStream::ReadOnly); + auto resource = GuiResource::LoadPrecompiledBinary(fileStream); + GetResourceManager()->SetResource(L"Resource", resource); + } + demo::MainWindow window; + window.MoveToScreenCenter(); + GetApplication()->Run(&window); +} \ No newline at end of file diff --git a/Tutorial/GacUI_Controls/ProgressAndAsync/ProgressAndAsync.vcxproj b/Tutorial/GacUI_Controls/ProgressAndAsync/ProgressAndAsync.vcxproj new file mode 100644 index 00000000..9d52ed90 --- /dev/null +++ b/Tutorial/GacUI_Controls/ProgressAndAsync/ProgressAndAsync.vcxproj @@ -0,0 +1,171 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + {32CC91B1-D3A5-4030-9355-EAE1B87E12AB} + Win32Proj + ProgressAndAsync + 8.1 + + + + Application + true + v140 + Unicode + + + Application + false + v140 + true + Unicode + + + Application + true + v140 + Unicode + + + Application + false + v140 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + $(ProjectDir)..\..\..\Import;$(IncludePath) + + + true + $(ProjectDir)..\..\..\Import;$(IncludePath) + + + false + $(ProjectDir)..\..\..\Import;$(IncludePath) + + + false + $(ProjectDir)..\..\..\Import;$(IncludePath) + + + + + + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;VCZH_DEBUG_NO_REFLECTION;%(PreprocessorDefinitions) + true + + + Windows + true + + + + + + + Level3 + Disabled + _DEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + + + Windows + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;VCZH_DEBUG_NO_REFLECTION;%(PreprocessorDefinitions) + true + + + Windows + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + + + Windows + true + true + true + + + + + + + + + + + + + + + + {96c559ca-9718-4bec-a053-28a0ab6a8ca2} + + + + + + \ No newline at end of file diff --git a/Tutorial/GacUI_Controls/ProgressAndAsync/ProgressAndAsync.vcxproj.filters b/Tutorial/GacUI_Controls/ProgressAndAsync/ProgressAndAsync.vcxproj.filters new file mode 100644 index 00000000..819eebf0 --- /dev/null +++ b/Tutorial/GacUI_Controls/ProgressAndAsync/ProgressAndAsync.vcxproj.filters @@ -0,0 +1,41 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + {74e461d4-779f-4342-91c2-637cf8eb6050} + + + + + Resource Files + + + + + UI + + + UI + + + + + UI + + + Source Files + + + \ No newline at end of file diff --git a/Tutorial/GacUI_Controls/ProgressAndAsync/UI/Codegen.bat b/Tutorial/GacUI_Controls/ProgressAndAsync/UI/Codegen.bat new file mode 100644 index 00000000..27f6654b --- /dev/null +++ b/Tutorial/GacUI_Controls/ProgressAndAsync/UI/Codegen.bat @@ -0,0 +1 @@ +..\..\..\..\Tools\GacGen.exe Resource.xml \ No newline at end of file diff --git a/Tutorial/GacUI_Controls/ProgressAndAsync/UI/Resource.xml b/Tutorial/GacUI_Controls/ProgressAndAsync/UI/Resource.xml new file mode 100644 index 00000000..0600806e --- /dev/null +++ b/Tutorial/GacUI_Controls/ProgressAndAsync/UI/Resource.xml @@ -0,0 +1,20 @@ + + + + + Source + ..\..\UIRes\ProgressAndAsync.bin + GacUI.h + Demo + + + + + + + + + + + + \ No newline at end of file diff --git a/Tutorial/GacUI_Controls/ProgressAndAsync/UI/Source/Demo.h b/Tutorial/GacUI_Controls/ProgressAndAsync/UI/Source/Demo.h new file mode 100644 index 00000000..a12c85a4 --- /dev/null +++ b/Tutorial/GacUI_Controls/ProgressAndAsync/UI/Source/Demo.h @@ -0,0 +1,35 @@ +/*********************************************************************** +!!!!!! DO NOT MODIFY !!!!!! + +GacGen.exe Resource.xml + +This file is generated by Workflow compiler +https://github.com/vczh-libraries +***********************************************************************/ + +#ifndef VCZH_WORKFLOW_COMPILER_GENERATED_DEMO +#define VCZH_WORKFLOW_COMPILER_GENERATED_DEMO + +#include "DemoPartialClasses.h" + +/*********************************************************************** +Reflection +***********************************************************************/ + +namespace vl +{ + namespace reflection + { + namespace description + { +#ifndef VCZH_DEBUG_NO_REFLECTION + DECL_TYPE_INFO(::demo::MainWindow) + DECL_TYPE_INFO(::demo::MainWindowConstructor) +#endif + + extern bool LoadDemoTypes(); + } + } +} + +#endif diff --git a/Tutorial/GacUI_Controls/ProgressAndAsync/UI/Source/DemoPartialClasses.cpp b/Tutorial/GacUI_Controls/ProgressAndAsync/UI/Source/DemoPartialClasses.cpp new file mode 100644 index 00000000..f5ded368 --- /dev/null +++ b/Tutorial/GacUI_Controls/ProgressAndAsync/UI/Source/DemoPartialClasses.cpp @@ -0,0 +1,160 @@ +/*********************************************************************** +!!!!!! DO NOT MODIFY !!!!!! + +GacGen.exe Resource.xml + +This file is generated by Workflow compiler +https://github.com/vczh-libraries +***********************************************************************/ + +#include "Demo.h" + +#if defined( _MSC_VER) +#pragma warning(push) +#pragma warning(disable:4250) +#elif defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wparentheses-equality" +#elif defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wparentheses-equality" +#endif + +#define GLOBAL_SYMBOL ::vl_workflow_global::Demo:: +#define GLOBAL_NAME ::vl_workflow_global::Demo::Instance(). +#define GLOBAL_OBJ &::vl_workflow_global::Demo::Instance() +#define USERIMPL(...) + +/*********************************************************************** +Global Variables +***********************************************************************/ + +BEGIN_GLOBAL_STORAGE_CLASS(vl_workflow_global_Demo) + vl_workflow_global::Demo instance; + INITIALIZE_GLOBAL_STORAGE_CLASS + FINALIZE_GLOBAL_STORAGE_CLASS +END_GLOBAL_STORAGE_CLASS(vl_workflow_global_Demo) + +namespace vl_workflow_global +{ +/*********************************************************************** +Global Functions +***********************************************************************/ + + Demo& Demo::Instance() + { + return Getvl_workflow_global_Demo().instance; + } +} + +/*********************************************************************** +Class (::demo::MainWindowConstructor) +***********************************************************************/ + +namespace demo +{ + void MainWindowConstructor::__vwsn_initialize_instance_(::demo::MainWindow* __vwsn_this_, ::vl::presentation::GuiResourcePathResolver* __vwsn_resolver_) + { + (::vl::__vwsn::This(this)->__vwsn_precompile_0 = __vwsn_this_); + (::vl::__vwsn::This(this)->__vwsn_precompile_1 = ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_0)->GetBoundsComposition()); + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_1)->SetPreferredMinSize([&](){ ::vl::presentation::Size __vwsn_temp__; __vwsn_temp__.x = 480; __vwsn_temp__.y = 320; return __vwsn_temp__; }()); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_0)->SetClientSize([&](){ ::vl::presentation::Size __vwsn_temp__; __vwsn_temp__.x = 480; __vwsn_temp__.y = 320; return __vwsn_temp__; }()); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_0)->SetText(::vl::WString(L"ProgressAndAsync", false)); + } + } + + MainWindowConstructor::MainWindowConstructor() + { + } + +/*********************************************************************** +Class (::demo::MainWindow) +***********************************************************************/ + + MainWindow::MainWindow() + : ::vl::presentation::controls::GuiWindow(::vl::__vwsn::This(::vl::presentation::theme::GetCurrentTheme())->CreateWindowStyle()) + { + auto __vwsn_resource_ = ::vl::__vwsn::This(::vl::presentation::GetResourceManager())->GetResourceFromClassName(::vl::WString(L"demo::MainWindow", false)); + auto __vwsn_resolver_ = ::vl::Ptr<::vl::presentation::GuiResourcePathResolver>(new ::vl::presentation::GuiResourcePathResolver(__vwsn_resource_, ::vl::__vwsn::This(__vwsn_resource_.Obj())->GetWorkingDirectory())); + ::vl::__vwsn::This(this)->__vwsn_initialize_instance_(this, ::vl::__vwsn::Ensure(static_cast<::vl::presentation::GuiResourcePathResolver*>(__vwsn_resolver_.Obj()))); + } + + MainWindow::~MainWindow() + { + ::vl::__vwsn::This(this)->ClearSubscriptions(); + } + +} +#undef GLOBAL_SYMBOL +#undef GLOBAL_NAME +#undef GLOBAL_OBJ +#undef USERIMPL + +/*********************************************************************** +Reflection +***********************************************************************/ + +namespace vl +{ + namespace reflection + { + namespace description + { +#ifndef VCZH_DEBUG_NO_REFLECTION + IMPL_CPP_TYPE_INFO(demo::MainWindow) + IMPL_CPP_TYPE_INFO(demo::MainWindowConstructor) + +#define _ , + BEGIN_CLASS_MEMBER(::demo::MainWindow) + CLASS_MEMBER_CONSTRUCTOR(::demo::MainWindow*(), NO_PARAMETER) + END_CLASS_MEMBER(::demo::MainWindow) + + BEGIN_CLASS_MEMBER(::demo::MainWindowConstructor) + CLASS_MEMBER_CONSTRUCTOR(::vl::Ptr<::demo::MainWindowConstructor>(), NO_PARAMETER) + CLASS_MEMBER_METHOD(__vwsn_initialize_instance_, { L"__vwsn_this_" _ L"__vwsn_resolver_" }) + CLASS_MEMBER_FIELD(__vwsn_precompile_0) + CLASS_MEMBER_FIELD(__vwsn_precompile_1) + END_CLASS_MEMBER(::demo::MainWindowConstructor) + +#undef _ + class DemoTypeLoader : public Object, public ITypeLoader + { + public: + void Load(ITypeManager* manager) + { + ADD_TYPE_INFO(::demo::MainWindow) + ADD_TYPE_INFO(::demo::MainWindowConstructor) + } + + void Unload(ITypeManager* manager) + { + } + }; +#endif + + bool LoadDemoTypes() + { +#ifndef VCZH_DEBUG_NO_REFLECTION + if (auto manager = GetGlobalTypeManager()) + { + return manager->AddTypeLoader(MakePtr()); + } +#endif + return false; + } + } + } +} + +#if defined( _MSC_VER) +#pragma warning(pop) +#elif defined(__GNUC__) +#pragma GCC diagnostic pop +#elif defined(__clang__) +#pragma clang diagnostic pop +#endif diff --git a/Tutorial/GacUI_Controls/ProgressAndAsync/UI/Source/DemoPartialClasses.h b/Tutorial/GacUI_Controls/ProgressAndAsync/UI/Source/DemoPartialClasses.h new file mode 100644 index 00000000..57bbc072 --- /dev/null +++ b/Tutorial/GacUI_Controls/ProgressAndAsync/UI/Source/DemoPartialClasses.h @@ -0,0 +1,78 @@ +/*********************************************************************** +!!!!!! DO NOT MODIFY !!!!!! + +GacGen.exe Resource.xml + +This file is generated by Workflow compiler +https://github.com/vczh-libraries +***********************************************************************/ + +#ifndef VCZH_WORKFLOW_COMPILER_GENERATED_DEMOPARTIALCLASSES +#define VCZH_WORKFLOW_COMPILER_GENERATED_DEMOPARTIALCLASSES + +#include "GacUI.h" + +#if defined( _MSC_VER) +#pragma warning(push) +#pragma warning(disable:4250) +#elif defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wparentheses-equality" +#elif defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wparentheses-equality" +#endif + +namespace demo +{ + class MainWindowConstructor; + class MainWindow; + + class MainWindowConstructor : public ::vl::Object, public ::vl::reflection::Description + { +#ifndef VCZH_DEBUG_NO_REFLECTION + friend struct ::vl::reflection::description::CustomTypeDescriptorSelector; +#endif + protected: + ::demo::MainWindow* __vwsn_precompile_0 = static_cast<::demo::MainWindow*>(nullptr); + ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_1 = static_cast<::vl::presentation::compositions::GuiBoundsComposition*>(nullptr); + void __vwsn_initialize_instance_(::demo::MainWindow* __vwsn_this_, ::vl::presentation::GuiResourcePathResolver* __vwsn_resolver_); + public: + MainWindowConstructor(); + }; + + class MainWindow : public ::vl::presentation::controls::GuiWindow, public ::demo::MainWindowConstructor, public ::vl::reflection::Description + { + friend class ::demo::MainWindowConstructor; +#ifndef VCZH_DEBUG_NO_REFLECTION + friend struct ::vl::reflection::description::CustomTypeDescriptorSelector; +#endif + public: + MainWindow(); + ~MainWindow(); + }; + +} +/*********************************************************************** +Global Variables and Functions +***********************************************************************/ + +namespace vl_workflow_global +{ + class Demo + { + public: + + static Demo& Instance(); + }; +} + +#if defined( _MSC_VER) +#pragma warning(pop) +#elif defined(__GNUC__) +#pragma GCC diagnostic pop +#elif defined(__clang__) +#pragma clang diagnostic pop +#endif + +#endif diff --git a/Tutorial/GacUI_Controls/UIRes/ProgressAndAsync.bin b/Tutorial/GacUI_Controls/UIRes/ProgressAndAsync.bin new file mode 100644 index 00000000..7edcdd0e Binary files /dev/null and b/Tutorial/GacUI_Controls/UIRes/ProgressAndAsync.bin differ