mirror of
https://github.com/vczh-libraries/Release.git
synced 2026-08-18 17:57:20 +08:00
...
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
#define GAC_HEADER_USE_NAMESPACE
|
||||
#include "UI/Source/Demo.h"
|
||||
#include <Windows.h>
|
||||
|
||||
@@ -44,17 +45,17 @@ public:
|
||||
return name;
|
||||
}
|
||||
|
||||
Ptr<GuiImageData> GetImage()override
|
||||
vl::Ptr<GuiImageData> GetImage()override
|
||||
{
|
||||
return folderImage;
|
||||
}
|
||||
|
||||
Ptr<IValueObservableList> GetFolders()override
|
||||
vl::Ptr<IValueObservableList> GetFolders()override
|
||||
{
|
||||
return folders.GetWrapper();
|
||||
}
|
||||
|
||||
Ptr<IValueObservableList> GetContacts()override
|
||||
vl::Ptr<IValueObservableList> GetContacts()override
|
||||
{
|
||||
return contacts.GetWrapper();
|
||||
}
|
||||
@@ -85,12 +86,12 @@ public:
|
||||
return name;
|
||||
}
|
||||
|
||||
Ptr<GuiImageData> GetBigImage()override
|
||||
vl::Ptr<GuiImageData> GetBigImage()override
|
||||
{
|
||||
return contactBigImage;
|
||||
}
|
||||
|
||||
Ptr<GuiImageData> GetSmallImage()override
|
||||
vl::Ptr<GuiImageData> GetSmallImage()override
|
||||
{
|
||||
return contactSmallImage;
|
||||
}
|
||||
@@ -167,17 +168,17 @@ public:
|
||||
return L"";
|
||||
}
|
||||
|
||||
Ptr<GuiImageData> GetImage()override
|
||||
vl::Ptr<GuiImageData> GetImage()override
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Ptr<IValueObservableList> GetFolders()override
|
||||
vl::Ptr<IValueObservableList> GetFolders()override
|
||||
{
|
||||
return folders.GetWrapper();
|
||||
}
|
||||
|
||||
Ptr<IValueObservableList> GetContacts()override
|
||||
vl::Ptr<IValueObservableList> GetContacts()override
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
@@ -186,9 +187,9 @@ public:
|
||||
class ViewModel : public Object, public IViewModel
|
||||
{
|
||||
protected:
|
||||
Ptr<RootCategory> rootCategory;
|
||||
Ptr<ICategory> selectedCategory;
|
||||
Ptr<IContact> selectedContact;
|
||||
vl::Ptr<RootCategory> rootCategory;
|
||||
vl::Ptr<ICategory> selectedCategory;
|
||||
vl::Ptr<IContact> selectedContact;
|
||||
|
||||
public:
|
||||
ViewModel()
|
||||
@@ -196,12 +197,12 @@ public:
|
||||
rootCategory = new RootCategory;
|
||||
}
|
||||
|
||||
Ptr<ICategory> GetRootCategory()override
|
||||
vl::Ptr<ICategory> GetRootCategory()override
|
||||
{
|
||||
return rootCategory;
|
||||
}
|
||||
|
||||
Ptr<ICategory> GetSelectedCategory()override
|
||||
vl::Ptr<ICategory> GetSelectedCategory()override
|
||||
{
|
||||
return selectedCategory;
|
||||
}
|
||||
@@ -215,7 +216,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
Ptr<IContact> GetSelectedContact()override
|
||||
vl::Ptr<IContact> GetSelectedContact()override
|
||||
{
|
||||
return selectedContact;
|
||||
}
|
||||
@@ -248,7 +249,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
Ptr<IContact> CreateContact()override
|
||||
vl::Ptr<IContact> CreateContact()override
|
||||
{
|
||||
if (auto category = dynamic_cast<Category*>(selectedCategory.Obj()))
|
||||
{
|
||||
@@ -259,7 +260,7 @@ public:
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void AddContact(vl::Ptr<demo::IContact> contact)override
|
||||
void AddContact(Ptr<demo::IContact> contact)override
|
||||
{
|
||||
dynamic_cast<Contact*>(contact.Obj())->GetCategory()->contacts.Add(contact);
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace demo
|
||||
|
||||
// #endregion CLASS_MEMBER_GUIEVENT_HANDLER
|
||||
|
||||
NewContactWindow::NewContactWindow(Ptr<demo::IContact> Contact)
|
||||
NewContactWindow::NewContactWindow(vl::Ptr<demo::IContact> Contact)
|
||||
{
|
||||
InitializeComponents(Contact);
|
||||
OnCreate();
|
||||
@@ -133,7 +133,7 @@ namespace vl
|
||||
|
||||
BEGIN_CLASS_MEMBER(demo::MainWindow)
|
||||
CLASS_MEMBER_BASE(::vl::presentation::controls::GuiWindow)
|
||||
CLASS_MEMBER_CONSTRUCTOR(demo::MainWindow*(Ptr<demo::IViewModel>), { L"ViewModel" })
|
||||
CLASS_MEMBER_CONSTRUCTOR(demo::MainWindow*(vl::Ptr<demo::IViewModel>), { L"ViewModel" })
|
||||
|
||||
CLASS_MEMBER_GUIEVENT_HANDLER(commandBigIcon_Executed, ::vl::presentation::compositions::GuiEventArgs)
|
||||
CLASS_MEMBER_GUIEVENT_HANDLER(commandDetail_Executed, ::vl::presentation::compositions::GuiEventArgs)
|
||||
@@ -147,7 +147,7 @@ namespace vl
|
||||
|
||||
BEGIN_CLASS_MEMBER(demo::NewContactWindow)
|
||||
CLASS_MEMBER_BASE(::vl::presentation::controls::GuiWindow)
|
||||
CLASS_MEMBER_CONSTRUCTOR(demo::NewContactWindow*(Ptr<demo::IContact>), { L"Contact" })
|
||||
CLASS_MEMBER_CONSTRUCTOR(demo::NewContactWindow*(vl::Ptr<demo::IContact>), { L"Contact" })
|
||||
|
||||
CLASS_MEMBER_PROPERTY_READONLY_FAST(Contact)
|
||||
CLASS_MEMBER_EVENT(ForEditChanged)
|
||||
|
||||
@@ -67,7 +67,7 @@ namespace demo
|
||||
{
|
||||
friend struct vl::reflection::description::CustomTypeDescriptorSelector<TImpl>;
|
||||
private:
|
||||
Ptr<demo::IViewModel> ViewModel_;
|
||||
vl::Ptr<demo::IViewModel> ViewModel_;
|
||||
protected:
|
||||
::vl::presentation::controls::GuiToolstripCommand* commandBigIcon;
|
||||
::vl::presentation::controls::GuiToolstripCommand* commandDeleteContact;
|
||||
@@ -84,7 +84,7 @@ namespace demo
|
||||
::vl::presentation::controls::GuiWindow* self;
|
||||
::vl::presentation::controls::GuiBindableTreeView* treeViewFolders;
|
||||
|
||||
void InitializeComponents(Ptr<demo::IViewModel> ViewModel)
|
||||
void InitializeComponents(vl::Ptr<demo::IViewModel> ViewModel)
|
||||
{
|
||||
ViewModel_ = ViewModel;
|
||||
if (InitializeFromResource())
|
||||
@@ -130,7 +130,7 @@ namespace demo
|
||||
{
|
||||
}
|
||||
|
||||
Ptr<demo::IViewModel> GetViewModel()
|
||||
vl::Ptr<demo::IViewModel> GetViewModel()
|
||||
{
|
||||
return ViewModel_;
|
||||
}
|
||||
@@ -141,7 +141,7 @@ namespace demo
|
||||
{
|
||||
friend struct vl::reflection::description::CustomTypeDescriptorSelector<TImpl>;
|
||||
private:
|
||||
Ptr<demo::IContact> Contact_;
|
||||
vl::Ptr<demo::IContact> Contact_;
|
||||
bool ForEdit_;
|
||||
bool Ready_;
|
||||
protected:
|
||||
@@ -151,7 +151,7 @@ namespace demo
|
||||
::vl::presentation::controls::GuiDocumentLabel* textBoxName;
|
||||
::vl::presentation::controls::GuiDocumentLabel* textBoxPhone;
|
||||
|
||||
void InitializeComponents(Ptr<demo::IContact> Contact)
|
||||
void InitializeComponents(vl::Ptr<demo::IContact> Contact)
|
||||
{
|
||||
Contact_ = Contact;
|
||||
if (InitializeFromResource())
|
||||
@@ -177,23 +177,23 @@ namespace demo
|
||||
,textBoxName(0)
|
||||
,textBoxPhone(0)
|
||||
{
|
||||
this->ForEdit = vl::reflection::description::UnboxValue<bool>(
|
||||
this->ForEdit_ = vl::reflection::description::UnboxValue<bool>(
|
||||
[]()
|
||||
{
|
||||
vl::reflection::description::Value value;
|
||||
reflection::description::GetTypeDescriptor<bool>()->GetSerializableType()->Deserialize(L"false", value);
|
||||
vl::reflection::description::GetTypeDescriptor<bool>()->GetSerializableType()->Deserialize(L"false", value);
|
||||
return value;
|
||||
}());
|
||||
this->Ready = vl::reflection::description::UnboxValue<bool>(
|
||||
this->Ready_ = vl::reflection::description::UnboxValue<bool>(
|
||||
[]()
|
||||
{
|
||||
vl::reflection::description::Value value;
|
||||
reflection::description::GetTypeDescriptor<bool>()->GetSerializableType()->Deserialize(L"true", value);
|
||||
vl::reflection::description::GetTypeDescriptor<bool>()->GetSerializableType()->Deserialize(L"true", value);
|
||||
return value;
|
||||
}());
|
||||
}
|
||||
|
||||
Ptr<demo::IContact> GetContact()
|
||||
vl::Ptr<demo::IContact> GetContact()
|
||||
{
|
||||
return Contact_;
|
||||
}
|
||||
@@ -254,18 +254,18 @@ namespace demo
|
||||
,self(0)
|
||||
,textBoxName(0)
|
||||
{
|
||||
this->FolderName = vl::reflection::description::UnboxValue<::vl::WString>(
|
||||
this->FolderName_ = vl::reflection::description::UnboxValue<::vl::WString>(
|
||||
[]()
|
||||
{
|
||||
vl::reflection::description::Value value;
|
||||
reflection::description::GetTypeDescriptor<::vl::WString>()->GetSerializableType()->Deserialize(L"", value);
|
||||
vl::reflection::description::GetTypeDescriptor<::vl::WString>()->GetSerializableType()->Deserialize(L"", value);
|
||||
return value;
|
||||
}());
|
||||
this->Ready = vl::reflection::description::UnboxValue<bool>(
|
||||
this->Ready_ = vl::reflection::description::UnboxValue<bool>(
|
||||
[]()
|
||||
{
|
||||
vl::reflection::description::Value value;
|
||||
reflection::description::GetTypeDescriptor<bool>()->GetSerializableType()->Deserialize(L"true", value);
|
||||
vl::reflection::description::GetTypeDescriptor<bool>()->GetSerializableType()->Deserialize(L"true", value);
|
||||
return value;
|
||||
}());
|
||||
}
|
||||
@@ -327,7 +327,7 @@ namespace demo
|
||||
void OnDestroy();
|
||||
// #endregion CLASS_MEMBER_GUIEVENT_HANDLER
|
||||
public:
|
||||
NewContactWindow(Ptr<demo::IContact> Contact);
|
||||
NewContactWindow(vl::Ptr<demo::IContact> Contact);
|
||||
~NewContactWindow();
|
||||
};
|
||||
}
|
||||
|
||||
@@ -6,34 +6,53 @@ GacUI::MainWindow
|
||||
This file is generated by: Vczh GacUI Resource Code Generator
|
||||
***********************************************************************/
|
||||
|
||||
#define GAC_HEADER_USE_NAMESPACE
|
||||
#include "Demo.h"
|
||||
|
||||
namespace demo
|
||||
{
|
||||
// #region CLASS_MEMBER_GUIEVENT_HANDLER (DO NOT PUT OTHER CONTENT IN THIS #region.)
|
||||
|
||||
void MainWindow::commandBigIcon_Executed(GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments)
|
||||
void MainWindow::commandBigIcon_Executed(::vl::presentation::compositions::GuiGraphicsComposition* sender, vl::presentation::compositions::GuiEventArgs& arguments)
|
||||
{
|
||||
ClearViewSelection();
|
||||
commandBigIcon->SetSelected(true);
|
||||
listViewContacts->ChangeItemStyle(new list::ListViewBigIconContentProvider);
|
||||
}
|
||||
|
||||
void MainWindow::commandDetail_Executed(GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments)
|
||||
void MainWindow::commandDetail_Executed(::vl::presentation::compositions::GuiGraphicsComposition* sender, vl::presentation::compositions::GuiEventArgs& arguments)
|
||||
{
|
||||
ClearViewSelection();
|
||||
commandDetail->SetSelected(true);
|
||||
listViewContacts->ChangeItemStyle(new list::ListViewDetailContentProvider);
|
||||
}
|
||||
|
||||
void MainWindow::commandInformation_Executed(GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments)
|
||||
void MainWindow::commandInformation_Executed(::vl::presentation::compositions::GuiGraphicsComposition* sender, vl::presentation::compositions::GuiEventArgs& arguments)
|
||||
{
|
||||
ClearViewSelection();
|
||||
commandInformation->SetSelected(true);
|
||||
listViewContacts->ChangeItemStyle(new list::ListViewInformationContentProvider);
|
||||
}
|
||||
|
||||
void MainWindow::commandList_Executed(GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments)
|
||||
void MainWindow::commandList_Executed(::vl::presentation::compositions::GuiGraphicsComposition* sender, vl::presentation::compositions::GuiEventArgs& arguments)
|
||||
{
|
||||
ClearViewSelection();
|
||||
commandList->SetSelected(true);
|
||||
listViewContacts->ChangeItemStyle(new list::ListViewListContentProvider);
|
||||
}
|
||||
|
||||
void MainWindow::commandSmallIcon_Executed(GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments)
|
||||
void MainWindow::commandSmallIcon_Executed(::vl::presentation::compositions::GuiGraphicsComposition* sender, vl::presentation::compositions::GuiEventArgs& arguments)
|
||||
{
|
||||
ClearViewSelection();
|
||||
commandSmallIcon->SetSelected(true);
|
||||
listViewContacts->ChangeItemStyle(new list::ListViewSmallIconContentProvider);
|
||||
}
|
||||
|
||||
void MainWindow::commandTile_Executed(GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments)
|
||||
void MainWindow::commandTile_Executed(::vl::presentation::compositions::GuiGraphicsComposition* sender, vl::presentation::compositions::GuiEventArgs& arguments)
|
||||
{
|
||||
ClearViewSelection();
|
||||
commandTile->SetSelected(true);
|
||||
listViewContacts->ChangeItemStyle(new list::ListViewTileContentProvider);
|
||||
}
|
||||
|
||||
void MainWindow::OnCreate()
|
||||
@@ -44,48 +63,6 @@ namespace demo
|
||||
{
|
||||
}
|
||||
|
||||
void MainWindow::commandBigIcon_Executed(GuiGraphicsComposition* sender, vl::presentation::compositions::GuiEventArgs& arguments)
|
||||
{
|
||||
ClearViewSelection();
|
||||
commandBigIcon->SetSelected(true);
|
||||
listViewContacts->ChangeItemStyle(new list::ListViewBigIconContentProvider);
|
||||
}
|
||||
|
||||
void MainWindow::commandDetail_Executed(GuiGraphicsComposition* sender, vl::presentation::compositions::GuiEventArgs& arguments)
|
||||
{
|
||||
ClearViewSelection();
|
||||
commandDetail->SetSelected(true);
|
||||
listViewContacts->ChangeItemStyle(new list::ListViewDetailContentProvider);
|
||||
}
|
||||
|
||||
void MainWindow::commandInformation_Executed(GuiGraphicsComposition* sender, vl::presentation::compositions::GuiEventArgs& arguments)
|
||||
{
|
||||
ClearViewSelection();
|
||||
commandInformation->SetSelected(true);
|
||||
listViewContacts->ChangeItemStyle(new list::ListViewInformationContentProvider);
|
||||
}
|
||||
|
||||
void MainWindow::commandList_Executed(GuiGraphicsComposition* sender, vl::presentation::compositions::GuiEventArgs& arguments)
|
||||
{
|
||||
ClearViewSelection();
|
||||
commandList->SetSelected(true);
|
||||
listViewContacts->ChangeItemStyle(new list::ListViewListContentProvider);
|
||||
}
|
||||
|
||||
void MainWindow::commandSmallIcon_Executed(GuiGraphicsComposition* sender, vl::presentation::compositions::GuiEventArgs& arguments)
|
||||
{
|
||||
ClearViewSelection();
|
||||
commandSmallIcon->SetSelected(true);
|
||||
listViewContacts->ChangeItemStyle(new list::ListViewSmallIconContentProvider);
|
||||
}
|
||||
|
||||
void MainWindow::commandTile_Executed(GuiGraphicsComposition* sender, vl::presentation::compositions::GuiEventArgs& arguments)
|
||||
{
|
||||
ClearViewSelection();
|
||||
commandTile->SetSelected(true);
|
||||
listViewContacts->ChangeItemStyle(new list::ListViewTileContentProvider);
|
||||
}
|
||||
|
||||
// #endregion CLASS_MEMBER_GUIEVENT_HANDLER
|
||||
|
||||
void MainWindow::ClearViewSelection()
|
||||
@@ -98,7 +75,7 @@ namespace demo
|
||||
commandInformation->SetSelected(false);
|
||||
}
|
||||
|
||||
MainWindow::MainWindow(Ptr<demo::IViewModel> ViewModel)
|
||||
MainWindow::MainWindow(vl::Ptr<demo::IViewModel> ViewModel)
|
||||
{
|
||||
InitializeComponents(ViewModel);
|
||||
OnCreate();
|
||||
|
||||
@@ -20,19 +20,19 @@ namespace demo
|
||||
protected:
|
||||
|
||||
// #region CLASS_MEMBER_GUIEVENT_HANDLER (DO NOT PUT OTHER CONTENT IN THIS #region.)
|
||||
void commandBigIcon_Executed(GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments);
|
||||
void commandDetail_Executed(GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments);
|
||||
void commandInformation_Executed(GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments);
|
||||
void commandList_Executed(GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments);
|
||||
void commandSmallIcon_Executed(GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments);
|
||||
void commandTile_Executed(GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments);
|
||||
void commandBigIcon_Executed(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments);
|
||||
void commandDetail_Executed(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments);
|
||||
void commandInformation_Executed(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments);
|
||||
void commandList_Executed(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments);
|
||||
void commandSmallIcon_Executed(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments);
|
||||
void commandTile_Executed(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments);
|
||||
void OnCreate();
|
||||
void OnDestroy();
|
||||
// #endregion CLASS_MEMBER_GUIEVENT_HANDLER
|
||||
|
||||
void ClearViewSelection();
|
||||
public:
|
||||
MainWindow(Ptr<demo::IViewModel> ViewModel);
|
||||
MainWindow(vl::Ptr<demo::IViewModel> ViewModel);
|
||||
~MainWindow();
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user