mirror of
https://github.com/vczh-libraries/Release.git
synced 2026-05-25 00:53:18 +08:00
...
This commit is contained in:
@@ -23,4 +23,91 @@ void GuiMain()
|
||||
demo::MainWindow window;
|
||||
window.MoveToScreenCenter();
|
||||
GetApplication()->Run(&window);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
OpenUrl
|
||||
***********************************************************************/
|
||||
|
||||
void OpenUrl(const WString& url)
|
||||
{
|
||||
ShellExecute(NULL, L"OPEN", url.Buffer(), NULL, NULL, SW_MAXIMIZE);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
SetTokenizer
|
||||
***********************************************************************/
|
||||
|
||||
class XmlColorizer : public GuiTextBoxRegexColorizer
|
||||
{
|
||||
public:
|
||||
XmlColorizer()
|
||||
{
|
||||
text::ColorEntry entry = GetCurrentTheme()->GetDefaultTextBoxColorEntry();
|
||||
SetDefaultColor(entry);
|
||||
|
||||
entry.normal.text = Color(0, 128, 0);
|
||||
AddToken(L"/<!--([^/-]|-[^/-]|--[^>])*--/>", entry);
|
||||
|
||||
entry.normal.text = Color(128, 0, 255);
|
||||
AddToken(L"/<!/[CDATA/[([^/]]|/][^/]]|/]/][^>])*/]/]/>", entry);
|
||||
|
||||
entry.normal.text = Color(0, 0, 0);
|
||||
AddToken(L"\"[^\"]*\"", entry);
|
||||
|
||||
entry.normal.text = Color(0, 0, 255);
|
||||
AddToken(L"[<>=]", entry);
|
||||
|
||||
entry.normal.text = Color(255, 0, 0);
|
||||
AddToken(L"[a-zA-Z0-9_/-:]+", entry);
|
||||
|
||||
entry.normal.text = Color(163, 21, 21);
|
||||
AddExtraToken(entry);
|
||||
|
||||
Setup();
|
||||
}
|
||||
|
||||
void ColorizeTokenContextSensitive(vint lineIndex, const wchar_t* text, vint start, vint length, vint& token, vint& contextState)override
|
||||
{
|
||||
// 0 < 1 name 2 att > 0
|
||||
switch (token)
|
||||
{
|
||||
case 3:
|
||||
if (length == 1)
|
||||
{
|
||||
switch (text[start])
|
||||
{
|
||||
case '<':
|
||||
contextState = 1;
|
||||
break;
|
||||
case '>':
|
||||
contextState = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
switch (contextState)
|
||||
{
|
||||
case 0:
|
||||
token = -1;
|
||||
break;
|
||||
case 1:
|
||||
token = 5;
|
||||
contextState = 2;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
vint GetContextStartState()override
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
void SetColorizer(GuiMultilineTextBox* textBox, bool forXml)
|
||||
{
|
||||
textBox->SetColorizer(forXml ? new XmlColorizer : nullptr);
|
||||
}
|
||||
@@ -83,6 +83,7 @@
|
||||
<ClCompile Include="Main.cpp" />
|
||||
<ClCompile Include="UI\Source\AboutWindow.cpp" />
|
||||
<ClCompile Include="UI\Source\DemoPartialClasses.cpp" />
|
||||
<ClCompile Include="UI\Source\FindWindow.cpp" />
|
||||
<ClCompile Include="UI\Source\MainWindow.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@@ -96,7 +97,9 @@
|
||||
<ClInclude Include="UI\Source\AboutWindow.h" />
|
||||
<ClInclude Include="UI\Source\Demo.h" />
|
||||
<ClInclude Include="UI\Source\DemoPartialClasses.h" />
|
||||
<ClInclude Include="UI\Source\FindWindow.h" />
|
||||
<ClInclude Include="UI\Source\MainWindow.h" />
|
||||
<ClInclude Include="Utilities.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="UI\Images\EditCopy.png" />
|
||||
|
||||
@@ -33,6 +33,9 @@
|
||||
<ClCompile Include="UI\Source\AboutWindow.cpp">
|
||||
<Filter>UI</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="UI\Source\FindWindow.cpp">
|
||||
<Filter>UI</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Xml Include="UI\Resource.xml">
|
||||
@@ -64,6 +67,12 @@
|
||||
<ClInclude Include="UI\Source\AboutWindow.h">
|
||||
<Filter>UI</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Utilities.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="UI\Source\FindWindow.h">
|
||||
<Filter>UI</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="UI\Images\EditCopy.png">
|
||||
|
||||
@@ -1,23 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Folder>
|
||||
<Script name="ViewModelResource">
|
||||
<Workflow-ViewModel>
|
||||
<![CDATA[
|
||||
module viewmodel;
|
||||
|
||||
namespace vm
|
||||
{
|
||||
interface IFindWindowViewModel
|
||||
{
|
||||
func FindNext(toFind : string, caseSensitive : bool, down : bool) : bool;
|
||||
}
|
||||
}
|
||||
]]>
|
||||
</Workflow-ViewModel>
|
||||
</Script>
|
||||
<Instance name="FindWindowResource">
|
||||
<Instance ref.CodeBehind="false" ref.Class="demo::FindWindow" xmlns:x="presentation::controls::GuiSelectableButton::*">
|
||||
<ref.Parameter Name="ViewModel" Class="vm::IFindWindowViewModel"/>
|
||||
<Instance ref.Class="demo::FindWindow" xmlns:x="presentation::controls::GuiSelectableButton::*">
|
||||
<ref.Members>
|
||||
<![CDATA[
|
||||
@cpp:UserImpl
|
||||
@cpp:Protected
|
||||
func FindNext(toFind : string, caseSensitive : bool, down : bool) : bool {}
|
||||
|
||||
var textBox : MultilineTextBox* = null;
|
||||
]]>
|
||||
</ref.Members>
|
||||
<Window ref.Name="self" Text="Find" ClientSize="x:360 y:150" MinimizedBox="false" MaximizedBox="false">
|
||||
<att.BoundsComposition-set PreferredMinSize="x:360 y:150"/>
|
||||
<x:MutexGroupController ref.Name="groupDirection"/>
|
||||
@@ -83,7 +76,7 @@
|
||||
<ev.Clicked-eval>
|
||||
<![CDATA[
|
||||
{
|
||||
if (not ViewModel.FindNext(textFind.Text, checkCase.Selected, radioDown.Selected))
|
||||
if (not self.FindNext(textFind.Text, checkCase.Selected, radioDown.Selected))
|
||||
{
|
||||
dialogContentNotFound.ShowDialog();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,32 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Instance ref.CodeBehind="true" ref.Class="demo::MainWindow">
|
||||
<ref.Members>
|
||||
<![CDATA[
|
||||
@cpp:UserImpl
|
||||
func CanCloseFile() : bool {}
|
||||
|
||||
@cpp:UserImpl
|
||||
func OpenFile(filterIndex : int) : bool {}
|
||||
|
||||
@cpp:UserImpl
|
||||
func SaveFile(saveAs : bool) : bool {}
|
||||
|
||||
@cpp:UserImpl
|
||||
func SetupTextConfig() : void {}
|
||||
|
||||
@cpp:UserImpl
|
||||
func SetupXmlConfig() : void {}
|
||||
|
||||
@cpp:Protected
|
||||
var fileName : string = "";
|
||||
|
||||
@cpp:Protected
|
||||
var isXml : bool = false;
|
||||
|
||||
@cpp:Protected
|
||||
var findWindow : GuiWindow^ = null;
|
||||
]]>
|
||||
</ref.Members>
|
||||
<Window ref.Name="self" Text="TextEditor" ClientSize="x:480 y:320" ev.WindowClosing="window_Closing">
|
||||
<att.BoundsComposition-set PreferredMinSize="x:480 y:320"/>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<Folder name="Cpp">
|
||||
<Text name="SourceFolder">Source</Text>
|
||||
<Text name="Resource">..\..\UIRes\TextEditor.bin</Text>
|
||||
<Text name="NormalInclude">GacUI.h</Text>
|
||||
<Text name="NormalInclude">..\..\Utilities.h</Text>
|
||||
<Text name="Name">Demo</Text>
|
||||
</Folder>
|
||||
</Folder>
|
||||
|
||||
@@ -1,42 +1,65 @@
|
||||
/***********************************************************************
|
||||
Vczh Library++ 3.0
|
||||
Developer: Zihan Chen(vczh)
|
||||
GacUI::AboutWindow
|
||||
/***********************************************************************
|
||||
!!!!!! DO NOT MODIFY !!!!!!
|
||||
|
||||
This file is generated by: Vczh GacUI Resource Code Generator
|
||||
GacGen.exe Resource.xml
|
||||
|
||||
This file is generated by Workflow compiler
|
||||
https://github.com/vczh-libraries
|
||||
***********************************************************************/
|
||||
|
||||
#include "Demo.h"
|
||||
#include <Windows.h>
|
||||
|
||||
#if defined( _MSC_VER)
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4250)
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wparentheses-equality"
|
||||
#elif defined(__clang__)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
#endif
|
||||
|
||||
#define GLOBAL_SYMBOL ::vl_workflow_global::Demo::
|
||||
#define GLOBAL_NAME ::vl_workflow_global::Demo::Instance().
|
||||
#define GLOBAL_OBJ &::vl_workflow_global::Demo::Instance()
|
||||
#define USERIMPL(...)
|
||||
|
||||
/***********************************************************************
|
||||
Class (::demo::AboutWindow)
|
||||
***********************************************************************/
|
||||
|
||||
namespace demo
|
||||
{
|
||||
// #region CLASS_MEMBER_GUIEVENT_HANDLER (DO NOT PUT OTHER CONTENT IN THIS #region.)
|
||||
|
||||
void AboutWindow::documentLabel_ActiveHyperlinkExecuted(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments)
|
||||
USERIMPL(/* ::demo::AboutWindow */)
|
||||
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);
|
||||
OpenUrl(documentLabel->GetActiveHyperlinkReference());
|
||||
}
|
||||
|
||||
void AboutWindow::OnCreate()
|
||||
{
|
||||
}
|
||||
|
||||
void AboutWindow::OnDestroy()
|
||||
{
|
||||
}
|
||||
|
||||
// #endregion CLASS_MEMBER_GUIEVENT_HANDLER
|
||||
|
||||
AboutWindow::AboutWindow()
|
||||
: ::vl::presentation::controls::GuiWindow(::vl::__vwsn::This(::vl::presentation::theme::GetCurrentTheme())->CreateWindowStyle())
|
||||
{
|
||||
InitializeComponents();
|
||||
OnCreate();
|
||||
auto __vwsn_resource_ = ::vl::__vwsn::This(::vl::presentation::GetResourceManager())->GetResourceFromClassName(::vl::WString(L"demo::AboutWindow", false));
|
||||
auto __vwsn_resolver_ = ::vl::Ptr<::vl::presentation::GuiResourcePathResolver>(new ::vl::presentation::GuiResourcePathResolver(__vwsn_resource_, ::vl::__vwsn::This(__vwsn_resource_.Obj())->GetWorkingDirectory()));
|
||||
::vl::__vwsn::This(this)->__vwsn_initialize_instance_(this, ::vl::__vwsn::Ensure(static_cast<::vl::presentation::GuiResourcePathResolver*>(__vwsn_resolver_.Obj())));
|
||||
}
|
||||
|
||||
AboutWindow::~AboutWindow()
|
||||
{
|
||||
OnDestroy();
|
||||
ClearSubscriptions();
|
||||
::vl::__vwsn::This(this)->ClearSubscriptions();
|
||||
}
|
||||
|
||||
}
|
||||
#undef GLOBAL_SYMBOL
|
||||
#undef GLOBAL_NAME
|
||||
#undef GLOBAL_OBJ
|
||||
#undef USERIMPL
|
||||
|
||||
#if defined( _MSC_VER)
|
||||
#pragma warning(pop)
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#elif defined(__clang__)
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
|
||||
@@ -1,33 +1,52 @@
|
||||
/***********************************************************************
|
||||
Vczh Library++ 3.0
|
||||
Developer: Zihan Chen(vczh)
|
||||
GacUI::AboutWindow
|
||||
/***********************************************************************
|
||||
!!!!!! DO NOT MODIFY !!!!!!
|
||||
|
||||
This file is generated by: Vczh GacUI Resource Code Generator
|
||||
GacGen.exe Resource.xml
|
||||
|
||||
This file is generated by Workflow compiler
|
||||
https://github.com/vczh-libraries
|
||||
***********************************************************************/
|
||||
|
||||
#ifndef VCZH_GACUI_RESOURCE_CODE_GENERATOR_Demo_AboutWindow
|
||||
#define VCZH_GACUI_RESOURCE_CODE_GENERATOR_Demo_AboutWindow
|
||||
#ifndef VCZH_WORKFLOW_COMPILER_GENERATED_ABOUTWINDOW
|
||||
#define VCZH_WORKFLOW_COMPILER_GENERATED_ABOUTWINDOW
|
||||
|
||||
#include "DemoPartialClasses.h"
|
||||
|
||||
#if defined( _MSC_VER)
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4250)
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wparentheses-equality"
|
||||
#elif defined(__clang__)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
#endif
|
||||
|
||||
namespace demo
|
||||
{
|
||||
class AboutWindow : public demo::AboutWindow_<demo::AboutWindow>
|
||||
class AboutWindow : public ::vl::presentation::controls::GuiWindow, public ::demo::AboutWindowConstructor, public ::vl::reflection::Description<AboutWindow>
|
||||
{
|
||||
friend class demo::AboutWindow_<demo::AboutWindow>;
|
||||
friend struct vl::reflection::description::CustomTypeDescriptorSelector<demo::AboutWindow>;
|
||||
friend class ::demo::AboutWindowConstructor;
|
||||
friend struct ::vl_workflow_global::__vwsnf26_Demo_demo_AboutWindowConstructor___vwsn_initialize_instance__;
|
||||
friend struct ::vl_workflow_global::__vwsno25_Demo_demo_AboutWindowConstructor___vwsn_initialize_instance__;
|
||||
#ifndef VCZH_DEBUG_NO_REFLECTION
|
||||
friend struct ::vl::reflection::description::CustomTypeDescriptorSelector<AboutWindow>;
|
||||
#endif
|
||||
protected:
|
||||
|
||||
// #region CLASS_MEMBER_GUIEVENT_HANDLER (DO NOT PUT OTHER CONTENT IN THIS #region.)
|
||||
void documentLabel_ActiveHyperlinkExecuted(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs& arguments);
|
||||
void OnCreate();
|
||||
void OnDestroy();
|
||||
// #endregion CLASS_MEMBER_GUIEVENT_HANDLER
|
||||
void documentLabel_ActiveHyperlinkExecuted(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs* arguments);
|
||||
public:
|
||||
AboutWindow();
|
||||
~AboutWindow();
|
||||
};
|
||||
|
||||
}
|
||||
#if defined( _MSC_VER)
|
||||
#pragma warning(pop)
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#elif defined(__clang__)
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,18 +1,42 @@
|
||||
/***********************************************************************
|
||||
Vczh Library++ 3.0
|
||||
Developer: Zihan Chen(vczh)
|
||||
GacUI::Demo
|
||||
/***********************************************************************
|
||||
!!!!!! DO NOT MODIFY !!!!!!
|
||||
|
||||
This file is generated by: Vczh GacUI Resource Code Generator
|
||||
************************************************************************
|
||||
DO NOT MODIFY
|
||||
GacGen.exe Resource.xml
|
||||
|
||||
This file is generated by Workflow compiler
|
||||
https://github.com/vczh-libraries
|
||||
***********************************************************************/
|
||||
|
||||
#ifndef VCZH_GACUI_RESOURCE_CODE_GENERATOR_Demo
|
||||
#define VCZH_GACUI_RESOURCE_CODE_GENERATOR_Demo
|
||||
#ifndef VCZH_WORKFLOW_COMPILER_GENERATED_DEMO
|
||||
#define VCZH_WORKFLOW_COMPILER_GENERATED_DEMO
|
||||
|
||||
#include "DemoPartialClasses.h"
|
||||
#include "AboutWindow.h"
|
||||
#include "FindWindow.h"
|
||||
#include "MainWindow.h"
|
||||
|
||||
/***********************************************************************
|
||||
Reflection
|
||||
***********************************************************************/
|
||||
|
||||
namespace vl
|
||||
{
|
||||
namespace reflection
|
||||
{
|
||||
namespace description
|
||||
{
|
||||
#ifndef VCZH_DEBUG_NO_REFLECTION
|
||||
DECL_TYPE_INFO(::demo::AboutWindow)
|
||||
DECL_TYPE_INFO(::demo::AboutWindowConstructor)
|
||||
DECL_TYPE_INFO(::demo::FindWindow)
|
||||
DECL_TYPE_INFO(::demo::FindWindowConstructor)
|
||||
DECL_TYPE_INFO(::demo::MainWindow)
|
||||
DECL_TYPE_INFO(::demo::MainWindowConstructor)
|
||||
#endif
|
||||
|
||||
extern bool LoadDemoTypes();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,118 @@
|
||||
/***********************************************************************
|
||||
!!!!!! DO NOT MODIFY !!!!!!
|
||||
|
||||
GacGen.exe Resource.xml
|
||||
|
||||
This file is generated by Workflow compiler
|
||||
https://github.com/vczh-libraries
|
||||
***********************************************************************/
|
||||
|
||||
#include "Demo.h"
|
||||
|
||||
#if defined( _MSC_VER)
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4250)
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wparentheses-equality"
|
||||
#elif defined(__clang__)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
#endif
|
||||
|
||||
#define GLOBAL_SYMBOL ::vl_workflow_global::Demo::
|
||||
#define GLOBAL_NAME ::vl_workflow_global::Demo::Instance().
|
||||
#define GLOBAL_OBJ &::vl_workflow_global::Demo::Instance()
|
||||
#define USERIMPL(...)
|
||||
|
||||
/***********************************************************************
|
||||
Class (::demo::FindWindow)
|
||||
***********************************************************************/
|
||||
|
||||
namespace demo
|
||||
{
|
||||
USERIMPL(/* ::demo::FindWindow */)
|
||||
bool FindWindow::FindNext(const ::vl::WString& toFind, bool caseSensitive, bool down)
|
||||
{
|
||||
auto position = textBox->GetCaretEnd();
|
||||
auto rowCount = textBox->GetRowCount();
|
||||
auto normalization = caseSensitive ? Locale::None : Locale::IgnoreCase;
|
||||
|
||||
for (vint i = position.row; 0 <= i&&i < rowCount; (down ? i++ : i--))
|
||||
{
|
||||
auto rowText = textBox->GetRowText(i);
|
||||
auto fragment = rowText;
|
||||
if (i == position.row)
|
||||
{
|
||||
if (down)
|
||||
{
|
||||
fragment = rowText.Right(rowText.Length() - position.column);
|
||||
}
|
||||
else
|
||||
{
|
||||
fragment = rowText.Left(position.column);
|
||||
}
|
||||
}
|
||||
|
||||
auto pair = down
|
||||
? INVLOC.FindFirst(fragment, toFind, normalization)
|
||||
: INVLOC.FindLast(fragment, toFind, normalization)
|
||||
;
|
||||
|
||||
if (pair.key != -1)
|
||||
{
|
||||
TextPos begin, end;
|
||||
if (i == position.row && down)
|
||||
{
|
||||
begin = TextPos(i, pair.key + position.column);
|
||||
}
|
||||
else
|
||||
{
|
||||
begin = TextPos(i, pair.key);
|
||||
}
|
||||
|
||||
if (down)
|
||||
{
|
||||
end = TextPos(begin.row, begin.column + pair.value);
|
||||
}
|
||||
else
|
||||
{
|
||||
end = TextPos(begin.row, begin.column);
|
||||
begin.column += pair.value;
|
||||
}
|
||||
|
||||
textBox->Select(begin, end);
|
||||
textBox->SetFocus();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
FindWindow::FindWindow()
|
||||
: ::vl::presentation::controls::GuiWindow(::vl::__vwsn::This(::vl::presentation::theme::GetCurrentTheme())->CreateWindowStyle())
|
||||
{
|
||||
auto __vwsn_resource_ = ::vl::__vwsn::This(::vl::presentation::GetResourceManager())->GetResourceFromClassName(::vl::WString(L"demo::FindWindow", false));
|
||||
auto __vwsn_resolver_ = ::vl::Ptr<::vl::presentation::GuiResourcePathResolver>(new ::vl::presentation::GuiResourcePathResolver(__vwsn_resource_, ::vl::__vwsn::This(__vwsn_resource_.Obj())->GetWorkingDirectory()));
|
||||
::vl::__vwsn::This(this)->__vwsn_initialize_instance_(this, ::vl::__vwsn::Ensure(static_cast<::vl::presentation::GuiResourcePathResolver*>(__vwsn_resolver_.Obj())));
|
||||
}
|
||||
|
||||
FindWindow::~FindWindow()
|
||||
{
|
||||
::vl::__vwsn::This(this)->ClearSubscriptions();
|
||||
}
|
||||
|
||||
}
|
||||
#undef GLOBAL_SYMBOL
|
||||
#undef GLOBAL_NAME
|
||||
#undef GLOBAL_OBJ
|
||||
#undef USERIMPL
|
||||
|
||||
#if defined( _MSC_VER)
|
||||
#pragma warning(pop)
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#elif defined(__clang__)
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
@@ -0,0 +1,53 @@
|
||||
/***********************************************************************
|
||||
!!!!!! DO NOT MODIFY !!!!!!
|
||||
|
||||
GacGen.exe Resource.xml
|
||||
|
||||
This file is generated by Workflow compiler
|
||||
https://github.com/vczh-libraries
|
||||
***********************************************************************/
|
||||
|
||||
#ifndef VCZH_WORKFLOW_COMPILER_GENERATED_FINDWINDOW
|
||||
#define VCZH_WORKFLOW_COMPILER_GENERATED_FINDWINDOW
|
||||
|
||||
#include "DemoPartialClasses.h"
|
||||
|
||||
#if defined( _MSC_VER)
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4250)
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wparentheses-equality"
|
||||
#elif defined(__clang__)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
#endif
|
||||
|
||||
namespace demo
|
||||
{
|
||||
class FindWindow : public ::vl::presentation::controls::GuiWindow, public ::demo::FindWindowConstructor, public ::vl::reflection::Description<FindWindow>
|
||||
{
|
||||
friend class ::demo::FindWindowConstructor;
|
||||
friend struct ::vl_workflow_global::__vwsnf27_Demo_demo_FindWindowConstructor___vwsn_initialize_instance__;
|
||||
friend struct ::vl_workflow_global::__vwsnf28_Demo_demo_FindWindowConstructor___vwsn_initialize_instance__;
|
||||
#ifndef VCZH_DEBUG_NO_REFLECTION
|
||||
friend struct ::vl::reflection::description::CustomTypeDescriptorSelector<FindWindow>;
|
||||
#endif
|
||||
protected:
|
||||
bool FindNext(const ::vl::WString& toFind, bool caseSensitive, bool down);
|
||||
public:
|
||||
::vl::presentation::controls::GuiMultilineTextBox* textBox = static_cast<::vl::presentation::controls::GuiMultilineTextBox*>(nullptr);
|
||||
FindWindow();
|
||||
~FindWindow();
|
||||
};
|
||||
|
||||
}
|
||||
#if defined( _MSC_VER)
|
||||
#pragma warning(pop)
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#elif defined(__clang__)
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,73 +1,112 @@
|
||||
/***********************************************************************
|
||||
Vczh Library++ 3.0
|
||||
Developer: Zihan Chen(vczh)
|
||||
GacUI::MainWindow
|
||||
/***********************************************************************
|
||||
!!!!!! DO NOT MODIFY !!!!!!
|
||||
|
||||
This file is generated by: Vczh GacUI Resource Code Generator
|
||||
GacGen.exe Resource.xml
|
||||
|
||||
This file is generated by Workflow compiler
|
||||
https://github.com/vczh-libraries
|
||||
***********************************************************************/
|
||||
|
||||
#ifndef VCZH_GACUI_RESOURCE_CODE_GENERATOR_Demo_MainWindow
|
||||
#define VCZH_GACUI_RESOURCE_CODE_GENERATOR_Demo_MainWindow
|
||||
#ifndef VCZH_WORKFLOW_COMPILER_GENERATED_MAINWINDOW
|
||||
#define VCZH_WORKFLOW_COMPILER_GENERATED_MAINWINDOW
|
||||
|
||||
#include "DemoPartialClasses.h"
|
||||
|
||||
#if defined( _MSC_VER)
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4250)
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wparentheses-equality"
|
||||
#elif defined(__clang__)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wparentheses-equality"
|
||||
#endif
|
||||
|
||||
namespace demo
|
||||
{
|
||||
class MainWindow : public demo::MainWindow_<demo::MainWindow>
|
||||
class MainWindow : public ::vl::presentation::controls::GuiWindow, public ::demo::MainWindowConstructor, public ::vl::reflection::Description<MainWindow>
|
||||
{
|
||||
friend class demo::MainWindow_<demo::MainWindow>;
|
||||
friend struct vl::reflection::description::CustomTypeDescriptorSelector<demo::MainWindow>;
|
||||
friend class ::demo::MainWindowConstructor;
|
||||
friend class ::vl_workflow_global::__vwsnc10_Demo_demo_MainWindowConstructor___vwsn_initialize_instance__Subscribe__vl_reflection_description_IValueListener;
|
||||
friend class ::vl_workflow_global::__vwsnc11_Demo_demo_MainWindowConstructor___vwsn_initialize_instance___vl_reflection_description_IValueSubscription;
|
||||
friend class ::vl_workflow_global::__vwsnc12_Demo_demo_MainWindowConstructor___vwsn_initialize_instance__Subscribe__vl_reflection_description_IValueListener;
|
||||
friend class ::vl_workflow_global::__vwsnc1_Demo_demo_MainWindowConstructor___vwsn_initialize_instance___vl_reflection_description_IValueSubscription;
|
||||
friend class ::vl_workflow_global::__vwsnc2_Demo_demo_MainWindowConstructor___vwsn_initialize_instance__Subscribe__vl_reflection_description_IValueListener;
|
||||
friend class ::vl_workflow_global::__vwsnc3_Demo_demo_MainWindowConstructor___vwsn_initialize_instance___vl_reflection_description_IValueSubscription;
|
||||
friend class ::vl_workflow_global::__vwsnc4_Demo_demo_MainWindowConstructor___vwsn_initialize_instance__Subscribe__vl_reflection_description_IValueListener;
|
||||
friend class ::vl_workflow_global::__vwsnc5_Demo_demo_MainWindowConstructor___vwsn_initialize_instance___vl_reflection_description_IValueSubscription;
|
||||
friend class ::vl_workflow_global::__vwsnc6_Demo_demo_MainWindowConstructor___vwsn_initialize_instance__Subscribe__vl_reflection_description_IValueListener;
|
||||
friend class ::vl_workflow_global::__vwsnc7_Demo_demo_MainWindowConstructor___vwsn_initialize_instance___vl_reflection_description_IValueSubscription;
|
||||
friend class ::vl_workflow_global::__vwsnc8_Demo_demo_MainWindowConstructor___vwsn_initialize_instance__Subscribe__vl_reflection_description_IValueListener;
|
||||
friend class ::vl_workflow_global::__vwsnc9_Demo_demo_MainWindowConstructor___vwsn_initialize_instance___vl_reflection_description_IValueSubscription;
|
||||
friend struct ::vl_workflow_global::__vwsnf11_Demo_demo_MainWindowConstructor___vwsn_initialize_instance__;
|
||||
friend struct ::vl_workflow_global::__vwsnf13_Demo_demo_MainWindowConstructor___vwsn_initialize_instance__;
|
||||
friend struct ::vl_workflow_global::__vwsnf15_Demo_demo_MainWindowConstructor___vwsn_initialize_instance__;
|
||||
friend struct ::vl_workflow_global::__vwsnf17_Demo_demo_MainWindowConstructor___vwsn_initialize_instance__;
|
||||
friend struct ::vl_workflow_global::__vwsnf19_Demo_demo_MainWindowConstructor___vwsn_initialize_instance__;
|
||||
friend struct ::vl_workflow_global::__vwsnf9_Demo_demo_MainWindowConstructor___vwsn_initialize_instance__;
|
||||
friend struct ::vl_workflow_global::__vwsno10_Demo_demo_MainWindowConstructor___vwsn_initialize_instance__;
|
||||
friend struct ::vl_workflow_global::__vwsno12_Demo_demo_MainWindowConstructor___vwsn_initialize_instance__;
|
||||
friend struct ::vl_workflow_global::__vwsno14_Demo_demo_MainWindowConstructor___vwsn_initialize_instance__;
|
||||
friend struct ::vl_workflow_global::__vwsno16_Demo_demo_MainWindowConstructor___vwsn_initialize_instance__;
|
||||
friend struct ::vl_workflow_global::__vwsno18_Demo_demo_MainWindowConstructor___vwsn_initialize_instance__;
|
||||
friend struct ::vl_workflow_global::__vwsno1_Demo_demo_MainWindowConstructor___vwsn_initialize_instance__;
|
||||
friend struct ::vl_workflow_global::__vwsno20_Demo_demo_MainWindowConstructor___vwsn_initialize_instance__;
|
||||
friend struct ::vl_workflow_global::__vwsno21_Demo_demo_MainWindowConstructor___vwsn_initialize_instance__;
|
||||
friend struct ::vl_workflow_global::__vwsno22_Demo_demo_MainWindowConstructor___vwsn_initialize_instance__;
|
||||
friend struct ::vl_workflow_global::__vwsno23_Demo_demo_MainWindowConstructor___vwsn_initialize_instance__;
|
||||
friend struct ::vl_workflow_global::__vwsno24_Demo_demo_MainWindowConstructor___vwsn_initialize_instance__;
|
||||
friend struct ::vl_workflow_global::__vwsno2_Demo_demo_MainWindowConstructor___vwsn_initialize_instance__;
|
||||
friend struct ::vl_workflow_global::__vwsno3_Demo_demo_MainWindowConstructor___vwsn_initialize_instance__;
|
||||
friend struct ::vl_workflow_global::__vwsno4_Demo_demo_MainWindowConstructor___vwsn_initialize_instance__;
|
||||
friend struct ::vl_workflow_global::__vwsno5_Demo_demo_MainWindowConstructor___vwsn_initialize_instance__;
|
||||
friend struct ::vl_workflow_global::__vwsno6_Demo_demo_MainWindowConstructor___vwsn_initialize_instance__;
|
||||
friend struct ::vl_workflow_global::__vwsno7_Demo_demo_MainWindowConstructor___vwsn_initialize_instance__;
|
||||
friend struct ::vl_workflow_global::__vwsno8_Demo_demo_MainWindowConstructor___vwsn_initialize_instance__;
|
||||
#ifndef VCZH_DEBUG_NO_REFLECTION
|
||||
friend struct ::vl::reflection::description::CustomTypeDescriptorSelector<MainWindow>;
|
||||
#endif
|
||||
public:
|
||||
bool CanCloseFile();
|
||||
bool OpenFile(::vl::vint32_t filterIndex);
|
||||
bool SaveFile(bool saveAs);
|
||||
void SetupTextConfig();
|
||||
void SetupXmlConfig();
|
||||
protected:
|
||||
|
||||
// #region CLASS_MEMBER_GUIEVENT_HANDLER (DO NOT PUT OTHER CONTENT IN THIS #region.)
|
||||
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
|
||||
private:
|
||||
|
||||
class FindWindowViewModel : public Object, public virtual vm::IFindWindowViewModel
|
||||
{
|
||||
private:
|
||||
vl::presentation::controls::GuiMultilineTextBox* textBox;
|
||||
|
||||
public:
|
||||
FindWindowViewModel(vl::presentation::controls::GuiMultilineTextBox* _textBox);
|
||||
|
||||
bool FindNext(vl::WString toFind, bool caseSensitive, bool down)override;
|
||||
};
|
||||
|
||||
private:
|
||||
vl::WString fileName;
|
||||
bool isXml = false;
|
||||
vl::Ptr<FindWindow> findWindow;
|
||||
|
||||
bool CanCloseFile();
|
||||
bool OpenFile(vl::vint filterIndex);
|
||||
bool SaveFile(bool saveAs);
|
||||
void SetupTextConfig();
|
||||
void SetupXmlConfig();
|
||||
::vl::WString fileName = ::vl::WString(L"", false);
|
||||
bool isXml = false;
|
||||
::vl::Ptr<::vl::presentation::controls::GuiWindow> findWindow = ::vl::Ptr<::vl::presentation::controls::GuiWindow>();
|
||||
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 commandFileOpen_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 commandFileSave_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 commandFileExit_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 commandEditRedo_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 commandEditCopy_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 commandEditDelete_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 commandEditFind_Executed(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs* arguments);
|
||||
void commandAbout_Executed(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiEventArgs* arguments);
|
||||
void window_Closing(::vl::presentation::compositions::GuiGraphicsComposition* sender, ::vl::presentation::compositions::GuiRequestEventArgs* arguments);
|
||||
public:
|
||||
MainWindow();
|
||||
~MainWindow();
|
||||
};
|
||||
|
||||
}
|
||||
#if defined( _MSC_VER)
|
||||
#pragma warning(pop)
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#elif defined(__clang__)
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
#ifndef VCZH_TUTORIAL_CONTROLS_TEXTEDITOR
|
||||
#define VCZH_TUTORIAL_CONTROLS_TEXTEDITOR
|
||||
|
||||
#include "GacUI.h"
|
||||
|
||||
using namespace vl;
|
||||
using namespace vl::presentation;
|
||||
using namespace vl::presentation::controls;
|
||||
|
||||
extern void OpenUrl(const WString& url);
|
||||
extern void SetColorizer(GuiMultilineTextBox* textBox, bool forXml);
|
||||
|
||||
#endif
|
||||
Binary file not shown.
Reference in New Issue
Block a user