mirror of
https://github.com/vczh-libraries/Release.git
synced 2026-05-20 20:13:15 +08:00
Begin demo GacUI_Controls/AddressBook
This commit is contained in:
@@ -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>{7F92FCD2-8A1E-4C73-9949-91555BEF3832}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>AddressBook</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>
|
||||
<ProjectReference Include="..\..\Lib\GacUI\GacUI.vcxproj">
|
||||
<Project>{8018d622-66ba-4e65-9d03-bdac37ea9a54}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Main.cpp" />
|
||||
<ClCompile Include="UI\Source\DemoPartialClasses.cpp" />
|
||||
</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>
|
||||
@@ -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>{4b44e603-d973-4480-9296-4ff2d97dad8d}</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>
|
||||
@@ -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/AddressBook.bin", FileStream::ReadOnly);
|
||||
auto resource = GuiResource::LoadPrecompiledBinary(fileStream, errors);
|
||||
GetResourceManager()->SetResource(L"Resource", resource);
|
||||
}
|
||||
demo::MainWindow window;
|
||||
window.MoveToScreenCenter();
|
||||
GetApplication()->Run(&window);
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
..\..\..\..\Tools\GacGen.exe Resource.xml
|
||||
@@ -0,0 +1,25 @@
|
||||
<?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">AddressBook.bin</Text>
|
||||
</Folder>
|
||||
</Folder>
|
||||
|
||||
<Folder name="MainWindow">
|
||||
<Instance name="MainWindowResource">
|
||||
<Instance ref.CodeBehind="false" ref.Class="demo::MainWindow">
|
||||
<Window Text="AddressBook" ClientSize="x:480 y:320">
|
||||
<att.BoundsComposition-set PreferredMinSize="x:480 y:320"/>
|
||||
</Window>
|
||||
</Instance>
|
||||
</Instance>
|
||||
</Folder>
|
||||
</Resource>
|
||||
@@ -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
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<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:
|
||||
|
||||
void InitializeComponents()
|
||||
{
|
||||
if (InitializeFromResource())
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
}
|
||||
public:
|
||||
MainWindow_()
|
||||
:vl::presentation::GuiInstancePartialClass<vl::presentation::controls::GuiWindow>(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_<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 OnCreate();
|
||||
void OnDestroy();
|
||||
// #endregion CLASS_MEMBER_GUIEVENT_HANDLER
|
||||
public:
|
||||
MainWindow();
|
||||
~MainWindow();
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
@@ -45,7 +45,7 @@
|
||||
<Instance name="MainWindowResource">
|
||||
<Instance ref.CodeBehind="false" ref.Class="demo::MainWindow">
|
||||
<ref.Parameter Name="ViewModel" Class="demo::IViewModel"/>
|
||||
<Window Text="ContainersAndButtons" ClientSize="x:480 y:320">
|
||||
<Window Text="ColorPicker" ClientSize="x:480 y:320">
|
||||
<att.BoundsComposition-set PreferredMinSize="x:480 y:320"/>
|
||||
<Table CellPadding="10" AlignmentToParent="left:0 top:0 right:0 bottom:0">
|
||||
<att.Rows>
|
||||
@@ -62,7 +62,7 @@
|
||||
<Label Text="ComboBox and BindableTextList using ItemTemplate:"/>
|
||||
</Cell>
|
||||
<Cell Site="row:1 column:0">
|
||||
<ComboBox SelectedIndex="0">
|
||||
<ComboBox SelectedIndex-eval="0">
|
||||
<att.ItemTemplate>demo::ColorBomboItemTemplate</att.ItemTemplate>
|
||||
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0"/>
|
||||
<att.ListControl>
|
||||
|
||||
@@ -15,6 +15,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TextEditor", "TextEditor\Te
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ColorPicker", "ColorPicker\ColorPicker.vcxproj", "{FBBBA8BF-96A4-4096-8204-A92571100F0E}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AddressBook", "AddressBook\AddressBook.vcxproj", "{7F92FCD2-8A1E-4C73-9949-91555BEF3832}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
@@ -41,6 +43,10 @@ Global
|
||||
{FBBBA8BF-96A4-4096-8204-A92571100F0E}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{FBBBA8BF-96A4-4096-8204-A92571100F0E}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{FBBBA8BF-96A4-4096-8204-A92571100F0E}.Release|Win32.Build.0 = Release|Win32
|
||||
{7F92FCD2-8A1E-4C73-9949-91555BEF3832}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{7F92FCD2-8A1E-4C73-9949-91555BEF3832}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{7F92FCD2-8A1E-4C73-9949-91555BEF3832}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{7F92FCD2-8A1E-4C73-9949-91555BEF3832}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user