Demo: GacUI_Xml\Member_(Field|Property|Parameter)

This commit is contained in:
vczh
2016-04-17 16:23:11 -07:00
parent 716cfea324
commit 94feef2060
32 changed files with 1395 additions and 4 deletions

View File

@@ -73,4 +73,13 @@ popd
pushd Event_ViewModel\UI
call Codegen.bat
popd
pushd Member_Field\UI
call Codegen.bat
popd
pushd Member_Property\UI
call Codegen.bat
popd
pushd Member_Parameter\UI
call Codegen.bat
popd
popd

View File

@@ -31,6 +31,12 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Event_Script", "Event_Scrip
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Event_ViewModel", "Event_ViewModel\Event_ViewModel.vcxproj", "{D87E9BEF-D61E-4254-AED7-A1D6665D587E}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Member_Parameter", "Member_Parameter\Member_Parameter.vcxproj", "{E9D1731A-375D-469E-944E-41461105E1B1}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Member_Field", "Member_Field\Member_Field.vcxproj", "{7B65FCB1-747C-4E74-AC72-2837D679A1FB}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Member_Property", "Member_Property\Member_Property.vcxproj", "{A0349180-FAAC-4A71-83F3-CD4D939FD981}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@@ -89,6 +95,18 @@ Global
{D87E9BEF-D61E-4254-AED7-A1D6665D587E}.Debug|Win32.Build.0 = Debug|Win32
{D87E9BEF-D61E-4254-AED7-A1D6665D587E}.Release|Win32.ActiveCfg = Release|Win32
{D87E9BEF-D61E-4254-AED7-A1D6665D587E}.Release|Win32.Build.0 = Release|Win32
{E9D1731A-375D-469E-944E-41461105E1B1}.Debug|Win32.ActiveCfg = Debug|Win32
{E9D1731A-375D-469E-944E-41461105E1B1}.Debug|Win32.Build.0 = Debug|Win32
{E9D1731A-375D-469E-944E-41461105E1B1}.Release|Win32.ActiveCfg = Release|Win32
{E9D1731A-375D-469E-944E-41461105E1B1}.Release|Win32.Build.0 = Release|Win32
{7B65FCB1-747C-4E74-AC72-2837D679A1FB}.Debug|Win32.ActiveCfg = Debug|Win32
{7B65FCB1-747C-4E74-AC72-2837D679A1FB}.Debug|Win32.Build.0 = Debug|Win32
{7B65FCB1-747C-4E74-AC72-2837D679A1FB}.Release|Win32.ActiveCfg = Release|Win32
{7B65FCB1-747C-4E74-AC72-2837D679A1FB}.Release|Win32.Build.0 = Release|Win32
{A0349180-FAAC-4A71-83F3-CD4D939FD981}.Debug|Win32.ActiveCfg = Debug|Win32
{A0349180-FAAC-4A71-83F3-CD4D939FD981}.Debug|Win32.Build.0 = Debug|Win32
{A0349180-FAAC-4A71-83F3-CD4D939FD981}.Release|Win32.ActiveCfg = Release|Win32
{A0349180-FAAC-4A71-83F3-CD4D939FD981}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@@ -0,0 +1,23 @@
#include "UI/Source/Demo.h"
#include <Windows.h>
using namespace vl::collections;
using namespace vl::stream;
int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int CmdShow)
{
return SetupWindowsDirect2DRenderer();
}
void GuiMain()
{
{
List<WString> errors;
FileStream fileStream(L"../UIRes/Member_Field.bin", FileStream::ReadOnly);
auto resource = GuiResource::LoadPrecompiledBinary(fileStream, errors);
GetResourceManager()->SetResource(L"Resource", resource);
}
demo::MainWindow window;
window.MoveToScreenCenter();
GetApplication()->Run(&window);
}

View File

