Update DocumentEditor demo

This commit is contained in:
Zihan Chen
2018-05-31 00:13:26 -07:00
parent a7e7d3be6f
commit 24d78f1df4
16 changed files with 5087 additions and 4024 deletions
@@ -163,12 +163,12 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Xml Include="UI\Base.xml" />
<Xml Include="UI\Hyperlink.xml" />
<Xml Include="UI\DocumentComponents.xml" />
<Xml Include="UI\DocumentEditorBase.xml" />
<Xml Include="UI\DocumentEditorRibbon.xml" />
<Xml Include="UI\DocumentEditorToolstrip.xml" />
<Xml Include="UI\Resource.xml" />
<Xml Include="UI\Ribbon.xml" />
<Xml Include="UI\ToolbarImages\Images.xml" />
<Xml Include="UI\Toolstrip.xml" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
@@ -43,16 +43,16 @@
<Xml Include="UI\ToolbarImages\Images.xml">
<Filter>Resource Files\ToolbarImages</Filter>
</Xml>
<Xml Include="UI\Toolstrip.xml">
<Xml Include="UI\DocumentEditorBase.xml">
<Filter>Resource Files</Filter>
</Xml>
<Xml Include="UI\Base.xml">
<Xml Include="UI\DocumentEditorRibbon.xml">
<Filter>Resource Files</Filter>
</Xml>
<Xml Include="UI\Hyperlink.xml">
<Xml Include="UI\DocumentEditorToolstrip.xml">
<Filter>Resource Files</Filter>
</Xml>
<Xml Include="UI\Ribbon.xml">
<Xml Include="UI\DocumentComponents.xml">
<Filter>Resource Files</Filter>
</Xml>
</ItemGroup>
@@ -1,412 +0,0 @@
<Instance ref.CodeBehind="false" ref.Class="demo::DocumentEditorWindowBase">
<ref.Members>
<![CDATA[
@cpp:Protected
prop EditModeCommand : ToolstripCommand* = null {const}
@cpp:Private
func SetEditMode(editMode: DocumentCommonInterface::EditMode) : void
{
var command =
editMode == DocumentCommonInterface::EditMode::ViewOnly ? commandViewOnly :
editMode == DocumentCommonInterface::EditMode::Selectable ? commandSelectable :
commandEditable;
document.EditMode = editMode;
commandViewOnly.Selected = (command == commandViewOnly);
commandSelectable.Selected = (command == commandSelectable);
commandEditable.Selected = (command == commandEditable);
SetEditModeCommand(command);
self.UpdateSubscriptions();
}
@cpp:Protected
func SelectAlignmentCommand() : ToolstripCommand*
{
var alignment = document.SummarizeParagraphAlignment(document.CaretBegin, document.CaretEnd);
return
alignment == Alignment::Left ? commandAlignLeft :
alignment == Alignment::Center ? commandAlignCenter :
alignment == Alignment::Right ? commandAlignRight :
commandAlignDefault;
}
@cpp:Private
func SetAlignment(alignment : Alignment?) : void
{
document.SetParagraphAlignment(document.CaretBegin, document.CaretEnd, alignment);
self.UpdateSubscriptions();
}
@cpp:Private
prop HasEditableSelection : bool = false {}
@cpp:Private
prop HasEditableSelectionInSingleParagraph : bool = false {}
@cpp:Private
func HasEditableCursor() : bool
{
return document.EditMode == DocumentCommonInterface::EditMode::Editable;
}
@cpp:Private
func HasEditableHyperlink(forEdit : bool) : bool
{
var a = document.CaretBegin;
var b = document.CaretEnd;
return a.row == b.row and a.column != b.column;
}
@cpp:Protected
func GetMenuContainer() : GraphicsComposition*
{
return menuContainer;
}
@cpp:Protected
func GetToolstripContainer() : GraphicsComposition*
{
return toolstripContainer;
}
prop MenuContainer : GraphicsComposition* {GetMenuContainer}
prop ToolstripContainer : GraphicsComposition* {GetToolstripContainer}
]]>
</ref.Members>
<ref.Ctor>
<![CDATA[
{
SetEditMode(Editable);
}
]]>
</ref.Ctor>
<Window ref.Name="self" Text="Document Editor" ClientSize="x:800 y:600">
<att.HasEditableSelection-bind>document.observe as _(_.CanCut() on _.SelectionChanged)</att.HasEditableSelection-bind>
<MessageDialog ref.Name="dialogMessage" Title="You Clicked a Hyperlink!"/>
<OpenFileDialog ref.Name="dialogOpen" Title="Select an Image" Filter="Image Files (*.jpg;*.png;*.bmp)|*.jpg;*.png;*.bmp" EnabledPreview="true" Options="FileDialogFileMustExist|FileDialogDereferenceLinks"/>
<Table AlignmentToParent="left:0 top:0 right:0 bottom:0">
<att.Rows>
<_>composeType:MinSize</_>
<_>composeType:MinSize</_>
<_>composeType:Percentage percentage:1.0</_>
</att.Rows>
<att.Columns>
<_>composeType:Percentage percentage:1.0</_>
</att.Columns>
<Cell ref.Name="menuContainer" Site="row:0 column:0"/>
<Cell ref.Name="toolstripContainer" Site="row:1 column:0"/>
<Cell Site="row:2 column:0">
<DocumentViewer ref.Name="document" EditMode="Editable" Alt="D">
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0"/>
<ev.ActiveHyperlinkExecuted-eval>
<![CDATA[
{
dialogMessage.Text = document.ActiveHyperlinkReference;
dialogMessage.ShowDialog();
}
]]>
</ev.ActiveHyperlinkExecuted-eval>
</DocumentViewer>
</Cell>
</Table>
<ToolstripCommand ref.Name="commandUndo" Text="Undo" Image-uri="res://ToolbarImages/Undo" LargeImage-uri="res://ToolbarImages/UndoLarge" ShortcutBuilder="Ctrl+Z">
<att.Enabled-bind>document.observe as _(_.CanUndo() on _.UndoRedoChanged)</att.Enabled-bind>
<ev.Executed-eval>
<![CDATA[document.Undo();]]>
</ev.Executed-eval>
</ToolstripCommand>
<ToolstripCommand ref.Name="commandRedo" Text="Redo" Image-uri="res://ToolbarImages/Redo" LargeImage-uri="res://ToolbarImages/RedoLarge" ShortcutBuilder="Ctrl+Y">
<att.Enabled-bind>document.observe as _(_.CanRedo() on _.UndoRedoChanged)</att.Enabled-bind>
<ev.Executed-eval>
<![CDATA[document.Redo();]]>
</ev.Executed-eval>
</ToolstripCommand>
<ToolstripCommand ref.Name="commandCopy" Text="Copy" Image-uri="res://ToolbarImages/Copy" LargeImage-uri="res://ToolbarImages/CopyLarge" ShortcutBuilder="Ctrl+C">
<att.Enabled-bind>document.observe as _(_.CanCopy() on _.SelectionChanged)</att.Enabled-bind>
<ev.Executed-eval>
<![CDATA[document.Copy();]]>
</ev.Executed-eval>
</ToolstripCommand>
<ToolstripCommand ref.Name="commandCut" Text="Cut" Image-uri="res://ToolbarImages/Cut" LargeImage-uri="res://ToolbarImages/CutLarge" ShortcutBuilder="Ctrl+X">
<att.Enabled-bind>self.HasEditableSelection</att.Enabled-bind>
<ev.Executed-eval>
<![CDATA[document.Cut();]]>
</ev.Executed-eval>
</ToolstripCommand>
<ToolstripCommand ref.Name="commandPaste" Text="Paste" Image-uri="res://ToolbarImages/Paste" LargeImage-uri="res://ToolbarImages/PasteLarge" ShortcutBuilder="Ctrl+V">
<att.Enabled-bind>self.observe as _(document.CanPaste() on _.BoundsComposition.clipboardNotify)</att.Enabled-bind>
<ev.Executed-eval>
<![CDATA[document.Paste();]]>
</ev.Executed-eval>
</ToolstripCommand>
<ToolstripCommand ref.Name="commandDelete" Text="Delete" Image-uri="res://ToolbarImages/Delete" LargeImage-uri="res://ToolbarImages/RemoveLinkLarge">
<att.Enabled-bind>self.HasEditableSelection</att.Enabled-bind>
<ev.Executed-eval>
<![CDATA[document.SetSelectionText("");]]>
</ev.Executed-eval>
</ToolstripCommand>
<ToolstripCommand ref.Name="commandSelect" Text="Select All" ShortcutBuilder="Ctrl+A">
<ev.Executed-eval>
<![CDATA[document.SelectAll();]]>
</ev.Executed-eval>
</ToolstripCommand>
<ToolstripCommand ref.Name="commandInsertImage" Text="Insert Image ..." Image-uri="res://ToolbarImages/Image" LargeImage-uri="res://ToolbarImages/ImageLarge">
<att.Enabled-bind>self.HasEditableCursor()</att.Enabled-bind>
<ev.Executed-eval>
<![CDATA[
{
if (dialogOpen.ShowDialog())
{
var imageService = INativeController::GetCurrentController().ImageService();
var image = imageService.CreateImageFromFile(dialogOpen.FileName);
var imageData = new ImageData^(image, 0);
document.EditImage(document.CaretBegin, document.CaretEnd, imageData);
}
}
]]>
</ev.Executed-eval>
</ToolstripCommand>
<ToolstripCommand ref.Name="commandEditHyperlink" Text="Edit Hyperlink ..." Image-uri="res://ToolbarImages/Link" LargeImage-uri="res://ToolbarImages/LinkLarge">
<att.Enabled-bind>document.observe as _(self.HasEditableHyperlink(true) on _.SelectionChanged)</att.Enabled-bind>
<ev.Executed-eval>
<![CDATA[
$Async{
var mainWindow = self.RelatedControlHost as controls::GuiWindow*;
var window = new HyperlinkWindow*();
window.MoveToScreenCenter(mainWindow.RelatedScreen);
$Await window.ShowModalAsync(mainWindow);
if (window.Url is not null)
{
var row = document.CaretBegin.row;
var begin = document.CaretBegin.column;
var end = document.CaretEnd.column;
document.EditHyperlink(row, begin, end, cast string window.Url, "#NormalLink", "#ActiveLink");
}
delete window;
}
]]>
</ev.Executed-eval>
</ToolstripCommand>
<ToolstripCommand ref.Name="commandRemoveHyperlink" Text="Remove Hyperlink" Image-uri="res://ToolbarImages/RemoveLink" LargeImage-uri="res://ToolbarImages/RemoveLinkLarge">
<att.Enabled-bind>document.observe as _(self.HasEditableHyperlink(false) on _.SelectionChanged)</att.Enabled-bind>
<ev.Executed-eval>
<![CDATA[
{
var row = document.CaretBegin.row;
var begin = document.CaretBegin.column;
var end = document.CaretEnd.column;
document.RemoveHyperlink(row, begin, end);
}
]]>
</ev.Executed-eval>
</ToolstripCommand>
<ToolstripCommand ref.Name="commandBold" Text="Bold" Image-uri="res://ToolbarImages/Bold">
<att.Enabled-bind>self.HasEditableSelection</att.Enabled-bind>
<att.Selected-bind>document.observe as _(_.SummarizeStyle(_.CaretBegin, _.CaretEnd).bold == true on _.SelectionChanged, _.ModifiedChanged)</att.Selected-bind>
<ev.Executed-eval>
<![CDATA[
{
var style = new DocumentStyleProperties^();
style.bold = not commandBold.Selected;
document.EditStyle(document.CaretBegin, document.CaretEnd, style);
}
]]>
</ev.Executed-eval>
</ToolstripCommand>
<ToolstripCommand ref.Name="commandItalic" Text="Italic" Image-uri="res://ToolbarImages/Italic">
<att.Enabled-bind>self.HasEditableSelection</att.Enabled-bind>
<att.Selected-bind>document.observe as _(_.SummarizeStyle(_.CaretBegin, _.CaretEnd).italic == true on _.SelectionChanged, _.ModifiedChanged)</att.Selected-bind>
<ev.Executed-eval>
<![CDATA[
{
var style = new DocumentStyleProperties^();
style.italic = not commandItalic.Selected;
document.EditStyle(document.CaretBegin, document.CaretEnd, style);
}
]]>
</ev.Executed-eval>
</ToolstripCommand>
<ToolstripCommand ref.Name="commandUnderline" Text="Underline" Image-uri="res://ToolbarImages/Underline">
<att.Enabled-bind>self.HasEditableSelection</att.Enabled-bind>
<att.Selected-bind>document.observe as _(_.SummarizeStyle(_.CaretBegin, _.CaretEnd).underline == true on _.SelectionChanged, _.ModifiedChanged)</att.Selected-bind>
<ev.Executed-eval>
<![CDATA[
{
var style = new DocumentStyleProperties^();
style.underline = not commandUnderline.Selected;
document.EditStyle(document.CaretBegin, document.CaretEnd, style);
}
]]>
</ev.Executed-eval>
</ToolstripCommand>
<ToolstripCommand ref.Name="commandStrike" Text="Strike" Image-uri="res://ToolbarImages/Strike">
<att.Enabled-bind>self.HasEditableSelection</att.Enabled-bind>
<att.Selected-bind>document.observe as _(_.SummarizeStyle(_.CaretBegin, _.CaretEnd).strikeline == true on _.SelectionChanged, _.ModifiedChanged)</att.Selected-bind>
<ev.Executed-eval>
<![CDATA[
{
var style = new DocumentStyleProperties^();
style.strikeline = not commandStrike.Selected;
document.EditStyle(document.CaretBegin, document.CaretEnd, style);
}
]]>
</ev.Executed-eval>
</ToolstripCommand>
<ColorDialog ref.Name="dialogColor" EnabledCustomColor="false"/>
<FontDialog ref.Name="dialogFont" ShowEffect="false" ShowSelection="true" ForceFontExist="true"/>
<ToolstripCommand ref.Name="commandFont" Text="Set Font ..." Image-uri="res://ToolbarImages/Font">
<att.Enabled-bind>self.HasEditableSelection</att.Enabled-bind>
<ev.Executed-eval>
<![CDATA[
{
var begin = document.CaretBegin;
var end = document.CaretEnd;
var style = document.SummarizeStyle(begin, end);
var baselineFont = document.Font;
dialogFont.SelectedFont =
{
fontFamily: ( style.face is null ? baselineFont.fontFamily : cast string style.face )
size: ( style.size is null ? baselineFont.size : cast int style.size.size )
};
if (dialogFont.ShowDialog())
{
style = new DocumentStyleProperties^();
var selectedFont = dialogFont.SelectedFont;
style.face = selectedFont.fontFamily;
style.size = {size:selectedFont.size relative:false};
document.EditStyle(begin, end, style);
}
}
]]>
</ev.Executed-eval>
</ToolstripCommand>
<ToolstripCommand ref.Name="commandColor" Text="Text Color ..." Image-uri="res://ToolbarImages/Color">
<att.Enabled-bind>self.HasEditableSelection</att.Enabled-bind>
<ev.Executed-eval>
<![CDATA[
{
var begin = document.CaretBegin;
var end = document.CaretEnd;
var selectedColor = document.SummarizeStyle(begin, end).color;
if (selectedColor is null)
{
dialogColor.SelectedColor = cast Color "#000000";
}
else
{
dialogColor.SelectedColor = cast Color selectedColor;
}
if (dialogColor.ShowDialog())
{
var style = new DocumentStyleProperties^();
style.color = dialogColor.SelectedColor;
document.EditStyle(begin, end, style);
}
}
]]>
</ev.Executed-eval>
</ToolstripCommand>
<ToolstripCommand ref.Name="commandBackColor" Text="Background Color ..." Image-uri="res://ToolbarImages/BackColor">
<att.Enabled-bind>self.HasEditableSelection</att.Enabled-bind>
<ev.Executed-eval>
<![CDATA[
{
var begin = document.CaretBegin;
var end = document.CaretEnd;
var selectedColor = document.SummarizeStyle(begin, end).backgroundColor;
if (selectedColor is null)
{
dialogColor.SelectedColor = cast Color "#000000";
}
else
{
dialogColor.SelectedColor = cast Color selectedColor;
}
if (dialogColor.ShowDialog())
{
var style = new DocumentStyleProperties^();
style.backgroundColor = dialogColor.SelectedColor;
document.EditStyle(begin, end, style);
}
}
]]>
</ev.Executed-eval>
</ToolstripCommand>
<ToolstripCommand ref.Name="commandViewOnly" Text="Preview" Image-uri="res://ToolbarImages/ViewOnly" LargeImage-uri="res://ToolbarImages/ViewOnlyLarge" ShortcutBuilder="Ctrl+Shift+P">
<ev.Executed-eval>
<![CDATA[self.SetEditMode(ViewOnly);]]>
</ev.Executed-eval>
</ToolstripCommand>
<ToolstripCommand ref.Name="commandSelectable" Text="Selectable" Image-uri="res://ToolbarImages/Selectable" LargeImage-uri="res://ToolbarImages/SelectableLarge" ShortcutBuilder="Ctrl+Shift+S">
<ev.Executed-eval>
<![CDATA[self.SetEditMode(Selectable);]]>
</ev.Executed-eval>
</ToolstripCommand>
<ToolstripCommand ref.Name="commandEditable" Text="Editable" Image-uri="res://ToolbarImages/Editable" LargeImage-uri="res://ToolbarImages/EditableLarge" ShortcutBuilder="Ctrl+Shift+E">
<ev.Executed-eval>
<![CDATA[self.SetEditMode(Editable);]]>
</ev.Executed-eval>
</ToolstripCommand>
<ToolstripCommand ref.Name="commandAlignDefault" Text="Set Alignment to Default (Left)" Image-uri="res://ToolbarImages/TextAlign">
<att.Enabled-bind>self.HasEditableCursor()</att.Enabled-bind>
<ev.Executed-eval>
<![CDATA[self.SetAlignment(null);]]>
</ev.Executed-eval>
</ToolstripCommand>
<ToolstripCommand ref.Name="commandAlignLeft" Text="Left" Image-uri="res://ToolbarImages/TextAlignLeft" LargeImage-uri="res://ToolbarImages/TextAlignLeftLarge">
<att.Enabled-bind>self.HasEditableCursor()</att.Enabled-bind>
<att.Selected-bind>document.observe as _(self.SelectAlignmentCommand() == commandAlignLeft on _.SelectionChanged)</att.Selected-bind>
<ev.Executed-eval>
<![CDATA[self.SetAlignment(Left);]]>
</ev.Executed-eval>
</ToolstripCommand>
<ToolstripCommand ref.Name="commandAlignCenter" Text="Center" Image-uri="res://ToolbarImages/TextAlignCenter" LargeImage-uri="res://ToolbarImages/TextAlignCenterLarge">
<att.Enabled-bind>self.HasEditableCursor()</att.Enabled-bind>
<att.Selected-bind>document.observe as _(self.SelectAlignmentCommand() == commandAlignCenter on _.SelectionChanged)</att.Selected-bind>
<ev.Executed-eval>
<![CDATA[self.SetAlignment(Center);]]>
</ev.Executed-eval>
</ToolstripCommand>
<ToolstripCommand ref.Name="commandAlignRight" Text="Right" Image-uri="res://ToolbarImages/TextAlignRight" LargeImage-uri="res://ToolbarImages/TextAlignRightLarge">
<att.Enabled-bind>self.HasEditableCursor()</att.Enabled-bind>
<att.Selected-bind>document.observe as _(self.SelectAlignmentCommand() == commandAlignRight on _.SelectionChanged)</att.Selected-bind>
<ev.Executed-eval>
<![CDATA[self.SetAlignment(Right);]]>
</ev.Executed-eval>
</ToolstripCommand>
</Window>
</Instance>
@@ -0,0 +1,78 @@
<Folder>
<Instance name="HyperlinkWindowResource">
<Instance ref.CodeBehind="false" ref.Class="demo::HyperlinkWindow">
<ref.Members>
<![CDATA[
prop Url : string? = null {}
]]>
</ref.Members>
<Window ref.Name="self" Text="Hyperlink" ClientSize="x:320 y:80" SizeBox="false" MinimizedBox="false" MaximizedBox="false" ShowInTaskBar="false">
<att.BoundsComposition-set PreferredMinSize="x:320 y:80"/>
<Table CellPadding="5" BorderVisible="true" AlignmentToParent="left:0 top:0 right:0 bottom:0">
<att.Rows>
<_>composeType:MinSize</_>
<_>composeType:Percentage percentage:1.0</_>
<_>composeType:MinSize</_>
</att.Rows>
<att.Columns>
<_>composeType:MinSize</_>
<_>composeType:Percentage percentage:1.0</_>
<_>composeType:MinSize</_>
<_>composeType:MinSize</_>
</att.Columns>
<Cell Site="row:0 column:0">
<Table AlignmentToParent="left:0 top:0 right:0 bottom:0" MinSizeLimitation="LimitToElementAndChildren">
<att.Rows>
<_>composeType:Percentage percentage:0.5</_>
<_>composeType:MinSize</_>
<_>composeType:Percentage percentage:0.5</_>
</att.Rows>
<att.Columns>
<_>composeType:Percentage percentage:1.0</_>
</att.Columns>
<Cell Site="row:1 column:0">
<Label Text="Url: "/>
</Cell>
</Table>
</Cell>
<Cell Site="row:0 column:1 columnSpan:3">
<SinglelineTextBox ref.Name="textUrl">
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0"/>
</SinglelineTextBox>
</Cell>
<Cell Site="row:2 column:2">
<Button Text="OK">
<att.BoundsComposition-set PreferredMinSize="x:100"/>
<ev.Clicked-eval>
<![CDATA[
{
self.Url = textUrl.Text;
self.Close();
}
]]>
</ev.Clicked-eval>
</Button>
</Cell>
<Cell Site="row:2 column:3">
<Button Text="Cancel">
<att.BoundsComposition-set PreferredMinSize="x:100"/>
<ev.Clicked-eval>
<![CDATA[
{
self.Url = null;
self.Close();
}
]]>
</ev.Clicked-eval>
</Button>
</Cell>
</Table>
</Window>
</Instance>
</Instance>
</Folder>
@@ -0,0 +1,416 @@
<Folder>
<Instance name="DocumentEditorBaseResource">
<Instance ref.CodeBehind="false" ref.Class="demo::DocumentEditorBase">
<ref.Members>
<![CDATA[
@cpp:Protected
prop EditModeCommand : ToolstripCommand* = null {const}
@cpp:Private
func SetEditMode(editMode: DocumentCommonInterface::EditMode) : void
{
var command =
editMode == DocumentCommonInterface::EditMode::ViewOnly ? commandViewOnly :
editMode == DocumentCommonInterface::EditMode::Selectable ? commandSelectable :
commandEditable;
document.EditMode = editMode;
commandViewOnly.Selected = (command == commandViewOnly);
commandSelectable.Selected = (command == commandSelectable);
commandEditable.Selected = (command == commandEditable);
SetEditModeCommand(command);
self.UpdateSubscriptions();
}
@cpp:Protected
func SelectAlignmentCommand() : ToolstripCommand*
{
var alignment = document.SummarizeParagraphAlignment(document.CaretBegin, document.CaretEnd);
return
alignment == Alignment::Left ? commandAlignLeft :
alignment == Alignment::Center ? commandAlignCenter :
alignment == Alignment::Right ? commandAlignRight :
commandAlignDefault;
}
@cpp:Private
func SetAlignment(alignment : Alignment?) : void
{
document.SetParagraphAlignment(document.CaretBegin, document.CaretEnd, alignment);
self.UpdateSubscriptions();
}
@cpp:Private
prop HasEditableSelection : bool = false {}
@cpp:Private
prop HasEditableSelectionInSingleParagraph : bool = false {}
@cpp:Private
func HasEditableCursor() : bool
{
return document.EditMode == DocumentCommonInterface::EditMode::Editable;
}
@cpp:Private
func HasEditableHyperlink(forEdit : bool) : bool
{
var a = document.CaretBegin;
var b = document.CaretEnd;
return a.row == b.row and a.column != b.column;
}
@cpp:Protected
func GetMenuContainer() : GraphicsComposition*
{
return menuContainer;
}
@cpp:Protected
func GetToolstripContainer() : GraphicsComposition*
{
return toolstripContainer;
}
prop MenuContainer : GraphicsComposition* {GetMenuContainer}
prop ToolstripContainer : GraphicsComposition* {GetToolstripContainer}
]]>
</ref.Members>
<ref.Ctor>
<![CDATA[
{
SetEditMode(Editable);
}
]]>
</ref.Ctor>
<CustomControl ref.Name="self" Text="Document Editor">
<att.HasEditableSelection-bind>document.observe as _(_.CanCut() on _.SelectionChanged)</att.HasEditableSelection-bind>
<MessageDialog ref.Name="dialogMessage" Title="You Clicked a Hyperlink!"/>
<OpenFileDialog ref.Name="dialogOpen" Title="Select an Image" Filter="Image Files (*.jpg;*.png;*.bmp)|*.jpg;*.png;*.bmp" EnabledPreview="true" Options="FileDialogFileMustExist|FileDialogDereferenceLinks"/>
<Table AlignmentToParent="left:0 top:0 right:0 bottom:0">
<att.Rows>
<_>composeType:MinSize</_>
<_>composeType:MinSize</_>
<_>composeType:Percentage percentage:1.0</_>
</att.Rows>
<att.Columns>
<_>composeType:Percentage percentage:1.0</_>
</att.Columns>
<Cell ref.Name="menuContainer" Site="row:0 column:0"/>
<Cell ref.Name="toolstripContainer" Site="row:1 column:0"/>
<Cell Site="row:2 column:0">
<DocumentViewer ref.Name="document" EditMode="Editable" Alt="D">
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0"/>
<ev.ActiveHyperlinkExecuted-eval>
<![CDATA[
{
dialogMessage.Text = document.ActiveHyperlinkReference;
dialogMessage.ShowDialog();
}
]]>
</ev.ActiveHyperlinkExecuted-eval>
</DocumentViewer>
</Cell>
</Table>
<ToolstripCommand ref.Name="commandUndo" Text="Undo" Image-uri="res://ToolbarImages/Undo" LargeImage-uri="res://ToolbarImages/UndoLarge" ShortcutBuilder="Ctrl+Z">
<att.Enabled-bind>document.observe as _(_.CanUndo() on _.UndoRedoChanged)</att.Enabled-bind>
<ev.Executed-eval>
<![CDATA[document.Undo();]]>
</ev.Executed-eval>
</ToolstripCommand>
<ToolstripCommand ref.Name="commandRedo" Text="Redo" Image-uri="res://ToolbarImages/Redo" LargeImage-uri="res://ToolbarImages/RedoLarge" ShortcutBuilder="Ctrl+Y">
<att.Enabled-bind>document.observe as _(_.CanRedo() on _.UndoRedoChanged)</att.Enabled-bind>
<ev.Executed-eval>
<![CDATA[document.Redo();]]>
</ev.Executed-eval>
</ToolstripCommand>
<ToolstripCommand ref.Name="commandCopy" Text="Copy" Image-uri="res://ToolbarImages/Copy" LargeImage-uri="res://ToolbarImages/CopyLarge" ShortcutBuilder="Ctrl+C">
<att.Enabled-bind>document.observe as _(_.CanCopy() on _.SelectionChanged)</att.Enabled-bind>
<ev.Executed-eval>
<![CDATA[document.Copy();]]>
</ev.Executed-eval>
</ToolstripCommand>
<ToolstripCommand ref.Name="commandCut" Text="Cut" Image-uri="res://ToolbarImages/Cut" LargeImage-uri="res://ToolbarImages/CutLarge" ShortcutBuilder="Ctrl+X">
<att.Enabled-bind>self.HasEditableSelection</att.Enabled-bind>
<ev.Executed-eval>
<![CDATA[document.Cut();]]>
</ev.Executed-eval>
</ToolstripCommand>
<ToolstripCommand ref.Name="commandPaste" Text="Paste" Image-uri="res://ToolbarImages/Paste" LargeImage-uri="res://ToolbarImages/PasteLarge" ShortcutBuilder="Ctrl+V">
<att.Enabled-bind>self.observe as _(document.CanPaste() on _.BoundsComposition.clipboardNotify)</att.Enabled-bind>
<ev.Executed-eval>
<![CDATA[document.Paste();]]>
</ev.Executed-eval>
</ToolstripCommand>
<ToolstripCommand ref.Name="commandDelete" Text="Delete" Image-uri="res://ToolbarImages/Delete" LargeImage-uri="res://ToolbarImages/RemoveLinkLarge">
<att.Enabled-bind>self.HasEditableSelection</att.Enabled-bind>
<ev.Executed-eval>
<![CDATA[document.SetSelectionText("");]]>
</ev.Executed-eval>
</ToolstripCommand>
<ToolstripCommand ref.Name="commandSelect" Text="Select All" ShortcutBuilder="Ctrl+A">
<ev.Executed-eval>
<![CDATA[document.SelectAll();]]>
</ev.Executed-eval>
</ToolstripCommand>
<ToolstripCommand ref.Name="commandInsertImage" Text="Insert Image ..." Image-uri="res://ToolbarImages/Image" LargeImage-uri="res://ToolbarImages/ImageLarge">
<att.Enabled-bind>self.HasEditableCursor()</att.Enabled-bind>
<ev.Executed-eval>
<![CDATA[
{
if (dialogOpen.ShowDialog())
{
var imageService = INativeController::GetCurrentController().ImageService();
var image = imageService.CreateImageFromFile(dialogOpen.FileName);
var imageData = new ImageData^(image, 0);
document.EditImage(document.CaretBegin, document.CaretEnd, imageData);
}
}
]]>
</ev.Executed-eval>
</ToolstripCommand>
<ToolstripCommand ref.Name="commandEditHyperlink" Text="Edit Hyperlink ..." Image-uri="res://ToolbarImages/Link" LargeImage-uri="res://ToolbarImages/LinkLarge">
<att.Enabled-bind>document.observe as _(self.HasEditableHyperlink(true) on _.SelectionChanged)</att.Enabled-bind>
<ev.Executed-eval>
<![CDATA[
$Async{
var mainWindow = self.RelatedControlHost as controls::GuiWindow*;
var window = new HyperlinkWindow*();
window.MoveToScreenCenter(mainWindow.RelatedScreen);
$Await window.ShowModalAsync(mainWindow);
if (window.Url is not null)
{
var row = document.CaretBegin.row;
var begin = document.CaretBegin.column;
var end = document.CaretEnd.column;
document.EditHyperlink(row, begin, end, cast string window.Url, "#NormalLink", "#ActiveLink");
}
delete window;
}
]]>
</ev.Executed-eval>
</ToolstripCommand>
<ToolstripCommand ref.Name="commandRemoveHyperlink" Text="Remove Hyperlink" Image-uri="res://ToolbarImages/RemoveLink" LargeImage-uri="res://ToolbarImages/RemoveLinkLarge">
<att.Enabled-bind>document.observe as _(self.HasEditableHyperlink(false) on _.SelectionChanged)</att.Enabled-bind>
<ev.Executed-eval>
<![CDATA[
{
var row = document.CaretBegin.row;
var begin = document.CaretBegin.column;
var end = document.CaretEnd.column;
document.RemoveHyperlink(row, begin, end);
}
]]>
</ev.Executed-eval>
</ToolstripCommand>
<ToolstripCommand ref.Name="commandBold" Text="Bold" Image-uri="res://ToolbarImages/Bold">
<att.Enabled-bind>self.HasEditableSelection</att.Enabled-bind>
<att.Selected-bind>document.observe as _(_.SummarizeStyle(_.CaretBegin, _.CaretEnd).bold == true on _.SelectionChanged, _.ModifiedChanged)</att.Selected-bind>
<ev.Executed-eval>
<![CDATA[
{
var style = new DocumentStyleProperties^();
style.bold = not commandBold.Selected;
document.EditStyle(document.CaretBegin, document.CaretEnd, style);
}
]]>
</ev.Executed-eval>
</ToolstripCommand>
<ToolstripCommand ref.Name="commandItalic" Text="Italic" Image-uri="res://ToolbarImages/Italic">
<att.Enabled-bind>self.HasEditableSelection</att.Enabled-bind>
<att.Selected-bind>document.observe as _(_.SummarizeStyle(_.CaretBegin, _.CaretEnd).italic == true on _.SelectionChanged, _.ModifiedChanged)</att.Selected-bind>
<ev.Executed-eval>
<![CDATA[
{
var style = new DocumentStyleProperties^();
style.italic = not commandItalic.Selected;
document.EditStyle(document.CaretBegin, document.CaretEnd, style);
}
]]>
</ev.Executed-eval>
</ToolstripCommand>
<ToolstripCommand ref.Name="commandUnderline" Text="Underline" Image-uri="res://ToolbarImages/Underline">
<att.Enabled-bind>self.HasEditableSelection</att.Enabled-bind>
<att.Selected-bind>document.observe as _(_.SummarizeStyle(_.CaretBegin, _.CaretEnd).underline == true on _.SelectionChanged, _.ModifiedChanged)</att.Selected-bind>
<ev.Executed-eval>
<![CDATA[
{
var style = new DocumentStyleProperties^();
style.underline = not commandUnderline.Selected;
document.EditStyle(document.CaretBegin, document.CaretEnd, style);
}
]]>
</ev.Executed-eval>
</ToolstripCommand>
<ToolstripCommand ref.Name="commandStrike" Text="Strike" Image-uri="res://ToolbarImages/Strike">
<att.Enabled-bind>self.HasEditableSelection</att.Enabled-bind>
<att.Selected-bind>document.observe as _(_.SummarizeStyle(_.CaretBegin, _.CaretEnd).strikeline == true on _.SelectionChanged, _.ModifiedChanged)</att.Selected-bind>
<ev.Executed-eval>
<![CDATA[
{
var style = new DocumentStyleProperties^();
style.strikeline = not commandStrike.Selected;
document.EditStyle(document.CaretBegin, document.CaretEnd, style);
}
]]>
</ev.Executed-eval>
</ToolstripCommand>
<ColorDialog ref.Name="dialogColor" EnabledCustomColor="false"/>
<FontDialog ref.Name="dialogFont" ShowEffect="false" ShowSelection="true" ForceFontExist="true"/>
<ToolstripCommand ref.Name="commandFont" Text="Set Font ..." Image-uri="res://ToolbarImages/Font">
<att.Enabled-bind>self.HasEditableSelection</att.Enabled-bind>
<ev.Executed-eval>
<![CDATA[
{
var begin = document.CaretBegin;
var end = document.CaretEnd;
var style = document.SummarizeStyle(begin, end);
var baselineFont = document.Font;
dialogFont.SelectedFont =
{
fontFamily: ( style.face is null ? baselineFont.fontFamily : cast string style.face )
size: ( style.size is null ? baselineFont.size : cast int style.size.size )
};
if (dialogFont.ShowDialog())
{
style = new DocumentStyleProperties^();
var selectedFont = dialogFont.SelectedFont;
style.face = selectedFont.fontFamily;
style.size = {size:selectedFont.size relative:false};
document.EditStyle(begin, end, style);
}
}
]]>
</ev.Executed-eval>
</ToolstripCommand>
<ToolstripCommand ref.Name="commandColor" Text="Text Color ..." Image-uri="res://ToolbarImages/Color">
<att.Enabled-bind>self.HasEditableSelection</att.Enabled-bind>
<ev.Executed-eval>
<![CDATA[
{
var begin = document.CaretBegin;
var end = document.CaretEnd;
var selectedColor = document.SummarizeStyle(begin, end).color;
if (selectedColor is null)
{
dialogColor.SelectedColor = cast Color "#000000";
}
else
{
dialogColor.SelectedColor = cast Color selectedColor;
}
if (dialogColor.ShowDialog())
{
var style = new DocumentStyleProperties^();
style.color = dialogColor.SelectedColor;
document.EditStyle(begin, end, style);
}
}
]]>
</ev.Executed-eval>
</ToolstripCommand>
<ToolstripCommand ref.Name="commandBackColor" Text="Background Color ..." Image-uri="res://ToolbarImages/BackColor">
<att.Enabled-bind>self.HasEditableSelection</att.Enabled-bind>
<ev.Executed-eval>
<![CDATA[
{
var begin = document.CaretBegin;
var end = document.CaretEnd;
var selectedColor = document.SummarizeStyle(begin, end).backgroundColor;
if (selectedColor is null)
{
dialogColor.SelectedColor = cast Color "#000000";
}
else
{
dialogColor.SelectedColor = cast Color selectedColor;
}
if (dialogColor.ShowDialog())
{
var style = new DocumentStyleProperties^();
style.backgroundColor = dialogColor.SelectedColor;
document.EditStyle(begin, end, style);
}
}
]]>
</ev.Executed-eval>
</ToolstripCommand>
<ToolstripCommand ref.Name="commandViewOnly" Text="Preview" Image-uri="res://ToolbarImages/ViewOnly" LargeImage-uri="res://ToolbarImages/ViewOnlyLarge" ShortcutBuilder="Ctrl+Shift+P">
<ev.Executed-eval>
<![CDATA[self.SetEditMode(ViewOnly);]]>
</ev.Executed-eval>
</ToolstripCommand>
<ToolstripCommand ref.Name="commandSelectable" Text="Selectable" Image-uri="res://ToolbarImages/Selectable" LargeImage-uri="res://ToolbarImages/SelectableLarge" ShortcutBuilder="Ctrl+Shift+S">
<ev.Executed-eval>
<![CDATA[self.SetEditMode(Selectable);]]>
</ev.Executed-eval>
</ToolstripCommand>
<ToolstripCommand ref.Name="commandEditable" Text="Editable" Image-uri="res://ToolbarImages/Editable" LargeImage-uri="res://ToolbarImages/EditableLarge" ShortcutBuilder="Ctrl+Shift+E">
<ev.Executed-eval>
<![CDATA[self.SetEditMode(Editable);]]>
</ev.Executed-eval>
</ToolstripCommand>
<ToolstripCommand ref.Name="commandAlignDefault" Text="Set Alignment to Default (Left)" Image-uri="res://ToolbarImages/TextAlign">
<att.Enabled-bind>self.HasEditableCursor()</att.Enabled-bind>
<ev.Executed-eval>
<![CDATA[self.SetAlignment(null);]]>
</ev.Executed-eval>
</ToolstripCommand>
<ToolstripCommand ref.Name="commandAlignLeft" Text="Left" Image-uri="res://ToolbarImages/TextAlignLeft" LargeImage-uri="res://ToolbarImages/TextAlignLeftLarge">
<att.Enabled-bind>self.HasEditableCursor()</att.Enabled-bind>
<att.Selected-bind>document.observe as _(self.SelectAlignmentCommand() == commandAlignLeft on _.SelectionChanged)</att.Selected-bind>
<ev.Executed-eval>
<![CDATA[self.SetAlignment(Left);]]>
</ev.Executed-eval>
</ToolstripCommand>
<ToolstripCommand ref.Name="commandAlignCenter" Text="Center" Image-uri="res://ToolbarImages/TextAlignCenter" LargeImage-uri="res://ToolbarImages/TextAlignCenterLarge">
<att.Enabled-bind>self.HasEditableCursor()</att.Enabled-bind>
<att.Selected-bind>document.observe as _(self.SelectAlignmentCommand() == commandAlignCenter on _.SelectionChanged)</att.Selected-bind>
<ev.Executed-eval>
<![CDATA[self.SetAlignment(Center);]]>
</ev.Executed-eval>
</ToolstripCommand>
<ToolstripCommand ref.Name="commandAlignRight" Text="Right" Image-uri="res://ToolbarImages/TextAlignRight" LargeImage-uri="res://ToolbarImages/TextAlignRightLarge">
<att.Enabled-bind>self.HasEditableCursor()</att.Enabled-bind>
<att.Selected-bind>document.observe as _(self.SelectAlignmentCommand() == commandAlignRight on _.SelectionChanged)</att.Selected-bind>
<ev.Executed-eval>
<![CDATA[self.SetAlignment(Right);]]>
</ev.Executed-eval>
</ToolstripCommand>
</CustomControl>
</Instance>
</Instance>
</Folder>
@@ -0,0 +1,361 @@
<Folder>
<Script name="RibbonScript">
<Workflow>
<![CDATA[
module ribbonscript;
using presentation::*;
namespace demo
{
class StyleItem
{
var Name : string = "";
var Style : DocumentStyle^ = null;
new (name : string, size : DocumentFontSize?, color : Color?, bold : bool?, italic : bool?, underline : bool?, strikeline : bool?)
{
Name = name;
Style = new DocumentStyle^();
Style.parentStyleName = "#Context";
Style.styles = new DocumentStyleProperties^();
Style.styles.size = size;
Style.styles.color = color;
Style.styles.bold = bold;
Style.styles.italic = italic;
Style.styles.underline = underline;
Style.styles.strikeline = strikeline;
}
}
class StyleGroup
{
var Name : string = "";
var Items : observe StyleItem^[] = {};
}
}
]]>
</Workflow>
</Script>
<Instance name="StyleItemTemplateResource">
<Instance ref.CodeBehind="false" ref.Class="demo::StyleItemTemplate">
<ref.Parameter Name="ViewModel" Class="demo::StyleItem"/>
<ref.Ctor>
<![CDATA[
{
var styles = ViewModel.Style.styles;
if (styles.color is not null) { styleLabel.Color = cast Color styles.color; }
var font = containerControl.Font;
var fontFamily = font.fontFamily;
var bold = font.bold;
var italic = font.italic;
var underline = font.underline;
var strikeline = font.strikeline;
var size = font.size;
if (styles.face is not null) { fontFamily = cast string styles.face; }
if (styles.bold is not null) { bold = cast bool styles.bold; }
if (styles.italic is not null) { italic = cast bool styles.italic; }
if (styles.underline is not null) { underline = cast bool styles.underline; }
if (styles.strikeline is not null) { strikeline = cast bool styles.strikeline; }
if(styles.size is not null)
{
var dsize = styles.size;
if (dsize.relative)
{
size = cast int Math::Round(dsize.size * font.size);
}
else
{
size = cast int Math::Round(dsize.size);
}
}
styleLabel.Font = {
fontFamily : fontFamily
size : size
bold : bold
italic : italic
underline : underline
strikeline : strikeline
antialias : font.antialias
verticalAntialias : font.verticalAntialias
};
}
]]>
</ref.Ctor>
<TextListItemTemplate ref.Name="self" MinSizeLimitation="LimitToElementAndChildren" PreferredMinSize="x:72">
<CustomControl ref.Name="containerControl">
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0"/>
<Table AlignmentToParent="left:0 top:0 right:0 bottom:0" MinSizeLimitation="LimitToElementAndChildren" CellPadding="5">
<att.Rows>
<_>composeType:Percentage percentage:1.0</_>
<_>composeType:MinSize</_>
</att.Rows>
<att.Columns>
<_>composeType:Percentage percentage:1.0</_>
</att.Columns>
<Cell Site="row:0 column:0">
<SolidLabel ref.Name="styleLabel" Text="AaBbCc" Ellipse="true" Color="#FFFFFF" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Cell>
<Cell Site="row:1 column:0">
<SolidLabel Text-bind="ViewModel.Name" Font-eval="containerControl.Font" Ellipse="true" HorizontalAlignment="Center">
<att.Color-bind>
<![CDATA[cast Color (self.Selected ? "#FFFFFF" : "#808080")]]>
</att.Color-bind>
</SolidLabel>
</Cell>
</Table>
<att.TooltipControl>
<CustomControl>
<Bounds AlignmentToParent="left:5 top:5 right:5 bottom:5" MinSizeLimitation="LimitToElementAndChildren">
<SolidLabel Text-bind="ViewModel.Name" Color="#FFFFFF" Font-eval="containerControl.Font"/>
</Bounds>
</CustomControl>
</att.TooltipControl>
</CustomControl>
</TextListItemTemplate>
</Instance>
</Instance>
<Instance name="DocumentEditorRibbonResource">
<Instance ref.CodeBehind="false" ref.Class="demo::DocumentEditorRibbon" xmlns:demo="demo::*">
<ref.Members>
<![CDATA[
@cpp:Private
prop AlignLeftSelected : bool = true {}
@cpp:Private
prop AlignCenterSelected : bool = true {}
@cpp:Private
prop AlignRightSelected : bool = true {}
@cpp:Private
prop StyleGroups : demo::StyleGroup^[] = null {}
@cpp:Private
func GenerateStyleGroups(): demo::StyleGroup^[]
{
var group1 = new StyleGroup^();
group1.Name = "Headers";
group1.Items.Add(new StyleItem^("Header 1", {size:2 relative:true}, (cast Color "#FF8000"), null, null, null, null));
group1.Items.Add(new StyleItem^("Header 2", {size:1.6 relative:true}, (cast Color "#FF8000"), null, null, null, null));
group1.Items.Add(new StyleItem^("Header 3", {size:1.3 relative:true}, null, null, null, null, null));
var group2 = new StyleGroup^();
group2.Name = "Content";
group2.Items.Add(new StyleItem^("Strong", null, null, true, null, null, null));
group2.Items.Add(new StyleItem^("Quote", null, null, null, true, null, null));
group2.Items.Add(new StyleItem^("Emphasis", null, null, null, true, true, null));
group2.Items.Add(new StyleItem^("Intense Emphasis", null, (cast Color "#8080FF"), null, true, true, null));
group2.Items.Add(new StyleItem^("Deleted", null, null, null, null, null, true));
var styles = document.Document.styles;
for (styleItem in group1.Items)
{
styles.Set(styleItem.Name, styleItem.Style);
}
for (styleItem in group2.Items)
{
styles.Set(styleItem.Name, styleItem.Style);
}
return {group1 group2};
}
@cpp:Private
func SelectStyleName(styleName : string?): void
{
if (styleName is not null)
{
for (groupIndex in range[0, StyleGroups.Count))
{
var group = StyleGroups[groupIndex];
for (itemIndex in range[0, group.Items.Count))
{
if (group.Items[itemIndex].Name == cast string styleName)
{
styleGallery.SelectItem(styleGallery.GalleryPosToIndex({group:groupIndex item:itemIndex}));
return;
}
}
}
}
styleGallery.SelectItem(-1);
}
]]>
</ref.Members>
<ref.Ctor>
<![CDATA[
{
StyleGroups = GenerateStyleGroups();
attach(document.SelectionChanged, func(sender: GuiGraphicsComposition*, arguments: GuiEventArgs*): void
{
SelectStyleName(document.SummarizeStyleName(document.CaretBegin, document.CaretEnd));
});
}
]]>
</ref.Ctor>
<demo:DocumentEditorBase ref.Name="self" Text="Document Editor (Ribbon)">
<att.AlignLeftSelected-bind>self.document.observe as _(self.SelectAlignmentCommand() == self.commandAlignLeft on _.SelectionChanged)</att.AlignLeftSelected-bind>
<att.AlignCenterSelected-bind>self.document.observe as _(self.SelectAlignmentCommand() == self.commandAlignCenter on _.SelectionChanged)</att.AlignCenterSelected-bind>
<att.AlignRightSelected-bind>self.document.observe as _(self.SelectAlignmentCommand() == self.commandAlignRight on _.SelectionChanged)</att.AlignRightSelected-bind>
<MessageDialog ref.Name="dialogMessage" Title="You Expanded a Group!" Text="GuiRibbonGroup::ExpandButtonClicked is executed!"/>
<att.MenuContainer-set>
<RibbonTab>
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0"/>
<att.BeforeHeaders-set>
<Button Text=" HOME ">
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0"/>
</Button>
</att.BeforeHeaders-set>
<att.AfterHeaders-set>
<Button Text=" WHATEVER ">
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0"/>
</Button>
</att.AfterHeaders-set>
<att.Pages>
<RibbonTabPage Text="Edit">
<att.ContainerComposition-set PreferredMinSize="y:110"/>
<att.Groups>
<RibbonGroup Text="Alignment" Expandable="true" LargeImage-uri="res://ToolbarImages/EditableLarge">
<ev.ExpandButtonClicked-eval>
<![CDATA[
{
dialogMessage.ShowDialog();
}
]]>
</ev.ExpandButtonClicked-eval>
<att.Items>
<RibbonLargeDropdownButton Text="Edit Mode">
<att.LargeImage-bind>self.EditModeCommand.LargeImage ?? null</att.LargeImage-bind>
<att.SubMenu-set>
<MenuItemButton Command-eval="self.commandViewOnly" Alt="V"/>
<MenuItemButton Command-eval="self.commandSelectable" Alt="S"/>
<MenuItemButton Command-eval="self.commandEditable" Alt="E"/>
</att.SubMenu-set>
</RibbonLargeDropdownButton>
<RibbonSplitter/>
<RibbonButtons MaxSize="Large" MinSize="Icon">
<att.Buttons>
<ToolstripButton Command-eval="self.commandAlignLeft" Selected-bind="self.AlignLeftSelected"/>
<ToolstripButton Command-eval="self.commandAlignCenter" Selected-bind="self.AlignCenterSelected"/>
<ToolstripButton Command-eval="self.commandAlignRight" Selected-bind="self.AlignRightSelected"/>
</att.Buttons>
</RibbonButtons>
</att.Items>
</RibbonGroup>
<RibbonGroup Text="Edit" LargeImage-uri="res://ToolbarImages/PasteLarge">
<att.Items>
<RibbonButtons MaxSize="Large" MinSize="Icon">
<att.Buttons>
<ToolstripButton Command-eval="self.commandUndo"/>
<ToolstripButton Command-eval="self.commandRedo"/>
</att.Buttons>
</RibbonButtons>
<RibbonSplitter/>
<RibbonButtons MaxSize="Large" MinSize="Icon">
<att.Buttons>
<ToolstripButton Command-eval="self.commandCopy"/>
<ToolstripButton Command-eval="self.commandCut"/>
<ToolstripButton Command-eval="self.commandPaste"/>
</att.Buttons>
</RibbonButtons>
<RibbonSplitter/>
<RibbonLargeButton Command-eval="self.commandDelete"/>
</att.Items>
</RibbonGroup>
<RibbonGroup Text="Text">
<att.Items>
<RibbonToolstrips>
<att.Groups>
<ToolstripGroup>
<ToolstripButton Command-eval="self.commandBold"/>
<ToolstripButton Command-eval="self.commandItalic"/>
</ToolstripGroup>
<ToolstripGroup>
<ToolstripButton Command-eval="self.commandUnderline"/>
<ToolstripButton Command-eval="self.commandStrike"/>
</ToolstripGroup>
<ToolstripGroup>
<ToolstripButton Command-eval="self.commandFont"/>
<ToolstripButton Command-eval="self.commandColor"/>
<ToolstripButton Command-eval="self.commandBackColor"/>
</ToolstripGroup>
<ToolstripGroup>
<ToolstripButton Command-eval="self.commandEditHyperlink"/>
<ToolstripButton Command-eval="self.commandRemoveHyperlink"/>
</ToolstripGroup>
</att.Groups>
</RibbonToolstrips>
</att.Items>
</RibbonGroup>
<RibbonGroup Text="Style" LargeImage-uri="res://ToolbarImages/EditableLarge">
<att.Items>
<BindableRibbonGalleryList ref.Name="styleGallery" ItemTemplate="demo:StyleItemTemplate" MinCount="2" MaxCount="5" VisibleItemCount="5" env.ItemType="demo::StyleGroup^">
<att.ItemSource-bind>self.StyleGroups</att.ItemSource-bind>
<att.GroupTitleProperty>Name</att.GroupTitleProperty>
<att.GroupChildrenProperty>Items</att.GroupChildrenProperty>
<att.SubMenu-set>
<RibbonToolstripHeader Text="Header A"/>
<MenuItemButton Text="Item A1"/>
<MenuItemButton Text="Item A2"/>
<MenuItemButton Text="Item A3"/>
<RibbonToolstripHeader Text="Header B"/>
<MenuItemButton Text="Item B1"/>
<MenuItemButton Text="Item B2"/>
<MenuItemButton Text="Item B3"/>
</att.SubMenu-set>
<ev.ItemApplied-eval>
<![CDATA[
{
if (arguments.itemIndex != -1)
{
var pos = styleGallery.IndexToGalleryPos(arguments.itemIndex);
self.document.ClearStyle(self.document.CaretBegin, self.document.CaretEnd);
self.document.EditStyleName(self.document.CaretBegin, self.document.CaretEnd, self.StyleGroups[pos.group].Items[pos.item].Name);
}
}
]]>
</ev.ItemApplied-eval>
</BindableRibbonGalleryList>
</att.Items>
</RibbonGroup>
</att.Groups>
</RibbonTabPage>
<RibbonTabPage Text="Insert" Highlighted="true">
<att.Groups>
<RibbonGroup Text="Object">
<att.Items>
<RibbonButtons MaxSize="Large" MinSize="Small">
<att.Buttons>
<ToolstripButton Command-eval="self.commandInsertImage"/>
<ToolstripButton Command-eval="self.commandEditHyperlink"/>
<ToolstripButton Command-eval="self.commandRemoveHyperlink"/>
</att.Buttons>
</RibbonButtons>
</att.Items>
</RibbonGroup>
</att.Groups>
</RibbonTabPage>
</att.Pages>
</RibbonTab>
</att.MenuContainer-set>
</demo:DocumentEditorBase>
</Instance>
</Instance>
</Folder>
@@ -0,0 +1,107 @@
<Folder>
<Instance name="DocumentEditorToolstripResource">
<Instance ref.CodeBehind="false" ref.Class="demo::DocumentEditorToolstrip" xmlns:demo="demo::*">
<demo:DocumentEditorBase ref.Name="self" Text="Document Editor (Toolstrip)">
<att.MenuContainer-set>
<ToolstripMenuBar>
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0"/>
<MenuBarButton Text="Edit" Alt="E">
<att.SubMenu-set>
<ToolstripGroupContainer>
<ToolstripGroup>
<MenuItemButton Command-eval="self.commandUndo" Alt="U"/>
<MenuItemButton Command-eval="self.commandRedo" Alt="R"/>
</ToolstripGroup>
<ToolstripGroup>
<MenuItemButton Command-eval="self.commandCopy" Alt="C"/>
<MenuItemButton Command-eval="self.commandCut" Alt="X"/>
<MenuItemButton Command-eval="self.commandPaste" Alt="P"/>
</ToolstripGroup>
<MenuItemButton Command-eval="self.commandDelete" Alt="D"/>
<ToolstripGroup>
<MenuItemButton Command-eval="self.commandSelect" Alt="A"/>
<MenuItemButton Text="Object" Alt="O">
<att.SubMenu-set>
<MenuItemButton Command-eval="self.commandInsertImage" Alt="I"/>
<MenuItemButton Command-eval="self.commandEditHyperlink" Alt="L"/>
<MenuItemButton Command-eval="self.commandRemoveHyperlink" Alt="R"/>
</att.SubMenu-set>
</MenuItemButton>
<MenuItemButton Text="Paragram Alignment" Alt="P">
<att.SubMenu-set>
<MenuItemButton Command-eval="self.commandAlignDefault" Alt="D"/>
<MenuItemButton Command-eval="self.commandAlignLeft" Alt="L"/>
<MenuItemButton Command-eval="self.commandAlignCenter" Alt="C"/>
<MenuItemButton Command-eval="self.commandAlignRight" Alt="R"/>
</att.SubMenu-set>
</MenuItemButton>
</ToolstripGroup>
</ToolstripGroupContainer>
</att.SubMenu-set>
</MenuBarButton>
<MenuBarButton Text="View" Alt="V">
<att.SubMenu-set>
<MenuItemButton Command-eval="self.commandViewOnly" Alt="V"/>
<MenuItemButton Command-eval="self.commandSelectable" Alt="S"/>
<MenuItemButton Command-eval="self.commandEditable" Alt="E"/>
</att.SubMenu-set>
</MenuBarButton>
</ToolstripMenuBar>
</att.MenuContainer-set>
<att.ToolstripContainer-set>
<ToolstripToolBar>
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0"/>
<ToolstripGroupContainer>
<ToolstripGroup>
<ToolstripDropdownButton Alt="V">
<att.Image-bind>self.EditModeCommand.Image ?? null</att.Image-bind>
<att.SubMenu-set>
<MenuItemButton Command-eval="self.commandViewOnly" Alt="V"/>
<MenuItemButton Command-eval="self.commandSelectable" Alt="S"/>
<MenuItemButton Command-eval="self.commandEditable" Alt="E"/>
</att.SubMenu-set>
</ToolstripDropdownButton>
<ToolstripDropdownButton ref.Name="buttonAlignment" Alt="P">
<att.Image-bind>self.document.observe as _(self.SelectAlignmentCommand().Image on _.SelectionChanged)</att.Image-bind>
<att.SubMenu-set>
<MenuItemButton Command-eval="self.commandAlignDefault" Alt="D"/>
<MenuItemButton Command-eval="self.commandAlignLeft" Alt="L"/>
<MenuItemButton Command-eval="self.commandAlignCenter" Alt="C"/>
<MenuItemButton Command-eval="self.commandAlignRight" Alt="R"/>
</att.SubMenu-set>
</ToolstripDropdownButton>
</ToolstripGroup>
<ToolstripGroup>
<ToolstripButton Command-eval="self.commandUndo" Alt="U"/>
<ToolstripButton Command-eval="self.commandRedo" Alt="R"/>
</ToolstripGroup>
<ToolstripGroup>
<ToolstripButton Command-eval="self.commandCopy" Alt="C"/>
<ToolstripButton Command-eval="self.commandCut" Alt="X"/>
<ToolstripButton Command-eval="self.commandPaste" Alt="P"/>
</ToolstripGroup>
<ToolstripButton Command-eval="self.commandDelete" Alt="D"/>
<ToolstripGroup>
<ToolstripSplitButton Command-eval="self.commandInsertImage" Alt="I">
<att.SubMenu-set>
<MenuItemButton Command-eval="self.commandInsertImage" Alt="I"/>
<MenuItemButton Command-eval="self.commandEditHyperlink" Alt="L"/>
<MenuItemButton Command-eval="self.commandRemoveHyperlink" Alt="R"/>
</att.SubMenu-set>
</ToolstripSplitButton>
<ToolstripButton Command-eval="self.commandBold" Alt="B"/>
<ToolstripButton Command-eval="self.commandItalic" Alt="I"/>
<ToolstripButton Command-eval="self.commandUnderline" Alt="U"/>
<ToolstripButton Command-eval="self.commandStrike" Alt="S"/>
<ToolstripButton Command-eval="self.commandFont" Alt="F"/>
<ToolstripButton Command-eval="self.commandColor" Alt="C"/>
<ToolstripButton Command-eval="self.commandBackColor" Alt="K"/>
</ToolstripGroup>
</ToolstripGroupContainer>
</ToolstripToolBar>
</att.ToolstripContainer-set>
</demo:DocumentEditorBase>
</Instance>
</Instance>
</Folder>
@@ -1,74 +0,0 @@
<Instance ref.CodeBehind="false" ref.Class="demo::HyperlinkWindow">
<ref.Members>
<![CDATA[
prop Url : string? = null {}
]]>
</ref.Members>
<Window ref.Name="self" Text="Hyperlink" ClientSize="x:320 y:80" SizeBox="false" MinimizedBox="false" MaximizedBox="false" ShowInTaskBar="false">
<att.BoundsComposition-set PreferredMinSize="x:320 y:80"/>
<Table CellPadding="5" BorderVisible="true" AlignmentToParent="left:0 top:0 right:0 bottom:0">
<att.Rows>
<_>composeType:MinSize</_>
<_>composeType:Percentage percentage:1.0</_>
<_>composeType:MinSize</_>
</att.Rows>
<att.Columns>
<_>composeType:MinSize</_>
<_>composeType:Percentage percentage:1.0</_>
<_>composeType:MinSize</_>
<_>composeType:MinSize</_>
</att.Columns>
<Cell Site="row:0 column:0">
<Table AlignmentToParent="left:0 top:0 right:0 bottom:0" MinSizeLimitation="LimitToElementAndChildren">
<att.Rows>
<_>composeType:Percentage percentage:0.5</_>
<_>composeType:MinSize</_>
<_>composeType:Percentage percentage:0.5</_>
</att.Rows>
<att.Columns>
<_>composeType:Percentage percentage:1.0</_>
</att.Columns>
<Cell Site="row:1 column:0">
<Label Text="Url: "/>
</Cell>
</Table>
</Cell>
<Cell Site="row:0 column:1 columnSpan:3">
<SinglelineTextBox ref.Name="textUrl">
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0"/>
</SinglelineTextBox>
</Cell>
<Cell Site="row:2 column:2">
<Button Text="OK">
<att.BoundsComposition-set PreferredMinSize="x:100"/>
<ev.Clicked-eval>
<![CDATA[
{
self.Url = textUrl.Text;
self.Close();
}
]]>
</ev.Clicked-eval>
</Button>
</Cell>
<Cell Site="row:2 column:3">
<Button Text="Cancel">
<att.BoundsComposition-set PreferredMinSize="x:100"/>
<ev.Clicked-eval>
<![CDATA[
{
self.Url = null;
self.Close();
}
]]>
</ev.Clicked-eval>
</Button>
</Cell>
</Table>
</Window>
</Instance>
@@ -57,8 +57,28 @@
</Instance>
<Folder name="ToolbarImages" content="Link">ToolbarImages/Images.xml</Folder>
<Instance name="DocumentEditorWindowBaseResource" content="File">Base.xml</Instance>
<Instance name="DocumentEditorToolstripWindowResource" content="File">Toolstrip.xml</Instance>
<Folder name="DocumentEditorRibbonWindowResource" content="Link">Ribbon.xml</Folder>
<Instance name="HyperlinkWindowResource" content="File">Hyperlink.xml</Instance>
<Folder name="DocumentComponents" content="Link">DocumentComponents.xml</Folder>
<Folder name="DocumentEditorBase" content="Link">DocumentEditorBase.xml</Folder>
<Folder name="DocumentEditorRibbon" content="Link">DocumentEditorRibbon.xml</Folder>
<Folder name="DocumentEditorToolstrip" content="Link">DocumentEditorToolstrip.xml</Folder>
<Instance name="DocumentEditorRibbonWindowResource">
<Instance ref.CodeBehind="false" ref.Class="demo::DocumentEditorRibbonWindow" xmlns:demo="demo::*">
<Window Text-bind="editor.Text" ClientSize="x:800 y:600">
<demo:DocumentEditorRibbon ref.Name="editor">
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0"/>
</demo:DocumentEditorRibbon>
</Window>
</Instance>
</Instance>
<Instance name="DocumentEditorToolstripWindowResource">
<Instance ref.CodeBehind="false" ref.Class="demo::DocumentEditorToolstripWindow" xmlns:demo="demo::*">
<Window Text-bind="editor.Text" ClientSize="x:800 y:600">
<demo:DocumentEditorToolstrip ref.Name="editor">
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0"/>
</demo:DocumentEditorToolstrip>
</Window>
</Instance>
</Instance>
</Resource>
@@ -1,214 +0,0 @@
<Folder>
<Script name="RibbonScript">
<Workflow>
<![CDATA[
module ribbonscript;
namespace demo
{
class StyleItem
{
new(value : string)
{
Value = value;
}
prop Value : string = 0 {not observe}
}
class StyleGroup
{
prop Name : string = "" {}
prop Items : observe StyleItem^[] = {} {const, not observe}
}
}
]]>
</Workflow>
</Script>
<Instance name="StyleItemTemplateResource">
<Instance ref.CodeBehind="false" ref.Class="demo::StyleItemTemplate">
<ref.Parameter Name="ViewModel" Class="demo::StyleItem"/>
<TextListItemTemplate MinSizeLimitation="LimitToElementAndChildren" PreferredMinSize="x:64">
<SolidLabel Text-bind="ViewModel.Value" Color="#FF8000" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</TextListItemTemplate>
</Instance>
</Instance>
<Instance name="DocumentEditorRibbonWindowResource">
<Instance ref.CodeBehind="false" ref.Class="demo::DocumentEditorRibbonWindow" xmlns:demo="demo::*">
<ref.Members>
<![CDATA[
@cpp:Private
prop AlignLeftSelected : bool = true {}
@cpp:Private
prop AlignCenterSelected : bool = true {}
@cpp:Private
prop AlignRightSelected : bool = true {}
@cpp:Private
func GetStyleGroups(): demo::StyleGroup^[]
{
var group1 = new StyleGroup^();
group1.Name = "Group A";
for (i in range [1, 5])
{
group1.Items.Add(new StyleItem^("A" & i));
}
var group2 = new StyleGroup^();
group2.Name = "Group B";
for (i in range [1, 5])
{
group2.Items.Add(new StyleItem^("B" & i));
}
return {group1 group2};
}
]]>
</ref.Members>
<demo:DocumentEditorWindowBase ref.Name="self" Text="Document Editor (Ribbon)">
<att.AlignLeftSelected-bind>self.document.observe as _(self.SelectAlignmentCommand() == self.commandAlignLeft on _.SelectionChanged)</att.AlignLeftSelected-bind>
<att.AlignCenterSelected-bind>self.document.observe as _(self.SelectAlignmentCommand() == self.commandAlignCenter on _.SelectionChanged)</att.AlignCenterSelected-bind>
<att.AlignRightSelected-bind>self.document.observe as _(self.SelectAlignmentCommand() == self.commandAlignRight on _.SelectionChanged)</att.AlignRightSelected-bind>
<att.MenuContainer-set>
<RibbonTab>
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0"/>
<att.BeforeHeaders-set>
<Button Text="HOME">
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0" PreferredMinSize="x:80"/>
</Button>
</att.BeforeHeaders-set>
<att.AfterHeaders-set>
<Stack Direction="Horizontal" AlignmentToParent="left:0 top:-1 right:0 bottom:0" MinSizeLimitation="LimitToElementAndChildren">
<StackItem InternalMargin="left:0 top:0 right:10 bottom:0">
<SolidLabel Font-bind="self.Font" Color="#FFFFFF" Text="Search:" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</StackItem>
<StackItem>
<SinglelineTextBox>
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:1" PreferredMinSize="x:180"/>
</SinglelineTextBox>
</StackItem>
</Stack>
</att.AfterHeaders-set>
<att.Pages>
<RibbonTabPage Text="Edit">
<att.ContainerComposition-set PreferredMinSize="y:110"/>
<att.Groups>
<RibbonGroup Text="Alignment">
<att.Items>
<RibbonLargeDropdownButton Text="Edit Mode">
<att.LargeImage-bind>self.EditModeCommand.LargeImage ?? null</att.LargeImage-bind>
<att.SubMenu-set>
<MenuItemButton Command-eval="self.commandViewOnly" Alt="V"/>
<MenuItemButton Command-eval="self.commandSelectable" Alt="S"/>
<MenuItemButton Command-eval="self.commandEditable" Alt="E"/>
</att.SubMenu-set>
</RibbonLargeDropdownButton>
<RibbonSplitter/>
<RibbonButtons MaxSize="Large" MinSize="Icon">
<att.Buttons>
<ToolstripButton Command-eval="self.commandAlignLeft" Selected-bind="self.AlignLeftSelected"/>
<ToolstripButton Command-eval="self.commandAlignCenter" Selected-bind="self.AlignCenterSelected"/>
<ToolstripButton Command-eval="self.commandAlignRight" Selected-bind="self.AlignRightSelected"/>
</att.Buttons>
</RibbonButtons>
</att.Items>
</RibbonGroup>
<RibbonGroup Text="Edit">
<att.Items>
<RibbonButtons MaxSize="Large" MinSize="Icon">
<att.Buttons>
<ToolstripButton Command-eval="self.commandUndo"/>
<ToolstripButton Command-eval="self.commandRedo"/>
</att.Buttons>
</RibbonButtons>
<RibbonSplitter/>
<RibbonButtons MaxSize="Large" MinSize="Icon">
<att.Buttons>
<ToolstripButton Command-eval="self.commandCopy"/>
<ToolstripButton Command-eval="self.commandCut"/>
<ToolstripButton Command-eval="self.commandPaste"/>
</att.Buttons>
</RibbonButtons>
<RibbonSplitter/>
<RibbonLargeButton Command-eval="self.commandDelete"/>
</att.Items>
</RibbonGroup>
<RibbonGroup Text="Text">
<att.Items>
<RibbonToolstrips>
<att.Groups>
<ToolstripGroup>
<ToolstripButton Command-eval="self.commandBold"/>
<ToolstripButton Command-eval="self.commandItalic"/>
</ToolstripGroup>
<ToolstripGroup>
<ToolstripButton Command-eval="self.commandUnderline"/>
<ToolstripButton Command-eval="self.commandStrike"/>
</ToolstripGroup>
<ToolstripGroup>
<ToolstripButton Command-eval="self.commandFont"/>
<ToolstripButton Command-eval="self.commandColor"/>
<ToolstripButton Command-eval="self.commandBackColor"/>
</ToolstripGroup>
<ToolstripGroup>
<ToolstripButton Command-eval="self.commandEditHyperlink"/>
<ToolstripButton Command-eval="self.commandRemoveHyperlink"/>
</ToolstripGroup>
</att.Groups>
</RibbonToolstrips>
</att.Items>
</RibbonGroup>
<RibbonGroup Text="Style">
<att.Items>
<BindableRibbonGalleryList ItemTemplate="demo:StyleItemTemplate" MinCount="2" MaxCount="5" env.ItemType="demo::StyleGroup^">
<att.ItemSource-eval>self.GetStyleGroups()</att.ItemSource-eval>
<att.GroupTitleProperty>Name</att.GroupTitleProperty>
<att.GroupChildrenProperty>Items</att.GroupChildrenProperty>
<att.SubMenu-set>
<RibbonToolstripHeader Text="Header A"/>
<MenuItemButton Text="Item A1"/>
<MenuItemButton Text="Item A2"/>
<MenuItemButton Text="Item A3"/>
<RibbonToolstripHeader Text="Header B"/>
<MenuItemButton Text="Item B1"/>
<MenuItemButton Text="Item B2"/>
<MenuItemButton Text="Item B3"/>
</att.SubMenu-set>
</BindableRibbonGalleryList>
</att.Items>
</RibbonGroup>
</att.Groups>
</RibbonTabPage>
<RibbonTabPage Text="Insert" Highlighted="true">
<att.Groups>
<RibbonGroup Text="Object">
<att.Items>
<RibbonButtons MaxSize="Large" MinSize="Small">
<att.Buttons>
<ToolstripButton Command-eval="self.commandInsertImage"/>
<ToolstripButton Command-eval="self.commandEditHyperlink"/>
<ToolstripButton Command-eval="self.commandRemoveHyperlink"/>
</att.Buttons>
</RibbonButtons>
</att.Items>
</RibbonGroup>
</att.Groups>
</RibbonTabPage>
</att.Pages>
</RibbonTab>
</att.MenuContainer-set>
</demo:DocumentEditorWindowBase>
</Instance>
</Instance>
</Folder>
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -31,12 +31,16 @@ namespace vl
namespace description
{
#ifndef VCZH_DEBUG_NO_REFLECTION
IMPL_CPP_TYPE_INFO(demo::DocumentEditorBase)
IMPL_CPP_TYPE_INFO(demo::DocumentEditorBaseConstructor)
IMPL_CPP_TYPE_INFO(demo::DocumentEditorRibbon)
IMPL_CPP_TYPE_INFO(demo::DocumentEditorRibbonConstructor)
IMPL_CPP_TYPE_INFO(demo::DocumentEditorRibbonWindow)
IMPL_CPP_TYPE_INFO(demo::DocumentEditorRibbonWindowConstructor)
IMPL_CPP_TYPE_INFO(demo::DocumentEditorToolstrip)
IMPL_CPP_TYPE_INFO(demo::DocumentEditorToolstripConstructor)
IMPL_CPP_TYPE_INFO(demo::DocumentEditorToolstripWindow)
IMPL_CPP_TYPE_INFO(demo::DocumentEditorToolstripWindowConstructor)
IMPL_CPP_TYPE_INFO(demo::DocumentEditorWindowBase)
IMPL_CPP_TYPE_INFO(demo::DocumentEditorWindowBaseConstructor)
IMPL_CPP_TYPE_INFO(demo::HyperlinkWindow)
IMPL_CPP_TYPE_INFO(demo::HyperlinkWindowConstructor)
IMPL_CPP_TYPE_INFO(demo::MainWindow)
@@ -47,32 +51,111 @@ namespace vl
IMPL_CPP_TYPE_INFO(demo::StyleItemTemplateConstructor)
#define _ ,
BEGIN_CLASS_MEMBER(::demo::DocumentEditorRibbonWindow)
CLASS_MEMBER_BASE(::demo::DocumentEditorWindowBase)
CLASS_MEMBER_BASE(::demo::DocumentEditorRibbonWindowConstructor)
CLASS_MEMBER_CONSTRUCTOR(::demo::DocumentEditorRibbonWindow*(), NO_PARAMETER)
BEGIN_CLASS_MEMBER(::demo::DocumentEditorBase)
CLASS_MEMBER_BASE(::vl::presentation::controls::GuiCustomControl)
CLASS_MEMBER_BASE(::demo::DocumentEditorBaseConstructor)
CLASS_MEMBER_CONSTRUCTOR(::demo::DocumentEditorBase*(), NO_PARAMETER)
CLASS_MEMBER_METHOD(__vwsn_instance_ctor_, NO_PARAMETER)
CLASS_MEMBER_METHOD(GetEditModeCommand, NO_PARAMETER)
CLASS_MEMBER_METHOD(GetHasEditableSelection, NO_PARAMETER)
CLASS_MEMBER_METHOD(GetHasEditableSelectionInSingleParagraph, NO_PARAMETER)
CLASS_MEMBER_METHOD(GetMenuContainer, NO_PARAMETER)
CLASS_MEMBER_METHOD(GetToolstripContainer, NO_PARAMETER)
CLASS_MEMBER_METHOD(HasEditableCursor, NO_PARAMETER)
CLASS_MEMBER_METHOD(HasEditableHyperlink, { L"forEdit" })
CLASS_MEMBER_METHOD(SelectAlignmentCommand, NO_PARAMETER)
CLASS_MEMBER_METHOD(SetAlignment, { L"alignment" })
CLASS_MEMBER_METHOD(SetEditMode, { L"editMode" })
CLASS_MEMBER_METHOD(SetEditModeCommand, { L"__vwsn_value_" })
CLASS_MEMBER_METHOD(SetHasEditableSelection, { L"__vwsn_value_" })
CLASS_MEMBER_METHOD(SetHasEditableSelectionInSingleParagraph, { L"__vwsn_value_" })
CLASS_MEMBER_EVENT(EditModeCommandChanged)
CLASS_MEMBER_EVENT(HasEditableSelectionChanged)
CLASS_MEMBER_EVENT(HasEditableSelectionInSingleParagraphChanged)
CLASS_MEMBER_FIELD(__vwsn_prop_EditModeCommand)
CLASS_MEMBER_FIELD(__vwsn_prop_HasEditableSelection)
CLASS_MEMBER_FIELD(__vwsn_prop_HasEditableSelectionInSingleParagraph)
CLASS_MEMBER_PROPERTY_EVENT_READONLY(EditModeCommand, GetEditModeCommand, EditModeCommandChanged)
CLASS_MEMBER_PROPERTY_EVENT(HasEditableSelection, GetHasEditableSelection, SetHasEditableSelection, HasEditableSelectionChanged)
CLASS_MEMBER_PROPERTY_EVENT(HasEditableSelectionInSingleParagraph, GetHasEditableSelectionInSingleParagraph, SetHasEditableSelectionInSingleParagraph, HasEditableSelectionInSingleParagraphChanged)
CLASS_MEMBER_PROPERTY_READONLY(MenuContainer, GetMenuContainer)
CLASS_MEMBER_PROPERTY_READONLY(ToolstripContainer, GetToolstripContainer)
END_CLASS_MEMBER(::demo::DocumentEditorBase)
BEGIN_CLASS_MEMBER(::demo::DocumentEditorBaseConstructor)
CLASS_MEMBER_BASE(::vl::reflection::DescriptableObject)
CLASS_MEMBER_CONSTRUCTOR(::vl::Ptr<::demo::DocumentEditorBaseConstructor>(), NO_PARAMETER)
CLASS_MEMBER_METHOD(__vwsn_demo_DocumentEditorBase_Initialize, { L"__vwsn_this_" })
CLASS_MEMBER_FIELD(__vwsn_precompile_0)
CLASS_MEMBER_FIELD(__vwsn_precompile_1)
CLASS_MEMBER_FIELD(__vwsn_precompile_2)
CLASS_MEMBER_FIELD(commandAlignCenter)
CLASS_MEMBER_FIELD(commandAlignDefault)
CLASS_MEMBER_FIELD(commandAlignLeft)
CLASS_MEMBER_FIELD(commandAlignRight)
CLASS_MEMBER_FIELD(commandBackColor)
CLASS_MEMBER_FIELD(commandBold)
CLASS_MEMBER_FIELD(commandColor)
CLASS_MEMBER_FIELD(commandCopy)
CLASS_MEMBER_FIELD(commandCut)
CLASS_MEMBER_FIELD(commandDelete)
CLASS_MEMBER_FIELD(commandEditHyperlink)
CLASS_MEMBER_FIELD(commandEditable)
CLASS_MEMBER_FIELD(commandFont)
CLASS_MEMBER_FIELD(commandInsertImage)
CLASS_MEMBER_FIELD(commandItalic)
CLASS_MEMBER_FIELD(commandPaste)
CLASS_MEMBER_FIELD(commandRedo)
CLASS_MEMBER_FIELD(commandRemoveHyperlink)
CLASS_MEMBER_FIELD(commandSelect)
CLASS_MEMBER_FIELD(commandSelectable)
CLASS_MEMBER_FIELD(commandStrike)
CLASS_MEMBER_FIELD(commandUnderline)
CLASS_MEMBER_FIELD(commandUndo)
CLASS_MEMBER_FIELD(commandViewOnly)
CLASS_MEMBER_FIELD(dialogColor)
CLASS_MEMBER_FIELD(dialogFont)
CLASS_MEMBER_FIELD(dialogMessage)
CLASS_MEMBER_FIELD(dialogOpen)
CLASS_MEMBER_FIELD(document)
CLASS_MEMBER_FIELD(menuContainer)
CLASS_MEMBER_FIELD(self)
CLASS_MEMBER_FIELD(toolstripContainer)
END_CLASS_MEMBER(::demo::DocumentEditorBaseConstructor)
BEGIN_CLASS_MEMBER(::demo::DocumentEditorRibbon)
CLASS_MEMBER_BASE(::demo::DocumentEditorBase)
CLASS_MEMBER_BASE(::demo::DocumentEditorRibbonConstructor)
CLASS_MEMBER_CONSTRUCTOR(::demo::DocumentEditorRibbon*(), NO_PARAMETER)
CLASS_MEMBER_METHOD(__vwsn_instance_ctor_, NO_PARAMETER)
CLASS_MEMBER_METHOD(GenerateStyleGroups, NO_PARAMETER)
CLASS_MEMBER_METHOD(GetAlignCenterSelected, NO_PARAMETER)
CLASS_MEMBER_METHOD(GetAlignLeftSelected, NO_PARAMETER)
CLASS_MEMBER_METHOD(GetAlignRightSelected, NO_PARAMETER)
CLASS_MEMBER_METHOD(GetStyleGroups, NO_PARAMETER)
CLASS_MEMBER_METHOD(SelectStyleName, { L"styleName" })
CLASS_MEMBER_METHOD(SetAlignCenterSelected, { L"__vwsn_value_" })
CLASS_MEMBER_METHOD(SetAlignLeftSelected, { L"__vwsn_value_" })
CLASS_MEMBER_METHOD(SetAlignRightSelected, { L"__vwsn_value_" })
CLASS_MEMBER_METHOD(SetStyleGroups, { L"__vwsn_value_" })
CLASS_MEMBER_EVENT(AlignCenterSelectedChanged)
CLASS_MEMBER_EVENT(AlignLeftSelectedChanged)
CLASS_MEMBER_EVENT(AlignRightSelectedChanged)
CLASS_MEMBER_EVENT(StyleGroupsChanged)
CLASS_MEMBER_FIELD(__vwsn_prop_AlignCenterSelected)
CLASS_MEMBER_FIELD(__vwsn_prop_AlignLeftSelected)
CLASS_MEMBER_FIELD(__vwsn_prop_AlignRightSelected)
CLASS_MEMBER_FIELD(__vwsn_prop_StyleGroups)
CLASS_MEMBER_PROPERTY_EVENT(AlignCenterSelected, GetAlignCenterSelected, SetAlignCenterSelected, AlignCenterSelectedChanged)
CLASS_MEMBER_PROPERTY_EVENT(AlignLeftSelected, GetAlignLeftSelected, SetAlignLeftSelected, AlignLeftSelectedChanged)
CLASS_MEMBER_PROPERTY_EVENT(AlignRightSelected, GetAlignRightSelected, SetAlignRightSelected, AlignRightSelectedChanged)
END_CLASS_MEMBER(::demo::DocumentEditorRibbonWindow)
CLASS_MEMBER_PROPERTY_EVENT(StyleGroups, GetStyleGroups, SetStyleGroups, StyleGroupsChanged)
END_CLASS_MEMBER(::demo::DocumentEditorRibbon)
BEGIN_CLASS_MEMBER(::demo::DocumentEditorRibbonWindowConstructor)
BEGIN_CLASS_MEMBER(::demo::DocumentEditorRibbonConstructor)
CLASS_MEMBER_BASE(::vl::reflection::DescriptableObject)
CLASS_MEMBER_CONSTRUCTOR(::vl::Ptr<::demo::DocumentEditorRibbonWindowConstructor>(), NO_PARAMETER)
CLASS_MEMBER_METHOD(__vwsn_demo_DocumentEditorRibbonWindow_Initialize, { L"__vwsn_this_" })
CLASS_MEMBER_CONSTRUCTOR(::vl::Ptr<::demo::DocumentEditorRibbonConstructor>(), NO_PARAMETER)
CLASS_MEMBER_METHOD(__vwsn_demo_DocumentEditorRibbon_Initialize, { L"__vwsn_this_" })
CLASS_MEMBER_FIELD(__vwsn_precompile_0)
CLASS_MEMBER_FIELD(__vwsn_precompile_1)
CLASS_MEMBER_FIELD(__vwsn_precompile_10)
@@ -134,27 +217,39 @@ namespace vl
CLASS_MEMBER_FIELD(__vwsn_precompile_61)
CLASS_MEMBER_FIELD(__vwsn_precompile_62)
CLASS_MEMBER_FIELD(__vwsn_precompile_63)
CLASS_MEMBER_FIELD(__vwsn_precompile_64)
CLASS_MEMBER_FIELD(__vwsn_precompile_65)
CLASS_MEMBER_FIELD(__vwsn_precompile_66)
CLASS_MEMBER_FIELD(__vwsn_precompile_67)
CLASS_MEMBER_FIELD(__vwsn_precompile_68)
CLASS_MEMBER_FIELD(__vwsn_precompile_7)
CLASS_MEMBER_FIELD(__vwsn_precompile_8)
CLASS_MEMBER_FIELD(__vwsn_precompile_9)
CLASS_MEMBER_FIELD(dialogMessage)
CLASS_MEMBER_FIELD(self)
CLASS_MEMBER_FIELD(styleGallery)
END_CLASS_MEMBER(::demo::DocumentEditorRibbonConstructor)
BEGIN_CLASS_MEMBER(::demo::DocumentEditorRibbonWindow)
CLASS_MEMBER_BASE(::vl::presentation::controls::GuiWindow)
CLASS_MEMBER_BASE(::demo::DocumentEditorRibbonWindowConstructor)
CLASS_MEMBER_CONSTRUCTOR(::demo::DocumentEditorRibbonWindow*(), NO_PARAMETER)
END_CLASS_MEMBER(::demo::DocumentEditorRibbonWindow)
BEGIN_CLASS_MEMBER(::demo::DocumentEditorRibbonWindowConstructor)
CLASS_MEMBER_BASE(::vl::reflection::DescriptableObject)
CLASS_MEMBER_CONSTRUCTOR(::vl::Ptr<::demo::DocumentEditorRibbonWindowConstructor>(), NO_PARAMETER)
CLASS_MEMBER_METHOD(__vwsn_demo_DocumentEditorRibbonWindow_Initialize, { L"__vwsn_this_" })
CLASS_MEMBER_FIELD(__vwsn_precompile_0)
CLASS_MEMBER_FIELD(__vwsn_precompile_1)
CLASS_MEMBER_FIELD(editor)
END_CLASS_MEMBER(::demo::DocumentEditorRibbonWindowConstructor)
BEGIN_CLASS_MEMBER(::demo::DocumentEditorToolstripWindow)
CLASS_MEMBER_BASE(::demo::DocumentEditorWindowBase)
CLASS_MEMBER_BASE(::demo::DocumentEditorToolstripWindowConstructor)
CLASS_MEMBER_CONSTRUCTOR(::demo::DocumentEditorToolstripWindow*(), NO_PARAMETER)
END_CLASS_MEMBER(::demo::DocumentEditorToolstripWindow)
BEGIN_CLASS_MEMBER(::demo::DocumentEditorToolstrip)
CLASS_MEMBER_BASE(::demo::DocumentEditorBase)
CLASS_MEMBER_BASE(::demo::DocumentEditorToolstripConstructor)
CLASS_MEMBER_CONSTRUCTOR(::demo::DocumentEditorToolstrip*(), NO_PARAMETER)
END_CLASS_MEMBER(::demo::DocumentEditorToolstrip)
BEGIN_CLASS_MEMBER(::demo::DocumentEditorToolstripWindowConstructor)
BEGIN_CLASS_MEMBER(::demo::DocumentEditorToolstripConstructor)
CLASS_MEMBER_BASE(::vl::reflection::DescriptableObject)
CLASS_MEMBER_CONSTRUCTOR(::vl::Ptr<::demo::DocumentEditorToolstripWindowConstructor>(), NO_PARAMETER)
CLASS_MEMBER_METHOD(__vwsn_demo_DocumentEditorToolstripWindow_Initialize, { L"__vwsn_this_" })
CLASS_MEMBER_CONSTRUCTOR(::vl::Ptr<::demo::DocumentEditorToolstripConstructor>(), NO_PARAMETER)
CLASS_MEMBER_METHOD(__vwsn_demo_DocumentEditorToolstrip_Initialize, { L"__vwsn_this_" })
CLASS_MEMBER_FIELD(__vwsn_precompile_0)
CLASS_MEMBER_FIELD(__vwsn_precompile_1)
CLASS_MEMBER_FIELD(__vwsn_precompile_10)
@@ -225,79 +320,22 @@ namespace vl
CLASS_MEMBER_FIELD(__vwsn_precompile_9)
CLASS_MEMBER_FIELD(buttonAlignment)
CLASS_MEMBER_FIELD(self)
END_CLASS_MEMBER(::demo::DocumentEditorToolstripWindowConstructor)
END_CLASS_MEMBER(::demo::DocumentEditorToolstripConstructor)
BEGIN_CLASS_MEMBER(::demo::DocumentEditorWindowBase)
BEGIN_CLASS_MEMBER(::demo::DocumentEditorToolstripWindow)
CLASS_MEMBER_BASE(::vl::presentation::controls::GuiWindow)
CLASS_MEMBER_BASE(::demo::DocumentEditorWindowBaseConstructor)
CLASS_MEMBER_CONSTRUCTOR(::demo::DocumentEditorWindowBase*(), NO_PARAMETER)
CLASS_MEMBER_METHOD(__vwsn_instance_ctor_, NO_PARAMETER)
CLASS_MEMBER_METHOD(GetEditModeCommand, NO_PARAMETER)
CLASS_MEMBER_METHOD(GetHasEditableSelection, NO_PARAMETER)
CLASS_MEMBER_METHOD(GetHasEditableSelectionInSingleParagraph, NO_PARAMETER)
CLASS_MEMBER_METHOD(GetMenuContainer, NO_PARAMETER)
CLASS_MEMBER_METHOD(GetToolstripContainer, NO_PARAMETER)
CLASS_MEMBER_METHOD(HasEditableCursor, NO_PARAMETER)
CLASS_MEMBER_METHOD(HasEditableHyperlink, { L"forEdit" })
CLASS_MEMBER_METHOD(SelectAlignmentCommand, NO_PARAMETER)
CLASS_MEMBER_METHOD(SetAlignment, { L"alignment" })
CLASS_MEMBER_METHOD(SetEditMode, { L"editMode" })
CLASS_MEMBER_METHOD(SetEditModeCommand, { L"__vwsn_value_" })
CLASS_MEMBER_METHOD(SetHasEditableSelection, { L"__vwsn_value_" })
CLASS_MEMBER_METHOD(SetHasEditableSelectionInSingleParagraph, { L"__vwsn_value_" })
CLASS_MEMBER_EVENT(EditModeCommandChanged)
CLASS_MEMBER_EVENT(HasEditableSelectionChanged)
CLASS_MEMBER_EVENT(HasEditableSelectionInSingleParagraphChanged)
CLASS_MEMBER_FIELD(__vwsn_prop_EditModeCommand)
CLASS_MEMBER_FIELD(__vwsn_prop_HasEditableSelection)
CLASS_MEMBER_FIELD(__vwsn_prop_HasEditableSelectionInSingleParagraph)
CLASS_MEMBER_PROPERTY_EVENT_READONLY(EditModeCommand, GetEditModeCommand, EditModeCommandChanged)
CLASS_MEMBER_PROPERTY_EVENT(HasEditableSelection, GetHasEditableSelection, SetHasEditableSelection, HasEditableSelectionChanged)
CLASS_MEMBER_PROPERTY_EVENT(HasEditableSelectionInSingleParagraph, GetHasEditableSelectionInSingleParagraph, SetHasEditableSelectionInSingleParagraph, HasEditableSelectionInSingleParagraphChanged)
CLASS_MEMBER_PROPERTY_READONLY(MenuContainer, GetMenuContainer)
CLASS_MEMBER_PROPERTY_READONLY(ToolstripContainer, GetToolstripContainer)
END_CLASS_MEMBER(::demo::DocumentEditorWindowBase)
CLASS_MEMBER_BASE(::demo::DocumentEditorToolstripWindowConstructor)
CLASS_MEMBER_CONSTRUCTOR(::demo::DocumentEditorToolstripWindow*(), NO_PARAMETER)
END_CLASS_MEMBER(::demo::DocumentEditorToolstripWindow)
BEGIN_CLASS_MEMBER(::demo::DocumentEditorWindowBaseConstructor)
BEGIN_CLASS_MEMBER(::demo::DocumentEditorToolstripWindowConstructor)
CLASS_MEMBER_BASE(::vl::reflection::DescriptableObject)
CLASS_MEMBER_CONSTRUCTOR(::vl::Ptr<::demo::DocumentEditorWindowBaseConstructor>(), NO_PARAMETER)
CLASS_MEMBER_METHOD(__vwsn_demo_DocumentEditorWindowBase_Initialize, { L"__vwsn_this_" })
CLASS_MEMBER_CONSTRUCTOR(::vl::Ptr<::demo::DocumentEditorToolstripWindowConstructor>(), NO_PARAMETER)
CLASS_MEMBER_METHOD(__vwsn_demo_DocumentEditorToolstripWindow_Initialize, { L"__vwsn_this_" })
CLASS_MEMBER_FIELD(__vwsn_precompile_0)
CLASS_MEMBER_FIELD(__vwsn_precompile_1)
CLASS_MEMBER_FIELD(__vwsn_precompile_2)
CLASS_MEMBER_FIELD(commandAlignCenter)
CLASS_MEMBER_FIELD(commandAlignDefault)
CLASS_MEMBER_FIELD(commandAlignLeft)
CLASS_MEMBER_FIELD(commandAlignRight)
CLASS_MEMBER_FIELD(commandBackColor)
CLASS_MEMBER_FIELD(commandBold)
CLASS_MEMBER_FIELD(commandColor)
CLASS_MEMBER_FIELD(commandCopy)
CLASS_MEMBER_FIELD(commandCut)
CLASS_MEMBER_FIELD(commandDelete)
CLASS_MEMBER_FIELD(commandEditHyperlink)
CLASS_MEMBER_FIELD(commandEditable)
CLASS_MEMBER_FIELD(commandFont)
CLASS_MEMBER_FIELD(commandInsertImage)
CLASS_MEMBER_FIELD(commandItalic)
CLASS_MEMBER_FIELD(commandPaste)
CLASS_MEMBER_FIELD(commandRedo)
CLASS_MEMBER_FIELD(commandRemoveHyperlink)
CLASS_MEMBER_FIELD(commandSelect)
CLASS_MEMBER_FIELD(commandSelectable)
CLASS_MEMBER_FIELD(commandStrike)
CLASS_MEMBER_FIELD(commandUnderline)
CLASS_MEMBER_FIELD(commandUndo)
CLASS_MEMBER_FIELD(commandViewOnly)
CLASS_MEMBER_FIELD(dialogColor)
CLASS_MEMBER_FIELD(dialogFont)
CLASS_MEMBER_FIELD(dialogMessage)
CLASS_MEMBER_FIELD(dialogOpen)
CLASS_MEMBER_FIELD(document)
CLASS_MEMBER_FIELD(menuContainer)
CLASS_MEMBER_FIELD(self)
CLASS_MEMBER_FIELD(toolstripContainer)
END_CLASS_MEMBER(::demo::DocumentEditorWindowBaseConstructor)
CLASS_MEMBER_FIELD(editor)
END_CLASS_MEMBER(::demo::DocumentEditorToolstripWindowConstructor)
BEGIN_CLASS_MEMBER(::demo::HyperlinkWindow)
CLASS_MEMBER_BASE(::vl::presentation::controls::GuiWindow)
@@ -356,30 +394,22 @@ namespace vl
BEGIN_CLASS_MEMBER(::demo::StyleGroup)
CLASS_MEMBER_BASE(::vl::reflection::DescriptableObject)
CLASS_MEMBER_CONSTRUCTOR(::vl::Ptr<::demo::StyleGroup>(), NO_PARAMETER)
CLASS_MEMBER_METHOD(GetItems, NO_PARAMETER)
CLASS_MEMBER_METHOD(GetName, NO_PARAMETER)
CLASS_MEMBER_METHOD(SetItems, { L"__vwsn_value_" })
CLASS_MEMBER_METHOD(SetName, { L"__vwsn_value_" })
CLASS_MEMBER_EVENT(NameChanged)
CLASS_MEMBER_FIELD(__vwsn_prop_Items)
CLASS_MEMBER_FIELD(__vwsn_prop_Name)
CLASS_MEMBER_PROPERTY_READONLY(Items, GetItems)
CLASS_MEMBER_PROPERTY_EVENT(Name, GetName, SetName, NameChanged)
CLASS_MEMBER_FIELD(Items)
CLASS_MEMBER_FIELD(Name)
END_CLASS_MEMBER(::demo::StyleGroup)
BEGIN_CLASS_MEMBER(::demo::StyleItem)
CLASS_MEMBER_BASE(::vl::reflection::DescriptableObject)
CLASS_MEMBER_CONSTRUCTOR(::vl::Ptr<::demo::StyleItem>(const ::vl::WString&), { L"value" })
CLASS_MEMBER_METHOD(GetValue, NO_PARAMETER)
CLASS_MEMBER_METHOD(SetValue, { L"__vwsn_value_" })
CLASS_MEMBER_FIELD(__vwsn_prop_Value)
CLASS_MEMBER_PROPERTY(Value, GetValue, SetValue)
CLASS_MEMBER_CONSTRUCTOR(::vl::Ptr<::demo::StyleItem>(const ::vl::WString&, ::vl::Nullable<::vl::presentation::DocumentFontSize>, ::vl::Nullable<::vl::presentation::Color>, ::vl::Nullable<bool>, ::vl::Nullable<bool>, ::vl::Nullable<bool>, ::vl::Nullable<bool>), { L"name" _ L"size" _ L"color" _ L"bold" _ L"italic" _ L"underline" _ L"strikeline" })
CLASS_MEMBER_FIELD(Name)
CLASS_MEMBER_FIELD(Style)
END_CLASS_MEMBER(::demo::StyleItem)
BEGIN_CLASS_MEMBER(::demo::StyleItemTemplate)
CLASS_MEMBER_BASE(::vl::presentation::templates::GuiTextListItemTemplate)
CLASS_MEMBER_BASE(::demo::StyleItemTemplateConstructor)
CLASS_MEMBER_CONSTRUCTOR(::demo::StyleItemTemplate*(::vl::Ptr<::demo::StyleItem>), { L"__vwsn_ctor_parameter_ViewModel" })
CLASS_MEMBER_METHOD(__vwsn_instance_ctor_, NO_PARAMETER)
CLASS_MEMBER_METHOD(GetViewModel, NO_PARAMETER)
CLASS_MEMBER_FIELD(__vwsn_parameter_ViewModel)
CLASS_MEMBER_PROPERTY_READONLY(ViewModel, GetViewModel)
@@ -391,7 +421,16 @@ namespace vl
CLASS_MEMBER_METHOD(__vwsn_demo_StyleItemTemplate_Initialize, { L"__vwsn_this_" })
CLASS_MEMBER_FIELD(__vwsn_precompile_0)
CLASS_MEMBER_FIELD(__vwsn_precompile_1)
CLASS_MEMBER_FIELD(__vwsn_precompile_2)
CLASS_MEMBER_FIELD(__vwsn_precompile_3)
CLASS_MEMBER_FIELD(__vwsn_precompile_4)
CLASS_MEMBER_FIELD(__vwsn_precompile_5)
CLASS_MEMBER_FIELD(__vwsn_precompile_6)
CLASS_MEMBER_FIELD(__vwsn_precompile_7)
CLASS_MEMBER_FIELD(ViewModel)
CLASS_MEMBER_FIELD(containerControl)
CLASS_MEMBER_FIELD(self)
CLASS_MEMBER_FIELD(styleLabel)
END_CLASS_MEMBER(::demo::StyleItemTemplateConstructor)
#undef _
@@ -400,12 +439,16 @@ namespace vl
public:
void Load(ITypeManager* manager)
{
ADD_TYPE_INFO(::demo::DocumentEditorBase)
ADD_TYPE_INFO(::demo::DocumentEditorBaseConstructor)
ADD_TYPE_INFO(::demo::DocumentEditorRibbon)
ADD_TYPE_INFO(::demo::DocumentEditorRibbonConstructor)
ADD_TYPE_INFO(::demo::DocumentEditorRibbonWindow)
ADD_TYPE_INFO(::demo::DocumentEditorRibbonWindowConstructor)
ADD_TYPE_INFO(::demo::DocumentEditorToolstrip)
ADD_TYPE_INFO(::demo::DocumentEditorToolstripConstructor)
ADD_TYPE_INFO(::demo::DocumentEditorToolstripWindow)
ADD_TYPE_INFO(::demo::DocumentEditorToolstripWindowConstructor)
ADD_TYPE_INFO(::demo::DocumentEditorWindowBase)
ADD_TYPE_INFO(::demo::DocumentEditorWindowBaseConstructor)
ADD_TYPE_INFO(::demo::HyperlinkWindow)
ADD_TYPE_INFO(::demo::HyperlinkWindowConstructor)
ADD_TYPE_INFO(::demo::MainWindow)
@@ -37,12 +37,16 @@ namespace vl
namespace description
{
#ifndef VCZH_DEBUG_NO_REFLECTION
DECL_TYPE_INFO(::demo::DocumentEditorBase)
DECL_TYPE_INFO(::demo::DocumentEditorBaseConstructor)
DECL_TYPE_INFO(::demo::DocumentEditorRibbon)
DECL_TYPE_INFO(::demo::DocumentEditorRibbonConstructor)
DECL_TYPE_INFO(::demo::DocumentEditorRibbonWindow)
DECL_TYPE_INFO(::demo::DocumentEditorRibbonWindowConstructor)
DECL_TYPE_INFO(::demo::DocumentEditorToolstrip)
DECL_TYPE_INFO(::demo::DocumentEditorToolstripConstructor)
DECL_TYPE_INFO(::demo::DocumentEditorToolstripWindow)
DECL_TYPE_INFO(::demo::DocumentEditorToolstripWindowConstructor)
DECL_TYPE_INFO(::demo::DocumentEditorWindowBase)
DECL_TYPE_INFO(::demo::DocumentEditorWindowBaseConstructor)
DECL_TYPE_INFO(::demo::HyperlinkWindow)
DECL_TYPE_INFO(::demo::HyperlinkWindowConstructor)
DECL_TYPE_INFO(::demo::MainWindow)
@@ -1,103 +0,0 @@
<Instance ref.CodeBehind="false" ref.Class="demo::DocumentEditorToolstripWindow" xmlns:demo="demo::*">
<demo:DocumentEditorWindowBase ref.Name="self" Text="Document Editor (Toolstrip)">
<att.MenuContainer-set>
<ToolstripMenuBar>
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0"/>
<MenuBarButton Text="Edit" Alt="E">
<att.SubMenu-set>
<ToolstripGroupContainer>
<ToolstripGroup>
<MenuItemButton Command-eval="self.commandUndo" Alt="U"/>
<MenuItemButton Command-eval="self.commandRedo" Alt="R"/>
</ToolstripGroup>
<ToolstripGroup>
<MenuItemButton Command-eval="self.commandCopy" Alt="C"/>
<MenuItemButton Command-eval="self.commandCut" Alt="X"/>
<MenuItemButton Command-eval="self.commandPaste" Alt="P"/>
</ToolstripGroup>
<MenuItemButton Command-eval="self.commandDelete" Alt="D"/>
<ToolstripGroup>
<MenuItemButton Command-eval="self.commandSelect" Alt="A"/>
<MenuItemButton Text="Object" Alt="O">
<att.SubMenu-set>
<MenuItemButton Command-eval="self.commandInsertImage" Alt="I"/>
<MenuItemButton Command-eval="self.commandEditHyperlink" Alt="L"/>
<MenuItemButton Command-eval="self.commandRemoveHyperlink" Alt="R"/>
</att.SubMenu-set>
</MenuItemButton>
<MenuItemButton Text="Paragram Alignment" Alt="P">
<att.SubMenu-set>
<MenuItemButton Command-eval="self.commandAlignDefault" Alt="D"/>
<MenuItemButton Command-eval="self.commandAlignLeft" Alt="L"/>
<MenuItemButton Command-eval="self.commandAlignCenter" Alt="C"/>
<MenuItemButton Command-eval="self.commandAlignRight" Alt="R"/>
</att.SubMenu-set>
</MenuItemButton>
</ToolstripGroup>
</ToolstripGroupContainer>
</att.SubMenu-set>
</MenuBarButton>
<MenuBarButton Text="View" Alt="V">
<att.SubMenu-set>
<MenuItemButton Command-eval="self.commandViewOnly" Alt="V"/>
<MenuItemButton Command-eval="self.commandSelectable" Alt="S"/>
<MenuItemButton Command-eval="self.commandEditable" Alt="E"/>
</att.SubMenu-set>
</MenuBarButton>
</ToolstripMenuBar>
</att.MenuContainer-set>
<att.ToolstripContainer-set>
<ToolstripToolBar>
<att.BoundsComposition-set AlignmentToParent="left:0 top:0 right:0 bottom:0"/>
<ToolstripGroupContainer>
<ToolstripGroup>
<ToolstripDropdownButton Alt="V">
<att.Image-bind>self.EditModeCommand.Image ?? null</att.Image-bind>
<att.SubMenu-set>
<MenuItemButton Command-eval="self.commandViewOnly" Alt="V"/>
<MenuItemButton Command-eval="self.commandSelectable" Alt="S"/>
<MenuItemButton Command-eval="self.commandEditable" Alt="E"/>
</att.SubMenu-set>
</ToolstripDropdownButton>
<ToolstripDropdownButton ref.Name="buttonAlignment" Alt="P">
<att.Image-bind>self.document.observe as _(self.SelectAlignmentCommand().Image on _.SelectionChanged)</att.Image-bind>
<att.SubMenu-set>
<MenuItemButton Command-eval="self.commandAlignDefault" Alt="D"/>
<MenuItemButton Command-eval="self.commandAlignLeft" Alt="L"/>
<MenuItemButton Command-eval="self.commandAlignCenter" Alt="C"/>
<MenuItemButton Command-eval="self.commandAlignRight" Alt="R"/>
</att.SubMenu-set>
</ToolstripDropdownButton>
</ToolstripGroup>
<ToolstripGroup>
<ToolstripButton Command-eval="self.commandUndo" Alt="U"/>
<ToolstripButton Command-eval="self.commandRedo" Alt="R"/>
</ToolstripGroup>
<ToolstripGroup>
<ToolstripButton Command-eval="self.commandCopy" Alt="C"/>
<ToolstripButton Command-eval="self.commandCut" Alt="X"/>
<ToolstripButton Command-eval="self.commandPaste" Alt="P"/>
</ToolstripGroup>
<ToolstripButton Command-eval="self.commandDelete" Alt="D"/>
<ToolstripGroup>
<ToolstripSplitButton Command-eval="self.commandInsertImage" Alt="I">
<att.SubMenu-set>
<MenuItemButton Command-eval="self.commandInsertImage" Alt="I"/>
<MenuItemButton Command-eval="self.commandEditHyperlink" Alt="L"/>
<MenuItemButton Command-eval="self.commandRemoveHyperlink" Alt="R"/>
</att.SubMenu-set>
</ToolstripSplitButton>
<ToolstripButton Command-eval="self.commandBold" Alt="B"/>
<ToolstripButton Command-eval="self.commandItalic" Alt="I"/>
<ToolstripButton Command-eval="self.commandUnderline" Alt="U"/>
<ToolstripButton Command-eval="self.commandStrike" Alt="S"/>
<ToolstripButton Command-eval="self.commandFont" Alt="F"/>
<ToolstripButton Command-eval="self.commandColor" Alt="C"/>
<ToolstripButton Command-eval="self.commandBackColor" Alt="K"/>
</ToolstripGroup>
</ToolstripGroupContainer>
</ToolstripToolBar>
</att.ToolstripContainer-set>
</demo:DocumentEditorWindowBase>
</Instance>