mirror of
https://github.com/vczh-libraries/Release.git
synced 2026-05-22 23:36:46 +08:00
Update GacUI_Controls\TextEditor demo
This commit is contained in:
@@ -111,6 +111,7 @@
|
||||
<Image Include="UI\Images\NewXml.png" />
|
||||
<Image Include="UI\Images\Open.png" />
|
||||
<Image Include="UI\Images\Save.png" />
|
||||
<Image Include="UI\Images\SaveAs.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
|
||||
@@ -87,5 +87,8 @@
|
||||
<Image Include="UI\Images\Save.png">
|
||||
<Filter>Resource Files\Images</Filter>
|
||||
</Image>
|
||||
<Image Include="UI\Images\SaveAs.png">
|
||||
<Filter>Resource Files\Images</Filter>
|
||||
</Image>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -5,6 +5,7 @@
|
||||
<Image content="File">NewXml.png</Image>
|
||||
<Image content="File">Open.png</Image>
|
||||
<Image content="File">Save.png</Image>
|
||||
<Image content="File">SaveAs.png</Image>
|
||||
<Image content="File">EditCopy.png</Image>
|
||||
<Image content="File">EditCut.png</Image>
|
||||
<Image content="File">EditDelete.png</Image>
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 236 B |
@@ -16,7 +16,7 @@
|
||||
<Folder name="MainWindow">
|
||||
<Instance name="MainWindowResource">
|
||||
<Instance ref.CodeBehind="true" ref.Class="demo::MainWindow">
|
||||
<Window Text="TextEditor" ClientSize="x:480 y:320">
|
||||
<Window ref.Name="self" Text="TextEditor" ClientSize="x:480 y:320">
|
||||
<att.BoundsComposition-set PreferredMinSize="x:480 y:320"/>
|
||||
|
||||
<ToolstripCommand ref.Name="commandFileNewText" Text="Text File" Image-uri="res://Images/NewText.png">
|
||||
@@ -34,9 +34,12 @@
|
||||
<ToolstripCommand ref.Name="commandFileOpenXml" Text="Xml File ..." Image-uri="res://Images/NewXml.png">
|
||||
<ev.Executed>commandFileOpenXml_Executed</ev.Executed>
|
||||
</ToolstripCommand>
|
||||
<ToolstripCommand ref.Name="commandFileSave" Text="Save ..." Image-uri="res://Images/Save.png" ShortcutBuilder="Ctrl+S">
|
||||
<ToolstripCommand ref.Name="commandFileSave" Text="Save" Image-uri="res://Images/Save.png" ShortcutBuilder="Ctrl+S">
|
||||
<ev.Executed>commandFileSave_Executed</ev.Executed>
|
||||
</ToolstripCommand>
|
||||
<ToolstripCommand ref.Name="commandFileSaveAs" Text="Save As ..." Image-uri="res://Images/SaveAs.png">
|
||||
<ev.Executed>commandFileSaveAs_Executed</ev.Executed>
|
||||
</ToolstripCommand>
|
||||
<ToolstripCommand ref.Name="commandFileExit" Text="Exit">
|
||||
<ev.Executed>commandFileExit_Executed</ev.Executed>
|
||||
</ToolstripCommand>
|
||||
@@ -69,6 +72,27 @@
|
||||
<ToolstripCommand ref.Name="commandAbout" Text="About TextEditor ...">
|
||||
<ev.Executed>commandAbout_Executed</ev.Executed>
|
||||
</ToolstripCommand>
|
||||
|
||||
<MessageDialog ref.Name="dialogQueryClose"
|
||||
Input="DisplayYesNoCancel"
|
||||
Icon="IconQuestion"
|
||||
Title-eval="self.Text"
|
||||
Text="Do you want to save the file before closing this application?"
|
||||
/>
|
||||
|
||||
<OpenFileDialog ref.Name="dialogOpen"
|
||||
Filter="Text Files (*.txt)|*.txt|XML Files (*.xml)|*.xml|All Files (*.*)|*.*"
|
||||
Title-eval="self.Text"
|
||||
DefaultExtension="txt"
|
||||
Options="FileDialogFileMustExist|FileDialogDereferenceLinks"
|
||||
/>
|
||||
|
||||
<SaveFileDialog ref.Name="dialogSave"
|
||||
Filter="Text Files (*.txt)|*.txt|XML Files (*.xml)|*.xml|All Files (*.*)|*.*"
|
||||
Title-eval="self.Text"
|
||||
DefaultExtension="txt"
|
||||
Options="FileDialogPromptCreateFile|FileDialogPromptOverwriteFile|FileDialogDirectoryMustExist|FileDialogAddToRecent"
|
||||
/>
|
||||
|
||||
<Table AlignmentToParent="left:0 top:0 right:0 bottom:0" MinSizeLimitation="LimitToElementAndChildren">
|
||||
<att.Rows>
|
||||
@@ -93,6 +117,7 @@
|
||||
</MenuItemButton>
|
||||
<MenuItemButton Command-ref="commandFileOpen" Alt="O"/>
|
||||
<MenuItemButton Command-ref="commandFileSave" Alt="S"/>
|
||||
<MenuItemButton Command-ref="commandFileSaveAs" Alt="A"/>
|
||||
<MenuSplitter/>
|
||||
<MenuItemButton Command-ref="commandFileExit" Alt="X"/>
|
||||
</att.SubMenu-set>
|
||||
@@ -136,6 +161,7 @@
|
||||
</att.SubMenu-set>
|
||||
</ToolstripSplitButton>
|
||||
<ToolstripButton Command-ref="commandFileSave" Alt="S"/>
|
||||
<ToolstripButton Command-ref="commandFileSaveAs" Alt="A"/>
|
||||
<ToolstripSplitter/>
|
||||
<ToolstripButton Command-ref="commandEditUndo" Alt="U"/>
|
||||
<ToolstripButton Command-ref="commandEditRedo" Alt="R"/>
|
||||
|
||||
@@ -38,6 +38,7 @@ namespace vl
|
||||
CLASS_MEMBER_GUIEVENT_HANDLER(commandFileOpenText_Executed, vl::presentation::compositions::GuiEventArgs)
|
||||
CLASS_MEMBER_GUIEVENT_HANDLER(commandFileOpenXml_Executed, vl::presentation::compositions::GuiEventArgs)
|
||||
CLASS_MEMBER_GUIEVENT_HANDLER(commandFileOpen_Executed, vl::presentation::compositions::GuiEventArgs)
|
||||
CLASS_MEMBER_GUIEVENT_HANDLER(commandFileSaveAs_Executed, vl::presentation::compositions::GuiEventArgs)
|
||||
CLASS_MEMBER_GUIEVENT_HANDLER(commandFileSave_Executed, vl::presentation::compositions::GuiEventArgs)
|
||||
END_CLASS_MEMBER(demo::MainWindow)
|
||||
|
||||
|
||||
@@ -39,6 +39,11 @@ namespace demo
|
||||
vl::presentation::controls::GuiToolstripCommand* commandFileOpenText;
|
||||
vl::presentation::controls::GuiToolstripCommand* commandFileOpenXml;
|
||||
vl::presentation::controls::GuiToolstripCommand* commandFileSave;
|
||||
vl::presentation::controls::GuiToolstripCommand* commandFileSaveAs;
|
||||
vl::presentation::controls::GuiOpenFileDialog* dialogOpen;
|
||||
vl::presentation::controls::GuiMessageDialog* dialogQueryClose;
|
||||
vl::presentation::controls::GuiSaveFileDialog* dialogSave;
|
||||
vl::presentation::controls::GuiWindow* self;
|
||||
vl::presentation::controls::GuiMultilineTextBox* textBox;
|
||||
|
||||
void InitializeComponents()
|
||||
@@ -61,6 +66,11 @@ namespace demo
|
||||
GUI_INSTANCE_REFERENCE(commandFileOpenText);
|
||||
GUI_INSTANCE_REFERENCE(commandFileOpenXml);
|
||||
GUI_INSTANCE_REFERENCE(commandFileSave);
|
||||
GUI_INSTANCE_REFERENCE(commandFileSaveAs);
|
||||
GUI_INSTANCE_REFERENCE(dialogOpen);
|
||||
GUI_INSTANCE_REFERENCE(dialogQueryClose);
|
||||
GUI_INSTANCE_REFERENCE(dialogSave);
|
||||
GUI_INSTANCE_REFERENCE(self);
|
||||
GUI_INSTANCE_REFERENCE(textBox);
|
||||
}
|
||||
else
|
||||
@@ -87,6 +97,11 @@ namespace demo
|
||||
,commandFileOpenText(0)
|
||||
,commandFileOpenXml(0)
|
||||
,commandFileSave(0)
|
||||
,commandFileSaveAs(0)
|
||||
,dialogOpen(0)
|
||||
,dialogQueryClose(0)
|
||||
,dialogSave(0)
|
||||
,self(0)
|
||||
,textBox(0)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -72,6 +72,10 @@ namespace demo
|
||||
{
|
||||
}
|
||||
|
||||
void MainWindow::commandFileSaveAs_Executed(GuiGraphicsComposition* sender, vl::presentation::compositions::GuiEventArgs& arguments)
|
||||
{
|
||||
}
|
||||
|
||||
void MainWindow::commandFileSave_Executed(GuiGraphicsComposition* sender, vl::presentation::compositions::GuiEventArgs& arguments)
|
||||
{
|
||||
}
|
||||
@@ -88,4 +92,3 @@ namespace demo
|
||||
ClearSubscriptions();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@ namespace demo
|
||||
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);
|
||||
// #endregion CLASS_MEMBER_GUIEVENT_HANDLER
|
||||
public:
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user