@@ -0,0 +1,103 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{7B65FCB1-747C-4E74-AC72-2837D679A1FB}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>Member_Field</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<IncludePath>$(ProjectDir)..\..\..\Import;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<IncludePath>$(ProjectDir)..\..\..\Import;$(IncludePath)</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="Main.cpp" />
<ClCompile Include="UI\Source\DemoPartialClasses.cpp" />
<ClCompile Include="UI\Source\MainWindow.cpp" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Lib\GacUI\GacUI.vcxproj">
<Project>{8018d622-66ba-4e65-9d03-bdac37ea9a54}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Xml Include="UI\Resource.xml" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="UI\Source\Demo.h" />
<ClInclude Include="UI\Source\DemoPartialClasses.h" />
<ClInclude Include="UI\Source\MainWindow.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
<Filter Include="UI">
<UniqueIdentifier>{28212a56-0101-40d3-9ea9-4e39715b77f4}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="Main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="UI\Source\DemoPartialClasses.cpp">
<Filter>UI</Filter>
</ClCompile>
<ClCompile Include="UI\Source\MainWindow.cpp">
<Filter>UI</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<Xml Include="UI\Resource.xml">
<Filter>Resource Files</Filter>
</Xml>
</ItemGroup>
<ItemGroup>
<ClInclude Include="UI\Source\DemoPartialClasses.h">
<Filter>UI</Filter>
</ClInclude>
<ClInclude Include="UI\Source\Demo.h">
<Filter>UI</Filter>
</ClInclude>
<ClInclude Include="UI\Source\MainWindow.h">
<Filter>UI</Filter>
</ClInclude>
</ItemGroup>
</Project>

View File

@@ -0,0 +1 @@
..\..\..\..\Tools\GacGen.exe Resource.xml

View File

@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="utf-8"?>
<Resource>
<Folder name="GacGenConfig">
<Folder name="Cpp">
<Text name="Output">Source</Text>
<Text name="Include">GacUIReflection.h</Text>
<Text name="Name">Demo</Text>
<Text name="Prefix"></Text>
</Folder>
<Folder name="Res">
<Text name="Output">..\..\UIRes</Text>
<Text name="PrecompiledBinary">Member_Field.bin</Text>
</Folder>
</Folder>
<Folder name="MainWindow">
<Instance name="MainWindowResource">
<Instance ref.CodeBehind="true" ref.Class="demo::MainWindow">
<ref.State Name="integerState" Type="int" Value="0"/>
<Window ref.Name="self" Text="Member_Field" ClientSize="x:480 y:320">
<att.BoundsComposition-set PreferredMinSize="x:480 y:320"/>
<Table CellPadding="5" AlignmentToParent="left:0 top:0 right:0 bottom:0" MinSizeLimitation="LimitToElementAndChildren">
<att.Rows>
<CellOption>composeType:MinSize</CellOption>
<CellOption>composeType:MinSize</CellOption>
<CellOption>composeType:Percentage percentage:1.0</CellOption>
</att.Rows>
<att.Columns>
<CellOption>composeType:Absolute absolute:100</CellOption>
<CellOption>composeType:MinSize</CellOption>
<CellOption>composeType:Percentage percentage:1.0</CellOption>
</att.Columns>
<Cell Site="row:0 column:0">
<SinglelineTextBox ref.Name="textBoxA" Text="12345">
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0" PreferredMinSize="y:24"/>
</SinglelineTextBox>
</Cell>
<Cell Site="row:0 column:1">
<Button Text="Copy in Script">
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0"/>
<att.Enabled-bind>(cast int textBoxA.Text) is int ?? false </att.Enabled-bind>
<ev.Clicked-eval>
<![CDATA[
{
self.integerState = cast int textBoxA.Text;
}
]]>
</ev.Clicked-eval>
</Button>
</Cell>
<Cell Site="row:1 column:0">
<SinglelineTextBox ref.Name="textBoxB" Text="">
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0" PreferredMinSize="y:24"/>
</SinglelineTextBox>
</Cell>
<Cell Site="row:1 column:1">
<Button Text="Paste in C++" ev.Clicked="buttonPaste_Clicked">
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0"/>
</Button>
</Cell>
</Table>
</Window>
</Instance>
</Instance>
</Folder>
</Resource>

View File

