diff --git a/SampleForDoc/GacUI/GacUI.sln b/SampleForDoc/GacUI/GacUI.sln new file mode 100644 index 00000000..dbdd5edf --- /dev/null +++ b/SampleForDoc/GacUI/GacUI.sln @@ -0,0 +1,44 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.28307.421 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RunResource", "RunResource\RunResource.vcxproj", "{0FAA859A-1B12-4F70-9EA9-31DBBF202595}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Lib", "Lib", "{21E29BA1-4CA5-4BDB-B7BF-19A6E76B3A12}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GacUI", "..\..\Tutorial\Lib\GacUI\GacUI.vcxproj", "{8018D622-66BA-4E65-9D03-BDAC37EA9A54}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {0FAA859A-1B12-4F70-9EA9-31DBBF202595}.Debug|x64.ActiveCfg = Debug|x64 + {0FAA859A-1B12-4F70-9EA9-31DBBF202595}.Debug|x64.Build.0 = Debug|x64 + {0FAA859A-1B12-4F70-9EA9-31DBBF202595}.Debug|x86.ActiveCfg = Debug|Win32 + {0FAA859A-1B12-4F70-9EA9-31DBBF202595}.Debug|x86.Build.0 = Debug|Win32 + {0FAA859A-1B12-4F70-9EA9-31DBBF202595}.Release|x64.ActiveCfg = Release|x64 + {0FAA859A-1B12-4F70-9EA9-31DBBF202595}.Release|x64.Build.0 = Release|x64 + {0FAA859A-1B12-4F70-9EA9-31DBBF202595}.Release|x86.ActiveCfg = Release|Win32 + {0FAA859A-1B12-4F70-9EA9-31DBBF202595}.Release|x86.Build.0 = Release|Win32 + {8018D622-66BA-4E65-9D03-BDAC37EA9A54}.Debug|x64.ActiveCfg = Debug|Win32 + {8018D622-66BA-4E65-9D03-BDAC37EA9A54}.Debug|x86.ActiveCfg = Debug|Win32 + {8018D622-66BA-4E65-9D03-BDAC37EA9A54}.Debug|x86.Build.0 = Debug|Win32 + {8018D622-66BA-4E65-9D03-BDAC37EA9A54}.Release|x64.ActiveCfg = Release|Win32 + {8018D622-66BA-4E65-9D03-BDAC37EA9A54}.Release|x86.ActiveCfg = Release|Win32 + {8018D622-66BA-4E65-9D03-BDAC37EA9A54}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {8018D622-66BA-4E65-9D03-BDAC37EA9A54} = {21E29BA1-4CA5-4BDB-B7BF-19A6E76B3A12} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {1089FAC6-7FE3-4ED1-A226-E1D2CEE0930E} + EndGlobalSection +EndGlobal diff --git a/SampleForDoc/GacUI/README.md b/SampleForDoc/GacUI/README.md new file mode 100644 index 00000000..829d312b --- /dev/null +++ b/SampleForDoc/GacUI/README.md @@ -0,0 +1,26 @@ +# Sample Applications for Document + +http://vczh-libraries.github.io/doc/current/gacui/home.html + +## Steps to Try + +### Modify a Resource File + +- All resource files are in `XmlRes\*\Resource.xml` +- All compiled binaries are in `UIRes\*\*.bin` + - C++ files are not generated in these samples + - Compiled Workflow script are contained in binaries + - They are platform dependent, x86 and x64 application doesn't load the same binary + +### Build + +- Go to folder `XmlRes` +- Run `..\..\..\Tools\GacClear.ps1 -FileName GacUI.xml` +- Run `..\..\..\Tools\GacBuild.ps1 -FileName GacUI.xml` + +### Execute + +- Open GacUI.sln +- Build the solution +- Run project `RunResource` + - If you want to load `XmlRes\kb_elements\Resource.xml`, set the command line arguments to `kb_elements` diff --git a/SampleForDoc/GacUI/RunResource/GuiMain.cpp b/SampleForDoc/GacUI/RunResource/GuiMain.cpp new file mode 100644 index 00000000..58e90243 --- /dev/null +++ b/SampleForDoc/GacUI/RunResource/GuiMain.cpp @@ -0,0 +1,37 @@ +#include +#include + +using namespace vl; +using namespace vl::filesystem; +using namespace vl::reflection::description; +using namespace vl::presentation; +using namespace vl::presentation::controls; +using namespace vl::presentation::compositions; + +void GuiMain() +{ + { + // expected to executed like "RunResource.exe kb-elements" + WString resourceName; + { + int argc = 0; + LPWSTR* argv = CommandLineToArgvW(GetCommandLine(), &argc); + CHECK_ERROR(argc == 2, L"Command line arguments are missing."); \ + resourceName = argv[1]; + LocalFree(argv); + } +#ifdef VCZH_64 + FilePath resourcePath = FilePath(L"../UIRes/64bits") / (resourceName + L".bin"); +#else + FilePath resourcePath = FilePath(L"../UIRes/32bits") / (resourceName + L".bin"); +#endif + + stream::FileStream resourceStream(resourcePath.GetFullPath(), stream::FileStream::ReadOnly); + GetResourceManager()->LoadResourceOrPending(resourceStream, GuiResourceUsage::InstanceClass); + } + + auto window = UnboxValue(Value::Create(L"sample::MainWindow")); + window->MoveToScreenCenter(); + GetApplication()->Run(window); + SafeDeleteControl(window); +} \ No newline at end of file diff --git a/SampleForDoc/GacUI/RunResource/RunResource.vcxproj b/SampleForDoc/GacUI/RunResource/RunResource.vcxproj new file mode 100644 index 00000000..730e666b --- /dev/null +++ b/SampleForDoc/GacUI/RunResource/RunResource.vcxproj @@ -0,0 +1,160 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 15.0 + {0FAA859A-1B12-4F70-9EA9-31DBBF202595} + Win32Proj + RunResource + 10.0.17763.0 + + + + Application + true + v141 + Unicode + + + Application + false + v141 + true + Unicode + + + Application + true + v141 + Unicode + + + Application + false + v141 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)..\..\Import;$(SolutionDir)..\..\Import\Skins\DarkSkin;$(IncludePath) + + + true + $(SolutionDir)..\..\Import;$(SolutionDir)..\..\Import\Skins\DarkSkin;$(IncludePath) + + + false + $(SolutionDir)..\..\Import;$(SolutionDir)..\..\Import\Skins\DarkSkin;$(IncludePath) + + + false + $(SolutionDir)..\..\Import;$(SolutionDir)..\..\Import\Skins\DarkSkin;$(IncludePath) + + + + Level3 + Disabled + true + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + + + true + Windows + + + + + Level3 + Disabled + true + _DEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + + + true + Windows + + + + + Level3 + MaxSpeed + true + true + true + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + + + true + true + true + Windows + + + + + Level3 + MaxSpeed + true + true + true + NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + + + true + true + true + Windows + + + + + + + + {8018d622-66ba-4e65-9d03-bdac37ea9a54} + + + + + + \ No newline at end of file diff --git a/SampleForDoc/GacUI/RunResource/RunResource.vcxproj.filters b/SampleForDoc/GacUI/RunResource/RunResource.vcxproj.filters new file mode 100644 index 00000000..e0d083d7 --- /dev/null +++ b/SampleForDoc/GacUI/RunResource/RunResource.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {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;ipp;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 + + + + + Source Files + + + \ No newline at end of file diff --git a/SampleForDoc/GacUI/UIRes/32bits/kb_elements.bin b/SampleForDoc/GacUI/UIRes/32bits/kb_elements.bin new file mode 100644 index 00000000..0e88a76a Binary files /dev/null and b/SampleForDoc/GacUI/UIRes/32bits/kb_elements.bin differ diff --git a/SampleForDoc/GacUI/UIRes/64bits/kb_elements.bin b/SampleForDoc/GacUI/UIRes/64bits/kb_elements.bin new file mode 100644 index 00000000..1ab8bd1b Binary files /dev/null and b/SampleForDoc/GacUI/UIRes/64bits/kb_elements.bin differ diff --git a/SampleForDoc/GacUI/XmlRes/GacUI.xml b/SampleForDoc/GacUI/XmlRes/GacUI.xml new file mode 100644 index 00000000..e52f351d --- /dev/null +++ b/SampleForDoc/GacUI/XmlRes/GacUI.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/SampleForDoc/GacUI/XmlRes/kb_elements/Resource.xml b/SampleForDoc/GacUI/XmlRes/kb_elements/Resource.xml new file mode 100644 index 00000000..10763799 --- /dev/null +++ b/SampleForDoc/GacUI/XmlRes/kb_elements/Resource.xml @@ -0,0 +1,23 @@ + + + + + ..\..\UIRes\32bits\kb_elements.bin + + + ..\..\UIRes\64bits\kb_elements.bin + + + + + + + + + + + + + \ No newline at end of file