diff --git a/Tutorial/GacUI_Xml/Event_Cpp/UI/Source/Demo.h b/Tutorial/GacUI_Xml/Event_Cpp/UI/Source/Demo.h index 0f5f6c6b..b364bcac 100644 --- a/Tutorial/GacUI_Xml/Event_Cpp/UI/Source/Demo.h +++ b/Tutorial/GacUI_Xml/Event_Cpp/UI/Source/Demo.h @@ -1,17 +1,36 @@ -/*********************************************************************** -Vczh Library++ 3.0 -Developer: Zihan Chen(vczh) -GacUI::Demo +/*********************************************************************** +!!!!!! DO NOT MODIFY !!!!!! -This file is generated by: Vczh GacUI Resource Code Generator -************************************************************************ -DO NOT MODIFY +GacGen.exe Resource.xml + +This file is generated by Workflow compiler +https://github.com/vczh-libraries ***********************************************************************/ -#ifndef VCZH_GACUI_RESOURCE_CODE_GENERATOR_Demo -#define VCZH_GACUI_RESOURCE_CODE_GENERATOR_Demo +#ifndef VCZH_WORKFLOW_COMPILER_GENERATED_DEMO +#define VCZH_WORKFLOW_COMPILER_GENERATED_DEMO #include "DemoPartialClasses.h" #include "MainWindow.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_Xml/Event_Cpp/UI/Source/DemoPartialClasses.cpp b/Tutorial/GacUI_Xml/Event_Cpp/UI/Source/DemoPartialClasses.cpp index e475a8de..6abef937 100644 --- a/Tutorial/GacUI_Xml/Event_Cpp/UI/Source/DemoPartialClasses.cpp +++ b/Tutorial/GacUI_Xml/Event_Cpp/UI/Source/DemoPartialClasses.cpp @@ -1,64 +1,358 @@ -/*********************************************************************** -Vczh Library++ 3.0 -Developer: Zihan Chen(vczh) -GacUI::Partial Classes +/*********************************************************************** +!!!!!! DO NOT MODIFY !!!!!! -This file is generated by: Vczh GacUI Resource Code Generator -************************************************************************ -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 +{ +/*********************************************************************** +Closure Definitions +***********************************************************************/ + + struct __vwsno1_Demo_demo_MainWindowConstructor___vwsn_initialize_instance__ + { + ::demo::MainWindow* __vwsn_this_; + ::demo::MainWindowConstructor* __vwsnthis_0; + + __vwsno1_Demo_demo_MainWindowConstructor___vwsn_initialize_instance__(::demo::MainWindow* __vwsnctor___vwsn_this_, ::demo::MainWindowConstructor* __vwsnctorthis_0); + + void operator()(::vl::presentation::compositions::GuiGraphicsComposition* __vwsno_1, ::vl::presentation::compositions::GuiEventArgs* __vwsno_2) const; + }; + + //------------------------------------------------------------------- + + __vwsno1_Demo_demo_MainWindowConstructor___vwsn_initialize_instance__::__vwsno1_Demo_demo_MainWindowConstructor___vwsn_initialize_instance__(::demo::MainWindow* __vwsnctor___vwsn_this_, ::demo::MainWindowConstructor* __vwsnctorthis_0) + :__vwsn_this_(__vwsnctor___vwsn_this_) + , __vwsnthis_0(__vwsnctorthis_0) + { + } + + void __vwsno1_Demo_demo_MainWindowConstructor___vwsn_initialize_instance__::operator()(::vl::presentation::compositions::GuiGraphicsComposition* __vwsno_1, ::vl::presentation::compositions::GuiEventArgs* __vwsno_2) const + { + return ::vl::__vwsn::This(__vwsn_this_)->buttonCalculate_Clicked(__vwsno_1, __vwsno_2); + } +/*********************************************************************** +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_17 = ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_0)->GetBoundsComposition()); + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_17)->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"Event_Cpp", false)); + } + (::vl::__vwsn::This(this)->__vwsn_precompile_1 = new ::vl::presentation::compositions::GuiTableComposition()); + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_1)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = 0; __vwsn_temp__.top = 0; __vwsn_temp__.right = 0; __vwsn_temp__.bottom = 0; return __vwsn_temp__; }()); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_1)->SetMinSizeLimitation(::vl::presentation::compositions::GuiGraphicsComposition::MinSizeLimitation::LimitToElementAndChildren); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_1)->SetCellPadding(::vl::__vwsn::Parse<::vl::vint32_t>(::vl::WString(L"5", false))); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_1)->SetRowsAndColumns(4, 4); + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_1)->SetRowOption(0, [&](){ ::vl::presentation::compositions::GuiCellOption __vwsn_temp__; __vwsn_temp__.composeType = ::vl::presentation::compositions::GuiCellOption::ComposeType::MinSize; return __vwsn_temp__; }()); + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_1)->SetRowOption(1, [&](){ ::vl::presentation::compositions::GuiCellOption __vwsn_temp__; __vwsn_temp__.composeType = ::vl::presentation::compositions::GuiCellOption::ComposeType::MinSize; return __vwsn_temp__; }()); + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_1)->SetRowOption(2, [&](){ ::vl::presentation::compositions::GuiCellOption __vwsn_temp__; __vwsn_temp__.composeType = ::vl::presentation::compositions::GuiCellOption::ComposeType::MinSize; return __vwsn_temp__; }()); + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_1)->SetRowOption(3, [&](){ ::vl::presentation::compositions::GuiCellOption __vwsn_temp__; __vwsn_temp__.composeType = ::vl::presentation::compositions::GuiCellOption::ComposeType::Percentage; __vwsn_temp__.percentage = 1.0; return __vwsn_temp__; }()); + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_1)->SetColumnOption(0, [&](){ ::vl::presentation::compositions::GuiCellOption __vwsn_temp__; __vwsn_temp__.composeType = ::vl::presentation::compositions::GuiCellOption::ComposeType::MinSize; return __vwsn_temp__; }()); + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_1)->SetColumnOption(1, [&](){ ::vl::presentation::compositions::GuiCellOption __vwsn_temp__; __vwsn_temp__.composeType = ::vl::presentation::compositions::GuiCellOption::ComposeType::Absolute; __vwsn_temp__.absolute = 100; return __vwsn_temp__; }()); + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_1)->SetColumnOption(2, [&](){ ::vl::presentation::compositions::GuiCellOption __vwsn_temp__; __vwsn_temp__.composeType = ::vl::presentation::compositions::GuiCellOption::ComposeType::MinSize; return __vwsn_temp__; }()); + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_1)->SetColumnOption(3, [&](){ ::vl::presentation::compositions::GuiCellOption __vwsn_temp__; __vwsn_temp__.composeType = ::vl::presentation::compositions::GuiCellOption::ComposeType::Percentage; __vwsn_temp__.percentage = 1.0; return __vwsn_temp__; }()); + } + (::vl::__vwsn::This(this)->__vwsn_precompile_2 = new ::vl::presentation::compositions::GuiCellComposition()); + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_2)->SetInternalMargin([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = 0; __vwsn_temp__.top = 5; __vwsn_temp__.right = 0; __vwsn_temp__.bottom = 5; return __vwsn_temp__; }()); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_2)->SetSite(0, 0, 1, 1); + } + { + auto __vwsn_controlStyle_ = ::vl::__vwsn::This(::vl::presentation::theme::GetCurrentTheme())->CreateLabelStyle(); + (::vl::__vwsn::This(this)->__vwsn_precompile_3 = new ::vl::presentation::controls::GuiLabel(__vwsn_controlStyle_)); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_3)->SetText(::vl::WString(L"A : ", false)); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_2)->AddChild(::vl::__vwsn::Ensure(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_3)->GetBoundsComposition()))); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_1)->AddChild(::vl::__vwsn::Ensure(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(::vl::__vwsn::This(this)->__vwsn_precompile_2))); + } + (::vl::__vwsn::This(this)->__vwsn_precompile_4 = new ::vl::presentation::compositions::GuiCellComposition()); + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_4)->SetSite(0, 1, 1, 2); + } + { + auto __vwsn_controlStyle_ = ::vl::__vwsn::This(::vl::presentation::theme::GetCurrentTheme())->CreateTextBoxStyle(); + (::vl::__vwsn::This(this)->textBoxA = new ::vl::presentation::controls::GuiSinglelineTextBox(__vwsn_controlStyle_)); + } + (::vl::__vwsn::This(this)->__vwsn_precompile_5 = ::vl::__vwsn::This(::vl::__vwsn::This(this)->textBoxA)->GetBoundsComposition()); + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_5)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = 0; __vwsn_temp__.top = 0; __vwsn_temp__.right = 0; __vwsn_temp__.bottom = 0; return __vwsn_temp__; }()); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->textBoxA)->SetText(::vl::WString(L"1", false)); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_4)->AddChild(::vl::__vwsn::Ensure(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(::vl::__vwsn::This(::vl::__vwsn::This(this)->textBoxA)->GetBoundsComposition()))); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_1)->AddChild(::vl::__vwsn::Ensure(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(::vl::__vwsn::This(this)->__vwsn_precompile_4))); + } + (::vl::__vwsn::This(this)->__vwsn_precompile_6 = new ::vl::presentation::compositions::GuiCellComposition()); + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_6)->SetInternalMargin([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = 0; __vwsn_temp__.top = 5; __vwsn_temp__.right = 0; __vwsn_temp__.bottom = 5; return __vwsn_temp__; }()); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_6)->SetSite(1, 0, 1, 1); + } + { + auto __vwsn_controlStyle_ = ::vl::__vwsn::This(::vl::presentation::theme::GetCurrentTheme())->CreateLabelStyle(); + (::vl::__vwsn::This(this)->__vwsn_precompile_7 = new ::vl::presentation::controls::GuiLabel(__vwsn_controlStyle_)); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_7)->SetText(::vl::WString(L"B : ", false)); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_6)->AddChild(::vl::__vwsn::Ensure(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_7)->GetBoundsComposition()))); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_1)->AddChild(::vl::__vwsn::Ensure(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(::vl::__vwsn::This(this)->__vwsn_precompile_6))); + } + (::vl::__vwsn::This(this)->__vwsn_precompile_8 = new ::vl::presentation::compositions::GuiCellComposition()); + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_8)->SetSite(1, 1, 1, 2); + } + { + auto __vwsn_controlStyle_ = ::vl::__vwsn::This(::vl::presentation::theme::GetCurrentTheme())->CreateTextBoxStyle(); + (::vl::__vwsn::This(this)->textBoxB = new ::vl::presentation::controls::GuiSinglelineTextBox(__vwsn_controlStyle_)); + } + (::vl::__vwsn::This(this)->__vwsn_precompile_9 = ::vl::__vwsn::This(::vl::__vwsn::This(this)->textBoxB)->GetBoundsComposition()); + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_9)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = 0; __vwsn_temp__.top = 0; __vwsn_temp__.right = 0; __vwsn_temp__.bottom = 0; return __vwsn_temp__; }()); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->textBoxB)->SetText(::vl::WString(L"2", false)); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_8)->AddChild(::vl::__vwsn::Ensure(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(::vl::__vwsn::This(::vl::__vwsn::This(this)->textBoxB)->GetBoundsComposition()))); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_1)->AddChild(::vl::__vwsn::Ensure(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(::vl::__vwsn::This(this)->__vwsn_precompile_8))); + } + (::vl::__vwsn::This(this)->__vwsn_precompile_10 = new ::vl::presentation::compositions::GuiCellComposition()); + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_10)->SetInternalMargin([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = 0; __vwsn_temp__.top = 5; __vwsn_temp__.right = 0; __vwsn_temp__.bottom = 5; return __vwsn_temp__; }()); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_10)->SetSite(2, 0, 1, 1); + } + { + auto __vwsn_controlStyle_ = ::vl::__vwsn::This(::vl::presentation::theme::GetCurrentTheme())->CreateLabelStyle(); + (::vl::__vwsn::This(this)->__vwsn_precompile_11 = new ::vl::presentation::controls::GuiLabel(__vwsn_controlStyle_)); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_11)->SetText(::vl::WString(L"A + B = : ", false)); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_10)->AddChild(::vl::__vwsn::Ensure(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_11)->GetBoundsComposition()))); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_1)->AddChild(::vl::__vwsn::Ensure(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(::vl::__vwsn::This(this)->__vwsn_precompile_10))); + } + (::vl::__vwsn::This(this)->__vwsn_precompile_12 = new ::vl::presentation::compositions::GuiCellComposition()); + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_12)->SetSite(2, 1, 1, 1); + } + { + auto __vwsn_controlStyle_ = ::vl::__vwsn::This(::vl::presentation::theme::GetCurrentTheme())->CreateTextBoxStyle(); + (::vl::__vwsn::This(this)->textBoxC = new ::vl::presentation::controls::GuiSinglelineTextBox(__vwsn_controlStyle_)); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->textBoxC)->SetReadonly(::vl::__vwsn::Parse(::vl::WString(L"true", false))); + } + (::vl::__vwsn::This(this)->__vwsn_precompile_13 = ::vl::__vwsn::This(::vl::__vwsn::This(this)->textBoxC)->GetBoundsComposition()); + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_13)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = 0; __vwsn_temp__.top = 0; __vwsn_temp__.right = 0; __vwsn_temp__.bottom = 0; return __vwsn_temp__; }()); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_12)->AddChild(::vl::__vwsn::Ensure(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(::vl::__vwsn::This(::vl::__vwsn::This(this)->textBoxC)->GetBoundsComposition()))); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_1)->AddChild(::vl::__vwsn::Ensure(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(::vl::__vwsn::This(this)->__vwsn_precompile_12))); + } + (::vl::__vwsn::This(this)->__vwsn_precompile_14 = new ::vl::presentation::compositions::GuiCellComposition()); + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_14)->SetSite(2, 2, 1, 1); + } + { + auto __vwsn_controlStyle_ = ::vl::__vwsn::This(::vl::presentation::theme::GetCurrentTheme())->CreateButtonStyle(); + (::vl::__vwsn::This(this)->__vwsn_precompile_15 = new ::vl::presentation::controls::GuiButton(__vwsn_controlStyle_)); + } + (::vl::__vwsn::This(this)->__vwsn_precompile_16 = ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_15)->GetBoundsComposition()); + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_16)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = 0; __vwsn_temp__.top = 0; __vwsn_temp__.right = 0; __vwsn_temp__.bottom = 0; return __vwsn_temp__; }()); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_15)->SetText(::vl::WString(L"Calculate", false)); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_14)->AddChild(::vl::__vwsn::Ensure(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_15)->GetBoundsComposition()))); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_1)->AddChild(::vl::__vwsn::Ensure(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(::vl::__vwsn::This(this)->__vwsn_precompile_14))); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_0)->GetContainerComposition())->AddChild(::vl::__vwsn::Ensure(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(::vl::__vwsn::This(this)->__vwsn_precompile_1))); + } + { + ::vl::__vwsn::EventAttach(::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_15)->Clicked, LAMBDA(::vl_workflow_global::__vwsno1_Demo_demo_MainWindowConstructor___vwsn_initialize_instance__(__vwsn_this_, this))); + } + } + + MainWindowConstructor::MainWindowConstructor() + { + } + +} +#undef GLOBAL_SYMBOL +#undef GLOBAL_NAME +#undef GLOBAL_OBJ +#undef USERIMPL + +/*********************************************************************** +Reflection +***********************************************************************/ + namespace vl { namespace reflection { namespace description { - #define _ , - IMPL_CPP_TYPE_INFO(demo::MainWindow) +#ifndef VCZH_DEBUG_NO_REFLECTION + IMPL_CPP_TYPE_INFO(::demo::MainWindow) + IMPL_CPP_TYPE_INFO(::demo::MainWindowConstructor) - BEGIN_CLASS_MEMBER(demo::MainWindow) - CLASS_MEMBER_BASE(::vl::presentation::controls::GuiWindow) - CLASS_MEMBER_CONSTRUCTOR(demo::MainWindow*(), NO_PARAMETER) +#define _ , + BEGIN_CLASS_MEMBER(::demo::MainWindow) + CLASS_MEMBER_METHOD(buttonCalculate_Clicked, { L"sender" _ L"arguments" }) + END_CLASS_MEMBER(::demo::MainWindow) - CLASS_MEMBER_GUIEVENT_HANDLER(buttonCalculate_Clicked, ::vl::presentation::compositions::GuiEventArgs) - END_CLASS_MEMBER(demo::MainWindow) + BEGIN_CLASS_MEMBER(::demo::MainWindowConstructor) + CLASS_MEMBER_METHOD(__vwsn_initialize_instance_, { L"__vwsn_this_" _ L"__vwsn_resolver_" }) + CLASS_MEMBER_FIELD(__vwsn_precompile_0) + CLASS_MEMBER_FIELD(__vwsn_precompile_1) + CLASS_MEMBER_FIELD(__vwsn_precompile_10) + CLASS_MEMBER_FIELD(__vwsn_precompile_11) + CLASS_MEMBER_FIELD(__vwsn_precompile_12) + CLASS_MEMBER_FIELD(__vwsn_precompile_13) + CLASS_MEMBER_FIELD(__vwsn_precompile_14) + CLASS_MEMBER_FIELD(__vwsn_precompile_15) + CLASS_MEMBER_FIELD(__vwsn_precompile_16) + CLASS_MEMBER_FIELD(__vwsn_precompile_17) + CLASS_MEMBER_FIELD(__vwsn_precompile_2) + CLASS_MEMBER_FIELD(__vwsn_precompile_3) + CLASS_MEMBER_FIELD(__vwsn_precompile_4) + CLASS_MEMBER_FIELD(__vwsn_precompile_5) + CLASS_MEMBER_FIELD(__vwsn_precompile_6) + CLASS_MEMBER_FIELD(__vwsn_precompile_7) + CLASS_MEMBER_FIELD(__vwsn_precompile_8) + CLASS_MEMBER_FIELD(__vwsn_precompile_9) + CLASS_MEMBER_FIELD(textBoxA) + CLASS_MEMBER_FIELD(textBoxB) + CLASS_MEMBER_FIELD(textBoxC) + END_CLASS_MEMBER(::demo::MainWindowConstructor) - #undef _ - - class DemoResourceLoader : public Object, public ITypeLoader +#undef _ + class DemoTypeLoader : public Object, public ITypeLoader { public: void Load(ITypeManager* manager) { - ADD_TYPE_INFO(demo::MainWindow) + ADD_TYPE_INFO(::demo::MainWindow) + ADD_TYPE_INFO(::demo::MainWindowConstructor) } void Unload(ITypeManager* manager) { } }; +#endif - class DemoResourcePlugin : public Object, public vl::presentation::controls::IGuiPlugin + bool LoadDemoTypes() { - public: - void Load()override +#ifndef VCZH_DEBUG_NO_REFLECTION + if (auto manager = GetGlobalTypeManager()) { - GetGlobalTypeManager()->AddTypeLoader(new DemoResourceLoader); + return manager->AddTypeLoader(MakePtr()); } - - void AfterLoad()override - { - } - - void Unload()override - { - } - }; - GUI_REGISTER_PLUGIN(DemoResourcePlugin) +#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_Xml/Event_Cpp/UI/Source/DemoPartialClasses.h b/Tutorial/GacUI_Xml/Event_Cpp/UI/Source/DemoPartialClasses.h index 2de31d7f..c136b48b 100644 --- a/Tutorial/GacUI_Xml/Event_Cpp/UI/Source/DemoPartialClasses.h +++ b/Tutorial/GacUI_Xml/Event_Cpp/UI/Source/DemoPartialClasses.h @@ -1,66 +1,92 @@ -/*********************************************************************** -Vczh Library++ 3.0 -Developer: Zihan Chen(vczh) -GacUI::Partial Classes +/*********************************************************************** +!!!!!! DO NOT MODIFY !!!!!! -This file is generated by: Vczh GacUI Resource Code Generator -************************************************************************ -DO NOT MODIFY +GacGen.exe Resource.xml + +This file is generated by Workflow compiler +https://github.com/vczh-libraries ***********************************************************************/ -#ifndef VCZH_GACUI_RESOURCE_CODE_GENERATOR_Demo_PARTIAL_CLASSES -#define VCZH_GACUI_RESOURCE_CODE_GENERATOR_Demo_PARTIAL_CLASSES +#ifndef VCZH_WORKFLOW_COMPILER_GENERATED_DEMOPARTIALCLASSES +#define VCZH_WORKFLOW_COMPILER_GENERATED_DEMOPARTIALCLASSES -#include "GacUIReflection.h" +#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 vl_workflow_global +{ + struct __vwsno1_Demo_demo_MainWindowConstructor___vwsn_initialize_instance__; +} namespace demo { + class MainWindowConstructor; class MainWindow; - template - class MainWindow_ : public ::vl::presentation::controls::GuiWindow, public vl::presentation::GuiInstancePartialClass, public vl::reflection::Description + class MainWindowConstructor : public ::vl::Object, public ::vl::reflection::Description { - friend struct vl::reflection::description::CustomTypeDescriptorSelector; - private: + friend struct ::vl_workflow_global::__vwsno1_Demo_demo_MainWindowConstructor___vwsn_initialize_instance__; +#ifndef VCZH_DEBUG_NO_REFLECTION + friend struct ::vl::reflection::description::CustomTypeDescriptorSelector; +#endif protected: - ::vl::presentation::controls::GuiSinglelineTextBox* textBoxA; - ::vl::presentation::controls::GuiSinglelineTextBox* textBoxB; - ::vl::presentation::controls::GuiSinglelineTextBox* textBoxC; - - void InitializeComponents() - { - if (InitializeFromResource()) - { - GUI_INSTANCE_REFERENCE(textBoxA); - GUI_INSTANCE_REFERENCE(textBoxB); - GUI_INSTANCE_REFERENCE(textBoxC); - } - else - { - } - } + ::vl::presentation::controls::GuiSinglelineTextBox* textBoxA = static_cast<::vl::presentation::controls::GuiSinglelineTextBox*>(nullptr); + ::vl::presentation::controls::GuiSinglelineTextBox* textBoxB = static_cast<::vl::presentation::controls::GuiSinglelineTextBox*>(nullptr); + ::vl::presentation::controls::GuiSinglelineTextBox* textBoxC = static_cast<::vl::presentation::controls::GuiSinglelineTextBox*>(nullptr); + ::demo::MainWindow* __vwsn_precompile_0 = static_cast<::demo::MainWindow*>(nullptr); + ::vl::presentation::compositions::GuiTableComposition* __vwsn_precompile_1 = static_cast<::vl::presentation::compositions::GuiTableComposition*>(nullptr); + ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_2 = static_cast<::vl::presentation::compositions::GuiCellComposition*>(nullptr); + ::vl::presentation::controls::GuiLabel* __vwsn_precompile_3 = static_cast<::vl::presentation::controls::GuiLabel*>(nullptr); + ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_4 = static_cast<::vl::presentation::compositions::GuiCellComposition*>(nullptr); + ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_5 = static_cast<::vl::presentation::compositions::GuiBoundsComposition*>(nullptr); + ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_6 = static_cast<::vl::presentation::compositions::GuiCellComposition*>(nullptr); + ::vl::presentation::controls::GuiLabel* __vwsn_precompile_7 = static_cast<::vl::presentation::controls::GuiLabel*>(nullptr); + ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_8 = static_cast<::vl::presentation::compositions::GuiCellComposition*>(nullptr); + ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_9 = static_cast<::vl::presentation::compositions::GuiBoundsComposition*>(nullptr); + ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_10 = static_cast<::vl::presentation::compositions::GuiCellComposition*>(nullptr); + ::vl::presentation::controls::GuiLabel* __vwsn_precompile_11 = static_cast<::vl::presentation::controls::GuiLabel*>(nullptr); + ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_12 = static_cast<::vl::presentation::compositions::GuiCellComposition*>(nullptr); + ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_13 = static_cast<::vl::presentation::compositions::GuiBoundsComposition*>(nullptr); + ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_14 = static_cast<::vl::presentation::compositions::GuiCellComposition*>(nullptr); + ::vl::presentation::controls::GuiButton* __vwsn_precompile_15 = static_cast<::vl::presentation::controls::GuiButton*>(nullptr); + ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_16 = static_cast<::vl::presentation::compositions::GuiBoundsComposition*>(nullptr); + ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_17 = static_cast<::vl::presentation::compositions::GuiBoundsComposition*>(nullptr); + void __vwsn_initialize_instance_(::demo::MainWindow* __vwsn_this_, ::vl::presentation::GuiResourcePathResolver* __vwsn_resolver_); public: - MainWindow_() - :vl::presentation::GuiInstancePartialClass<::vl::presentation::controls::GuiWindow>(L"demo::MainWindow") - ,::vl::presentation::controls::GuiWindow(vl::presentation::theme::GetCurrentTheme()->CreateWindowStyle()) - ,textBoxA(0) - ,textBoxB(0) - ,textBoxC(0) - { - } + MainWindowConstructor(); }; } -namespace vl -{ - namespace reflection - { - namespace description - { - DECL_TYPE_INFO(demo::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_Xml/Event_Cpp/UI/Source/MainWindow.cpp b/Tutorial/GacUI_Xml/Event_Cpp/UI/Source/MainWindow.cpp index 8a079364..071c2c0d 100644 --- a/Tutorial/GacUI_Xml/Event_Cpp/UI/Source/MainWindow.cpp +++ b/Tutorial/GacUI_Xml/Event_Cpp/UI/Source/MainWindow.cpp @@ -1,18 +1,38 @@ /*********************************************************************** -Vczh Library++ 3.0 -Developer: Zihan Chen(vczh) -GacUI::MainWindow +!!!!!! DO NOT MODIFY !!!!!! -This file is generated by: Vczh GacUI Resource Code Generator +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(...) + +/*********************************************************************** +Class (::demo::MainWindow) +***********************************************************************/ + namespace demo { - // #region CLASS_MEMBER_GUIEVENT_HANDLER (DO NOT PUT OTHER CONTENT IN THIS #region.) - - void MainWindow::buttonCalculate_Clicked(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments) + USERIMPL(/* ::demo::MainWindow */) + void MainWindow::buttonCalculate_Clicked(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs* arguments) { bool successA = false; bool successB = false; @@ -25,25 +45,29 @@ namespace demo textBoxC->SetText(c); } - void MainWindow::OnCreate() - { - } - - void MainWindow::OnDestroy() - { - } - - // #endregion CLASS_MEMBER_GUIEVENT_HANDLER - MainWindow::MainWindow() + : ::vl::presentation::controls::GuiWindow(::vl::__vwsn::This(::vl::presentation::theme::GetCurrentTheme())->CreateWindowStyle()) { - InitializeComponents(); - OnCreate(); + 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() { - OnDestroy(); - ClearSubscriptions(); + ::vl::__vwsn::This(this)->ClearSubscriptions(); } + } +#undef GLOBAL_SYMBOL +#undef GLOBAL_NAME +#undef GLOBAL_OBJ +#undef USERIMPL + +#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_Xml/Event_Cpp/UI/Source/MainWindow.h b/Tutorial/GacUI_Xml/Event_Cpp/UI/Source/MainWindow.h index 5a9bab1b..13a30f74 100644 --- a/Tutorial/GacUI_Xml/Event_Cpp/UI/Source/MainWindow.h +++ b/Tutorial/GacUI_Xml/Event_Cpp/UI/Source/MainWindow.h @@ -1,33 +1,51 @@ -/*********************************************************************** -Vczh Library++ 3.0 -Developer: Zihan Chen(vczh) -GacUI::MainWindow +/*********************************************************************** +!!!!!! DO NOT MODIFY !!!!!! -This file is generated by: Vczh GacUI Resource Code Generator +GacGen.exe Resource.xml + +This file is generated by Workflow compiler +https://github.com/vczh-libraries ***********************************************************************/ -#ifndef VCZH_GACUI_RESOURCE_CODE_GENERATOR_Demo_MainWindow -#define VCZH_GACUI_RESOURCE_CODE_GENERATOR_Demo_MainWindow +#ifndef VCZH_WORKFLOW_COMPILER_GENERATED_MAINWINDOW +#define VCZH_WORKFLOW_COMPILER_GENERATED_MAINWINDOW #include "DemoPartialClasses.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 MainWindow : public demo::MainWindow_ + class MainWindow : public ::vl::presentation::controls::GuiWindow, public ::demo::MainWindowConstructor, public ::vl::reflection::Description { - friend class demo::MainWindow_; - friend struct vl::reflection::description::CustomTypeDescriptorSelector; + friend class ::demo::MainWindowConstructor; + friend struct ::vl_workflow_global::__vwsno1_Demo_demo_MainWindowConstructor___vwsn_initialize_instance__; +#ifndef VCZH_DEBUG_NO_REFLECTION + friend struct ::vl::reflection::description::CustomTypeDescriptorSelector; +#endif protected: - - // #region CLASS_MEMBER_GUIEVENT_HANDLER (DO NOT PUT OTHER CONTENT IN THIS #region.) - void buttonCalculate_Clicked(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments); - void OnCreate(); - void OnDestroy(); - // #endregion CLASS_MEMBER_GUIEVENT_HANDLER + void buttonCalculate_Clicked(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs* arguments); public: MainWindow(); ~MainWindow(); }; + } +#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_Xml/Event_Script/UI/Source/Demo.h b/Tutorial/GacUI_Xml/Event_Script/UI/Source/Demo.h index febeba0f..a12c85a4 100644 --- a/Tutorial/GacUI_Xml/Event_Script/UI/Source/Demo.h +++ b/Tutorial/GacUI_Xml/Event_Script/UI/Source/Demo.h @@ -1,16 +1,35 @@ -/*********************************************************************** -Vczh Library++ 3.0 -Developer: Zihan Chen(vczh) -GacUI::Demo +/*********************************************************************** +!!!!!! DO NOT MODIFY !!!!!! -This file is generated by: Vczh GacUI Resource Code Generator -************************************************************************ -DO NOT MODIFY +GacGen.exe Resource.xml + +This file is generated by Workflow compiler +https://github.com/vczh-libraries ***********************************************************************/ -#ifndef VCZH_GACUI_RESOURCE_CODE_GENERATOR_Demo -#define VCZH_GACUI_RESOURCE_CODE_GENERATOR_Demo +#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_Xml/Event_Script/UI/Source/DemoPartialClasses.cpp b/Tutorial/GacUI_Xml/Event_Script/UI/Source/DemoPartialClasses.cpp index 1967f719..f3cc8df2 100644 --- a/Tutorial/GacUI_Xml/Event_Script/UI/Source/DemoPartialClasses.cpp +++ b/Tutorial/GacUI_Xml/Event_Script/UI/Source/DemoPartialClasses.cpp @@ -1,42 +1,304 @@ -/*********************************************************************** -Vczh Library++ 3.0 -Developer: Zihan Chen(vczh) -GacUI::Partial Classes +/*********************************************************************** +!!!!!! DO NOT MODIFY !!!!!! -This file is generated by: Vczh GacUI Resource Code Generator -************************************************************************ -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 +{ +/*********************************************************************** +Closure Definitions +***********************************************************************/ + + struct __vwsnf1_Demo_demo_MainWindowConstructor___vwsn_initialize_instance__ + { + ::demo::MainWindowConstructor* __vwsnthis_0; + + __vwsnf1_Demo_demo_MainWindowConstructor___vwsn_initialize_instance__(::demo::MainWindowConstructor* __vwsnctorthis_0); + + void operator()(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs* arguments) const; + }; + + //------------------------------------------------------------------- + + __vwsnf1_Demo_demo_MainWindowConstructor___vwsn_initialize_instance__::__vwsnf1_Demo_demo_MainWindowConstructor___vwsn_initialize_instance__(::demo::MainWindowConstructor* __vwsnctorthis_0) + :__vwsnthis_0(__vwsnctorthis_0) + { + } + + void __vwsnf1_Demo_demo_MainWindowConstructor___vwsn_initialize_instance__::operator()(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs* arguments) const + { + { + auto a = ::vl::__vwsn::This(::vl::__vwsn::This(__vwsnthis_0)->textBoxA)->GetText(); + auto b = ::vl::__vwsn::This(::vl::__vwsn::This(__vwsnthis_0)->textBoxB)->GetText(); + auto c = [&](){ try{ return ::vl::__vwsn::ToString((::vl::__vwsn::Parse<::vl::vint32_t>(a) + ::vl::__vwsn::Parse<::vl::vint32_t>(b))); } catch(...){ return ::vl::WString(L"", false); } }(); + ::vl::__vwsn::This(::vl::__vwsn::This(__vwsnthis_0)->textBoxC)->SetText(c); + } + } +/*********************************************************************** +Global Functions +***********************************************************************/ + + Demo& Demo::Instance() + { + return Getvl_workflow_global_Demo().instance; + } +} + +/*********************************************************************** +Class (::demo::MainWindowConstructor) +***********************************************************************/ + namespace demo { - // #region CLASS_MEMBER_GUIEVENT_HANDLER (DO NOT PUT OTHER CONTENT IN THIS #region.) + 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_17 = ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_0)->GetBoundsComposition()); + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_17)->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"Event_Script", false)); + } + (::vl::__vwsn::This(this)->__vwsn_precompile_1 = new ::vl::presentation::compositions::GuiTableComposition()); + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_1)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = 0; __vwsn_temp__.top = 0; __vwsn_temp__.right = 0; __vwsn_temp__.bottom = 0; return __vwsn_temp__; }()); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_1)->SetMinSizeLimitation(::vl::presentation::compositions::GuiGraphicsComposition::MinSizeLimitation::LimitToElementAndChildren); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_1)->SetCellPadding(::vl::__vwsn::Parse<::vl::vint32_t>(::vl::WString(L"5", false))); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_1)->SetRowsAndColumns(4, 4); + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_1)->SetRowOption(0, [&](){ ::vl::presentation::compositions::GuiCellOption __vwsn_temp__; __vwsn_temp__.composeType = ::vl::presentation::compositions::GuiCellOption::ComposeType::MinSize; return __vwsn_temp__; }()); + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_1)->SetRowOption(1, [&](){ ::vl::presentation::compositions::GuiCellOption __vwsn_temp__; __vwsn_temp__.composeType = ::vl::presentation::compositions::GuiCellOption::ComposeType::MinSize; return __vwsn_temp__; }()); + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_1)->SetRowOption(2, [&](){ ::vl::presentation::compositions::GuiCellOption __vwsn_temp__; __vwsn_temp__.composeType = ::vl::presentation::compositions::GuiCellOption::ComposeType::MinSize; return __vwsn_temp__; }()); + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_1)->SetRowOption(3, [&](){ ::vl::presentation::compositions::GuiCellOption __vwsn_temp__; __vwsn_temp__.composeType = ::vl::presentation::compositions::GuiCellOption::ComposeType::Percentage; __vwsn_temp__.percentage = 1.0; return __vwsn_temp__; }()); + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_1)->SetColumnOption(0, [&](){ ::vl::presentation::compositions::GuiCellOption __vwsn_temp__; __vwsn_temp__.composeType = ::vl::presentation::compositions::GuiCellOption::ComposeType::MinSize; return __vwsn_temp__; }()); + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_1)->SetColumnOption(1, [&](){ ::vl::presentation::compositions::GuiCellOption __vwsn_temp__; __vwsn_temp__.composeType = ::vl::presentation::compositions::GuiCellOption::ComposeType::Absolute; __vwsn_temp__.absolute = 100; return __vwsn_temp__; }()); + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_1)->SetColumnOption(2, [&](){ ::vl::presentation::compositions::GuiCellOption __vwsn_temp__; __vwsn_temp__.composeType = ::vl::presentation::compositions::GuiCellOption::ComposeType::MinSize; return __vwsn_temp__; }()); + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_1)->SetColumnOption(3, [&](){ ::vl::presentation::compositions::GuiCellOption __vwsn_temp__; __vwsn_temp__.composeType = ::vl::presentation::compositions::GuiCellOption::ComposeType::Percentage; __vwsn_temp__.percentage = 1.0; return __vwsn_temp__; }()); + } + (::vl::__vwsn::This(this)->__vwsn_precompile_2 = new ::vl::presentation::compositions::GuiCellComposition()); + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_2)->SetInternalMargin([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = 0; __vwsn_temp__.top = 5; __vwsn_temp__.right = 0; __vwsn_temp__.bottom = 5; return __vwsn_temp__; }()); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_2)->SetSite(0, 0, 1, 1); + } + { + auto __vwsn_controlStyle_ = ::vl::__vwsn::This(::vl::presentation::theme::GetCurrentTheme())->CreateLabelStyle(); + (::vl::__vwsn::This(this)->__vwsn_precompile_3 = new ::vl::presentation::controls::GuiLabel(__vwsn_controlStyle_)); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_3)->SetText(::vl::WString(L"A : ", false)); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_2)->AddChild(::vl::__vwsn::Ensure(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_3)->GetBoundsComposition()))); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_1)->AddChild(::vl::__vwsn::Ensure(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(::vl::__vwsn::This(this)->__vwsn_precompile_2))); + } + (::vl::__vwsn::This(this)->__vwsn_precompile_4 = new ::vl::presentation::compositions::GuiCellComposition()); + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_4)->SetSite(0, 1, 1, 2); + } + { + auto __vwsn_controlStyle_ = ::vl::__vwsn::This(::vl::presentation::theme::GetCurrentTheme())->CreateTextBoxStyle(); + (::vl::__vwsn::This(this)->textBoxA = new ::vl::presentation::controls::GuiSinglelineTextBox(__vwsn_controlStyle_)); + } + (::vl::__vwsn::This(this)->__vwsn_precompile_5 = ::vl::__vwsn::This(::vl::__vwsn::This(this)->textBoxA)->GetBoundsComposition()); + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_5)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = 0; __vwsn_temp__.top = 0; __vwsn_temp__.right = 0; __vwsn_temp__.bottom = 0; return __vwsn_temp__; }()); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->textBoxA)->SetText(::vl::WString(L"1", false)); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_4)->AddChild(::vl::__vwsn::Ensure(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(::vl::__vwsn::This(::vl::__vwsn::This(this)->textBoxA)->GetBoundsComposition()))); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_1)->AddChild(::vl::__vwsn::Ensure(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(::vl::__vwsn::This(this)->__vwsn_precompile_4))); + } + (::vl::__vwsn::This(this)->__vwsn_precompile_6 = new ::vl::presentation::compositions::GuiCellComposition()); + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_6)->SetInternalMargin([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = 0; __vwsn_temp__.top = 5; __vwsn_temp__.right = 0; __vwsn_temp__.bottom = 5; return __vwsn_temp__; }()); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_6)->SetSite(1, 0, 1, 1); + } + { + auto __vwsn_controlStyle_ = ::vl::__vwsn::This(::vl::presentation::theme::GetCurrentTheme())->CreateLabelStyle(); + (::vl::__vwsn::This(this)->__vwsn_precompile_7 = new ::vl::presentation::controls::GuiLabel(__vwsn_controlStyle_)); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_7)->SetText(::vl::WString(L"B : ", false)); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_6)->AddChild(::vl::__vwsn::Ensure(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_7)->GetBoundsComposition()))); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_1)->AddChild(::vl::__vwsn::Ensure(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(::vl::__vwsn::This(this)->__vwsn_precompile_6))); + } + (::vl::__vwsn::This(this)->__vwsn_precompile_8 = new ::vl::presentation::compositions::GuiCellComposition()); + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_8)->SetSite(1, 1, 1, 2); + } + { + auto __vwsn_controlStyle_ = ::vl::__vwsn::This(::vl::presentation::theme::GetCurrentTheme())->CreateTextBoxStyle(); + (::vl::__vwsn::This(this)->textBoxB = new ::vl::presentation::controls::GuiSinglelineTextBox(__vwsn_controlStyle_)); + } + (::vl::__vwsn::This(this)->__vwsn_precompile_9 = ::vl::__vwsn::This(::vl::__vwsn::This(this)->textBoxB)->GetBoundsComposition()); + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_9)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = 0; __vwsn_temp__.top = 0; __vwsn_temp__.right = 0; __vwsn_temp__.bottom = 0; return __vwsn_temp__; }()); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->textBoxB)->SetText(::vl::WString(L"2", false)); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_8)->AddChild(::vl::__vwsn::Ensure(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(::vl::__vwsn::This(::vl::__vwsn::This(this)->textBoxB)->GetBoundsComposition()))); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_1)->AddChild(::vl::__vwsn::Ensure(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(::vl::__vwsn::This(this)->__vwsn_precompile_8))); + } + (::vl::__vwsn::This(this)->__vwsn_precompile_10 = new ::vl::presentation::compositions::GuiCellComposition()); + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_10)->SetInternalMargin([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = 0; __vwsn_temp__.top = 5; __vwsn_temp__.right = 0; __vwsn_temp__.bottom = 5; return __vwsn_temp__; }()); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_10)->SetSite(2, 0, 1, 1); + } + { + auto __vwsn_controlStyle_ = ::vl::__vwsn::This(::vl::presentation::theme::GetCurrentTheme())->CreateLabelStyle(); + (::vl::__vwsn::This(this)->__vwsn_precompile_11 = new ::vl::presentation::controls::GuiLabel(__vwsn_controlStyle_)); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_11)->SetText(::vl::WString(L"A + B = : ", false)); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_10)->AddChild(::vl::__vwsn::Ensure(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_11)->GetBoundsComposition()))); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_1)->AddChild(::vl::__vwsn::Ensure(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(::vl::__vwsn::This(this)->__vwsn_precompile_10))); + } + (::vl::__vwsn::This(this)->__vwsn_precompile_12 = new ::vl::presentation::compositions::GuiCellComposition()); + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_12)->SetSite(2, 1, 1, 1); + } + { + auto __vwsn_controlStyle_ = ::vl::__vwsn::This(::vl::presentation::theme::GetCurrentTheme())->CreateTextBoxStyle(); + (::vl::__vwsn::This(this)->textBoxC = new ::vl::presentation::controls::GuiSinglelineTextBox(__vwsn_controlStyle_)); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->textBoxC)->SetReadonly(::vl::__vwsn::Parse(::vl::WString(L"true", false))); + } + (::vl::__vwsn::This(this)->__vwsn_precompile_13 = ::vl::__vwsn::This(::vl::__vwsn::This(this)->textBoxC)->GetBoundsComposition()); + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_13)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = 0; __vwsn_temp__.top = 0; __vwsn_temp__.right = 0; __vwsn_temp__.bottom = 0; return __vwsn_temp__; }()); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_12)->AddChild(::vl::__vwsn::Ensure(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(::vl::__vwsn::This(::vl::__vwsn::This(this)->textBoxC)->GetBoundsComposition()))); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_1)->AddChild(::vl::__vwsn::Ensure(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(::vl::__vwsn::This(this)->__vwsn_precompile_12))); + } + (::vl::__vwsn::This(this)->__vwsn_precompile_14 = new ::vl::presentation::compositions::GuiCellComposition()); + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_14)->SetSite(2, 2, 1, 1); + } + { + auto __vwsn_controlStyle_ = ::vl::__vwsn::This(::vl::presentation::theme::GetCurrentTheme())->CreateButtonStyle(); + (::vl::__vwsn::This(this)->__vwsn_precompile_15 = new ::vl::presentation::controls::GuiButton(__vwsn_controlStyle_)); + } + (::vl::__vwsn::This(this)->__vwsn_precompile_16 = ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_15)->GetBoundsComposition()); + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_16)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = 0; __vwsn_temp__.top = 0; __vwsn_temp__.right = 0; __vwsn_temp__.bottom = 0; return __vwsn_temp__; }()); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_15)->SetText(::vl::WString(L"Calculate", false)); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_14)->AddChild(::vl::__vwsn::Ensure(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_15)->GetBoundsComposition()))); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_1)->AddChild(::vl::__vwsn::Ensure(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(::vl::__vwsn::This(this)->__vwsn_precompile_14))); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_0)->GetContainerComposition())->AddChild(::vl::__vwsn::Ensure(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(::vl::__vwsn::This(this)->__vwsn_precompile_1))); + } + { + auto __vwsn_event_handler_ = LAMBDA(::vl_workflow_global::__vwsnf1_Demo_demo_MainWindowConstructor___vwsn_initialize_instance__(this)); + ::vl::__vwsn::EventAttach(::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_15)->Clicked, __vwsn_event_handler_); + } + } - void MainWindow::OnCreate() + MainWindowConstructor::MainWindowConstructor() { } - void MainWindow::OnDestroy() - { - } - - // #endregion CLASS_MEMBER_GUIEVENT_HANDLER +/*********************************************************************** +Class (::demo::MainWindow) +***********************************************************************/ MainWindow::MainWindow() + : ::vl::presentation::controls::GuiWindow(::vl::__vwsn::This(::vl::presentation::theme::GetCurrentTheme())->CreateWindowStyle()) { - InitializeComponents(); - OnCreate(); + 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() { - OnDestroy(); - ClearSubscriptions(); + ::vl::__vwsn::This(this)->ClearSubscriptions(); } -} +} +#undef GLOBAL_SYMBOL +#undef GLOBAL_NAME +#undef GLOBAL_OBJ +#undef USERIMPL + +/*********************************************************************** +Reflection +***********************************************************************/ namespace vl { @@ -44,47 +306,73 @@ namespace vl { namespace description { - #define _ , - IMPL_CPP_TYPE_INFO(demo::MainWindow) +#ifndef VCZH_DEBUG_NO_REFLECTION + IMPL_CPP_TYPE_INFO(::demo::MainWindow) + IMPL_CPP_TYPE_INFO(::demo::MainWindowConstructor) - BEGIN_CLASS_MEMBER(demo::MainWindow) - CLASS_MEMBER_BASE(::vl::presentation::controls::GuiWindow) - CLASS_MEMBER_CONSTRUCTOR(demo::MainWindow*(), NO_PARAMETER) - END_CLASS_MEMBER(demo::MainWindow) +#define _ , + BEGIN_CLASS_MEMBER(::demo::MainWindow) + END_CLASS_MEMBER(::demo::MainWindow) - #undef _ + BEGIN_CLASS_MEMBER(::demo::MainWindowConstructor) + CLASS_MEMBER_METHOD(__vwsn_initialize_instance_, { L"__vwsn_this_" _ L"__vwsn_resolver_" }) + CLASS_MEMBER_FIELD(__vwsn_precompile_0) + CLASS_MEMBER_FIELD(__vwsn_precompile_1) + CLASS_MEMBER_FIELD(__vwsn_precompile_10) + CLASS_MEMBER_FIELD(__vwsn_precompile_11) + CLASS_MEMBER_FIELD(__vwsn_precompile_12) + CLASS_MEMBER_FIELD(__vwsn_precompile_13) + CLASS_MEMBER_FIELD(__vwsn_precompile_14) + CLASS_MEMBER_FIELD(__vwsn_precompile_15) + CLASS_MEMBER_FIELD(__vwsn_precompile_16) + CLASS_MEMBER_FIELD(__vwsn_precompile_17) + CLASS_MEMBER_FIELD(__vwsn_precompile_2) + CLASS_MEMBER_FIELD(__vwsn_precompile_3) + CLASS_MEMBER_FIELD(__vwsn_precompile_4) + CLASS_MEMBER_FIELD(__vwsn_precompile_5) + CLASS_MEMBER_FIELD(__vwsn_precompile_6) + CLASS_MEMBER_FIELD(__vwsn_precompile_7) + CLASS_MEMBER_FIELD(__vwsn_precompile_8) + CLASS_MEMBER_FIELD(__vwsn_precompile_9) + CLASS_MEMBER_FIELD(textBoxA) + CLASS_MEMBER_FIELD(textBoxB) + CLASS_MEMBER_FIELD(textBoxC) + END_CLASS_MEMBER(::demo::MainWindowConstructor) - class DemoResourceLoader : public Object, public ITypeLoader +#undef _ + class DemoTypeLoader : public Object, public ITypeLoader { public: void Load(ITypeManager* manager) { - ADD_TYPE_INFO(demo::MainWindow) + ADD_TYPE_INFO(::demo::MainWindow) + ADD_TYPE_INFO(::demo::MainWindowConstructor) } void Unload(ITypeManager* manager) { } }; +#endif - class DemoResourcePlugin : public Object, public vl::presentation::controls::IGuiPlugin + bool LoadDemoTypes() { - public: - void Load()override +#ifndef VCZH_DEBUG_NO_REFLECTION + if (auto manager = GetGlobalTypeManager()) { - GetGlobalTypeManager()->AddTypeLoader(new DemoResourceLoader); + return manager->AddTypeLoader(MakePtr()); } - - void AfterLoad()override - { - } - - void Unload()override - { - } - }; - GUI_REGISTER_PLUGIN(DemoResourcePlugin) +#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_Xml/Event_Script/UI/Source/DemoPartialClasses.h b/Tutorial/GacUI_Xml/Event_Script/UI/Source/DemoPartialClasses.h index d796474f..287dd149 100644 --- a/Tutorial/GacUI_Xml/Event_Script/UI/Source/DemoPartialClasses.h +++ b/Tutorial/GacUI_Xml/Event_Script/UI/Source/DemoPartialClasses.h @@ -1,85 +1,104 @@ -/*********************************************************************** -Vczh Library++ 3.0 -Developer: Zihan Chen(vczh) -GacUI::Partial Classes +/*********************************************************************** +!!!!!! DO NOT MODIFY !!!!!! -This file is generated by: Vczh GacUI Resource Code Generator -************************************************************************ -DO NOT MODIFY +GacGen.exe Resource.xml + +This file is generated by Workflow compiler +https://github.com/vczh-libraries ***********************************************************************/ -#ifndef VCZH_GACUI_RESOURCE_CODE_GENERATOR_Demo_PARTIAL_CLASSES -#define VCZH_GACUI_RESOURCE_CODE_GENERATOR_Demo_PARTIAL_CLASSES +#ifndef VCZH_WORKFLOW_COMPILER_GENERATED_DEMOPARTIALCLASSES +#define VCZH_WORKFLOW_COMPILER_GENERATED_DEMOPARTIALCLASSES -#include "GacUIReflection.h" +#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 vl_workflow_global +{ + struct __vwsnf1_Demo_demo_MainWindowConstructor___vwsn_initialize_instance__; +} namespace demo { + class MainWindowConstructor; class MainWindow; - template - class MainWindow_ : public ::vl::presentation::controls::GuiWindow, public vl::presentation::GuiInstancePartialClass, public vl::reflection::Description + class MainWindowConstructor : public ::vl::Object, public ::vl::reflection::Description { - friend struct vl::reflection::description::CustomTypeDescriptorSelector; - private: + friend struct ::vl_workflow_global::__vwsnf1_Demo_demo_MainWindowConstructor___vwsn_initialize_instance__; +#ifndef VCZH_DEBUG_NO_REFLECTION + friend struct ::vl::reflection::description::CustomTypeDescriptorSelector; +#endif protected: - ::vl::presentation::controls::GuiSinglelineTextBox* textBoxA; - ::vl::presentation::controls::GuiSinglelineTextBox* textBoxB; - ::vl::presentation::controls::GuiSinglelineTextBox* textBoxC; - - void InitializeComponents() - { - if (InitializeFromResource()) - { - GUI_INSTANCE_REFERENCE(textBoxA); - GUI_INSTANCE_REFERENCE(textBoxB); - GUI_INSTANCE_REFERENCE(textBoxC); - } - else - { - } - } + ::vl::presentation::controls::GuiSinglelineTextBox* textBoxA = static_cast<::vl::presentation::controls::GuiSinglelineTextBox*>(nullptr); + ::vl::presentation::controls::GuiSinglelineTextBox* textBoxB = static_cast<::vl::presentation::controls::GuiSinglelineTextBox*>(nullptr); + ::vl::presentation::controls::GuiSinglelineTextBox* textBoxC = static_cast<::vl::presentation::controls::GuiSinglelineTextBox*>(nullptr); + ::demo::MainWindow* __vwsn_precompile_0 = static_cast<::demo::MainWindow*>(nullptr); + ::vl::presentation::compositions::GuiTableComposition* __vwsn_precompile_1 = static_cast<::vl::presentation::compositions::GuiTableComposition*>(nullptr); + ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_2 = static_cast<::vl::presentation::compositions::GuiCellComposition*>(nullptr); + ::vl::presentation::controls::GuiLabel* __vwsn_precompile_3 = static_cast<::vl::presentation::controls::GuiLabel*>(nullptr); + ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_4 = static_cast<::vl::presentation::compositions::GuiCellComposition*>(nullptr); + ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_5 = static_cast<::vl::presentation::compositions::GuiBoundsComposition*>(nullptr); + ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_6 = static_cast<::vl::presentation::compositions::GuiCellComposition*>(nullptr); + ::vl::presentation::controls::GuiLabel* __vwsn_precompile_7 = static_cast<::vl::presentation::controls::GuiLabel*>(nullptr); + ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_8 = static_cast<::vl::presentation::compositions::GuiCellComposition*>(nullptr); + ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_9 = static_cast<::vl::presentation::compositions::GuiBoundsComposition*>(nullptr); + ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_10 = static_cast<::vl::presentation::compositions::GuiCellComposition*>(nullptr); + ::vl::presentation::controls::GuiLabel* __vwsn_precompile_11 = static_cast<::vl::presentation::controls::GuiLabel*>(nullptr); + ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_12 = static_cast<::vl::presentation::compositions::GuiCellComposition*>(nullptr); + ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_13 = static_cast<::vl::presentation::compositions::GuiBoundsComposition*>(nullptr); + ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_14 = static_cast<::vl::presentation::compositions::GuiCellComposition*>(nullptr); + ::vl::presentation::controls::GuiButton* __vwsn_precompile_15 = static_cast<::vl::presentation::controls::GuiButton*>(nullptr); + ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_16 = static_cast<::vl::presentation::compositions::GuiBoundsComposition*>(nullptr); + ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_17 = static_cast<::vl::presentation::compositions::GuiBoundsComposition*>(nullptr); + void __vwsn_initialize_instance_(::demo::MainWindow* __vwsn_this_, ::vl::presentation::GuiResourcePathResolver* __vwsn_resolver_); public: - MainWindow_() - :vl::presentation::GuiInstancePartialClass<::vl::presentation::controls::GuiWindow>(L"demo::MainWindow") - ,::vl::presentation::controls::GuiWindow(vl::presentation::theme::GetCurrentTheme()->CreateWindowStyle()) - ,textBoxA(0) - ,textBoxB(0) - ,textBoxC(0) - { - } + MainWindowConstructor(); }; -} -namespace vl -{ - namespace reflection + class MainWindow : public ::vl::presentation::controls::GuiWindow, public ::demo::MainWindowConstructor, public ::vl::reflection::Description { - namespace description - { - DECL_TYPE_INFO(demo::MainWindow) - - } - } -} -namespace demo -{ - class MainWindow : public demo::MainWindow_ - { - friend class demo::MainWindow_; - friend struct vl::reflection::description::CustomTypeDescriptorSelector; - protected: - - // #region CLASS_MEMBER_GUIEVENT_HANDLER (DO NOT PUT OTHER CONTENT IN THIS #region.) - void OnCreate(); - void OnDestroy(); - // #endregion CLASS_MEMBER_GUIEVENT_HANDLER + friend class ::demo::MainWindowConstructor; + friend struct ::vl_workflow_global::__vwsnf1_Demo_demo_MainWindowConstructor___vwsn_initialize_instance__; +#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_Xml/Event_ViewModel/UI/Resource.xml b/Tutorial/GacUI_Xml/Event_ViewModel/UI/Resource.xml index 1cfb0476..5aa4793a 100644 --- a/Tutorial/GacUI_Xml/Event_ViewModel/UI/Resource.xml +++ b/Tutorial/GacUI_Xml/Event_ViewModel/UI/Resource.xml @@ -10,7 +10,7 @@ diff --git a/Tutorial/GacUI_Xml/Event_ViewModel/UI/Source/Demo.h b/Tutorial/GacUI_Xml/Event_ViewModel/UI/Source/Demo.h index febeba0f..7ce6f38c 100644 --- a/Tutorial/GacUI_Xml/Event_ViewModel/UI/Source/Demo.h +++ b/Tutorial/GacUI_Xml/Event_ViewModel/UI/Source/Demo.h @@ -1,16 +1,47 @@ -/*********************************************************************** -Vczh Library++ 3.0 -Developer: Zihan Chen(vczh) -GacUI::Demo +/*********************************************************************** +!!!!!! DO NOT MODIFY !!!!!! -This file is generated by: Vczh GacUI Resource Code Generator -************************************************************************ -DO NOT MODIFY +GacGen.exe Resource.xml + +This file is generated by Workflow compiler +https://github.com/vczh-libraries ***********************************************************************/ -#ifndef VCZH_GACUI_RESOURCE_CODE_GENERATOR_Demo -#define VCZH_GACUI_RESOURCE_CODE_GENERATOR_Demo +#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::IViewModel) + DECL_TYPE_INFO(::demo::MainWindow) + DECL_TYPE_INFO(::demo::MainWindowConstructor) + + BEGIN_INTERFACE_PROXY_NOPARENT_SHAREDPTR(::demo::IViewModel) + ::vl::vint32_t Add(::vl::vint32_t a, ::vl::vint32_t b) override + { + INVOKEGET_INTERFACE_PROXY(Add, a, b); + } + ::vl::WString Error() override + { + INVOKEGET_INTERFACE_PROXY_NOPARAMS(Error); + } + END_INTERFACE_PROXY(::demo::IViewModel) +#endif + + extern bool LoadDemoTypes(); + } + } +} + #endif diff --git a/Tutorial/GacUI_Xml/Event_ViewModel/UI/Source/DemoPartialClasses.cpp b/Tutorial/GacUI_Xml/Event_ViewModel/UI/Source/DemoPartialClasses.cpp index 87f3d23c..d9efb20a 100644 --- a/Tutorial/GacUI_Xml/Event_ViewModel/UI/Source/DemoPartialClasses.cpp +++ b/Tutorial/GacUI_Xml/Event_ViewModel/UI/Source/DemoPartialClasses.cpp @@ -1,42 +1,312 @@ -/*********************************************************************** -Vczh Library++ 3.0 -Developer: Zihan Chen(vczh) -GacUI::Partial Classes +/*********************************************************************** +!!!!!! DO NOT MODIFY !!!!!! -This file is generated by: Vczh GacUI Resource Code Generator -************************************************************************ -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 +{ +/*********************************************************************** +Closure Definitions +***********************************************************************/ + + struct __vwsnf1_Demo_demo_MainWindowConstructor___vwsn_initialize_instance__ + { + ::demo::MainWindowConstructor* __vwsnthis_0; + + __vwsnf1_Demo_demo_MainWindowConstructor___vwsn_initialize_instance__(::demo::MainWindowConstructor* __vwsnctorthis_0); + + void operator()(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs* arguments) const; + }; + + //------------------------------------------------------------------- + + __vwsnf1_Demo_demo_MainWindowConstructor___vwsn_initialize_instance__::__vwsnf1_Demo_demo_MainWindowConstructor___vwsn_initialize_instance__(::demo::MainWindowConstructor* __vwsnctorthis_0) + :__vwsnthis_0(__vwsnctorthis_0) + { + } + + void __vwsnf1_Demo_demo_MainWindowConstructor___vwsn_initialize_instance__::operator()(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs* arguments) const + { + { + ::vl::__vwsn::This(::vl::__vwsn::This(__vwsnthis_0)->textBoxC)->SetText([&](){ try{ return ::vl::__vwsn::ToString(::vl::__vwsn::This(::vl::__vwsn::This(__vwsnthis_0)->ViewModel.Obj())->Add(::vl::__vwsn::Parse<::vl::vint32_t>(::vl::__vwsn::This(::vl::__vwsn::This(__vwsnthis_0)->textBoxA)->GetText()), ::vl::__vwsn::Parse<::vl::vint32_t>(::vl::__vwsn::This(::vl::__vwsn::This(__vwsnthis_0)->textBoxB)->GetText()))); } catch(...){ return ::vl::__vwsn::This(::vl::__vwsn::This(__vwsnthis_0)->ViewModel.Obj())->Error(); } }()); + } + } +/*********************************************************************** +Global Functions +***********************************************************************/ + + Demo& Demo::Instance() + { + return Getvl_workflow_global_Demo().instance; + } +} + +/*********************************************************************** +Class (::demo::MainWindowConstructor) +***********************************************************************/ + namespace demo { - // #region CLASS_MEMBER_GUIEVENT_HANDLER (DO NOT PUT OTHER CONTENT IN THIS #region.) + 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)->ViewModel = ::vl::__vwsn::This(__vwsn_this_)->GetViewModel()); + (::vl::__vwsn::This(this)->__vwsn_precompile_17 = ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_0)->GetBoundsComposition()); + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_17)->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"Event_ViewModel", false)); + } + (::vl::__vwsn::This(this)->__vwsn_precompile_1 = new ::vl::presentation::compositions::GuiTableComposition()); + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_1)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = 0; __vwsn_temp__.top = 0; __vwsn_temp__.right = 0; __vwsn_temp__.bottom = 0; return __vwsn_temp__; }()); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_1)->SetMinSizeLimitation(::vl::presentation::compositions::GuiGraphicsComposition::MinSizeLimitation::LimitToElementAndChildren); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_1)->SetCellPadding(::vl::__vwsn::Parse<::vl::vint32_t>(::vl::WString(L"5", false))); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_1)->SetRowsAndColumns(4, 4); + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_1)->SetRowOption(0, [&](){ ::vl::presentation::compositions::GuiCellOption __vwsn_temp__; __vwsn_temp__.composeType = ::vl::presentation::compositions::GuiCellOption::ComposeType::MinSize; return __vwsn_temp__; }()); + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_1)->SetRowOption(1, [&](){ ::vl::presentation::compositions::GuiCellOption __vwsn_temp__; __vwsn_temp__.composeType = ::vl::presentation::compositions::GuiCellOption::ComposeType::MinSize; return __vwsn_temp__; }()); + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_1)->SetRowOption(2, [&](){ ::vl::presentation::compositions::GuiCellOption __vwsn_temp__; __vwsn_temp__.composeType = ::vl::presentation::compositions::GuiCellOption::ComposeType::MinSize; return __vwsn_temp__; }()); + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_1)->SetRowOption(3, [&](){ ::vl::presentation::compositions::GuiCellOption __vwsn_temp__; __vwsn_temp__.composeType = ::vl::presentation::compositions::GuiCellOption::ComposeType::Percentage; __vwsn_temp__.percentage = 1.0; return __vwsn_temp__; }()); + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_1)->SetColumnOption(0, [&](){ ::vl::presentation::compositions::GuiCellOption __vwsn_temp__; __vwsn_temp__.composeType = ::vl::presentation::compositions::GuiCellOption::ComposeType::MinSize; return __vwsn_temp__; }()); + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_1)->SetColumnOption(1, [&](){ ::vl::presentation::compositions::GuiCellOption __vwsn_temp__; __vwsn_temp__.composeType = ::vl::presentation::compositions::GuiCellOption::ComposeType::Absolute; __vwsn_temp__.absolute = 100; return __vwsn_temp__; }()); + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_1)->SetColumnOption(2, [&](){ ::vl::presentation::compositions::GuiCellOption __vwsn_temp__; __vwsn_temp__.composeType = ::vl::presentation::compositions::GuiCellOption::ComposeType::MinSize; return __vwsn_temp__; }()); + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_1)->SetColumnOption(3, [&](){ ::vl::presentation::compositions::GuiCellOption __vwsn_temp__; __vwsn_temp__.composeType = ::vl::presentation::compositions::GuiCellOption::ComposeType::Percentage; __vwsn_temp__.percentage = 1.0; return __vwsn_temp__; }()); + } + (::vl::__vwsn::This(this)->__vwsn_precompile_2 = new ::vl::presentation::compositions::GuiCellComposition()); + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_2)->SetInternalMargin([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = 0; __vwsn_temp__.top = 5; __vwsn_temp__.right = 0; __vwsn_temp__.bottom = 5; return __vwsn_temp__; }()); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_2)->SetSite(0, 0, 1, 1); + } + { + auto __vwsn_controlStyle_ = ::vl::__vwsn::This(::vl::presentation::theme::GetCurrentTheme())->CreateLabelStyle(); + (::vl::__vwsn::This(this)->__vwsn_precompile_3 = new ::vl::presentation::controls::GuiLabel(__vwsn_controlStyle_)); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_3)->SetText(::vl::WString(L"A : ", false)); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_2)->AddChild(::vl::__vwsn::Ensure(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_3)->GetBoundsComposition()))); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_1)->AddChild(::vl::__vwsn::Ensure(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(::vl::__vwsn::This(this)->__vwsn_precompile_2))); + } + (::vl::__vwsn::This(this)->__vwsn_precompile_4 = new ::vl::presentation::compositions::GuiCellComposition()); + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_4)->SetSite(0, 1, 1, 2); + } + { + auto __vwsn_controlStyle_ = ::vl::__vwsn::This(::vl::presentation::theme::GetCurrentTheme())->CreateTextBoxStyle(); + (::vl::__vwsn::This(this)->textBoxA = new ::vl::presentation::controls::GuiSinglelineTextBox(__vwsn_controlStyle_)); + } + (::vl::__vwsn::This(this)->__vwsn_precompile_5 = ::vl::__vwsn::This(::vl::__vwsn::This(this)->textBoxA)->GetBoundsComposition()); + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_5)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = 0; __vwsn_temp__.top = 0; __vwsn_temp__.right = 0; __vwsn_temp__.bottom = 0; return __vwsn_temp__; }()); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->textBoxA)->SetText(::vl::WString(L"1", false)); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_4)->AddChild(::vl::__vwsn::Ensure(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(::vl::__vwsn::This(::vl::__vwsn::This(this)->textBoxA)->GetBoundsComposition()))); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_1)->AddChild(::vl::__vwsn::Ensure(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(::vl::__vwsn::This(this)->__vwsn_precompile_4))); + } + (::vl::__vwsn::This(this)->__vwsn_precompile_6 = new ::vl::presentation::compositions::GuiCellComposition()); + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_6)->SetInternalMargin([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = 0; __vwsn_temp__.top = 5; __vwsn_temp__.right = 0; __vwsn_temp__.bottom = 5; return __vwsn_temp__; }()); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_6)->SetSite(1, 0, 1, 1); + } + { + auto __vwsn_controlStyle_ = ::vl::__vwsn::This(::vl::presentation::theme::GetCurrentTheme())->CreateLabelStyle(); + (::vl::__vwsn::This(this)->__vwsn_precompile_7 = new ::vl::presentation::controls::GuiLabel(__vwsn_controlStyle_)); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_7)->SetText(::vl::WString(L"B : ", false)); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_6)->AddChild(::vl::__vwsn::Ensure(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_7)->GetBoundsComposition()))); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_1)->AddChild(::vl::__vwsn::Ensure(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(::vl::__vwsn::This(this)->__vwsn_precompile_6))); + } + (::vl::__vwsn::This(this)->__vwsn_precompile_8 = new ::vl::presentation::compositions::GuiCellComposition()); + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_8)->SetSite(1, 1, 1, 2); + } + { + auto __vwsn_controlStyle_ = ::vl::__vwsn::This(::vl::presentation::theme::GetCurrentTheme())->CreateTextBoxStyle(); + (::vl::__vwsn::This(this)->textBoxB = new ::vl::presentation::controls::GuiSinglelineTextBox(__vwsn_controlStyle_)); + } + (::vl::__vwsn::This(this)->__vwsn_precompile_9 = ::vl::__vwsn::This(::vl::__vwsn::This(this)->textBoxB)->GetBoundsComposition()); + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_9)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = 0; __vwsn_temp__.top = 0; __vwsn_temp__.right = 0; __vwsn_temp__.bottom = 0; return __vwsn_temp__; }()); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->textBoxB)->SetText(::vl::WString(L"2", false)); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_8)->AddChild(::vl::__vwsn::Ensure(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(::vl::__vwsn::This(::vl::__vwsn::This(this)->textBoxB)->GetBoundsComposition()))); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_1)->AddChild(::vl::__vwsn::Ensure(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(::vl::__vwsn::This(this)->__vwsn_precompile_8))); + } + (::vl::__vwsn::This(this)->__vwsn_precompile_10 = new ::vl::presentation::compositions::GuiCellComposition()); + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_10)->SetInternalMargin([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = 0; __vwsn_temp__.top = 5; __vwsn_temp__.right = 0; __vwsn_temp__.bottom = 5; return __vwsn_temp__; }()); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_10)->SetSite(2, 0, 1, 1); + } + { + auto __vwsn_controlStyle_ = ::vl::__vwsn::This(::vl::presentation::theme::GetCurrentTheme())->CreateLabelStyle(); + (::vl::__vwsn::This(this)->__vwsn_precompile_11 = new ::vl::presentation::controls::GuiLabel(__vwsn_controlStyle_)); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_11)->SetText(::vl::WString(L"A + B = : ", false)); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_10)->AddChild(::vl::__vwsn::Ensure(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_11)->GetBoundsComposition()))); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_1)->AddChild(::vl::__vwsn::Ensure(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(::vl::__vwsn::This(this)->__vwsn_precompile_10))); + } + (::vl::__vwsn::This(this)->__vwsn_precompile_12 = new ::vl::presentation::compositions::GuiCellComposition()); + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_12)->SetSite(2, 1, 1, 1); + } + { + auto __vwsn_controlStyle_ = ::vl::__vwsn::This(::vl::presentation::theme::GetCurrentTheme())->CreateTextBoxStyle(); + (::vl::__vwsn::This(this)->textBoxC = new ::vl::presentation::controls::GuiSinglelineTextBox(__vwsn_controlStyle_)); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->textBoxC)->SetReadonly(::vl::__vwsn::Parse(::vl::WString(L"true", false))); + } + (::vl::__vwsn::This(this)->__vwsn_precompile_13 = ::vl::__vwsn::This(::vl::__vwsn::This(this)->textBoxC)->GetBoundsComposition()); + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_13)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = 0; __vwsn_temp__.top = 0; __vwsn_temp__.right = 0; __vwsn_temp__.bottom = 0; return __vwsn_temp__; }()); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_12)->AddChild(::vl::__vwsn::Ensure(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(::vl::__vwsn::This(::vl::__vwsn::This(this)->textBoxC)->GetBoundsComposition()))); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_1)->AddChild(::vl::__vwsn::Ensure(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(::vl::__vwsn::This(this)->__vwsn_precompile_12))); + } + (::vl::__vwsn::This(this)->__vwsn_precompile_14 = new ::vl::presentation::compositions::GuiCellComposition()); + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_14)->SetSite(2, 2, 1, 1); + } + { + auto __vwsn_controlStyle_ = ::vl::__vwsn::This(::vl::presentation::theme::GetCurrentTheme())->CreateButtonStyle(); + (::vl::__vwsn::This(this)->__vwsn_precompile_15 = new ::vl::presentation::controls::GuiButton(__vwsn_controlStyle_)); + } + (::vl::__vwsn::This(this)->__vwsn_precompile_16 = ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_15)->GetBoundsComposition()); + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_16)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = 0; __vwsn_temp__.top = 0; __vwsn_temp__.right = 0; __vwsn_temp__.bottom = 0; return __vwsn_temp__; }()); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_15)->SetText(::vl::WString(L"Calculate", false)); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_14)->AddChild(::vl::__vwsn::Ensure(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_15)->GetBoundsComposition()))); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_1)->AddChild(::vl::__vwsn::Ensure(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(::vl::__vwsn::This(this)->__vwsn_precompile_14))); + } + { + ::vl::__vwsn::This(::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_0)->GetContainerComposition())->AddChild(::vl::__vwsn::Ensure(static_cast<::vl::presentation::compositions::GuiGraphicsComposition*>(::vl::__vwsn::This(this)->__vwsn_precompile_1))); + } + { + auto __vwsn_event_handler_ = LAMBDA(::vl_workflow_global::__vwsnf1_Demo_demo_MainWindowConstructor___vwsn_initialize_instance__(this)); + ::vl::__vwsn::EventAttach(::vl::__vwsn::This(::vl::__vwsn::This(this)->__vwsn_precompile_15)->Clicked, __vwsn_event_handler_); + } + } - void MainWindow::OnCreate() + MainWindowConstructor::MainWindowConstructor() { } - void MainWindow::OnDestroy() +/*********************************************************************** +Class (::demo::MainWindow) +***********************************************************************/ + + ::vl::Ptr<::demo::IViewModel> MainWindow::GetViewModel() { + return ::vl::__vwsn::This(this)->__vwsn_parameter_ViewModel; } - // #endregion CLASS_MEMBER_GUIEVENT_HANDLER - - MainWindow::MainWindow(vl::Ptr ViewModel) + MainWindow::MainWindow(::vl::Ptr<::demo::IViewModel> __vwsn_ctor_parameter_ViewModel) + : ::vl::presentation::controls::GuiWindow(::vl::__vwsn::This(::vl::presentation::theme::GetCurrentTheme())->CreateWindowStyle()) { - InitializeComponents(ViewModel); - OnCreate(); + (::vl::__vwsn::This(this)->__vwsn_parameter_ViewModel = __vwsn_ctor_parameter_ViewModel); + 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() { - OnDestroy(); - ClearSubscriptions(); + ::vl::__vwsn::This(this)->ClearSubscriptions(); } -} +/*********************************************************************** +Class (::demo::IViewModel) +***********************************************************************/ + +} +#undef GLOBAL_SYMBOL +#undef GLOBAL_NAME +#undef GLOBAL_OBJ +#undef USERIMPL + +/*********************************************************************** +Reflection +***********************************************************************/ namespace vl { @@ -44,57 +314,84 @@ namespace vl { namespace description { - #define _ , - IMPL_CPP_TYPE_INFO(demo::IViewModel) - IMPL_CPP_TYPE_INFO(demo::MainWindow) +#ifndef VCZH_DEBUG_NO_REFLECTION + IMPL_CPP_TYPE_INFO(::demo::IViewModel) + IMPL_CPP_TYPE_INFO(::demo::MainWindow) + IMPL_CPP_TYPE_INFO(::demo::MainWindowConstructor) - BEGIN_CLASS_MEMBER(demo::IViewModel) - CLASS_MEMBER_BASE(::vl::reflection::IDescriptable) - CLASS_MEMBER_METHOD(Add, { L"a" _ L"b" }); - CLASS_MEMBER_METHOD(Error, NO_PARAMETER); - END_CLASS_MEMBER(demo::IViewModel) +#define _ , + BEGIN_INTERFACE_MEMBER(::demo::IViewModel) + CLASS_MEMBER_METHOD(Add, { L"a" _ L"b" }) + CLASS_MEMBER_METHOD(Error, NO_PARAMETER) + END_INTERFACE_MEMBER(::demo::IViewModel) - BEGIN_CLASS_MEMBER(demo::MainWindow) - CLASS_MEMBER_BASE(::vl::presentation::controls::GuiWindow) - CLASS_MEMBER_CONSTRUCTOR(demo::MainWindow*(vl::Ptr), { L"ViewModel" }) + BEGIN_CLASS_MEMBER(::demo::MainWindow) + CLASS_MEMBER_METHOD(GetViewModel, NO_PARAMETER) + CLASS_MEMBER_FIELD(__vwsn_parameter_ViewModel) + CLASS_MEMBER_PROPERTY_READONLY(ViewModel, GetViewModel) + END_CLASS_MEMBER(::demo::MainWindow) - CLASS_MEMBER_PROPERTY_READONLY_FAST(ViewModel) - END_CLASS_MEMBER(demo::MainWindow) + BEGIN_CLASS_MEMBER(::demo::MainWindowConstructor) + CLASS_MEMBER_METHOD(__vwsn_initialize_instance_, { L"__vwsn_this_" _ L"__vwsn_resolver_" }) + CLASS_MEMBER_FIELD(__vwsn_precompile_0) + CLASS_MEMBER_FIELD(__vwsn_precompile_1) + CLASS_MEMBER_FIELD(__vwsn_precompile_10) + CLASS_MEMBER_FIELD(__vwsn_precompile_11) + CLASS_MEMBER_FIELD(__vwsn_precompile_12) + CLASS_MEMBER_FIELD(__vwsn_precompile_13) + CLASS_MEMBER_FIELD(__vwsn_precompile_14) + CLASS_MEMBER_FIELD(__vwsn_precompile_15) + CLASS_MEMBER_FIELD(__vwsn_precompile_16) + CLASS_MEMBER_FIELD(__vwsn_precompile_17) + CLASS_MEMBER_FIELD(__vwsn_precompile_2) + CLASS_MEMBER_FIELD(__vwsn_precompile_3) + CLASS_MEMBER_FIELD(__vwsn_precompile_4) + CLASS_MEMBER_FIELD(__vwsn_precompile_5) + CLASS_MEMBER_FIELD(__vwsn_precompile_6) + CLASS_MEMBER_FIELD(__vwsn_precompile_7) + CLASS_MEMBER_FIELD(__vwsn_precompile_8) + CLASS_MEMBER_FIELD(__vwsn_precompile_9) + CLASS_MEMBER_FIELD(ViewModel) + CLASS_MEMBER_FIELD(textBoxA) + CLASS_MEMBER_FIELD(textBoxB) + CLASS_MEMBER_FIELD(textBoxC) + END_CLASS_MEMBER(::demo::MainWindowConstructor) - #undef _ - - class DemoResourceLoader : public Object, public ITypeLoader +#undef _ + class DemoTypeLoader : public Object, public ITypeLoader { public: void Load(ITypeManager* manager) { - ADD_TYPE_INFO(demo::IViewModel) - ADD_TYPE_INFO(demo::MainWindow) + ADD_TYPE_INFO(::demo::IViewModel) + ADD_TYPE_INFO(::demo::MainWindow) + ADD_TYPE_INFO(::demo::MainWindowConstructor) } void Unload(ITypeManager* manager) { } }; +#endif - class DemoResourcePlugin : public Object, public vl::presentation::controls::IGuiPlugin + bool LoadDemoTypes() { - public: - void Load()override +#ifndef VCZH_DEBUG_NO_REFLECTION + if (auto manager = GetGlobalTypeManager()) { - GetGlobalTypeManager()->AddTypeLoader(new DemoResourceLoader); + return manager->AddTypeLoader(MakePtr()); } - - void AfterLoad()override - { - } - - void Unload()override - { - } - }; - GUI_REGISTER_PLUGIN(DemoResourcePlugin) +#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_Xml/Event_ViewModel/UI/Source/DemoPartialClasses.h b/Tutorial/GacUI_Xml/Event_ViewModel/UI/Source/DemoPartialClasses.h index d100f9fd..dd904f10 100644 --- a/Tutorial/GacUI_Xml/Event_ViewModel/UI/Source/DemoPartialClasses.h +++ b/Tutorial/GacUI_Xml/Event_ViewModel/UI/Source/DemoPartialClasses.h @@ -1,102 +1,118 @@ -/*********************************************************************** -Vczh Library++ 3.0 -Developer: Zihan Chen(vczh) -GacUI::Partial Classes +/*********************************************************************** +!!!!!! DO NOT MODIFY !!!!!! -This file is generated by: Vczh GacUI Resource Code Generator -************************************************************************ -DO NOT MODIFY +GacGen.exe Resource.xml + +This file is generated by Workflow compiler +https://github.com/vczh-libraries ***********************************************************************/ -#ifndef VCZH_GACUI_RESOURCE_CODE_GENERATOR_Demo_PARTIAL_CLASSES -#define VCZH_GACUI_RESOURCE_CODE_GENERATOR_Demo_PARTIAL_CLASSES +#ifndef VCZH_WORKFLOW_COMPILER_GENERATED_DEMOPARTIALCLASSES +#define VCZH_WORKFLOW_COMPILER_GENERATED_DEMOPARTIALCLASSES -#include "GacUIReflection.h" +#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 vl_workflow_global +{ + struct __vwsnf1_Demo_demo_MainWindowConstructor___vwsn_initialize_instance__; +} namespace demo { - class IViewModel; + class MainWindowConstructor; class MainWindow; + class IViewModel; - class IViewModel : public virtual ::vl::reflection::IDescriptable, public vl::reflection::Description + class MainWindowConstructor : public ::vl::Object, public ::vl::reflection::Description { + friend struct ::vl_workflow_global::__vwsnf1_Demo_demo_MainWindowConstructor___vwsn_initialize_instance__; +#ifndef VCZH_DEBUG_NO_REFLECTION + friend struct ::vl::reflection::description::CustomTypeDescriptorSelector; +#endif + protected: + ::vl::Ptr<::demo::IViewModel> ViewModel = ::vl::Ptr<::demo::IViewModel>(); + ::vl::presentation::controls::GuiSinglelineTextBox* textBoxA = static_cast<::vl::presentation::controls::GuiSinglelineTextBox*>(nullptr); + ::vl::presentation::controls::GuiSinglelineTextBox* textBoxB = static_cast<::vl::presentation::controls::GuiSinglelineTextBox*>(nullptr); + ::vl::presentation::controls::GuiSinglelineTextBox* textBoxC = static_cast<::vl::presentation::controls::GuiSinglelineTextBox*>(nullptr); + ::demo::MainWindow* __vwsn_precompile_0 = static_cast<::demo::MainWindow*>(nullptr); + ::vl::presentation::compositions::GuiTableComposition* __vwsn_precompile_1 = static_cast<::vl::presentation::compositions::GuiTableComposition*>(nullptr); + ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_2 = static_cast<::vl::presentation::compositions::GuiCellComposition*>(nullptr); + ::vl::presentation::controls::GuiLabel* __vwsn_precompile_3 = static_cast<::vl::presentation::controls::GuiLabel*>(nullptr); + ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_4 = static_cast<::vl::presentation::compositions::GuiCellComposition*>(nullptr); + ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_5 = static_cast<::vl::presentation::compositions::GuiBoundsComposition*>(nullptr); + ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_6 = static_cast<::vl::presentation::compositions::GuiCellComposition*>(nullptr); + ::vl::presentation::controls::GuiLabel* __vwsn_precompile_7 = static_cast<::vl::presentation::controls::GuiLabel*>(nullptr); + ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_8 = static_cast<::vl::presentation::compositions::GuiCellComposition*>(nullptr); + ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_9 = static_cast<::vl::presentation::compositions::GuiBoundsComposition*>(nullptr); + ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_10 = static_cast<::vl::presentation::compositions::GuiCellComposition*>(nullptr); + ::vl::presentation::controls::GuiLabel* __vwsn_precompile_11 = static_cast<::vl::presentation::controls::GuiLabel*>(nullptr); + ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_12 = static_cast<::vl::presentation::compositions::GuiCellComposition*>(nullptr); + ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_13 = static_cast<::vl::presentation::compositions::GuiBoundsComposition*>(nullptr); + ::vl::presentation::compositions::GuiCellComposition* __vwsn_precompile_14 = static_cast<::vl::presentation::compositions::GuiCellComposition*>(nullptr); + ::vl::presentation::controls::GuiButton* __vwsn_precompile_15 = static_cast<::vl::presentation::controls::GuiButton*>(nullptr); + ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_16 = static_cast<::vl::presentation::compositions::GuiBoundsComposition*>(nullptr); + ::vl::presentation::compositions::GuiBoundsComposition* __vwsn_precompile_17 = 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; + friend struct ::vl_workflow_global::__vwsnf1_Demo_demo_MainWindowConstructor___vwsn_initialize_instance__; +#ifndef VCZH_DEBUG_NO_REFLECTION + friend struct ::vl::reflection::description::CustomTypeDescriptorSelector; +#endif + public: + ::vl::Ptr<::demo::IViewModel> __vwsn_parameter_ViewModel = ::vl::Ptr<::demo::IViewModel>(); + ::vl::Ptr<::demo::IViewModel> GetViewModel(); + MainWindow(::vl::Ptr<::demo::IViewModel> __vwsn_ctor_parameter_ViewModel); + ~MainWindow(); + }; + + class IViewModel : public virtual ::vl::reflection::IDescriptable, public ::vl::reflection::Description + { +#ifndef VCZH_DEBUG_NO_REFLECTION + friend struct ::vl::reflection::description::CustomTypeDescriptorSelector; +#endif public: virtual ::vl::vint32_t Add(::vl::vint32_t a, ::vl::vint32_t b) = 0; virtual ::vl::WString Error() = 0; }; - template - class MainWindow_ : public ::vl::presentation::controls::GuiWindow, public vl::presentation::GuiInstancePartialClass, public vl::reflection::Description - { - friend struct vl::reflection::description::CustomTypeDescriptorSelector; - private: - vl::Ptr ViewModel_; - protected: - ::vl::presentation::controls::GuiSinglelineTextBox* textBoxA; - ::vl::presentation::controls::GuiSinglelineTextBox* textBoxB; - ::vl::presentation::controls::GuiSinglelineTextBox* textBoxC; - - void InitializeComponents(vl::Ptr ViewModel) - { - ViewModel_ = ViewModel; - if (InitializeFromResource()) - { - GUI_INSTANCE_REFERENCE(textBoxA); - GUI_INSTANCE_REFERENCE(textBoxB); - GUI_INSTANCE_REFERENCE(textBoxC); - } - else - { - ViewModel_ = 0; - } - } - public: - MainWindow_() - :vl::presentation::GuiInstancePartialClass<::vl::presentation::controls::GuiWindow>(L"demo::MainWindow") - ,::vl::presentation::controls::GuiWindow(vl::presentation::theme::GetCurrentTheme()->CreateWindowStyle()) - ,textBoxA(0) - ,textBoxB(0) - ,textBoxC(0) - { - } - - vl::Ptr GetViewModel() - { - return ViewModel_; - } - }; - } -namespace vl -{ - namespace reflection - { - namespace description - { - DECL_TYPE_INFO(demo::IViewModel) - DECL_TYPE_INFO(demo::MainWindow) +/*********************************************************************** +Global Variables and Functions +***********************************************************************/ - } - } -} -namespace demo +namespace vl_workflow_global { - class MainWindow : public demo::MainWindow_ + class Demo { - friend class demo::MainWindow_; - friend struct vl::reflection::description::CustomTypeDescriptorSelector; - protected: - - // #region CLASS_MEMBER_GUIEVENT_HANDLER (DO NOT PUT OTHER CONTENT IN THIS #region.) - void OnCreate(); - void OnDestroy(); - // #endregion CLASS_MEMBER_GUIEVENT_HANDLER public: - MainWindow(vl::Ptr ViewModel); - ~MainWindow(); + + 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_Xml/UIRes/Event_Cpp.bin b/Tutorial/GacUI_Xml/UIRes/Event_Cpp.bin index 52c8f911..1f9e95da 100644 Binary files a/Tutorial/GacUI_Xml/UIRes/Event_Cpp.bin and b/Tutorial/GacUI_Xml/UIRes/Event_Cpp.bin differ diff --git a/Tutorial/GacUI_Xml/UIRes/Event_Script.bin b/Tutorial/GacUI_Xml/UIRes/Event_Script.bin index 2fedcbb4..fd4e814e 100644 Binary files a/Tutorial/GacUI_Xml/UIRes/Event_Script.bin and b/Tutorial/GacUI_Xml/UIRes/Event_Script.bin differ diff --git a/Tutorial/GacUI_Xml/UIRes/Event_ViewModel.bin b/Tutorial/GacUI_Xml/UIRes/Event_ViewModel.bin index 02469660..1ce1a438 100644 Binary files a/Tutorial/GacUI_Xml/UIRes/Event_ViewModel.bin and b/Tutorial/GacUI_Xml/UIRes/Event_ViewModel.bin differ