@@ -0,0 +1,17 @@
/***********************************************************************
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"
#include "MainWindow.h"
#endif

View File

@@ -0,0 +1,66 @@
/***********************************************************************
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 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)
CLASS_MEMBER_GUIEVENT_HANDLER(buttonPaste_Clicked, vl::presentation::compositions::GuiEventArgs)
CLASS_MEMBER_FIELD(integerState)
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)
}
}
}

View File

@@ -0,0 +1,68 @@
/***********************************************************************
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<typename TImpl>
class MainWindow_ : public vl::presentation::controls::GuiWindow, public vl::presentation::GuiInstancePartialClass<vl::presentation::controls::GuiWindow>, public vl::reflection::Description<TImpl>
{
friend struct vl::reflection::description::CustomTypeDescriptorSelector<TImpl>;
private:
protected:
vl::vint32_t integerState;
vl::presentation::controls::GuiWindow* self;
vl::presentation::controls::GuiSinglelineTextBox* textBoxA;
vl::presentation::controls::GuiSinglelineTextBox* textBoxB;
void InitializeComponents()
{
if (InitializeFromResource())
{
GUI_INSTANCE_REFERENCE(self);
GUI_INSTANCE_REFERENCE(textBoxA);
GUI_INSTANCE_REFERENCE(textBoxB);
}
else
{
}
}
public:
MainWindow_()
:vl::presentation::GuiInstancePartialClass<vl::presentation::controls::GuiWindow>(L"demo::MainWindow")
,vl::presentation::controls::GuiWindow(vl::presentation::theme::GetCurrentTheme()->CreateWindowStyle())
,self(0)
,textBoxA(0)
,textBoxB(0)
{
this->integerState = vl::reflection::description::UnboxValue<vl::vint32_t>(vl::reflection::description::Value::From(L"0", reflection::description::GetTypeDescriptor<vl::vint32_t>()));
}
};
}
namespace vl
{
namespace reflection
{
namespace description
{
DECL_TYPE_INFO(demo::MainWindow)
}
}
}
#endif

View File

@@ -0,0 +1,31 @@
/***********************************************************************
Vczh Library++ 3.0
Developer: Zihan Chen(vczh)
GacUI::MainWindow
This file is generated by: Vczh GacUI Resource Code Generator
***********************************************************************/
#include "Demo.h"
namespace demo
{
// #region CLASS_MEMBER_GUIEVENT_HANDLER (DO NOT PUT OTHER CONTENT IN THIS #region.)
void MainWindow::buttonPaste_Clicked(GuiGraphicsComposition* sender, vl::presentation::compositions::GuiEventArgs& arguments)
{
textBoxB->SetText(itow(this->integerState));
}
// #endregion CLASS_MEMBER_GUIEVENT_HANDLER
MainWindow::MainWindow()
{
InitializeComponents();
}
MainWindow::~MainWindow()
{
ClearSubscriptions();
}
}

View File

@@ -0,0 +1,31 @@
/***********************************************************************
Vczh Library++ 3.0
Developer: Zihan Chen(vczh)
GacUI::MainWindow
This file is generated by: Vczh GacUI Resource Code Generator
***********************************************************************/
#ifndef VCZH_GACUI_RESOURCE_CODE_GENERATOR_Demo_MainWindow
#define VCZH_GACUI_RESOURCE_CODE_GENERATOR_Demo_MainWindow
#include "DemoPartialClasses.h"
namespace demo
{
class MainWindow : public demo::MainWindow_<demo::MainWindow>
{
friend class demo::MainWindow_<demo::MainWindow>;
friend struct vl::reflection::description::CustomTypeDescriptorSelector<demo::MainWindow>;
protected:
// #region CLASS_MEMBER_GUIEVENT_HANDLER (DO NOT PUT OTHER CONTENT IN THIS #region.)
void buttonPaste_Clicked(GuiGraphicsComposition* sender, vl::presentation::compositions::GuiEventArgs& arguments);
// #endregion CLASS_MEMBER_GUIEVENT_HANDLER
public:
MainWindow();
~MainWindow();
};
}
#endif

View File

@@ -0,0 +1,32 @@
#include "UI/Source/Demo.h"
#include <Windows.h>
using namespace vl::collections;
using namespace vl::stream;
int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int CmdShow)
{
return SetupWindowsDirect2DRenderer();
}
class ViewModelImpl : public Object, public virtual demo::IViewModel
{
public:
WString GetText()override
{
return L"This is a Window! (ViewModel)";
}
};
void GuiMain()
{
{
List<WString> errors;
FileStream fileStream(L"../UIRes/Member_Parameter.bin", FileStream::ReadOnly);
auto resource = GuiResource::LoadPrecompiledBinary(fileStream, errors);
GetResourceManager()->SetResource(L"Resource", resource);
}
demo::MainWindow window(new ViewModelImpl);
window.MoveToScreenCenter();
GetApplication()->Run(&window);
}

View File

