diff --git a/Tutorial/Codegen.bat b/Tutorial/Codegen.bat index 184f5f59..e6eab1ab 100644 --- a/Tutorial/Codegen.bat +++ b/Tutorial/Codegen.bat @@ -39,6 +39,9 @@ popd pushd ColorPicker\UI call Codegen.bat popd +pushd AddressBook\UI +call Codegen.bat +popd popd pushd GacUI_ControlTemplate pushd BlackSkin\UI diff --git a/Tutorial/GacUI_Controls/AddressBook/AddressBook.vcxproj b/Tutorial/GacUI_Controls/AddressBook/AddressBook.vcxproj new file mode 100644 index 00000000..5342a3bd --- /dev/null +++ b/Tutorial/GacUI_Controls/AddressBook/AddressBook.vcxproj @@ -0,0 +1,101 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {7F92FCD2-8A1E-4C73-9949-91555BEF3832} + Win32Proj + AddressBook + + + + Application + true + v120 + Unicode + + + Application + false + v120 + true + Unicode + + + + + + + + + + + + + true + $(ProjectDir)..\..\..\Import;$(IncludePath) + + + false + $(ProjectDir)..\..\..\Import;$(IncludePath) + + + + + + Level3 + Disabled + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + + + Windows + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + + + Windows + true + true + true + + + + + {8018d622-66ba-4e65-9d03-bdac37ea9a54} + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Tutorial/GacUI_Controls/AddressBook/AddressBook.vcxproj.filters b/Tutorial/GacUI_Controls/AddressBook/AddressBook.vcxproj.filters new file mode 100644 index 00000000..77e14c98 --- /dev/null +++ b/Tutorial/GacUI_Controls/AddressBook/AddressBook.vcxproj.filters @@ -0,0 +1,41 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + {4b44e603-d973-4480-9296-4ff2d97dad8d} + + + + + Source Files + + + UI + + + + + Resource Files + + + + + UI + + + UI + + + \ No newline at end of file diff --git a/Tutorial/GacUI_Controls/AddressBook/Main.cpp b/Tutorial/GacUI_Controls/AddressBook/Main.cpp new file mode 100644 index 00000000..706d9aea --- /dev/null +++ b/Tutorial/GacUI_Controls/AddressBook/Main.cpp @@ -0,0 +1,23 @@ +#include "UI/Source/Demo.h" +#include + +using namespace vl::collections; +using namespace vl::stream; + +int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int CmdShow) +{ + return SetupWindowsDirect2DRenderer(); +} + +void GuiMain() +{ + { + List errors; + FileStream fileStream(L"../UIRes/AddressBook.bin", FileStream::ReadOnly); + auto resource = GuiResource::LoadPrecompiledBinary(fileStream, errors); + GetResourceManager()->SetResource(L"Resource", resource); + } + demo::MainWindow window; + window.MoveToScreenCenter(); + GetApplication()->Run(&window); +} \ No newline at end of file diff --git a/Tutorial/GacUI_Controls/AddressBook/UI/Codegen.bat b/Tutorial/GacUI_Controls/AddressBook/UI/Codegen.bat new file mode 100644 index 00000000..27f6654b --- /dev/null +++ b/Tutorial/GacUI_Controls/AddressBook/UI/Codegen.bat @@ -0,0 +1 @@ +..\..\..\..\Tools\GacGen.exe Resource.xml \ No newline at end of file diff --git a/Tutorial/GacUI_Controls/AddressBook/UI/Resource.xml b/Tutorial/GacUI_Controls/AddressBook/UI/Resource.xml new file mode 100644 index 00000000..df5b6f3b --- /dev/null +++ b/Tutorial/GacUI_Controls/AddressBook/UI/Resource.xml @@ -0,0 +1,25 @@ + + + + + Source + GacUIReflection.h + Demo + + + + ..\..\UIRes + AddressBook.bin + + + + + + + + + + + + + \ No newline at end of file diff --git a/Tutorial/GacUI_Controls/AddressBook/UI/Source/Demo.h b/Tutorial/GacUI_Controls/AddressBook/UI/Source/Demo.h new file mode 100644 index 00000000..febeba0f --- /dev/null +++ b/Tutorial/GacUI_Controls/AddressBook/UI/Source/Demo.h @@ -0,0 +1,16 @@ +/*********************************************************************** +Vczh Library++ 3.0 +Developer: Zihan Chen(vczh) +GacUI::Demo + +This file is generated by: Vczh GacUI Resource Code Generator +************************************************************************ +DO NOT MODIFY +***********************************************************************/ + +#ifndef VCZH_GACUI_RESOURCE_CODE_GENERATOR_Demo +#define VCZH_GACUI_RESOURCE_CODE_GENERATOR_Demo + +#include "DemoPartialClasses.h" + +#endif diff --git a/Tutorial/GacUI_Controls/AddressBook/UI/Source/DemoPartialClasses.cpp b/Tutorial/GacUI_Controls/AddressBook/UI/Source/DemoPartialClasses.cpp new file mode 100644 index 00000000..4be7d2d3 --- /dev/null +++ b/Tutorial/GacUI_Controls/AddressBook/UI/Source/DemoPartialClasses.cpp @@ -0,0 +1,90 @@ +/*********************************************************************** +Vczh Library++ 3.0 +Developer: Zihan Chen(vczh) +GacUI::Partial Classes + +This file is generated by: Vczh GacUI Resource Code Generator +************************************************************************ +DO NOT MODIFY +***********************************************************************/ + +#include "Demo.h" + +namespace demo +{ + // #region CLASS_MEMBER_GUIEVENT_HANDLER (DO NOT PUT OTHER CONTENT IN THIS #region.) + + void MainWindow::OnCreate() + { + } + + void MainWindow::OnDestroy() + { + } + + // #endregion CLASS_MEMBER_GUIEVENT_HANDLER + + MainWindow::MainWindow() + { + InitializeComponents(); + OnCreate(); + } + + MainWindow::~MainWindow() + { + OnDestroy(); + ClearSubscriptions(); + } +} + + +namespace vl +{ + namespace reflection + { + namespace description + { + #define _ , + IMPL_CPP_TYPE_INFO(demo::MainWindow) + + BEGIN_CLASS_MEMBER(demo::MainWindow) + CLASS_MEMBER_BASE(vl::presentation::controls::GuiWindow) + CLASS_MEMBER_CONSTRUCTOR(demo::MainWindow*(), NO_PARAMETER) + END_CLASS_MEMBER(demo::MainWindow) + + #undef _ + + class DemoResourceLoader : public Object, public ITypeLoader + { + public: + void Load(ITypeManager* manager) + { + ADD_TYPE_INFO(demo::MainWindow) + } + + void Unload(ITypeManager* manager) + { + } + }; + + class DemoResourcePlugin : public Object, public vl::presentation::controls::IGuiPlugin + { + public: + void Load()override + { + GetGlobalTypeManager()->AddTypeLoader(new DemoResourceLoader); + } + + void AfterLoad()override + { + } + + void Unload()override + { + } + }; + GUI_REGISTER_PLUGIN(DemoResourcePlugin) + } + } +} + diff --git a/Tutorial/GacUI_Controls/AddressBook/UI/Source/DemoPartialClasses.h b/Tutorial/GacUI_Controls/AddressBook/UI/Source/DemoPartialClasses.h new file mode 100644 index 00000000..8383bfe1 --- /dev/null +++ b/Tutorial/GacUI_Controls/AddressBook/UI/Source/DemoPartialClasses.h @@ -0,0 +1,76 @@ +/*********************************************************************** +Vczh Library++ 3.0 +Developer: Zihan Chen(vczh) +GacUI::Partial Classes + +This file is generated by: Vczh GacUI Resource Code Generator +************************************************************************ +DO NOT MODIFY +***********************************************************************/ + +#ifndef VCZH_GACUI_RESOURCE_CODE_GENERATOR_Demo_PARTIAL_CLASSES +#define VCZH_GACUI_RESOURCE_CODE_GENERATOR_Demo_PARTIAL_CLASSES + +#include "GacUIReflection.h" + +namespace demo +{ + class MainWindow; + + template + class MainWindow_ : public vl::presentation::controls::GuiWindow, public vl::presentation::GuiInstancePartialClass, public vl::reflection::Description + { + friend struct vl::reflection::description::CustomTypeDescriptorSelector; + private: + protected: + + void InitializeComponents() + { + if (InitializeFromResource()) + { + } + else + { + } + } + public: + MainWindow_() + :vl::presentation::GuiInstancePartialClass(L"demo::MainWindow") + ,vl::presentation::controls::GuiWindow(vl::presentation::theme::GetCurrentTheme()->CreateWindowStyle()) + { + } + }; + +} +namespace vl +{ + namespace reflection + { + 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 + public: + MainWindow(); + ~MainWindow(); + }; +} + + + +#endif diff --git a/Tutorial/GacUI_Controls/ColorPicker/UI/Resource.xml b/Tutorial/GacUI_Controls/ColorPicker/UI/Resource.xml index 8687b938..d7ced6d0 100644 --- a/Tutorial/GacUI_Controls/ColorPicker/UI/Resource.xml +++ b/Tutorial/GacUI_Controls/ColorPicker/UI/Resource.xml @@ -45,7 +45,7 @@ - + @@ -62,7 +62,7 @@