diff --git a/Tutorial/GacUI_Controls/AddressBook/Main.cpp b/Tutorial/GacUI_Controls/AddressBook/Main.cpp index 58eed535..bb7c68e4 100644 --- a/Tutorial/GacUI_Controls/AddressBook/Main.cpp +++ b/Tutorial/GacUI_Controls/AddressBook/Main.cpp @@ -1,3 +1,4 @@ +#define GAC_HEADER_USE_NAMESPACE #include "UI/Source/Demo.h" #include @@ -44,17 +45,17 @@ public: return name; } - Ptr GetImage()override + vl::Ptr GetImage()override { return folderImage; } - Ptr GetFolders()override + vl::Ptr GetFolders()override { return folders.GetWrapper(); } - Ptr GetContacts()override + vl::Ptr GetContacts()override { return contacts.GetWrapper(); } @@ -85,12 +86,12 @@ public: return name; } - Ptr GetBigImage()override + vl::Ptr GetBigImage()override { return contactBigImage; } - Ptr GetSmallImage()override + vl::Ptr GetSmallImage()override { return contactSmallImage; } @@ -167,17 +168,17 @@ public: return L""; } - Ptr GetImage()override + vl::Ptr GetImage()override { return nullptr; } - Ptr GetFolders()override + vl::Ptr GetFolders()override { return folders.GetWrapper(); } - Ptr GetContacts()override + vl::Ptr GetContacts()override { return nullptr; } @@ -186,9 +187,9 @@ public: class ViewModel : public Object, public IViewModel { protected: - Ptr rootCategory; - Ptr selectedCategory; - Ptr selectedContact; + vl::Ptr rootCategory; + vl::Ptr selectedCategory; + vl::Ptr selectedContact; public: ViewModel() @@ -196,12 +197,12 @@ public: rootCategory = new RootCategory; } - Ptr GetRootCategory()override + vl::Ptr GetRootCategory()override { return rootCategory; } - Ptr GetSelectedCategory()override + vl::Ptr GetSelectedCategory()override { return selectedCategory; } @@ -215,7 +216,7 @@ public: } } - Ptr GetSelectedContact()override + vl::Ptr GetSelectedContact()override { return selectedContact; } @@ -248,7 +249,7 @@ public: } } - Ptr CreateContact()override + vl::Ptr CreateContact()override { if (auto category = dynamic_cast(selectedCategory.Obj())) { @@ -259,7 +260,7 @@ public: return nullptr; } - void AddContact(vl::Ptr contact)override + void AddContact(Ptr contact)override { dynamic_cast(contact.Obj())->GetCategory()->contacts.Add(contact); } diff --git a/Tutorial/GacUI_Controls/AddressBook/UI/Source/DemoPartialClasses.cpp b/Tutorial/GacUI_Controls/AddressBook/UI/Source/DemoPartialClasses.cpp index 3d987f1c..110dbc6e 100644 --- a/Tutorial/GacUI_Controls/AddressBook/UI/Source/DemoPartialClasses.cpp +++ b/Tutorial/GacUI_Controls/AddressBook/UI/Source/DemoPartialClasses.cpp @@ -24,7 +24,7 @@ namespace demo // #endregion CLASS_MEMBER_GUIEVENT_HANDLER - NewContactWindow::NewContactWindow(Ptr Contact) + NewContactWindow::NewContactWindow(vl::Ptr 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), { L"ViewModel" }) + CLASS_MEMBER_CONSTRUCTOR(demo::MainWindow*(vl::Ptr), { 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), { L"Contact" }) + CLASS_MEMBER_CONSTRUCTOR(demo::NewContactWindow*(vl::Ptr), { L"Contact" }) CLASS_MEMBER_PROPERTY_READONLY_FAST(Contact) CLASS_MEMBER_EVENT(ForEditChanged) diff --git a/Tutorial/GacUI_Controls/AddressBook/UI/Source/DemoPartialClasses.h b/Tutorial/GacUI_Controls/AddressBook/UI/Source/DemoPartialClasses.h index bc06b531..3b1e8da1 100644 --- a/Tutorial/GacUI_Controls/AddressBook/UI/Source/DemoPartialClasses.h +++ b/Tutorial/GacUI_Controls/AddressBook/UI/Source/DemoPartialClasses.h @@ -67,7 +67,7 @@ namespace demo { friend struct vl::reflection::description::CustomTypeDescriptorSelector; private: - Ptr ViewModel_; + vl::Ptr 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 ViewModel) + void InitializeComponents(vl::Ptr ViewModel) { ViewModel_ = ViewModel; if (InitializeFromResource()) @@ -130,7 +130,7 @@ namespace demo { } - Ptr GetViewModel() + vl::Ptr GetViewModel() { return ViewModel_; } @@ -141,7 +141,7 @@ namespace demo { friend struct vl::reflection::description::CustomTypeDescriptorSelector; private: - Ptr Contact_; + vl::Ptr 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 Contact) + void InitializeComponents(vl::Ptr Contact) { Contact_ = Contact; if (InitializeFromResource()) @@ -177,23 +177,23 @@ namespace demo ,textBoxName(0) ,textBoxPhone(0) { - this->ForEdit = vl::reflection::description::UnboxValue( + this->ForEdit_ = vl::reflection::description::UnboxValue( []() { vl::reflection::description::Value value; - reflection::description::GetTypeDescriptor()->GetSerializableType()->Deserialize(L"false", value); + vl::reflection::description::GetTypeDescriptor()->GetSerializableType()->Deserialize(L"false", value); return value; }()); - this->Ready = vl::reflection::description::UnboxValue( + this->Ready_ = vl::reflection::description::UnboxValue( []() { vl::reflection::description::Value value; - reflection::description::GetTypeDescriptor()->GetSerializableType()->Deserialize(L"true", value); + vl::reflection::description::GetTypeDescriptor()->GetSerializableType()->Deserialize(L"true", value); return value; }()); } - Ptr GetContact() + vl::Ptr 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( + this->Ready_ = vl::reflection::description::UnboxValue( []() { vl::reflection::description::Value value; - reflection::description::GetTypeDescriptor()->GetSerializableType()->Deserialize(L"true", value); + vl::reflection::description::GetTypeDescriptor()->GetSerializableType()->Deserialize(L"true", value); return value; }()); } @@ -327,7 +327,7 @@ namespace demo void OnDestroy(); // #endregion CLASS_MEMBER_GUIEVENT_HANDLER public: - NewContactWindow(Ptr Contact); + NewContactWindow(vl::Ptr Contact); ~NewContactWindow(); }; } diff --git a/Tutorial/GacUI_Controls/AddressBook/UI/Source/MainWindow.cpp b/Tutorial/GacUI_Controls/AddressBook/UI/Source/MainWindow.cpp index 91469143..ee6a1ae4 100644 --- a/Tutorial/GacUI_Controls/AddressBook/UI/Source/MainWindow.cpp +++ b/Tutorial/GacUI_Controls/AddressBook/UI/Source/MainWindow.cpp @@ -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 ViewModel) + MainWindow::MainWindow(vl::Ptr ViewModel) { InitializeComponents(ViewModel); OnCreate(); diff --git a/Tutorial/GacUI_Controls/AddressBook/UI/Source/MainWindow.h b/Tutorial/GacUI_Controls/AddressBook/UI/Source/MainWindow.h index c54befc4..b4e6a84c 100644 --- a/Tutorial/GacUI_Controls/AddressBook/UI/Source/MainWindow.h +++ b/Tutorial/GacUI_Controls/AddressBook/UI/Source/MainWindow.h @@ -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 ViewModel); + MainWindow(vl::Ptr ViewModel); ~MainWindow(); }; } diff --git a/Tutorial/GacUI_Controls/ColorPicker/Main.cpp b/Tutorial/GacUI_Controls/ColorPicker/Main.cpp index deb48c38..998e8d6d 100644 --- a/Tutorial/GacUI_Controls/ColorPicker/Main.cpp +++ b/Tutorial/GacUI_Controls/ColorPicker/Main.cpp @@ -1,3 +1,4 @@ +#define GAC_HEADER_USE_NAMESPACE #include "UI/Source/Demo.h" #include diff --git a/Tutorial/GacUI_Controls/ColorPicker/UI/Source/DemoPartialClasses.cpp b/Tutorial/GacUI_Controls/ColorPicker/UI/Source/DemoPartialClasses.cpp index b56d924b..78bab742 100644 --- a/Tutorial/GacUI_Controls/ColorPicker/UI/Source/DemoPartialClasses.cpp +++ b/Tutorial/GacUI_Controls/ColorPicker/UI/Source/DemoPartialClasses.cpp @@ -24,7 +24,7 @@ namespace demo // #endregion CLASS_MEMBER_GUIEVENT_HANDLER - ColorBomboItemTemplate::ColorBomboItemTemplate(Ptr ViewModel) + ColorBomboItemTemplate::ColorBomboItemTemplate(vl::Ptr ViewModel) { InitializeComponents(ViewModel); OnCreate(); @@ -52,7 +52,7 @@ namespace demo // #endregion CLASS_MEMBER_GUIEVENT_HANDLER - ColorListItemTemplate::ColorListItemTemplate(Ptr ViewModel) + ColorListItemTemplate::ColorListItemTemplate(vl::Ptr ViewModel) { InitializeComponents(ViewModel); OnCreate(); @@ -80,7 +80,7 @@ namespace demo // #endregion CLASS_MEMBER_GUIEVENT_HANDLER - MainWindow::MainWindow(Ptr ViewModel) + MainWindow::MainWindow(vl::Ptr ViewModel) { InitializeComponents(ViewModel); OnCreate(); @@ -123,7 +123,7 @@ namespace vl BEGIN_CLASS_MEMBER(demo::ColorBomboItemTemplate) CLASS_MEMBER_BASE(::vl::presentation::templates::GuiControlTemplate) - CLASS_MEMBER_CONSTRUCTOR(demo::ColorBomboItemTemplate*(Ptr), { L"ViewModel" }) + CLASS_MEMBER_CONSTRUCTOR(demo::ColorBomboItemTemplate*(vl::Ptr), { L"ViewModel" }) CLASS_MEMBER_PROPERTY_READONLY_FAST(ViewModel) CLASS_MEMBER_EVENT(TextColorChanged) @@ -132,14 +132,14 @@ namespace vl BEGIN_CLASS_MEMBER(demo::ColorListItemTemplate) CLASS_MEMBER_BASE(::vl::presentation::templates::GuiTextListItemTemplate) - CLASS_MEMBER_CONSTRUCTOR(demo::ColorListItemTemplate*(Ptr), { L"ViewModel" }) + CLASS_MEMBER_CONSTRUCTOR(demo::ColorListItemTemplate*(vl::Ptr), { L"ViewModel" }) CLASS_MEMBER_PROPERTY_READONLY_FAST(ViewModel) END_CLASS_MEMBER(demo::ColorListItemTemplate) BEGIN_CLASS_MEMBER(demo::MainWindow) CLASS_MEMBER_BASE(::vl::presentation::controls::GuiWindow) - CLASS_MEMBER_CONSTRUCTOR(demo::MainWindow*(Ptr), { L"ViewModel" }) + CLASS_MEMBER_CONSTRUCTOR(demo::MainWindow*(vl::Ptr), { L"ViewModel" }) CLASS_MEMBER_PROPERTY_READONLY_FAST(ViewModel) END_CLASS_MEMBER(demo::MainWindow) diff --git a/Tutorial/GacUI_Controls/ColorPicker/UI/Source/DemoPartialClasses.h b/Tutorial/GacUI_Controls/ColorPicker/UI/Source/DemoPartialClasses.h index fe6cd34a..a7395d36 100644 --- a/Tutorial/GacUI_Controls/ColorPicker/UI/Source/DemoPartialClasses.h +++ b/Tutorial/GacUI_Controls/ColorPicker/UI/Source/DemoPartialClasses.h @@ -39,12 +39,12 @@ namespace demo { friend struct vl::reflection::description::CustomTypeDescriptorSelector; private: - Ptr ViewModel_; + vl::Ptr ViewModel_; ::vl::presentation::Color TextColor_; protected: ::vl::presentation::templates::GuiControlTemplate* self; - void InitializeComponents(Ptr ViewModel) + void InitializeComponents(vl::Ptr ViewModel) { ViewModel_ = ViewModel; if (InitializeFromResource()) @@ -61,16 +61,16 @@ namespace demo :vl::presentation::GuiInstancePartialClass<::vl::presentation::templates::GuiControlTemplate>(L"demo::ColorBomboItemTemplate") ,self(0) { - this->TextColor = vl::reflection::description::UnboxValue<::vl::presentation::Color>( + this->TextColor_ = vl::reflection::description::UnboxValue<::vl::presentation::Color>( []() { vl::reflection::description::Value value; - reflection::description::GetTypeDescriptor<::vl::presentation::Color>()->GetSerializableType()->Deserialize(L"", value); + vl::reflection::description::GetTypeDescriptor<::vl::presentation::Color>()->GetSerializableType()->Deserialize(L"", value); return value; }()); } - Ptr GetViewModel() + vl::Ptr GetViewModel() { return ViewModel_; } @@ -94,11 +94,11 @@ namespace demo { friend struct vl::reflection::description::CustomTypeDescriptorSelector; private: - Ptr ViewModel_; + vl::Ptr ViewModel_; protected: ::vl::presentation::templates::GuiTextListItemTemplate* self; - void InitializeComponents(Ptr ViewModel) + void InitializeComponents(vl::Ptr ViewModel) { ViewModel_ = ViewModel; if (InitializeFromResource()) @@ -117,7 +117,7 @@ namespace demo { } - Ptr GetViewModel() + vl::Ptr GetViewModel() { return ViewModel_; } @@ -128,10 +128,10 @@ namespace demo { friend struct vl::reflection::description::CustomTypeDescriptorSelector; private: - Ptr ViewModel_; + vl::Ptr ViewModel_; protected: - void InitializeComponents(Ptr ViewModel) + void InitializeComponents(vl::Ptr ViewModel) { ViewModel_ = ViewModel; if (InitializeFromResource()) @@ -149,7 +149,7 @@ namespace demo { } - Ptr GetViewModel() + vl::Ptr GetViewModel() { return ViewModel_; } @@ -184,7 +184,7 @@ namespace demo void OnDestroy(); // #endregion CLASS_MEMBER_GUIEVENT_HANDLER public: - ColorBomboItemTemplate(Ptr ViewModel); + ColorBomboItemTemplate(vl::Ptr ViewModel); ~ColorBomboItemTemplate(); }; } @@ -203,7 +203,7 @@ namespace demo void OnDestroy(); // #endregion CLASS_MEMBER_GUIEVENT_HANDLER public: - ColorListItemTemplate(Ptr ViewModel); + ColorListItemTemplate(vl::Ptr ViewModel); ~ColorListItemTemplate(); }; } @@ -222,7 +222,7 @@ namespace demo void OnDestroy(); // #endregion CLASS_MEMBER_GUIEVENT_HANDLER public: - MainWindow(Ptr ViewModel); + MainWindow(vl::Ptr ViewModel); ~MainWindow(); }; } diff --git a/Tutorial/GacUI_Controls/ContainersAndButtons/Main.cpp b/Tutorial/GacUI_Controls/ContainersAndButtons/Main.cpp index 28827b45..c7a3c011 100644 --- a/Tutorial/GacUI_Controls/ContainersAndButtons/Main.cpp +++ b/Tutorial/GacUI_Controls/ContainersAndButtons/Main.cpp @@ -1,3 +1,4 @@ +#define GAC_HEADER_USE_NAMESPACE #include "UI/Source/Demo.h" #include diff --git a/Tutorial/GacUI_Controls/TextEditor/Main.cpp b/Tutorial/GacUI_Controls/TextEditor/Main.cpp index 268e440e..0f404509 100644 --- a/Tutorial/GacUI_Controls/TextEditor/Main.cpp +++ b/Tutorial/GacUI_Controls/TextEditor/Main.cpp @@ -1,3 +1,4 @@ +#define GAC_HEADER_USE_NAMESPACE #include "UI/Source/Demo.h" #include diff --git a/Tutorial/GacUI_Controls/TextEditor/UI/Source/AboutWindow.cpp b/Tutorial/GacUI_Controls/TextEditor/UI/Source/AboutWindow.cpp index 30552299..25dc09ae 100644 --- a/Tutorial/GacUI_Controls/TextEditor/UI/Source/AboutWindow.cpp +++ b/Tutorial/GacUI_Controls/TextEditor/UI/Source/AboutWindow.cpp @@ -13,8 +13,9 @@ namespace demo { // #region CLASS_MEMBER_GUIEVENT_HANDLER (DO NOT PUT OTHER CONTENT IN THIS #region.) - void AboutWindow::documentLabel_ActiveHyperlinkExecuted(GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments) + void AboutWindow::documentLabel_ActiveHyperlinkExecuted(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments) { + ShellExecute(NULL, L"OPEN", documentLabel->GetActiveHyperlinkReference().Buffer(), NULL, NULL, SW_MAXIMIZE); } void AboutWindow::OnCreate() @@ -25,11 +26,6 @@ namespace demo { } - void AboutWindow::documentLabel_ActiveHyperlinkExecuted(GuiGraphicsComposition* sender, vl::presentation::compositions::GuiEventArgs& arguments) - { - ShellExecute(NULL, L"OPEN", documentLabel->GetActiveHyperlinkReference().Buffer(), NULL, NULL, SW_MAXIMIZE); - } - // #endregion CLASS_MEMBER_GUIEVENT_HANDLER AboutWindow::AboutWindow() diff --git a/Tutorial/GacUI_Controls/TextEditor/UI/Source/AboutWindow.h b/Tutorial/GacUI_Controls/TextEditor/UI/Source/AboutWindow.h index 10536cf2..fb61d0aa 100644 --- a/Tutorial/GacUI_Controls/TextEditor/UI/Source/AboutWindow.h +++ b/Tutorial/GacUI_Controls/TextEditor/UI/Source/AboutWindow.h @@ -20,7 +20,7 @@ namespace demo protected: // #region CLASS_MEMBER_GUIEVENT_HANDLER (DO NOT PUT OTHER CONTENT IN THIS #region.) - void documentLabel_ActiveHyperlinkExecuted(GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments); + void documentLabel_ActiveHyperlinkExecuted(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments); void OnCreate(); void OnDestroy(); // #endregion CLASS_MEMBER_GUIEVENT_HANDLER diff --git a/Tutorial/GacUI_Controls/TextEditor/UI/Source/DemoPartialClasses.cpp b/Tutorial/GacUI_Controls/TextEditor/UI/Source/DemoPartialClasses.cpp index c1b891d3..a1d467fb 100644 --- a/Tutorial/GacUI_Controls/TextEditor/UI/Source/DemoPartialClasses.cpp +++ b/Tutorial/GacUI_Controls/TextEditor/UI/Source/DemoPartialClasses.cpp @@ -24,7 +24,7 @@ namespace demo // #endregion CLASS_MEMBER_GUIEVENT_HANDLER - FindWindow::FindWindow(Ptr ViewModel) + FindWindow::FindWindow(vl::Ptr ViewModel) { InitializeComponents(ViewModel); OnCreate(); @@ -64,7 +64,7 @@ namespace vl BEGIN_CLASS_MEMBER(demo::FindWindow) CLASS_MEMBER_BASE(::vl::presentation::controls::GuiWindow) - CLASS_MEMBER_CONSTRUCTOR(demo::FindWindow*(Ptr), { L"ViewModel" }) + CLASS_MEMBER_CONSTRUCTOR(demo::FindWindow*(vl::Ptr), { L"ViewModel" }) CLASS_MEMBER_PROPERTY_READONLY_FAST(ViewModel) END_CLASS_MEMBER(demo::FindWindow) diff --git a/Tutorial/GacUI_Controls/TextEditor/UI/Source/DemoPartialClasses.h b/Tutorial/GacUI_Controls/TextEditor/UI/Source/DemoPartialClasses.h index 00cec84e..1697614e 100644 --- a/Tutorial/GacUI_Controls/TextEditor/UI/Source/DemoPartialClasses.h +++ b/Tutorial/GacUI_Controls/TextEditor/UI/Source/DemoPartialClasses.h @@ -70,7 +70,7 @@ namespace demo { friend struct vl::reflection::description::CustomTypeDescriptorSelector; private: - Ptr ViewModel_; + vl::Ptr ViewModel_; protected: ::vl::presentation::controls::GuiSelectableButton* checkCase; ::vl::presentation::controls::GuiMessageDialog* dialogContentNotFound; @@ -80,7 +80,7 @@ namespace demo ::vl::presentation::controls::GuiWindow* self; ::vl::presentation::controls::GuiSinglelineTextBox* textFind; - void InitializeComponents(Ptr ViewModel) + void InitializeComponents(vl::Ptr ViewModel) { ViewModel_ = ViewModel; if (InitializeFromResource()) @@ -112,7 +112,7 @@ namespace demo { } - Ptr GetViewModel() + vl::Ptr GetViewModel() { return ViewModel_; } @@ -242,7 +242,7 @@ namespace demo void OnDestroy(); // #endregion CLASS_MEMBER_GUIEVENT_HANDLER public: - FindWindow(Ptr ViewModel); + FindWindow(vl::Ptr ViewModel); ~FindWindow(); }; } diff --git a/Tutorial/GacUI_Controls/TextEditor/UI/Source/MainWindow.cpp b/Tutorial/GacUI_Controls/TextEditor/UI/Source/MainWindow.cpp index b7e404e7..f01b01bb 100644 --- a/Tutorial/GacUI_Controls/TextEditor/UI/Source/MainWindow.cpp +++ b/Tutorial/GacUI_Controls/TextEditor/UI/Source/MainWindow.cpp @@ -6,6 +6,7 @@ GacUI::MainWindow This file is generated by: Vczh GacUI Resource Code Generator ***********************************************************************/ +#define GAC_HEADER_USE_NAMESPACE #include "Demo.h" using namespace vl::stream; @@ -86,76 +87,106 @@ namespace demo { // #region CLASS_MEMBER_GUIEVENT_HANDLER (DO NOT PUT OTHER CONTENT IN THIS #region.) - void MainWindow::commandAbout_Executed(GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments) + void MainWindow::commandAbout_Executed(::vl::presentation::compositions::GuiGraphicsComposition* sender, vl::presentation::compositions::GuiEventArgs& arguments) { + auto window = new AboutWindow; + window->MoveToScreenCenter(); + window->ShowModalAndDelete(this, []() {}); } - void MainWindow::commandEditCopy_Executed(GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments) + void MainWindow::commandEditCopy_Executed(::vl::presentation::compositions::GuiGraphicsComposition* sender, vl::presentation::compositions::GuiEventArgs& arguments) { + textBox->Copy(); } - void MainWindow::commandEditCut_Executed(GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments) + void MainWindow::commandEditCut_Executed(::vl::presentation::compositions::GuiGraphicsComposition* sender, vl::presentation::compositions::GuiEventArgs& arguments) { + textBox->Cut(); } - void MainWindow::commandEditDelete_Executed(GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments) + void MainWindow::commandEditDelete_Executed(::vl::presentation::compositions::GuiGraphicsComposition* sender, vl::presentation::compositions::GuiEventArgs& arguments) { + textBox->SetSelectionText(L""); } - void MainWindow::commandEditFind_Executed(GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments) + void MainWindow::commandEditFind_Executed(::vl::presentation::compositions::GuiGraphicsComposition* sender, vl::presentation::compositions::GuiEventArgs& arguments) { + findWindow->Show(); } - void MainWindow::commandEditPaste_Executed(GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments) + void MainWindow::commandEditPaste_Executed(::vl::presentation::compositions::GuiGraphicsComposition* sender, vl::presentation::compositions::GuiEventArgs& arguments) { + textBox->Paste(); } - void MainWindow::commandEditRedo_Executed(GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments) + void MainWindow::commandEditRedo_Executed(::vl::presentation::compositions::GuiGraphicsComposition* sender, vl::presentation::compositions::GuiEventArgs& arguments) { + textBox->Redo(); } - void MainWindow::commandEditSelect_Executed(GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments) + void MainWindow::commandEditSelect_Executed(::vl::presentation::compositions::GuiGraphicsComposition* sender, vl::presentation::compositions::GuiEventArgs& arguments) { + textBox->SelectAll(); } - void MainWindow::commandEditUndo_Executed(GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments) + void MainWindow::commandEditUndo_Executed(::vl::presentation::compositions::GuiGraphicsComposition* sender, vl::presentation::compositions::GuiEventArgs& arguments) { + textBox->Undo(); } - void MainWindow::commandFileExit_Executed(GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments) + void MainWindow::commandFileExit_Executed(::vl::presentation::compositions::GuiGraphicsComposition* sender, vl::presentation::compositions::GuiEventArgs& arguments) { + Close(); } - void MainWindow::commandFileNewText_Executed(GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments) + void MainWindow::commandFileNewText_Executed(::vl::presentation::compositions::GuiGraphicsComposition* sender, vl::presentation::compositions::GuiEventArgs& arguments) { + if (CanCloseFile()) + { + textBox->SetText(L""); + textBox->ClearUndoRedo(); + SetupTextConfig(); + } } - void MainWindow::commandFileNewXml_Executed(GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments) + void MainWindow::commandFileNewXml_Executed(::vl::presentation::compositions::GuiGraphicsComposition* sender, vl::presentation::compositions::GuiEventArgs& arguments) { + if (CanCloseFile()) + { + textBox->SetText(L""); + textBox->ClearUndoRedo(); + SetupXmlConfig(); + } } - void MainWindow::commandFileOpenText_Executed(GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments) + void MainWindow::commandFileOpenText_Executed(::vl::presentation::compositions::GuiGraphicsComposition* sender, vl::presentation::compositions::GuiEventArgs& arguments) { + OpenFile(0); } - void MainWindow::commandFileOpenXml_Executed(GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments) + void MainWindow::commandFileOpenXml_Executed(::vl::presentation::compositions::GuiGraphicsComposition* sender, vl::presentation::compositions::GuiEventArgs& arguments) { + OpenFile(1); } - void MainWindow::commandFileOpen_Executed(GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments) + void MainWindow::commandFileOpen_Executed(::vl::presentation::compositions::GuiGraphicsComposition* sender, vl::presentation::compositions::GuiEventArgs& arguments) { + OpenFile(dialogOpen->GetFilterIndex()); } - void MainWindow::commandFileSaveAs_Executed(GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments) + void MainWindow::commandFileSaveAs_Executed(::vl::presentation::compositions::GuiGraphicsComposition* sender, vl::presentation::compositions::GuiEventArgs& arguments) { + SaveFile(true); } - void MainWindow::commandFileSave_Executed(GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments) + void MainWindow::commandFileSave_Executed(::vl::presentation::compositions::GuiGraphicsComposition* sender, vl::presentation::compositions::GuiEventArgs& arguments) { + SaveFile(false); } - void MainWindow::window_Closing(GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiRequestEventArgs& arguments) + void MainWindow::window_Closing(::vl::presentation::compositions::GuiGraphicsComposition* sender, vl::presentation::compositions::GuiRequestEventArgs& arguments) { + arguments.cancel = !CanCloseFile(); } void MainWindow::OnCreate() @@ -169,108 +200,6 @@ namespace demo { } - void MainWindow::commandAbout_Executed(GuiGraphicsComposition* sender, vl::presentation::compositions::GuiEventArgs& arguments) - { - auto window = new AboutWindow; - window->MoveToScreenCenter(); - window->ShowModalAndDelete(this, [](){}); - } - - void MainWindow::commandEditCopy_Executed(GuiGraphicsComposition* sender, vl::presentation::compositions::GuiEventArgs& arguments) - { - textBox->Copy(); - } - - void MainWindow::commandEditCut_Executed(GuiGraphicsComposition* sender, vl::presentation::compositions::GuiEventArgs& arguments) - { - textBox->Cut(); - } - - void MainWindow::commandEditDelete_Executed(GuiGraphicsComposition* sender, vl::presentation::compositions::GuiEventArgs& arguments) - { - textBox->SetSelectionText(L""); - } - - void MainWindow::commandEditFind_Executed(GuiGraphicsComposition* sender, vl::presentation::compositions::GuiEventArgs& arguments) - { - findWindow->Show(); - } - - void MainWindow::commandEditPaste_Executed(GuiGraphicsComposition* sender, vl::presentation::compositions::GuiEventArgs& arguments) - { - textBox->Paste(); - } - - void MainWindow::commandEditRedo_Executed(GuiGraphicsComposition* sender, vl::presentation::compositions::GuiEventArgs& arguments) - { - textBox->Redo(); - } - - void MainWindow::commandEditSelect_Executed(GuiGraphicsComposition* sender, vl::presentation::compositions::GuiEventArgs& arguments) - { - textBox->SelectAll(); - } - - void MainWindow::commandEditUndo_Executed(GuiGraphicsComposition* sender, vl::presentation::compositions::GuiEventArgs& arguments) - { - textBox->Undo(); - } - - void MainWindow::commandFileExit_Executed(GuiGraphicsComposition* sender, vl::presentation::compositions::GuiEventArgs& arguments) - { - Close(); - } - - void MainWindow::commandFileNewText_Executed(GuiGraphicsComposition* sender, vl::presentation::compositions::GuiEventArgs& arguments) - { - if (CanCloseFile()) - { - textBox->SetText(L""); - textBox->ClearUndoRedo(); - SetupTextConfig(); - } - } - - void MainWindow::commandFileNewXml_Executed(GuiGraphicsComposition* sender, vl::presentation::compositions::GuiEventArgs& arguments) - { - if (CanCloseFile()) - { - textBox->SetText(L""); - textBox->ClearUndoRedo(); - SetupXmlConfig(); - } - } - - void MainWindow::commandFileOpenText_Executed(GuiGraphicsComposition* sender, vl::presentation::compositions::GuiEventArgs& arguments) - { - OpenFile(0); - } - - void MainWindow::commandFileOpenXml_Executed(GuiGraphicsComposition* sender, vl::presentation::compositions::GuiEventArgs& arguments) - { - OpenFile(1); - } - - void MainWindow::commandFileOpen_Executed(GuiGraphicsComposition* sender, vl::presentation::compositions::GuiEventArgs& arguments) - { - OpenFile(dialogOpen->GetFilterIndex()); - } - - void MainWindow::commandFileSaveAs_Executed(GuiGraphicsComposition* sender, vl::presentation::compositions::GuiEventArgs& arguments) - { - SaveFile(true); - } - - void MainWindow::commandFileSave_Executed(GuiGraphicsComposition* sender, vl::presentation::compositions::GuiEventArgs& arguments) - { - SaveFile(false); - } - - void MainWindow::window_Closing(GuiGraphicsComposition* sender, vl::presentation::compositions::GuiRequestEventArgs& arguments) - { - arguments.cancel = !CanCloseFile(); - } - // #endregion CLASS_MEMBER_GUIEVENT_HANDLER bool MainWindow::CanCloseFile() diff --git a/Tutorial/GacUI_Controls/TextEditor/UI/Source/MainWindow.h b/Tutorial/GacUI_Controls/TextEditor/UI/Source/MainWindow.h index 401d98c1..008c3283 100644 --- a/Tutorial/GacUI_Controls/TextEditor/UI/Source/MainWindow.h +++ b/Tutorial/GacUI_Controls/TextEditor/UI/Source/MainWindow.h @@ -20,24 +20,24 @@ namespace demo protected: // #region CLASS_MEMBER_GUIEVENT_HANDLER (DO NOT PUT OTHER CONTENT IN THIS #region.) - void commandAbout_Executed(GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments); - void commandEditCopy_Executed(GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments); - void commandEditCut_Executed(GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments); - void commandEditDelete_Executed(GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments); - void commandEditFind_Executed(GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments); - void commandEditPaste_Executed(GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments); - void commandEditRedo_Executed(GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments); - void commandEditSelect_Executed(GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments); - void commandEditUndo_Executed(GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments); - void commandFileExit_Executed(GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments); - void commandFileNewText_Executed(GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments); - void commandFileNewXml_Executed(GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments); - void commandFileOpenText_Executed(GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments); - void commandFileOpenXml_Executed(GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments); - void commandFileOpen_Executed(GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments); - void commandFileSaveAs_Executed(GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments); - void commandFileSave_Executed(GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments); - void window_Closing(GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiRequestEventArgs& arguments); + void commandAbout_Executed(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments); + void commandEditCopy_Executed(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments); + void commandEditCut_Executed(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments); + void commandEditDelete_Executed(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments); + void commandEditFind_Executed(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments); + void commandEditPaste_Executed(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments); + void commandEditRedo_Executed(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments); + void commandEditSelect_Executed(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments); + void commandEditUndo_Executed(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments); + void commandFileExit_Executed(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments); + void commandFileNewText_Executed(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments); + void commandFileNewXml_Executed(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments); + void commandFileOpenText_Executed(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments); + void commandFileOpenXml_Executed(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments); + void commandFileOpen_Executed(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments); + void commandFileSaveAs_Executed(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments); + void commandFileSave_Executed(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments); + void window_Closing(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiRequestEventArgs& arguments); void OnCreate(); void OnDestroy(); // #endregion CLASS_MEMBER_GUIEVENT_HANDLER @@ -46,21 +46,21 @@ namespace demo class FindWindowViewModel : public Object, public virtual vm::IFindWindowViewModel { private: - GuiMultilineTextBox* textBox; + vl::presentation::controls::GuiMultilineTextBox* textBox; public: - FindWindowViewModel(GuiMultilineTextBox* _textBox); + FindWindowViewModel(vl::presentation::controls::GuiMultilineTextBox* _textBox); bool FindNext(vl::WString toFind, bool caseSensitive, bool down)override; }; private: - WString fileName; + vl::WString fileName; bool isXml = false; - Ptr findWindow; + vl::Ptr findWindow; bool CanCloseFile(); - bool OpenFile(vint filterIndex); + bool OpenFile(vl::vint filterIndex); bool SaveFile(bool saveAs); void SetupTextConfig(); void SetupXmlConfig();