@@ -0,0 +1,101 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{E9D1731A-375D-469E-944E-41461105E1B1}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>Member_Parameter</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<IncludePath>$(ProjectDir)..\..\..\Import;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<IncludePath>$(ProjectDir)..\..\..\Import;$(IncludePath)</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="Main.cpp" />
<ClCompile Include="UI\Source\DemoPartialClasses.cpp" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Lib\GacUI\GacUI.vcxproj">
<Project>{8018d622-66ba-4e65-9d03-bdac37ea9a54}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Xml Include="UI\Resource.xml" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="UI\Source\Demo.h" />
<ClInclude Include="UI\Source\DemoPartialClasses.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
<Filter Include="UI">
<UniqueIdentifier>{1b8aa771-9b6b-4a1c-9994-b6c56abd6067}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="Main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="UI\Source\DemoPartialClasses.cpp">
<Filter>UI</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<Xml Include="UI\Resource.xml">
<Filter>Resource Files</Filter>
</Xml>
</ItemGroup>
<ItemGroup>
<ClInclude Include="UI\Source\DemoPartialClasses.h">
<Filter>UI</Filter>
</ClInclude>
<ClInclude Include="UI\Source\Demo.h">
<Filter>UI</Filter>
</ClInclude>
</ItemGroup>
</Project>

View File

@@ -0,0 +1 @@
..\..\..\..\Tools\GacGen.exe Resource.xml

View File

@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<Resource>
<Folder name="GacGenConfig">
<Folder name="Cpp">
<Text name="Output">Source</Text>
<Text name="Include">GacUIReflection.h</Text>
<Text name="Name">Demo</Text>
<Text name="Prefix"></Text>
</Folder>
<Folder name="Res">
<Text name="Output">..\..\UIRes</Text>
<Text name="PrecompiledBinary">Member_Parameter.bin</Text>
</Folder>
</Folder>
<Folder name="MainWindow">
<Script>
<Workflow-ViewModel>
module script;
namespace demo
{
interface IViewModel
{
func GetText() : string;
}
}
</Workflow-ViewModel>
</Script>
<Instance name="MainWindowResource">
<Instance ref.CodeBehind="false" ref.Class="demo::MainWindow">
<ref.Parameter Name="ViewModel" Class="demo::IViewModel"/>
<Window Text="Member_Parameter" ClientSize="x:480 y:320">
<att.BoundsComposition-set PreferredMinSize="x:480 y:320"/>
<Label Text-eval="ViewModel.GetText()">
<att.Font>fontFamily:{Segoe UI} size:32 antialias:true</att.Font>
</Label>
</Window>
</Instance>
</Instance>
</Folder>
</Resource>

View File

@@ -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

View File

