mirror of
https://github.com/vczh-libraries/Release.git
synced 2026-02-06 20:11:41 +08:00
Update tutorials
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#include <GacUIReflection.h>
|
||||
#include <GacUIWindows.h>
|
||||
#include <GacUI.Windows.h>
|
||||
#include "resource.h"
|
||||
|
||||
using namespace vl;
|
||||
|
||||
@@ -149,7 +149,7 @@ protected:
|
||||
public:
|
||||
RootCategory()
|
||||
{
|
||||
folders.Add(new StaticCategory);
|
||||
folders.Add(Ptr(new StaticCategory));
|
||||
}
|
||||
|
||||
ICategory* GetParent()override
|
||||
@@ -188,7 +188,7 @@ protected:
|
||||
public:
|
||||
ViewModel()
|
||||
{
|
||||
rootCategory = new RootCategory;
|
||||
rootCategory = Ptr(new RootCategory);
|
||||
}
|
||||
|
||||
vl::Ptr<ICategory> GetRootCategory()override
|
||||
@@ -228,7 +228,7 @@ public:
|
||||
{
|
||||
if (auto current = dynamic_cast<Category*>(selectedCategory.Obj()))
|
||||
{
|
||||
auto category = new Category(current);
|
||||
auto category = Ptr(new Category(current));
|
||||
category->name = name;
|
||||
current->folders.Add(category);
|
||||
}
|
||||
@@ -247,7 +247,7 @@ public:
|
||||
{
|
||||
if (auto category = dynamic_cast<Category*>(selectedCategory.Obj()))
|
||||
{
|
||||
auto contact = new Contact(category);
|
||||
auto contact = Ptr(new Contact(category));
|
||||
contact->Update(L"Mr. New Contact", DateTime::LocalTime(), L"(123)-456-7890", L"110 st, New York, NY 10118");
|
||||
return contact;
|
||||
}
|
||||
@@ -280,7 +280,7 @@ void GuiMain()
|
||||
contactBigImage = resource->GetImageByPath(L"Images/ContactBig");
|
||||
contactSmallImage = resource->GetImageByPath(L"Images/ContactSmall");
|
||||
}
|
||||
MainWindow window(new ViewModel);
|
||||
MainWindow window(Ptr(new ViewModel));
|
||||
window.MoveToScreenCenter();
|
||||
GetApplication()->Run(&window);
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ void GuiMain()
|
||||
FileStream fileStream(L"../UIRes/CalculatorAndStateMachine.bin", FileStream::ReadOnly);
|
||||
GetResourceManager()->LoadResourceOrPending(fileStream);
|
||||
}
|
||||
demo::MainWindow window(new demo::Calculator);
|
||||
demo::MainWindow window(Ptr(new demo::Calculator));
|
||||
window.MoveToScreenCenter();
|
||||
GetApplication()->Run(&window);
|
||||
}
|
||||
@@ -36,22 +36,22 @@ protected:
|
||||
public:
|
||||
ViewModel()
|
||||
{
|
||||
items.Add(new ColorItem(L"Black", L"#000000"));
|
||||
items.Add(new ColorItem(L"Maroon", L"#800000"));
|
||||
items.Add(new ColorItem(L"Green", L"#008000"));
|
||||
items.Add(new ColorItem(L"Olive", L"#808000"));
|
||||
items.Add(new ColorItem(L"Navy", L"#000080"));
|
||||
items.Add(new ColorItem(L"Purble", L"#800080"));
|
||||
items.Add(new ColorItem(L"Teal", L"#008080"));
|
||||
items.Add(new ColorItem(L"Silver", L"#C0C0C0"));
|
||||
items.Add(new ColorItem(L"Gray", L"#808080"));
|
||||
items.Add(new ColorItem(L"Red", L"#FF0000"));
|
||||
items.Add(new ColorItem(L"Lime", L"#00FF00"));
|
||||
items.Add(new ColorItem(L"Yellow", L"#FFFF00"));
|
||||
items.Add(new ColorItem(L"Blue", L"#0000FF"));
|
||||
items.Add(new ColorItem(L"Fuchsia", L"#FF00FF"));
|
||||
items.Add(new ColorItem(L"Aqua", L"#00FFFF"));
|
||||
items.Add(new ColorItem(L"White", L"#FFFFFF"));
|
||||
items.Add(Ptr(new ColorItem(L"Black", L"#000000")));
|
||||
items.Add(Ptr(new ColorItem(L"Maroon", L"#800000")));
|
||||
items.Add(Ptr(new ColorItem(L"Green", L"#008000")));
|
||||
items.Add(Ptr(new ColorItem(L"Olive", L"#808000")));
|
||||
items.Add(Ptr(new ColorItem(L"Navy", L"#000080")));
|
||||
items.Add(Ptr(new ColorItem(L"Purble", L"#800080")));
|
||||
items.Add(Ptr(new ColorItem(L"Teal", L"#008080")));
|
||||
items.Add(Ptr(new ColorItem(L"Silver", L"#C0C0C0")));
|
||||
items.Add(Ptr(new ColorItem(L"Gray", L"#808080")));
|
||||
items.Add(Ptr(new ColorItem(L"Red", L"#FF0000")));
|
||||
items.Add(Ptr(new ColorItem(L"Lime", L"#00FF00")));
|
||||
items.Add(Ptr(new ColorItem(L"Yellow", L"#FFFF00")));
|
||||
items.Add(Ptr(new ColorItem(L"Blue", L"#0000FF")));
|
||||
items.Add(Ptr(new ColorItem(L"Fuchsia", L"#FF00FF")));
|
||||
items.Add(Ptr(new ColorItem(L"Aqua", L"#00FFFF")));
|
||||
items.Add(Ptr(new ColorItem(L"White", L"#FFFFFF")));
|
||||
}
|
||||
|
||||
LazyList<Ptr<demo::IColorItem>> GetColorItems()override
|
||||
@@ -66,7 +66,7 @@ void GuiMain()
|
||||
FileStream fileStream(L"../UIRes/ColorPicker.bin", FileStream::ReadOnly);
|
||||
GetResourceManager()->LoadResourceOrPending(fileStream);
|
||||
}
|
||||
demo::MainWindow window(new ViewModel);
|
||||
demo::MainWindow window(Ptr(new ViewModel));
|
||||
window.MoveToScreenCenter();
|
||||
GetApplication()->Run(&window);
|
||||
}
|
||||
@@ -52,7 +52,7 @@ void GuiMain()
|
||||
FileStream fileStream(L"../UIRes/ProgressAndAsync.bin", FileStream::ReadOnly);
|
||||
GetResourceManager()->LoadResourceOrPending(fileStream);
|
||||
}
|
||||
demo::MainWindow window(new ViewModel);
|
||||
demo::MainWindow window(Ptr(new ViewModel));
|
||||
window.MoveToScreenCenter();
|
||||
GetApplication()->Run(&window);
|
||||
}
|
||||
@@ -112,5 +112,5 @@ public:
|
||||
|
||||
void SetColorizer(GuiMultilineTextBox* textBox, bool forXml)
|
||||
{
|
||||
textBox->SetColorizer(forXml ? new XmlColorizer : nullptr);
|
||||
textBox->SetColorizer(forXml ? Ptr(new XmlColorizer) : nullptr);
|
||||
}
|
||||
@@ -298,7 +298,7 @@ namespace demo
|
||||
{/* USER_CONTENT_BEGIN(::demo::MainWindow) */
|
||||
if (!findWindow)
|
||||
{
|
||||
auto window = MakePtr<FindWindow>();
|
||||
auto window = Ptr(new FindWindow);
|
||||
window->textBox = textBox;
|
||||
window->MoveToScreenCenter();
|
||||
window->GetNativeWindow()->SetParent(GetNativeWindow());
|
||||
|
||||
@@ -81,7 +81,7 @@ void GuiMain()
|
||||
FileStream fileStream(L"../UIRes/MVVM.bin", FileStream::ReadOnly);
|
||||
GetResourceManager()->LoadResourceOrPending(fileStream);
|
||||
}
|
||||
auto viewModel = MakePtr<ViewModel>();
|
||||
auto viewModel = Ptr(new ViewModel);
|
||||
auto window = new helloworld::MainWindow(viewModel);
|
||||
window->MoveToScreenCenter();
|
||||
GetApplication()->Run(window);
|
||||
|
||||
@@ -41,7 +41,7 @@ void GuiMain()
|
||||
codes.Add(WorkflowScript);
|
||||
workflow::Parser workflowParser;
|
||||
auto assembly = Compile(workflowParser, codes, errors);
|
||||
globalContext = MakePtr<WfRuntimeGlobalContext>(assembly);
|
||||
globalContext = Ptr(new WfRuntimeGlobalContext(assembly));
|
||||
LoadFunction<void()>(globalContext, L"<initialize>")();
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ void GuiMain()
|
||||
FileStream fileStream(L"../UIRes/RichTextEmbedding.bin", FileStream::ReadOnly);
|
||||
GetResourceManager()->LoadResourceOrPending(fileStream);
|
||||
}
|
||||
demo::MainWindow window(new ViewModel);
|
||||
demo::MainWindow window(Ptr(new ViewModel));
|
||||
window.MoveToScreenCenter();
|
||||
GetApplication()->Run(&window);
|
||||
}
|
||||
@@ -98,7 +98,7 @@ namespace demo
|
||||
|
||||
AnimationControl::AnimationControl()
|
||||
:GuiControl(theme::ThemeName::CustomControl)
|
||||
, members(MakePtr<AnimationControlMembers>())
|
||||
, members(Ptr(new AnimationControlMembers))
|
||||
{
|
||||
element = D2DElement::Create();
|
||||
element->BeforeRenderTargetChanged.AttachMethod(this, &AnimationControl::OnBeforeRenderTargetChanged);
|
||||
@@ -107,7 +107,7 @@ namespace demo
|
||||
{
|
||||
auto bounds = new GuiBoundsComposition();
|
||||
bounds->SetAlignmentToParent(Margin(0, 0, 0, 0));
|
||||
bounds->SetOwnedElement(element);
|
||||
bounds->SetOwnedElement(Ptr(element));
|
||||
GetContainerComposition()->AddChild(bounds);
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ void GuiMain()
|
||||
FileStream fileStream(L"../UIRes/Binding_ViewModel.bin", FileStream::ReadOnly);
|
||||
GetResourceManager()->LoadResourceOrPending(fileStream);
|
||||
}
|
||||
demo::MainWindow window(new ViewModelImpl);
|
||||
demo::MainWindow window(Ptr(new ViewModelImpl));
|
||||
window.MoveToScreenCenter();
|
||||
GetApplication()->Run(&window);
|
||||
}
|
||||
@@ -24,7 +24,7 @@ void GuiMain()
|
||||
FileStream fileStream(L"../UIRes/Event_ViewModel.bin", FileStream::ReadOnly);
|
||||
GetResourceManager()->LoadResourceOrPending(fileStream);
|
||||
}
|
||||
demo::MainWindow window(new ViewModelImpl);
|
||||
demo::MainWindow window(Ptr(new ViewModelImpl));
|
||||
window.MoveToScreenCenter();
|
||||
GetApplication()->Run(&window);
|
||||
}
|
||||
@@ -19,7 +19,7 @@ void GuiMain()
|
||||
FileStream fileStream(L"../UIRes/Member_Parameter.bin", FileStream::ReadOnly);
|
||||
GetResourceManager()->LoadResourceOrPending(fileStream);
|
||||
}
|
||||
demo::MainWindow window(new ViewModelImpl);
|
||||
demo::MainWindow window(Ptr(new ViewModelImpl));
|
||||
window.MoveToScreenCenter();
|
||||
GetApplication()->Run(&window);
|
||||
}
|
||||
@@ -14,7 +14,7 @@ public:
|
||||
|
||||
void Load()override
|
||||
{
|
||||
RegisterTheme(MakePtr<darkskin::Theme>());
|
||||
RegisterTheme(Ptr(new darkskin::Theme));
|
||||
}
|
||||
|
||||
void Unload()override
|
||||
|
||||
@@ -14,7 +14,7 @@ public:
|
||||
|
||||
void Load()override
|
||||
{
|
||||
RegisterTheme(MakePtr<darkskin::Theme>());
|
||||
RegisterTheme(Ptr(new darkskin::Theme));
|
||||
}
|
||||
|
||||
void Unload()override
|
||||
|
||||
Reference in New Issue
Block a user