diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2021-10-31 12:20:31 +0100 |
|---|---|---|
| committer | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2021-10-31 12:20:31 +0100 |
| commit | 6f2069f51fd45b0bd15a1e6531e8089af921c29c (patch) | |
| tree | 017d8662cce7f646ec9aea3a16719addbea70043 | |
| parent | 24bfc35fcb088ff6e8597c9c7e6b9a020dde228c (diff) | |
cut, copy, paste
| -rw-r--r-- | Crow/Default.style | 1 | ||||
| -rw-r--r-- | Crow/Templates/MenuButton.template | 2 | ||||
| -rw-r--r-- | Crow/Templates/MenuItem.template | 20 | ||||
| -rw-r--r-- | Crow/src/EventArgs/SelectionChangeEventArgs.cs | 5 | ||||
| -rw-r--r-- | Crow/src/EventArgs/TextSelectionChangeEventArgs.cs | 26 | ||||
| -rw-r--r-- | Crow/src/Widgets/Button.cs | 2 | ||||
| -rw-r--r-- | Crow/src/Widgets/Label.cs | 90 | ||||
| -rw-r--r-- | Crow/src/Widgets/MenuItem.cs | 10 | ||||
| -rw-r--r-- | Crow/src/Widgets/TextBox.cs | 4 | ||||
| -rw-r--r-- | Samples/ShowCase/ShowCase.cs | 4 | ||||
| -rw-r--r-- | Samples/ShowCase/ui/showcase.crow | 8 | ||||
| -rw-r--r-- | Samples/common/src/Editor.cs | 33 | ||||
| -rw-r--r-- | Samples/common/src/SampleBaseForEditor.cs | 19 | ||||
| -rw-r--r-- | Samples/common/ui/Interfaces/TemplatedGroup/menu3.crow | 6 |
14 files changed, 141 insertions, 89 deletions
diff --git a/Crow/Default.style b/Crow/Default.style index 54c44b42..066eb21b 100644 --- a/Crow/Default.style +++ b/Crow/Default.style @@ -81,6 +81,7 @@ Button { MinimumSize = "60,22"; Height = "Fit"; Width = "Fit"; + BubbleEvents= "None"; } ButtonBorder { BorderWidth="1"; diff --git a/Crow/Templates/MenuButton.template b/Crow/Templates/MenuButton.template index 8025954b..8bde1c59 100644 --- a/Crow/Templates/MenuButton.template +++ b/Crow/Templates/MenuButton.template @@ -5,4 +5,4 @@ MouseEnter="{Background=${ControlHighlight}}" MouseLeave="{Background=Transparent}"/> </Template> -</Button> +</Button>
\ No newline at end of file diff --git a/Crow/Templates/MenuItem.template b/Crow/Templates/MenuItem.template index 4075be94..a86c3538 100644 --- a/Crow/Templates/MenuItem.template +++ b/Crow/Templates/MenuItem.template @@ -4,17 +4,15 @@ Foreground = "{./Foreground}" BubbleEvents="All" IsPopped="{²./IsOpened}" PopWidth="{./PopWidth}" PopHeight="{./PopHeight}"> <Template> - - <Border Name="border1" - MinimumSize = "60,0" - Foreground="Transparent" - Background="{./Background}"> - <Label Text="{./Caption}" - Foreground="{./Foreground}" - Margin="2" HorizontalAlignment="Left" - Font="{./Font}" /> - </Border> - + <Border Name="border1" + MinimumSize = "60,0" + Foreground="Transparent" + Background="{./Background}"> + <Label Text="{./Caption}" + Foreground="{./Foreground}" + Margin="2" HorizontalAlignment="Left" + Font="{./Font}" /> + </Border> </Template> <Border Foreground="DimGrey" Width="{../PopWidth}" Height="{../PopHeight}" Background="${MenuBackground}"> <VerticalStack Name="ItemsContainer" Width="Stretched" /> diff --git a/Crow/src/EventArgs/SelectionChangeEventArgs.cs b/Crow/src/EventArgs/SelectionChangeEventArgs.cs index c45c880a..186de3fa 100644 --- a/Crow/src/EventArgs/SelectionChangeEventArgs.cs +++ b/Crow/src/EventArgs/SelectionChangeEventArgs.cs @@ -6,8 +6,11 @@ using System; namespace Crow { + /// <summary> + /// Occurs when the selection has changed. + /// </summary> public class SelectionChangeEventArgs: EventArgs - { + { public object NewValue; public SelectionChangeEventArgs (object _newValue) : base() diff --git a/Crow/src/EventArgs/TextSelectionChangeEventArgs.cs b/Crow/src/EventArgs/TextSelectionChangeEventArgs.cs new file mode 100644 index 00000000..979c7109 --- /dev/null +++ b/Crow/src/EventArgs/TextSelectionChangeEventArgs.cs @@ -0,0 +1,26 @@ +// Copyright (c) 2013-2021 Jean-Philippe Bruyère <jp_bruyere@hotmail.com> +// +// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) + +using Crow.Text; +using System; + +namespace Crow +{ + /// <summary> + /// Occurs in the TextBox widget and Label when the current selected text has changed. + /// </summary> + public class TextSelectionChangeEventArgs: EventArgs + { + /// <summary> + /// The text span of the current selection. + /// </summary> + public TextSpan Selection; + + public TextSelectionChangeEventArgs (TextSpan newSelection) : base() + { + Selection = newSelection; + } + } +} + diff --git a/Crow/src/Widgets/Button.cs b/Crow/src/Widgets/Button.cs index cdd9c590..607e0337 100644 --- a/Crow/src/Widgets/Button.cs +++ b/Crow/src/Widgets/Button.cs @@ -106,7 +106,7 @@ namespace Crow public override void onMouseClick (object sender, MouseButtonEventArgs e) { command?.Execute (this); - e.Handled = true; + //e.Handled = true; base.onMouseClick (sender, e); } diff --git a/Crow/src/Widgets/Label.cs b/Crow/src/Widgets/Label.cs index 7bd16b92..15a38357 100644 --- a/Crow/src/Widgets/Label.cs +++ b/Crow/src/Widgets/Label.cs @@ -26,11 +26,19 @@ namespace Crow /// Occurs when Text has changed. /// </summary> public event EventHandler<TextChangeEventArgs> TextChanged; + /// <summary> + /// Occurs when the current selected text has changed + /// </summary> + public event EventHandler<TextSelectionChangeEventArgs> SelectionChanged; public virtual void OnTextChanged(Object sender, TextChangeEventArgs e) { TextChanged.Raise (this, e); } + public virtual void OnSelectionChanged(Object sender, TextSelectionChangeEventArgs e) + { + SelectionChanged.Raise (this, e); + } //TODO:change protected to private #region private and protected fields @@ -54,6 +62,8 @@ namespace Crow currentLoc = value; NotifyValueChanged ("CurrentLine", CurrentLine); NotifyValueChanged ("CurrentColumn", CurrentColumn); + if (SelectionChanged != null) + OnSelectionChanged (this, new TextSelectionChangeEventArgs (Selection)); } } public virtual int CurrentLine { @@ -137,7 +147,7 @@ namespace Crow _textAlignment = value; CurrentLoc?.ResetVisualX (); - selectionStart?.ResetVisualX (); + SelectionStart?.ResetVisualX (); RegisterForRedraw (); NotifyValueChangedAuto (_textAlignment); @@ -170,10 +180,10 @@ namespace Crow } void constraintsLocations () { - if (selectionStart.HasValue) { + if (SelectionStart.HasValue) { CharLocation loc = CurrentLoc.Value; int l = Math.Min (loc.Line, lines.Count - 1); - selectionStart = new CharLocation (l, Math.Min (loc.Column, lines[l].Length - 1)); + SelectionStart = new CharLocation (l, Math.Min (loc.Column, lines[l].Length - 1)); } if (CurrentLoc.HasValue) { CharLocation loc = CurrentLoc.Value; @@ -308,27 +318,27 @@ namespace Crow public TextSpan Selection { set { if (value.IsEmpty) - selectionStart = null; + SelectionStart = null; else - selectionStart = lines.GetLocation (value.Start); + SelectionStart = lines.GetLocation (value.Start); CurrentLoc = lines.GetLocation (value.End); } get { if (CurrentLoc == null) return default; CharLocation selStart = CurrentLoc.Value, selEnd = CurrentLoc.Value; - if (selectionStart.HasValue) { - if (CurrentLoc.Value.Line < selectionStart.Value.Line) { + if (SelectionStart.HasValue) { + if (CurrentLoc.Value.Line < SelectionStart.Value.Line) { selStart = CurrentLoc.Value; - selEnd = selectionStart.Value; - } else if (CurrentLoc.Value.Line > selectionStart.Value.Line) { - selStart = selectionStart.Value; + selEnd = SelectionStart.Value; + } else if (CurrentLoc.Value.Line > SelectionStart.Value.Line) { + selStart = SelectionStart.Value; selEnd = CurrentLoc.Value; - } else if (CurrentLoc.Value.Column < selectionStart.Value.Column) { + } else if (CurrentLoc.Value.Column < SelectionStart.Value.Column) { selStart = CurrentLoc.Value; - selEnd = selectionStart.Value; + selEnd = SelectionStart.Value; } else { - selStart = selectionStart.Value; + selStart = SelectionStart.Value; selEnd = CurrentLoc.Value; } } @@ -341,7 +351,17 @@ namespace Crow return selection.IsEmpty ? "" : Text.AsSpan (selection.Start, selection.Length).ToString (); } } - public bool SelectionIsEmpty => selectionStart.HasValue ? Selection.IsEmpty : true; + public bool SelectionIsEmpty => SelectionStart.HasValue ? Selection.IsEmpty : true; + public CharLocation? SelectionStart { + get => selectionStart; + set { + if (selectionStart == value) + return; + selectionStart = value; + if (SelectionChanged != null) + OnSelectionChanged (this, new TextSelectionChangeEventArgs (Selection)); + } + } protected virtual void measureTextBounds (Context gr) { fe = gr.FontExtents; @@ -380,23 +400,23 @@ namespace Crow NotifyValueChanged ("CurrentColumn", CurrentColumn); } else updateLocation (gr, cb.Width, ref currentLoc); - if (selectionStart.HasValue) { + if (SelectionStart.HasValue) { updateLocation (gr, cb.Width, ref selectionStart); - if (CurrentLoc.Value != selectionStart.Value) + if (CurrentLoc.Value != SelectionStart.Value) selectionNotEmpty = true; } if (selectionNotEmpty) { - if (CurrentLoc.Value.Line < selectionStart.Value.Line) { + if (CurrentLoc.Value.Line < SelectionStart.Value.Line) { selStart = CurrentLoc.Value; - selEnd = selectionStart.Value; - } else if (CurrentLoc.Value.Line > selectionStart.Value.Line) { - selStart = selectionStart.Value; + selEnd = SelectionStart.Value; + } else if (CurrentLoc.Value.Line > SelectionStart.Value.Line) { + selStart = SelectionStart.Value; selEnd = CurrentLoc.Value; - } else if (CurrentLoc.Value.Column < selectionStart.Value.Column) { + } else if (CurrentLoc.Value.Column < SelectionStart.Value.Column) { selStart = CurrentLoc.Value; - selEnd = selectionStart.Value; + selEnd = SelectionStart.Value; } else { - selStart = selectionStart.Value; + selStart = SelectionStart.Value; selEnd = CurrentLoc.Value; } } else @@ -600,10 +620,10 @@ namespace Crow } protected void checkShift (Modifier modifier) { if (modifier.HasFlag (Modifier.Shift)) { - if (!selectionStart.HasValue) - selectionStart = CurrentLoc; + if (!SelectionStart.HasValue) + SelectionStart = CurrentLoc; } else - selectionStart = null; + SelectionStart = null; } #region Widget overrides @@ -670,7 +690,7 @@ namespace Crow { base.onFocused (sender, e); if (CurrentLoc == null) { - selectionStart = new CharLocation (0, 0); + SelectionStart = new CharLocation (0, 0); CurrentLoc = new CharLocation (lines.Count - 1, lines[lines.Count - 1].Length); } RegisterForRedraw (); @@ -702,9 +722,9 @@ namespace Crow targetColumn = -1; if (HasFocus) { if (!IFace.Shift) - selectionStart = hoverLoc; - else if (!selectionStart.HasValue) - selectionStart = CurrentLoc; + SelectionStart = hoverLoc; + else if (!SelectionStart.HasValue) + SelectionStart = CurrentLoc; CurrentLoc = hoverLoc; IFace.forceTextCursor = true; RegisterForRedraw (); @@ -718,10 +738,10 @@ namespace Crow public override void onMouseUp (object sender, MouseButtonEventArgs e) { base.onMouseUp (sender, e); - if (e.Button != MouseButton.Left || !HasFocus || !selectionStart.HasValue) + if (e.Button != MouseButton.Left || !HasFocus || !SelectionStart.HasValue) return; - if (selectionStart.Value == CurrentLoc.Value) - selectionStart = null; + if (SelectionStart.Value == CurrentLoc.Value) + SelectionStart = null; } public override void onMouseDoubleClick (object sender, MouseButtonEventArgs e) { @@ -730,7 +750,7 @@ namespace Crow return; GotoWordStart (); - selectionStart = CurrentLoc; + SelectionStart = CurrentLoc; GotoWordEnd (); RegisterForRedraw (); } @@ -741,7 +761,7 @@ namespace Crow switch (e.Key) { case Key.Escape: - selectionStart = null; + SelectionStart = null; RegisterForRedraw (); break; case Key.Home: diff --git a/Crow/src/Widgets/MenuItem.cs b/Crow/src/Widgets/MenuItem.cs index 91c4677c..4fc6d86a 100644 --- a/Crow/src/Widgets/MenuItem.cs +++ b/Crow/src/Widgets/MenuItem.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2013-2020 Jean-Philippe Bruyère <jp_bruyere@hotmail.com> +// Copyright (c) 2013-2021 Jean-Philippe Bruyère <jp_bruyere@hotmail.com> // // This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) @@ -25,7 +25,7 @@ namespace Crow #region Public properties [DefaultValue(false)] public bool IsOpened { - get { return isOpened; } + get => isOpened; set { if (isOpened == value) return; @@ -149,7 +149,7 @@ namespace Crow { if (command != null) { command.Execute (this); - closeMenu (); + CloseMenu (); } if (hasClick) base.onMouseClick (sender, e); @@ -159,8 +159,8 @@ namespace Crow m.AutomaticOpening = false; } - void closeMenu () { - MenuItem tmp = LogicalParent as MenuItem; + public void CloseMenu () { + MenuItem tmp = this; while (tmp != null) { tmp.IsOpened = false; tmp.Background = Colors.Transparent; diff --git a/Crow/src/Widgets/TextBox.cs b/Crow/src/Widgets/TextBox.cs index 900075ff..e3fac1b4 100644 --- a/Crow/src/Widgets/TextBox.cs +++ b/Crow/src/Widgets/TextBox.cs @@ -298,7 +298,7 @@ namespace Crow OnValidate (this, new ValidateEventArgs (_text)); break; case Key.Escape: - selectionStart = null; + SelectionStart = null; CurrentLoc = lines.GetLocation (selection.Start); RegisterForRedraw (); break; @@ -349,7 +349,7 @@ namespace Crow _text = tmp.ToString (); lines.Update (change); //lines.Update (_text); - selectionStart = null; + SelectionStart = null; CurrentLoc = lines.GetLocation (change.Start + change.ChangedText.Length); textMeasureIsUpToDate = false; diff --git a/Samples/ShowCase/ShowCase.cs b/Samples/ShowCase/ShowCase.cs index 06fca837..6774314a 100644 --- a/Samples/ShowCase/ShowCase.cs +++ b/Samples/ShowCase/ShowCase.cs @@ -111,7 +111,7 @@ namespace ShowCase } void showError (Exception ex) { - Console.WriteLine (ex); + Debug.WriteLine (ex); NotifyValueChanged ("ErrorMessage", ex); NotifyValueChanged ("ShowError", true); } @@ -127,7 +127,7 @@ namespace ShowCase Load ("#ShowCase.showcase.crow").DataSource = this; crowContainer = FindByName ("CrowContainer") as Container; - editor = FindByName ("tb") as TextBox; + editor = FindByName ("tb") as Editor; if (!File.Exists (CurrentFile)) newFile (); diff --git a/Samples/ShowCase/ui/showcase.crow b/Samples/ShowCase/ui/showcase.crow index 19939654..692ce88e 100644 --- a/Samples/ShowCase/ui/showcase.crow +++ b/Samples/ShowCase/ui/showcase.crow @@ -83,9 +83,9 @@ <Button Style="IcoButton" Command="{CMDSaveAs}" /> <Button Style="IcoButton" Command="{CMDUndo}" /> <Button Style="IcoButton" Command="{CMDRedo}" /> - <!--<Button Style="IcoButton" Command="{CMDCut}" /> + <Button Style="IcoButton" Command="{CMDCut}" /> <Button Style="IcoButton" Command="{CMDCopy}" /> - <Button Style="IcoButton" Command="{CMDPaste}" />--> + <Button Style="IcoButton" Command="{CMDPaste}" /> <Popper RootDataLevel="true" IsVisible="{DebugLoggingEnabled}" Fit="true"> <Template> <CheckBox IsChecked="{²./IsPopped}"> @@ -146,7 +146,7 @@ </Border> </Template> <VerticalStack Width="200" Height="200" Background="Jet" Margin="5"> - <CheckBox Caption="Embed source in templated control" IsChecked="{²EncloseInTemplatedControl}"/> + <CheckBox Caption="Embed source in template" IsChecked="{²EncloseInTemplatedControl}"/> <TextBox BubbleEvents="None" Text="{²TemplateContainerSource}" Width="Stretched" Height="Stretched" Multiline="true" Tooltip="Add '*source* where you want to load the source in the editor."/> </VerticalStack> @@ -155,8 +155,8 @@ <HorizontalStack> <Editor Name="tb" Text="{Source}" Multiline="true" Font="consolas, 12" Focusable="true" Height="Stretched" Width="Stretched" TextChanged="onTextChanged" KeyDown="textView_KeyDown" ContextCommands="{EditorCommands}" + SelectionChanged="onEditorSelectionChanged" Foreground="DarkGrey" Background="White" MouseWheelSpeed="20"/> - <!--SelectionChanged="onSelectedTextChanged"--> <ScrollBar Value="{²../tb.ScrollY}" LargeIncrement="{../tb.PageHeight}" SmallIncrement="1" CursorRatio="{../tb.ChildHeightRatio}" Maximum="{../tb.MaxScrollY}" /> diff --git a/Samples/common/src/Editor.cs b/Samples/common/src/Editor.cs index 25a15c5a..90335d83 100644 --- a/Samples/common/src/Editor.cs +++ b/Samples/common/src/Editor.cs @@ -210,7 +210,7 @@ namespace Crow if (attrib.ValueToken.HasValue) { TextChange tc = new TextChange (currentToken.Start, currentToken.Length, selectedSugg); update (tc); - selectionStart = lines.GetLocation (attrib.ValueToken.Value.Start + tc.CharDiff + 1); + SelectionStart = lines.GetLocation (attrib.ValueToken.Value.Start + tc.CharDiff + 1); CurrentLoc = lines.GetLocation (attrib.ValueToken.Value.End + tc.CharDiff - 1); } else { update (new TextChange (currentToken.Start, currentToken.Length, selectedSugg + "=\"\"")); @@ -224,7 +224,10 @@ namespace Crow hideOverlay (); base.onMouseDown (sender, e); } - + public override void onMouseEnter(object sender, MouseMoveEventArgs e) { + base.onMouseEnter (sender, e); + HasFocus = true; + } public override void onKeyDown(object sender, KeyEventArgs e) { TextSpan selection = Selection; @@ -280,7 +283,7 @@ namespace Crow update (new TextChange (lines[l].Start, 0, "\t")); } - selectionStart = new CharLocation (lineStart, 0); + SelectionStart = new CharLocation (lineStart, 0); CurrentLoc = new CharLocation (lineEnd, lines[lineEnd].Length); disableSuggestions = false; @@ -305,7 +308,7 @@ namespace Crow CharLocation selStart = default, selEnd = default; bool selectionNotEmpty = false; - if (HasFocus) { + //if (HasFocus) { if (currentLoc?.Column < 0) { updateLocation (gr, cb.Width, ref currentLoc); NotifyValueChanged ("CurrentColumn", CurrentColumn); @@ -322,28 +325,28 @@ namespace Crow overlay.Top = p.Y; } } - if (selectionStart.HasValue) { + if (SelectionStart.HasValue) { updateLocation (gr, cb.Width, ref selectionStart); - if (CurrentLoc.Value != selectionStart.Value) + if (CurrentLoc.Value != SelectionStart.Value) selectionNotEmpty = true; } if (selectionNotEmpty) { - if (CurrentLoc.Value.Line < selectionStart.Value.Line) { + if (CurrentLoc.Value.Line < SelectionStart.Value.Line) { selStart = CurrentLoc.Value; - selEnd = selectionStart.Value; - } else if (CurrentLoc.Value.Line > selectionStart.Value.Line) { - selStart = selectionStart.Value; + selEnd = SelectionStart.Value; + } else if (CurrentLoc.Value.Line > SelectionStart.Value.Line) { + selStart = SelectionStart.Value; selEnd = CurrentLoc.Value; - } else if (CurrentLoc.Value.Column < selectionStart.Value.Column) { + } else if (CurrentLoc.Value.Column < SelectionStart.Value.Column) { selStart = CurrentLoc.Value; - selEnd = selectionStart.Value; + selEnd = SelectionStart.Value; } else { - selStart = selectionStart.Value; + selStart = SelectionStart.Value; selEnd = CurrentLoc.Value; } } else IFace.forceTextCursor = true; - } + //} double spacePixelWidth = gr.TextExtents (" ").XAdvance; int x = 0, y = 0; @@ -429,7 +432,7 @@ namespace Crow tok = source.Tokens[tokPtr]; } - if (HasFocus && selectionNotEmpty) { + if (selectionNotEmpty) { RectangleD lineRect = new RectangleD (cb.X, lineHeight * y + cb.Top, pixX, lineHeight); RectangleD selRect = lineRect; diff --git a/Samples/common/src/SampleBaseForEditor.cs b/Samples/common/src/SampleBaseForEditor.cs index 92d0634c..b207eea3 100644 --- a/Samples/common/src/SampleBaseForEditor.cs +++ b/Samples/common/src/SampleBaseForEditor.cs @@ -27,12 +27,11 @@ namespace Samples if (string.IsNullOrEmpty (CurrentDir)) CurrentDir = Path.Combine (Directory.GetCurrentDirectory (), "Interfaces"); - } protected const string _defaultFileName = "unnamed.txt"; protected string source = "", origSource; - protected TextBox editor; + protected Editor editor; bool debugLogRecording; @@ -148,7 +147,10 @@ namespace Samples protected TextSpan selection; protected string SelectedText => selection.IsEmpty ? "" : Source.AsSpan (selection.Start, selection.Length).ToString (); - + public void onEditorSelectionChanged(Object sender, TextSelectionChangeEventArgs e) { + selection = e.Selection; + CMDCut.CanExecute = CMDCopy.CanExecute = !selection.IsEmpty; + } protected void undo () { if (undoStack.TryPop (out TextChange tch)) { redoStack.Push (tch.Inverse (source)); @@ -182,6 +184,7 @@ namespace Samples } protected void copy () { Clipboard = SelectedText; + CMDPaste.CanExecute = !string.IsNullOrEmpty (Clipboard); } protected void paste () { applyChange (new TextChange (selection.Start, selection.Length, Clipboard)); @@ -276,6 +279,10 @@ namespace Samples disableTextChangedEvent = true; Source = tmp.ToString (); disableTextChangedEvent = false; + editor.SelectionStart = null; + editor.SetCursorPosition (change.Start + change.ChangedText.Length); + + forceTextCursor = true; } protected void applyChange (TextChange change) { undoStack.Push (change.Inverse (source)); @@ -316,12 +323,6 @@ namespace Samples return; applyChange (e.Change); } - - protected void onSelectedTextChanged (object sender, EventArgs e) { - selection = (sender as Label).Selection; - Console.WriteLine($"selection:{selection.Start} length:{selection.Length}"); - CMDCut.CanExecute = CMDCopy.CanExecute = !selection.IsEmpty; - } protected void textView_KeyDown (object sender, Crow.KeyEventArgs e) { if (Ctrl) { if (e.Key == Glfw.Key.W) { diff --git a/Samples/common/ui/Interfaces/TemplatedGroup/menu3.crow b/Samples/common/ui/Interfaces/TemplatedGroup/menu3.crow index d58c9653..ba7a8e0c 100644 --- a/Samples/common/ui/Interfaces/TemplatedGroup/menu3.crow +++ b/Samples/common/ui/Interfaces/TemplatedGroup/menu3.crow @@ -13,7 +13,7 @@ </Template> <VerticalStack Margin="0" Name="ItemsContainer" Fit="true" Background="Jet"/> </Popper> - </Template> + </Template> <ItemTemplate DataType="Crow.Command" Path="#Crow.MenuButton.template"/> <ItemTemplate DataType="Crow.CommandGroup" Data="Commands"> <Popper PopDirection="Right" Caption="{Caption}" IsEnabled="{CanExecute}" Width="Stretched" @@ -25,10 +25,10 @@ <Label Text="{./Caption}" Width="Fit" Height="Stretched"/> <Label Text="..."/> </HorizontalStack> - </Template> + </Template> <VerticalStack Margin="0" Name="ItemsContainer" Width="{../PopWidth}" Height="{../PopHeight}" Background="${MenuBackground}"/> </Popper> - </ItemTemplate> + </ItemTemplate> </MenuItem> </ItemTemplate> </Menu>
\ No newline at end of file |