@@ -0,0 +1,89 @@
/***********************************************************************
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.)
// #endregion CLASS_MEMBER_GUIEVENT_HANDLER
MainWindow::MainWindow(Ptr<demo::IViewModel> ViewModel)
{
InitializeComponents(ViewModel);
}
MainWindow::~MainWindow()
{
ClearSubscriptions();
}
}
namespace vl
{
namespace reflection
{
namespace description
{
#define _ ,
IMPL_CPP_TYPE_INFO(demo::IViewModel)
IMPL_CPP_TYPE_INFO(demo::MainWindow)
BEGIN_CLASS_MEMBER(demo::IViewModel)
CLASS_MEMBER_BASE(vl::reflection::IDescriptable)
CLASS_MEMBER_METHOD(GetText, NO_PARAMETER);
END_CLASS_MEMBER(demo::IViewModel)
BEGIN_CLASS_MEMBER(demo::MainWindow)
CLASS_MEMBER_BASE(vl::presentation::controls::GuiWindow)
CLASS_MEMBER_CONSTRUCTOR(demo::MainWindow*(Ptr<demo::IViewModel>), { L"ViewModel" })
CLASS_MEMBER_PROPERTY_READONLY_FAST(ViewModel)
END_CLASS_MEMBER(demo::MainWindow)
#undef _
class DemoResourceLoader : public Object, public ITypeLoader
{
public:
void Load(ITypeManager* manager)
{
ADD_TYPE_INFO(demo::IViewModel)
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)
}
}
}

View File

@@ -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
***********************************************************************/
#ifndef VCZH_GACUI_RESOURCE_CODE_GENERATOR_Demo_PARTIAL_CLASSES
#define VCZH_GACUI_RESOURCE_CODE_GENERATOR_Demo_PARTIAL_CLASSES
#include "GacUIReflection.h"
namespace demo
{
class IViewModel;
class MainWindow;
class IViewModel : public virtual vl::reflection::IDescriptable, public vl::reflection::Description<IViewModel>
{
public:
virtual vl::WString GetText() = 0;
};
template<typename TImpl>
class MainWindow_ : public vl::presentation::controls::GuiWindow, public vl::presentation::GuiInstancePartialClass<vl::presentation::controls::GuiWindow>, public vl::reflection::Description<TImpl>
{
friend struct vl::reflection::description::CustomTypeDescriptorSelector<TImpl>;
private:
Ptr<demo::IViewModel> ViewModel_;
protected:
void InitializeComponents(Ptr<demo::IViewModel> ViewModel)
{
ViewModel_ = ViewModel;
if (InitializeFromResource())
{
}
else
{
ViewModel_ = 0;
}
}
public:
MainWindow_()
:vl::presentation::GuiInstancePartialClass<vl::presentation::controls::GuiWindow>(L"demo::MainWindow")
,vl::presentation::controls::GuiWindow(vl::presentation::theme::GetCurrentTheme()->CreateWindowStyle())
{
}
Ptr<demo::IViewModel> GetViewModel()
{
return ViewModel_;
}
};
}
namespace vl
{
namespace reflection
{
namespace description
{
DECL_TYPE_INFO(demo::IViewModel)
DECL_TYPE_INFO(demo::MainWindow)
}
}
}
namespace demo
{
class MainWindow : public demo::MainWindow_<demo::MainWindow>
{
friend class demo::MainWindow_<demo::MainWindow>;
friend struct vl::reflection::description::CustomTypeDescriptorSelector<demo::MainWindow>;
protected:
// #region CLASS_MEMBER_GUIEVENT_HANDLER (DO NOT PUT OTHER CONTENT IN THIS #region.)
// #endregion CLASS_MEMBER_GUIEVENT_HANDLER
public:
MainWindow(Ptr<demo::IViewModel> ViewModel);
~MainWindow();
};
}
#endif

View File

@@ -0,0 +1,23 @@
#include "UI/Source/Demo.h"
#include <Windows.h>
using namespace vl::collections;
using namespace vl::stream;
int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int CmdShow)
{
return SetupWindowsDirect2DRenderer();
}
void GuiMain()
{
{
List<WString> errors;
FileStream fileStream(L"../UIRes/Member_Property.bin", FileStream::ReadOnly);
auto resource = GuiResource::LoadPrecompiledBinary(fileStream, errors);
GetResourceManager()->SetResource(L"Resource", resource);
}
demo::MainWindow window;
window.MoveToScreenCenter();
GetApplication()->Run(&window);
}

View File

@@ -0,0 +1,101 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{A0349180-FAAC-4A71-83F3-CD4D939FD981}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>Member_Property</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<IncludePath>$(ProjectDir)..\..\..\Import;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<IncludePath>$(ProjectDir)..\..\..\Import;$(IncludePath)</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="Main.cpp" />
<ClCompile Include="UI\Source\DemoPartialClasses.cpp" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Lib\GacUI\GacUI.vcxproj">
<Project>{8018d622-66ba-4e65-9d03-bdac37ea9a54}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Xml Include="UI\Resource.xml" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="UI\Source\Demo.h" />
<ClInclude Include="UI\Source\DemoPartialClasses.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
<Filter Include="UI">
<UniqueIdentifier>{0d902fcf-e104-4a3c-ab3c-03b03cc13efe}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="Main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="UI\Source\DemoPartialClasses.cpp">
<Filter>UI</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<Xml Include="UI\Resource.xml">
<Filter>Resource Files</Filter>
</Xml>
</ItemGroup>
<ItemGroup>
<ClInclude Include="UI\Source\DemoPartialClasses.h">
<Filter>UI</Filter>
</ClInclude>
<ClInclude Include="UI\Source\Demo.h">
<Filter>UI</Filter>
</ClInclude>
</ItemGroup>
</Project>

View File

@@ -0,0 +1 @@
..\..\..\..\Tools\GacGen.exe Resource.xml

View File

