mirror of
https://github.com/vczh-libraries/Release.git
synced 2026-09-24 08:44:19 +08:00
Fix tutorial bug
This commit is contained in:
@@ -107,12 +107,40 @@
|
||||
{
|
||||
switch (dialogSaveDoc.FilterIndex)
|
||||
{
|
||||
case 0: { self.SaveAsPrivateFormat(dialogSaveDoc.FileName); }
|
||||
case 0: { self.SaveAsPrivateFormat(dialogSaveDoc.FileName); document.NotifyModificationSaved(); }
|
||||
case 1: { self.SaveAsRTF(dialogSaveDoc.FileName); }
|
||||
case 2: { self.SaveAsHTML(dialogSaveDoc.FileName); }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func CancelWindowClose(): bool
|
||||
{
|
||||
if (document.Modified)
|
||||
{
|
||||
switch (dialogQueryClose.ShowDialog())
|
||||
{
|
||||
case SelectYes:
|
||||
{
|
||||
if (dialogSaveDocPrivate.ShowDialog())
|
||||
{
|
||||
self.SaveAsPrivateFormat(dialogSaveDocPrivate.FileName);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
case SelectNo: { return false; }
|
||||
default: { return true; }
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
prop MenuContainer : GraphicsComposition* {GetMenuContainer}
|
||||
prop ToolstripContainer : GraphicsComposition* {GetToolstripContainer}
|
||||
@@ -132,6 +160,13 @@
|
||||
<OpenFileDialog ref.Name="dialogOpen" Title="Select an Image" Filter="Image Files (*.jpg;*.png;*.bmp)|*.jpg;*.png;*.bmp" EnabledPreview="true" Options="FileDialogFileMustExist|FileDialogDereferenceLinks"/>
|
||||
<OpenFileDialog ref.Name="dialogOpenDoc" Title="Load a GacUI Document" Filter="Private Format (*.bin)|*.bin" Options="FileDialogFileMustExist|FileDialogDereferenceLinks"/>
|
||||
<SaveFileDialog ref.Name="dialogSaveDoc" Title="Save a GacUI Document" Filter="Private Format (*.bin)|*.bin|RTF Document (*.rtf)|*.rtf|HTML Document (*.html)|*.html" Options="FileDialogPromptOverwriteFile"/>
|
||||
<SaveFileDialog ref.Name="dialogSaveDocPrivate" Title="Save a GacUI Document" Filter="Private Format (*.bin)|*.bin" Options="FileDialogPromptOverwriteFile"/>
|
||||
<MessageDialog ref.Name="dialogQueryClose"
|
||||
Input="DisplayYesNoCancel"
|
||||
Icon="IconQuestion"
|
||||
Title-eval="self.Text"
|
||||
Text="The document has been changed since the last time it was saved as a Private Format file. Do you want to save this file?"
|
||||
/>
|
||||
|
||||
<Table AlignmentToParent="left:0 top:0 right:0 bottom:0">
|
||||
<att.Rows>
|
||||
|
||||
+62
-31
@@ -14318,6 +14318,32 @@ Class (::demo::DocumentEditorBaseConstructor)
|
||||
{
|
||||
::vl::__vwsn::This(this->self)->AddComponent(static_cast<::vl::presentation::controls::GuiComponent*>(this->dialogSaveDoc));
|
||||
}
|
||||
(this->dialogSaveDocPrivate = new ::vl::presentation::controls::GuiSaveFileDialog());
|
||||
{
|
||||
::vl::__vwsn::This(this->dialogSaveDocPrivate)->SetOptions(::vl::presentation::INativeDialogService::FileDialogOptions::FileDialogPromptOverwriteFile);
|
||||
}
|
||||
{
|
||||
::vl::__vwsn::This(this->dialogSaveDocPrivate)->SetTitle(::vl::WString(L"Save a GacUI Document", false));
|
||||
}
|
||||
{
|
||||
::vl::__vwsn::This(this->dialogSaveDocPrivate)->SetFilter(::vl::WString(L"Private Format (*.bin)|*.bin", false));
|
||||
}
|
||||
{
|
||||
::vl::__vwsn::This(this->self)->AddComponent(static_cast<::vl::presentation::controls::GuiComponent*>(this->dialogSaveDocPrivate));
|
||||
}
|
||||
(this->dialogQueryClose = new ::vl::presentation::controls::GuiMessageDialog());
|
||||
{
|
||||
::vl::__vwsn::This(this->dialogQueryClose)->SetIcon(::vl::presentation::INativeDialogService::MessageBoxIcons::IconQuestion);
|
||||
}
|
||||
{
|
||||
::vl::__vwsn::This(this->dialogQueryClose)->SetInput(::vl::presentation::INativeDialogService::MessageBoxButtonsInput::DisplayYesNoCancel);
|
||||
}
|
||||
{
|
||||
::vl::__vwsn::This(this->dialogQueryClose)->SetText(::vl::WString(L"The document has been changed since the last time it was saved as a Private Format file. Do you want to save this file?", false));
|
||||
}
|
||||
{
|
||||
::vl::__vwsn::This(this->self)->AddComponent(static_cast<::vl::presentation::controls::GuiComponent*>(this->dialogQueryClose));
|
||||
}
|
||||
(this->__vwsn_precompile_0 = new ::vl::presentation::compositions::GuiTableComposition());
|
||||
{
|
||||
::vl::__vwsn::This(this->__vwsn_precompile_0)->SetAlignmentToParent([&](){ ::vl::presentation::Margin __vwsn_temp__; __vwsn_temp__.left = static_cast<::vl::vint>(0); __vwsn_temp__.top = static_cast<::vl::vint>(0); __vwsn_temp__.right = static_cast<::vl::vint>(0); __vwsn_temp__.bottom = static_cast<::vl::vint>(0); return __vwsn_temp__; }());
|
||||
@@ -14617,6 +14643,9 @@ Class (::demo::DocumentEditorBaseConstructor)
|
||||
::vl::__vwsn::EventAttach(::vl::__vwsn::This(__vwsn_created_subscription_.Obj())->ValueChanged, LAMBDA(::vl_workflow_global::__vwsnf112_Demo_demo_DocumentEditorBaseConstructor___vwsn_demo_DocumentEditorBase_Initialize_(this)));
|
||||
::vl::__vwsn::This(__vwsn_this_)->AddSubscription(__vwsn_created_subscription_);
|
||||
}
|
||||
{
|
||||
::vl::__vwsn::This(this->dialogQueryClose)->SetTitle(::vl::__vwsn::This(this->self)->GetText());
|
||||
}
|
||||
{
|
||||
auto __vwsn_event_handler_ = LAMBDA(::vl_workflow_global::__vwsnf113_Demo_demo_DocumentEditorBaseConstructor___vwsn_demo_DocumentEditorBase_Initialize_(this));
|
||||
::vl::__vwsn::EventAttach(::vl::__vwsn::This(this->document)->ActiveHyperlinkExecuted, __vwsn_event_handler_);
|
||||
@@ -15020,6 +15049,8 @@ Class (::demo::DocumentEditorBaseConstructor)
|
||||
, dialogOpen(static_cast<::vl::presentation::controls::GuiOpenFileDialog*>(nullptr))
|
||||
, dialogOpenDoc(static_cast<::vl::presentation::controls::GuiOpenFileDialog*>(nullptr))
|
||||
, dialogSaveDoc(static_cast<::vl::presentation::controls::GuiSaveFileDialog*>(nullptr))
|
||||
, dialogSaveDocPrivate(static_cast<::vl::presentation::controls::GuiSaveFileDialog*>(nullptr))
|
||||
, dialogQueryClose(static_cast<::vl::presentation::controls::GuiMessageDialog*>(nullptr))
|
||||
, menuContainer(static_cast<::vl::presentation::compositions::GuiCellComposition*>(nullptr))
|
||||
, toolstripContainer(static_cast<::vl::presentation::compositions::GuiCellComposition*>(nullptr))
|
||||
, document(static_cast<::vl::presentation::controls::GuiDocumentViewer*>(nullptr))
|
||||
@@ -17902,40 +17933,40 @@ Class (::demo::EnglishNumbersController)
|
||||
::vl::WString EnglishNumbersController::ToText_1to9(::vl::vint i)
|
||||
{
|
||||
{
|
||||
auto __vwsn_switch_4 = i;
|
||||
if ((__vwsn_switch_4 == static_cast<::vl::vint>(1)))
|
||||
auto __vwsn_switch_5 = i;
|
||||
if ((__vwsn_switch_5 == static_cast<::vl::vint>(1)))
|
||||
{
|
||||
return ::vl::WString(L"one", false);
|
||||
}
|
||||
else if ((__vwsn_switch_4 == static_cast<::vl::vint>(2)))
|
||||
else if ((__vwsn_switch_5 == static_cast<::vl::vint>(2)))
|
||||
{
|
||||
return ::vl::WString(L"two", false);
|
||||
}
|
||||
else if ((__vwsn_switch_4 == static_cast<::vl::vint>(3)))
|
||||
else if ((__vwsn_switch_5 == static_cast<::vl::vint>(3)))
|
||||
{
|
||||
return ::vl::WString(L"three", false);
|
||||
}
|
||||
else if ((__vwsn_switch_4 == static_cast<::vl::vint>(4)))
|
||||
else if ((__vwsn_switch_5 == static_cast<::vl::vint>(4)))
|
||||
{
|
||||
return ::vl::WString(L"four", false);
|
||||
}
|
||||
else if ((__vwsn_switch_4 == static_cast<::vl::vint>(5)))
|
||||
else if ((__vwsn_switch_5 == static_cast<::vl::vint>(5)))
|
||||
{
|
||||
return ::vl::WString(L"five", false);
|
||||
}
|
||||
else if ((__vwsn_switch_4 == static_cast<::vl::vint>(6)))
|
||||
else if ((__vwsn_switch_5 == static_cast<::vl::vint>(6)))
|
||||
{
|
||||
return ::vl::WString(L"six", false);
|
||||
}
|
||||
else if ((__vwsn_switch_4 == static_cast<::vl::vint>(7)))
|
||||
else if ((__vwsn_switch_5 == static_cast<::vl::vint>(7)))
|
||||
{
|
||||
return ::vl::WString(L"seven", false);
|
||||
}
|
||||
else if ((__vwsn_switch_4 == static_cast<::vl::vint>(8)))
|
||||
else if ((__vwsn_switch_5 == static_cast<::vl::vint>(8)))
|
||||
{
|
||||
return ::vl::WString(L"eight", false);
|
||||
}
|
||||
else if ((__vwsn_switch_4 == static_cast<::vl::vint>(9)))
|
||||
else if ((__vwsn_switch_5 == static_cast<::vl::vint>(9)))
|
||||
{
|
||||
return ::vl::WString(L"nine", false);
|
||||
}
|
||||
@@ -17946,40 +17977,40 @@ Class (::demo::EnglishNumbersController)
|
||||
::vl::WString EnglishNumbersController::ToText_11to19(::vl::vint i)
|
||||
{
|
||||
{
|
||||
auto __vwsn_switch_5 = i;
|
||||
if ((__vwsn_switch_5 == static_cast<::vl::vint>(1)))
|
||||
auto __vwsn_switch_6 = i;
|
||||
if ((__vwsn_switch_6 == static_cast<::vl::vint>(1)))
|
||||
{
|
||||
return ::vl::WString(L"eleven", false);
|
||||
}
|
||||
else if ((__vwsn_switch_5 == static_cast<::vl::vint>(2)))
|
||||
else if ((__vwsn_switch_6 == static_cast<::vl::vint>(2)))
|
||||
{
|
||||
return ::vl::WString(L"twelve", false);
|
||||
}
|
||||
else if ((__vwsn_switch_5 == static_cast<::vl::vint>(3)))
|
||||
else if ((__vwsn_switch_6 == static_cast<::vl::vint>(3)))
|
||||
{
|
||||
return ::vl::WString(L"thirteen", false);
|
||||
}
|
||||
else if ((__vwsn_switch_5 == static_cast<::vl::vint>(4)))
|
||||
else if ((__vwsn_switch_6 == static_cast<::vl::vint>(4)))
|
||||
{
|
||||
return ::vl::WString(L"fourteen", false);
|
||||
}
|
||||
else if ((__vwsn_switch_5 == static_cast<::vl::vint>(5)))
|
||||
else if ((__vwsn_switch_6 == static_cast<::vl::vint>(5)))
|
||||
{
|
||||
return ::vl::WString(L"fifteen", false);
|
||||
}
|
||||
else if ((__vwsn_switch_5 == static_cast<::vl::vint>(6)))
|
||||
else if ((__vwsn_switch_6 == static_cast<::vl::vint>(6)))
|
||||
{
|
||||
return ::vl::WString(L"sixteen", false);
|
||||
}
|
||||
else if ((__vwsn_switch_5 == static_cast<::vl::vint>(7)))
|
||||
else if ((__vwsn_switch_6 == static_cast<::vl::vint>(7)))
|
||||
{
|
||||
return ::vl::WString(L"seventeen", false);
|
||||
}
|
||||
else if ((__vwsn_switch_5 == static_cast<::vl::vint>(8)))
|
||||
else if ((__vwsn_switch_6 == static_cast<::vl::vint>(8)))
|
||||
{
|
||||
return ::vl::WString(L"eightteen", false);
|
||||
}
|
||||
else if ((__vwsn_switch_5 == static_cast<::vl::vint>(9)))
|
||||
else if ((__vwsn_switch_6 == static_cast<::vl::vint>(9)))
|
||||
{
|
||||
return ::vl::WString(L"nineteen", false);
|
||||
}
|
||||
@@ -17990,44 +18021,44 @@ Class (::demo::EnglishNumbersController)
|
||||
::vl::WString EnglishNumbersController::NumberToText_1To99(::vl::vint i)
|
||||
{
|
||||
{
|
||||
auto __vwsn_switch_6 = (i / static_cast<::vl::vint>(10));
|
||||
if ((__vwsn_switch_6 == static_cast<::vl::vint>(0)))
|
||||
auto __vwsn_switch_7 = (i / static_cast<::vl::vint>(10));
|
||||
if ((__vwsn_switch_7 == static_cast<::vl::vint>(0)))
|
||||
{
|
||||
return this->ToText_1to9((i % static_cast<::vl::vint>(10)));
|
||||
}
|
||||
else if ((__vwsn_switch_6 == static_cast<::vl::vint>(1)))
|
||||
else if ((__vwsn_switch_7 == static_cast<::vl::vint>(1)))
|
||||
{
|
||||
return ((i == static_cast<::vl::vint>(10)) ? ::vl::WString(L"ten", false) : this->ToText_11to19((i % static_cast<::vl::vint>(10))));
|
||||
}
|
||||
else if ((__vwsn_switch_6 == static_cast<::vl::vint>(2)))
|
||||
else if ((__vwsn_switch_7 == static_cast<::vl::vint>(2)))
|
||||
{
|
||||
return (((i % static_cast<::vl::vint>(10)) == static_cast<::vl::vint>(0)) ? ::vl::WString(L"twenty", false) : (::vl::WString(L"twenty-", false) + this->ToText_1to9((i % static_cast<::vl::vint>(10)))));
|
||||
}
|
||||
else if ((__vwsn_switch_6 == static_cast<::vl::vint>(3)))
|
||||
else if ((__vwsn_switch_7 == static_cast<::vl::vint>(3)))
|
||||
{
|
||||
return (((i % static_cast<::vl::vint>(10)) == static_cast<::vl::vint>(0)) ? ::vl::WString(L"thirty", false) : (::vl::WString(L"thirty-", false) + this->ToText_1to9((i % static_cast<::vl::vint>(10)))));
|
||||
}
|
||||
else if ((__vwsn_switch_6 == static_cast<::vl::vint>(4)))
|
||||
else if ((__vwsn_switch_7 == static_cast<::vl::vint>(4)))
|
||||
{
|
||||
return (((i % static_cast<::vl::vint>(10)) == static_cast<::vl::vint>(0)) ? ::vl::WString(L"fourty", false) : (::vl::WString(L"fourty-", false) + this->ToText_1to9((i % static_cast<::vl::vint>(10)))));
|
||||
}
|
||||
else if ((__vwsn_switch_6 == static_cast<::vl::vint>(5)))
|
||||
else if ((__vwsn_switch_7 == static_cast<::vl::vint>(5)))
|
||||
{
|
||||
return (((i % static_cast<::vl::vint>(10)) == static_cast<::vl::vint>(0)) ? ::vl::WString(L"fifty", false) : (::vl::WString(L"fifty-", false) + this->ToText_1to9((i % static_cast<::vl::vint>(10)))));
|
||||
}
|
||||
else if ((__vwsn_switch_6 == static_cast<::vl::vint>(6)))
|
||||
else if ((__vwsn_switch_7 == static_cast<::vl::vint>(6)))
|
||||
{
|
||||
return (((i % static_cast<::vl::vint>(10)) == static_cast<::vl::vint>(0)) ? ::vl::WString(L"sixty", false) : (::vl::WString(L"sixty-", false) + this->ToText_1to9((i % static_cast<::vl::vint>(10)))));
|
||||
}
|
||||
else if ((__vwsn_switch_6 == static_cast<::vl::vint>(7)))
|
||||
else if ((__vwsn_switch_7 == static_cast<::vl::vint>(7)))
|
||||
{
|
||||
return (((i % static_cast<::vl::vint>(10)) == static_cast<::vl::vint>(0)) ? ::vl::WString(L"seventy", false) : (::vl::WString(L"seventy-", false) + this->ToText_1to9((i % static_cast<::vl::vint>(10)))));
|
||||
}
|
||||
else if ((__vwsn_switch_6 == static_cast<::vl::vint>(8)))
|
||||
else if ((__vwsn_switch_7 == static_cast<::vl::vint>(8)))
|
||||
{
|
||||
return (((i % static_cast<::vl::vint>(10)) == static_cast<::vl::vint>(0)) ? ::vl::WString(L"eighty", false) : (::vl::WString(L"eighty-", false) + this->ToText_1to9((i % static_cast<::vl::vint>(10)))));
|
||||
}
|
||||
else if ((__vwsn_switch_6 == static_cast<::vl::vint>(9)))
|
||||
else if ((__vwsn_switch_7 == static_cast<::vl::vint>(9)))
|
||||
{
|
||||
return (((i % static_cast<::vl::vint>(10)) == static_cast<::vl::vint>(0)) ? ::vl::WString(L"ninety", false) : (::vl::WString(L"ninety-", false) + this->ToText_1to9((i % static_cast<::vl::vint>(10)))));
|
||||
}
|
||||
|
||||
+2
@@ -1253,6 +1253,8 @@ namespace demo
|
||||
::vl::presentation::controls::GuiOpenFileDialog* dialogOpen;
|
||||
::vl::presentation::controls::GuiOpenFileDialog* dialogOpenDoc;
|
||||
::vl::presentation::controls::GuiSaveFileDialog* dialogSaveDoc;
|
||||
::vl::presentation::controls::GuiSaveFileDialog* dialogSaveDocPrivate;
|
||||
::vl::presentation::controls::GuiMessageDialog* dialogQueryClose;
|
||||
::vl::presentation::compositions::GuiCellComposition* menuContainer;
|
||||
::vl::presentation::compositions::GuiCellComposition* toolstripContainer;
|
||||
::vl::presentation::controls::GuiDocumentViewer* document;
|
||||
|
||||
@@ -448,6 +448,7 @@ namespace vl
|
||||
CLASS_MEMBER_BASE(::demo::DocumentEditorBaseConstructor)
|
||||
CLASS_MEMBER_CONSTRUCTOR(::demo::DocumentEditorBase*(), NO_PARAMETER)
|
||||
CLASS_MEMBER_METHOD(__vwsn_instance_ctor_, NO_PARAMETER)
|
||||
CLASS_MEMBER_METHOD(CancelWindowClose, NO_PARAMETER)
|
||||
CLASS_MEMBER_METHOD(GetEditModeCommand, NO_PARAMETER)
|
||||
CLASS_MEMBER_METHOD(GetHasEditableSelection, NO_PARAMETER)
|
||||
CLASS_MEMBER_METHOD(GetHasEditableSelectionInSingleParagraph, NO_PARAMETER)
|
||||
@@ -520,7 +521,9 @@ namespace vl
|
||||
CLASS_MEMBER_FIELD(dialogNotImpl)
|
||||
CLASS_MEMBER_FIELD(dialogOpen)
|
||||
CLASS_MEMBER_FIELD(dialogOpenDoc)
|
||||
CLASS_MEMBER_FIELD(dialogQueryClose)
|
||||
CLASS_MEMBER_FIELD(dialogSaveDoc)
|
||||
CLASS_MEMBER_FIELD(dialogSaveDocPrivate)
|
||||
CLASS_MEMBER_FIELD(document)
|
||||
CLASS_MEMBER_FIELD(menuContainer)
|
||||
CLASS_MEMBER_FIELD(self)
|
||||
|
||||
+35
@@ -152,6 +152,7 @@ namespace demo
|
||||
if ((__vwsn_switch_3 == static_cast<::vl::vint>(0)))
|
||||
{
|
||||
::vl::__vwsn::This(this->self)->SaveAsPrivateFormat(::vl::__vwsn::This(this->dialogSaveDoc)->GetFileName());
|
||||
::vl::__vwsn::This(this->document)->NotifyModificationSaved();
|
||||
}
|
||||
else if ((__vwsn_switch_3 == static_cast<::vl::vint>(1)))
|
||||
{
|
||||
@@ -165,6 +166,40 @@ namespace demo
|
||||
}
|
||||
}
|
||||
|
||||
bool DocumentEditorBase::CancelWindowClose()
|
||||
{
|
||||
if (::vl::__vwsn::This(this->document)->GetModified())
|
||||
{
|
||||
{
|
||||
auto __vwsn_switch_4 = ::vl::__vwsn::This(this->dialogQueryClose)->ShowDialog();
|
||||
if ((__vwsn_switch_4 == ::vl::presentation::INativeDialogService::MessageBoxButtonsOutput::SelectYes))
|
||||
{
|
||||
if (::vl::__vwsn::This(this->dialogSaveDocPrivate)->ShowDialog())
|
||||
{
|
||||
::vl::__vwsn::This(this->self)->SaveAsPrivateFormat(::vl::__vwsn::This(this->dialogSaveDocPrivate)->GetFileName());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if ((__vwsn_switch_4 == ::vl::presentation::INativeDialogService::MessageBoxButtonsOutput::SelectNo))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
DocumentEditorBase::DocumentEditorBase()
|
||||
: ::vl::presentation::controls::GuiCustomControl(::vl::presentation::theme::ThemeName::CustomControl)
|
||||
, __vwsn_prop_EditModeCommand(static_cast<::vl::presentation::controls::GuiToolstripCommand*>(nullptr))
|
||||
|
||||
+1
@@ -152,6 +152,7 @@ namespace demo
|
||||
private:
|
||||
void SaveDocument();
|
||||
public:
|
||||
bool CancelWindowClose();
|
||||
DocumentEditorBase();
|
||||
void __vwsn_instance_ctor_();
|
||||
~DocumentEditorBase();
|
||||
|
||||
Reference in New Issue
Block a user