@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="utf-8"?>
<Resource>
<Folder name="GacGenConfig">
<Folder name="Cpp">
<Text name="Output">Source</Text>
<Text name="Include">GacUIReflection.h</Text>
<Text name="Name">Demo</Text>
<Text name="Prefix"></Text>
</Folder>
<Folder name="Res">
<Text name="Output">..\..\UIRes</Text>
<Text name="PrecompiledBinary">Member_Property.bin</Text>
</Folder>
</Folder>
<Folder name="MainWindow">
<Instance name="MainWindowResource">
<Instance ref.CodeBehind="false" ref.Class="demo::MainWindow" xmlns:x="demo::*">
<Window Text="Member_Property" ClientSize="x:480 y:320">
<att.BoundsComposition-set PreferredMinSize="x:480 y:320"/>
<x:MyControl ref.Name="myControl" Text-format="Selected: $(myControl.SelectedOption)">
<att.BoundsComposition-set Margin="left:10 top:10"/>
</x:MyControl>
</Window>
</Instance>
</Instance>
<Instance name="MyControlResource">
<Instance ref.CodeBehind="false" ref.Class="demo::MyControl" xmlns:x="presentation::controls::GuiSelectableButton::*">
<ref.Property Name="SelectedOption" Type="string" Value="A"/>
<CustomControl ref.Name="self">
<x:MutexGroupController ref.Name="optionGroup"/>
<att.ContainerComposition-set MinSizeLimitation="LimitToElementAndChildren"/>
<GroupBox Text-bind="self.Text">
<att.ContainerComposition-set MinSizeLimitation="LimitToElementAndChildren"/>
<Stack Direction="Vertical" Margin="left:5 top:5 right:5 bottom:5" Padding="10" MinSizeLimitation="LimitToElementAndChildren">
<StackItem>
<RadioButton Text="Option A" GroupController-ref="optionGroup" Selected="true">
<ev.SelectedChanged-eval>
<![CDATA[
{
self.SelectedOption = "A";
}
]]>
</ev.SelectedChanged-eval>
</RadioButton>
</StackItem>
<StackItem>
<RadioButton Text="Option B" GroupController-ref="optionGroup">
<ev.SelectedChanged-eval>
<![CDATA[
{
self.SelectedOption = "B";
}
]]>
</ev.SelectedChanged-eval>
</RadioButton>
</StackItem>
</Stack>
</GroupBox>
</CustomControl>
</Instance>
</Instance>
</Folder>
</Resource>

View File

@@ -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

View File

@@ -0,0 +1,108 @@
/***********************************************************************
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.)
// #endregion CLASS_MEMBER_GUIEVENT_HANDLER
MainWindow::MainWindow()
{
InitializeComponents();
}
MainWindow::~MainWindow()
{
ClearSubscriptions();
}
}
namespace demo
{
// #region CLASS_MEMBER_GUIEVENT_HANDLER (DO NOT PUT OTHER CONTENT IN THIS #region.)
// #endregion CLASS_MEMBER_GUIEVENT_HANDLER
MyControl::MyControl()
{
InitializeComponents();
}
MyControl::~MyControl()
{
ClearSubscriptions();
}
}
namespace vl
{
namespace reflection
{
namespace description
{
#define _ ,
IMPL_CPP_TYPE_INFO(demo::MainWindow)
IMPL_CPP_TYPE_INFO(demo::MyControl)
BEGIN_CLASS_MEMBER(demo::MainWindow)
CLASS_MEMBER_BASE(vl::presentation::controls::GuiWindow)
CLASS_MEMBER_CONSTRUCTOR(demo::MainWindow*(), NO_PARAMETER)
END_CLASS_MEMBER(demo::MainWindow)
BEGIN_CLASS_MEMBER(demo::MyControl)
CLASS_MEMBER_BASE(vl::presentation::controls::GuiCustomControl)
CLASS_MEMBER_CONSTRUCTOR(demo::MyControl*(), NO_PARAMETER)
CLASS_MEMBER_EVENT(SelectedOptionChanged)
CLASS_MEMBER_PROPERTY_EVENT_FAST(SelectedOption, SelectedOptionChanged)
END_CLASS_MEMBER(demo::MyControl)
#undef _
class DemoResourceLoader : public Object, public ITypeLoader
{
public:
void Load(ITypeManager* manager)
{
ADD_TYPE_INFO(demo::MainWindow)
ADD_TYPE_INFO(demo::MyControl)
}
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)
}
}
}

View File

@@ -0,0 +1,140 @@
/***********************************************************************
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;
class MyControl;
template<typename TImpl>
class MainWindow_ : public vl::presentation::controls::GuiWindow, public vl::presentation::GuiInstancePartialClass<vl::presentation::controls::GuiWindow>, public vl::reflection::Description<TImpl>
{
friend struct vl::reflection::description::CustomTypeDescriptorSelector<TImpl>;
private:
protected:
demo::MyControl* myControl;
void InitializeComponents()
{
if (InitializeFromResource())
{
GUI_INSTANCE_REFERENCE(myControl);
}
else
{
}
}
public:
MainWindow_()
:vl::presentation::GuiInstancePartialClass<vl::presentation::controls::GuiWindow>(L"demo::MainWindow")
,vl::presentation::controls::GuiWindow(vl::presentation::theme::GetCurrentTheme()->CreateWindowStyle())
,myControl(0)
{
}
};
template<typename TImpl>
class MyControl_ : public vl::presentation::controls::GuiCustomControl, public vl::presentation::GuiInstancePartialClass<vl::presentation::controls::GuiCustomControl>, public vl::reflection::Description<TImpl>
{
friend struct vl::reflection::description::CustomTypeDescriptorSelector<TImpl>;
private:
vl::WString SelectedOption_;
protected:
vl::presentation::controls::GuiSelectableButton::MutexGroupController* optionGroup;
vl::presentation::controls::GuiCustomControl* self;
void InitializeComponents()
{
if (InitializeFromResource())
{
GUI_INSTANCE_REFERENCE(optionGroup);
GUI_INSTANCE_REFERENCE(self);
}
else
{
}
}
public:
MyControl_()
:vl::presentation::GuiInstancePartialClass<vl::presentation::controls::GuiCustomControl>(L"demo::MyControl")
,vl::presentation::controls::GuiCustomControl(vl::presentation::theme::GetCurrentTheme()->CreateCustomControlStyle())
,optionGroup(0)
,self(0)
{
}
vl::Event<void()> SelectedOptionChanged;
vl::WString GetSelectedOption()
{
return SelectedOption_;
}
void SetSelectedOption(vl::WString value)
{
SelectedOption_ = value;
SelectedOptionChanged();
}
};
}
namespace vl
{
namespace reflection
{
namespace description
{
DECL_TYPE_INFO(demo::MainWindow)
DECL_TYPE_INFO(demo::MyControl)
}
}
}
namespace demo
{
class MainWindow : public demo::MainWindow_<demo::MainWindow>
{
friend class demo::MainWindow_<demo::MainWindow>;
friend struct vl::reflection::description::CustomTypeDescriptorSelector<demo::MainWindow>;
protected:
// #region CLASS_MEMBER_GUIEVENT_HANDLER (DO NOT PUT OTHER CONTENT IN THIS #region.)
// #endregion CLASS_MEMBER_GUIEVENT_HANDLER
public:
MainWindow();
~MainWindow();
};
}
namespace demo
{
class MyControl : public demo::MyControl_<demo::MyControl>
{
friend class demo::MyControl_<demo::MyControl>;
friend struct vl::reflection::description::CustomTypeDescriptorSelector<demo::MyControl>;
protected:
// #region CLASS_MEMBER_GUIEVENT_HANDLER (DO NOT PUT OTHER CONTENT IN THIS #region.)
// #endregion CLASS_MEMBER_GUIEVENT_HANDLER
public:
MyControl();
~MyControl();
};
}
#endif

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -32,6 +32,7 @@ GacUI tutorials and the plan
* **Instance_Window**: Create a window.
* **Instance_MultipleWindows**: Create multiple windows.
* **Instance_Control**: Create a control.
* **Instance_Inheriting**:
* **Binding_Uri**: Using -uri binding.
* **Binding_Eval**: Using -eval binding.
* **Binding_Bind**: Using -bind binding.
@@ -40,10 +41,12 @@ GacUI tutorials and the plan
* **Event_Cpp**:Handling event in C++.
* **Event_Script**:Handling event in Workflow script.
* **Event_ViewModel**:Handling event in view model.
* **Member_ViewModel**:Adding view model to window. (developing)
* **Member_Property**:Adding property to window. (developing)
* **Member_State**:Adding state to window. (developing)
* **InheritableCustomControl**
* **Member_ViewModel**:Adding view model to window.
* **Member_Property**:Adding property to window.
* **Member_State**:Adding state to window.
* **Member_Component**:
* **Style_Path**:
* **Style_Template**:
* **VisualState**:
* **StateMachine**:
* **Animation**: