diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2021-07-01 23:38:09 +0200 |
|---|---|---|
| committer | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2021-07-01 23:38:09 +0200 |
| commit | a4386e4844dbb85b804770d936b2d47c7584d258 (patch) | |
| tree | 85113f4aa66fa77f2e4cde0d4e02bc8eeadbd962 /Samples | |
| parent | 6c4bb7e2c26c3a4c612fdece4dee96282391007a (diff) | |
wip
Diffstat (limited to 'Samples')
60 files changed, 684 insertions, 772 deletions
diff --git a/Samples/BasicTests/BasicTests.cs b/Samples/BasicTests/BasicTests.cs index 13bb41fe..7e704916 100644 --- a/Samples/BasicTests/BasicTests.cs +++ b/Samples/BasicTests/BasicTests.cs @@ -12,6 +12,7 @@ namespace Samples static void Main () { using (BasicTests app = new BasicTests ()) { + app.SolidBackground = false; app.Run (); } } @@ -91,8 +92,8 @@ namespace Samples #endif Load (testFiles [idx]).DataSource = this; } catch (Exception ex) { - (LoadIMLFragment ($"<Label Background='Red' Foreground='White' Height='Fit' Width='Stretched' Multiline='true' VerticalAlignment='Bottom' Margin='5' />") as OldLabel).Text = ex.ToString(); - Console.WriteLine (ex.Message + "\n" + ex.InnerException); + //(LoadIMLFragment ($"<Label Background='Red' Foreground='White' Height='Fit' Width='Stretched' Multiline='true' VerticalAlignment='Bottom' Margin='5' />") as OldLabel).Text = ex.ToString(); + Console.WriteLine (ex); //MessageBox.Show (CurrentInterface, MessageBox.Type.Error, ex.Message + "\n" + ex.InnerException.Message).Modal = true; } return false; diff --git a/Samples/DebugLogAnalyzer/src/DbgLogViewer.cs b/Samples/DebugLogAnalyzer/src/DbgLogViewer.cs index 251090ef..89cf3e0c 100644 --- a/Samples/DebugLogAnalyzer/src/DbgLogViewer.cs +++ b/Samples/DebugLogAnalyzer/src/DbgLogViewer.cs @@ -271,10 +271,7 @@ namespace Crow { base.onDraw (gr); - gr.SelectFontFace (Font.Name, Font.Slant, Font.Wheight); - gr.SetFontSize (Font.Size); - gr.FontOptions = Interface.FontRenderingOptions; - gr.Antialias = Cairo.Antialias.None; + setFontForContext (gr); if (widgets == null) return; @@ -387,10 +384,7 @@ namespace Crow } } - ctx.SelectFontFace (Font.Name, Font.Slant, Font.Wheight); - ctx.SetFontSize (Font.Size); - ctx.FontOptions = Interface.FontRenderingOptions; - ctx.Antialias = Interface.Antialias; + setFontForContext (ctx); string str = ticksToMS(hoverTick); @@ -609,8 +603,7 @@ namespace Crow using (Context gr = new Context (IFace.surf)) { double maxNameWidth = 0.0; - gr.SelectFontFace (Font.Name, Font.Slant, Font.Wheight); - gr.SetFontSize (Font.Size); + setFontForContext (gr); foreach (DbgWidgetRecord o in widgets) { double nameWidth = gr.TextExtents (o.name).Width + 5.0 * o.xLevel; diff --git a/Samples/DebugLogAnalyzer/src/DebugInterfaceWidget.cs b/Samples/DebugLogAnalyzer/src/DebugInterfaceWidget.cs index c8b27d7d..38d94f3d 100644 --- a/Samples/DebugLogAnalyzer/src/DebugInterfaceWidget.cs +++ b/Samples/DebugLogAnalyzer/src/DebugInterfaceWidget.cs @@ -427,7 +427,7 @@ namespace Crow Debugger.Break (); } } - void updateWidgetEvents (List<DbgWidgetRecord> widgets, DbgEvent evt) { + void updateWidgetEvents (IList<DbgWidgetRecord> widgets, DbgEvent evt) { if (evt is DbgWidgetEvent we) widgets.FirstOrDefault (w => w.InstanceIndex == we.InstanceIndex)?.Events.Add (we); if (evt.Events == null) diff --git a/Samples/DebugLogAnalyzer/ui/main.crow b/Samples/DebugLogAnalyzer/ui/main.crow index 5afc6c6c..28433b11 100644 --- a/Samples/DebugLogAnalyzer/ui/main.crow +++ b/Samples/DebugLogAnalyzer/ui/main.crow @@ -70,11 +70,11 @@ </HorizontalStack> <Label Background="Red" Foreground="White" Margin="5" Width="Stretched" Text="{../../../dbgIfaceWidget.CrowDebuggerErrorMessage}" IsVisible="{../../../dbgIfaceWidget.CrowDebuggerNOK}"/> - <!--<CheckBox Name="cbFile" Caption="Record to file" IsChecked="{²DebugLogToFile}" Background="Onyx"/>--> <HorizontalStack Height="Fit" Width="Stretched" IsEnabled="{../cbFile.IsChecked}" Background="Onyx" Margin="5"> <Label Text="Debug log output file:" Fit="true"/> <TextBox Text="{²../../../../dbgIfaceWidget.DebugLogFilePath}" /> </HorizontalStack> + <CheckBox Name="cbFile" Caption="Record to file" IsChecked="{²../../../dbgIfaceWidget.DebugLogToFile}" Background="Onyx"/> <EnumSelector RadioButtonStyle="CheckBox2" Template="#Dbg.EnumSelector.template" Background="Grey" Caption="Recorded Events" EnumValue="{²RecordedEvents}" BitFieldExcludeMask="255" /> @@ -97,7 +97,7 @@ <Wrapper Orientation="Vertical" Name="ItemsContainer" Margin="0" Background="{./Background}"/> </Template> <ItemTemplate> - <Button Command="{}" Height="Stretched" Width="Fit"/> + <Button Command="{}" Height="Fit" Width="Fit"/> </ItemTemplate> </Menu> </HorizontalStack> diff --git a/Samples/PerfTests/Program.cs b/Samples/PerfTests/Program.cs index cb96078b..14da072a 100644 --- a/Samples/PerfTests/Program.cs +++ b/Samples/PerfTests/Program.cs @@ -166,8 +166,8 @@ namespace PerfTests else surf = new Crow.Cairo.ImageSurface (Crow.Cairo.Format.Argb32, ClientRectangle.Width, ClientRectangle.Height); - loadStyling (); - + initDictionaries (); + loadStyling (); } protected override void Dispose (bool disposing) { diff --git a/Samples/ShowCase/ShowCase.cs b/Samples/ShowCase/ShowCase.cs index fdbe6aa3..66e1f43e 100644 --- a/Samples/ShowCase/ShowCase.cs +++ b/Samples/ShowCase/ShowCase.cs @@ -26,13 +26,13 @@ namespace ShowCase Environment.SetEnvironmentVariable ("FONTCONFIG_PATH", @"C:\Users\Jean-Philippe\source\vcpkg\installed\x64-windows\tools\fontconfig\fonts"); using (Showcase app = new Showcase ()) { + app.WindowTitle = "C.R.O.W Showcase"; + app.SetWindowIcon ("#Crow.Icons.crow.png"); //app.Theme = @"C:\Users\Jean-Philippe\source\Crow\Themes\TestTheme"; CurrentProgramInstance = app; app.Run (); } - } - - + } public Container crowContainer; Stopwatch reloadChrono = new Stopwatch (); @@ -106,15 +106,6 @@ namespace ShowCase reloadChrono.Reset (); } - public string DebugLogFilePath { - get => Configuration.Global.Get<string> (nameof (DebugLogFilePath)); - set { - if (CurrentFile == value) - return; - Configuration.Global.Set (nameof (DebugLogFilePath), value); - NotifyValueChanged (DebugLogFilePath); - } - } public override bool OnKeyDown (Key key) { diff --git a/Samples/ShowCase/ShowCase.csproj b/Samples/ShowCase/ShowCase.csproj index 70037e60..bee99267 100644 --- a/Samples/ShowCase/ShowCase.csproj +++ b/Samples/ShowCase/ShowCase.csproj @@ -3,9 +3,6 @@ <ItemGroup> <EmbeddedResource Include="ui\*.*"> <LogicalName>ShowCase.%(Filename)%(Extension)</LogicalName> - </EmbeddedResource> - </ItemGroup> - <ItemGroup> - <ProjectReference Include="$(MSBuildThisFileDirectory)\..\..\CrowDbgShared\CrowDbgShared.csproj" /> + </EmbeddedResource> </ItemGroup> </Project>
\ No newline at end of file diff --git a/Samples/ShowCase/ui/showcase.crow b/Samples/ShowCase/ui/showcase.crow index 1236b705..9e6b0cd2 100644 --- a/Samples/ShowCase/ui/showcase.crow +++ b/Samples/ShowCase/ui/showcase.crow @@ -25,7 +25,7 @@ <ListItem ContextCommands="{GetCommands}" Selected="{/exp.Background=${ControlHighlight}}" Unselected="{/exp.Background=Transparent}"> - <Expandable Name="exp" Caption="{Name}" MouseDoubleClick="/onClickForExpand"> + <Expandable Name="exp" Caption="{Name}" MouseDoubleClick="/onClickForExpand" BubbleMouseEvent="true"> <Template> <VerticalStack> <Border CornerRadius="2" Margin="0" Height="Fit" MouseDoubleClick="./onClickForExpand" @@ -86,7 +86,7 @@ <!--<Button Style="IcoButton" Command="{CMDCut}" /> <Button Style="IcoButton" Command="{CMDCopy}" /> <Button Style="IcoButton" Command="{CMDPaste}" />--> - <Popper IsVisible="{DebugLoggingEnabled}" Fit="true"> + <Popper RootDataLevel="true" IsVisible="{DebugLoggingEnabled}" Fit="true"> <Template> <CheckBox IsChecked="{²./IsPopped}"> <Template> @@ -103,41 +103,31 @@ <Label Text="Debug log output file:" Fit="true"/> <TextBox Text="{²DebugLogFilePath}" /> </HorizontalStack> - <EnumSelector RadioButtonStyle="CheckBox2" EnumValue="{²RecordedEvents}" Width="Stretched"> + <EnumSelector RadioButtonStyle="CheckBox2" EnumValue="{²RecordedEvents}" Width="Stretched" BitFieldExcludeMask="255" + Caption="Recorded Events"> <Template> <Popper > <Template> - <CheckBox IsChecked="{²./IsPopped}"> - <Template> - <HorizontalStack Background="Onyx" Margin="5" Spacing="10"> - <Label Text="Recorded Events:" Width="Stretched"/> - <Label Background="SeaGreen" Text="{RecordedEvents}" Margin="3"/> - </HorizontalStack> - </Template> - </CheckBox> - </Template> - <Scroller Height="50%" Width="80%" Background="Jet"> - <Wrapper Name="Content" Height="Fit" VerticalAlignment="Top" /> - </Scroller> + <HorizontalStack Background="{../../Background}" Margin="5" Spacing="10"> + <Label Text="{../../../Caption}" Width="Stretched"/> + <Label Background="SeaGreen" Text="{../../../EnumValue}" Margin="3"/> + </HorizontalStack> + </Template> + <Wrapper Name="Content" Height="Fit" Width="{../PopWidth}" Background="Jet" /> </Popper> </Template> </EnumSelector> - <EnumSelector RadioButtonStyle="CheckBox2" EnumValue="{²DiscardedEvents}" Width="Stretched"> + <EnumSelector RadioButtonStyle="CheckBox2" EnumValue="{²DiscardedEvents}" Width="Stretched" BitFieldExcludeMask="255" + Caption="Discarded Events"> <Template> <Popper > <Template> - <CheckBox IsChecked="{²./IsPopped}"> - <Template> - <HorizontalStack Background="Onyx" Margin="5" Spacing="10"> - <Label Text="Discarded Events:" Width="Stretched"/> - <Label Background="SeaGreen" Text="{DiscardedEvents}" Margin="3"/> - </HorizontalStack> - </Template> - </CheckBox> - </Template> - <Scroller Height="50%" Width="80%" Background="Jet"> - <Wrapper Name="Content" Height="Fit" VerticalAlignment="Top" /> - </Scroller> + <HorizontalStack Background="{../../Background}" Margin="5" Spacing="10"> + <Label Text="{../../../Caption}" Width="Stretched"/> + <Label Background="SeaGreen" Text="{../../../EnumValue}" Margin="3"/> + </HorizontalStack> + </Template> + <Wrapper Name="Content" Height="Fit" Width="{../PopWidth}" Background="Jet" /> </Popper> </Template> </EnumSelector> diff --git a/Samples/common/samples.style b/Samples/common/samples.style index 8a43f3a0..6f78b149 100644 --- a/Samples/common/samples.style +++ b/Samples/common/samples.style @@ -88,3 +88,25 @@ suggestionsListBox { Background = "Jet"; UseLoadingThread = "false"; } +allWidgetBackground = "DarkGrey"; +allWidgetCell { + Template = "Interfaces/grpBoxUnamed.tmp"; + Width = "20%"; + Background = "${allWidgetBackground}"; + MouseEnter = "{Background=Jet}"; + MouseLeave = "{Background=${allWidgetBackground}}"; +} +allWidgetNamedCell { + Template = "Interfaces/grpBox.tmp"; + Width = "20%"; + Background = "${allWidgetBackground}"; + MouseEnter = "{Background=Onyx}"; + MouseLeave = "{Background=${allWidgetBackground}}"; +} +allWidgetCell2 { + Template = "Interfaces/grpBox2.tmp"; + Width = "20%"; +} +allWidgetHS { + Width = "20%"; +} diff --git a/Samples/common/src/Editor.cs b/Samples/common/src/Editor.cs index 7b9d5c10..7b0f1f04 100644 --- a/Samples/common/src/Editor.cs +++ b/Samples/common/src/Editor.cs @@ -32,6 +32,7 @@ namespace Crow } ListBox overlay; IList suggestions; + volatile bool disableSuggestions; public IList Suggestions { get => suggestions; set { @@ -67,7 +68,8 @@ namespace Crow //Task.Run(()=>parse()); parse(); - if (HasFocus) + + if (!disableSuggestions && HasFocus) tryGetSuggestions (); //Console.WriteLine ($"{pos}: {suggestionTok.AsString (_text)} {suggestionTok}"); @@ -78,7 +80,6 @@ namespace Crow int pos = lines.GetAbsolutePosition (CurrentLoc.Value); currentToken = source.FindTokenIncludingPosition (pos); currentNode = source.FindNodeIncludingPosition (pos); - Console.WriteLine ($"Current Token: {currentToken} Current Node: {currentNode}"); if (currentToken.Type == TokenType.ElementOpen) { @@ -96,7 +97,10 @@ namespace Crow MemberInfo mi = getCrowTypeMember ( eltTag.NameToken.Value.AsString (_text), attribNode.NameToken.Value.AsString (_text)); if (mi is PropertyInfo pi) { - if (pi.PropertyType.IsEnum) + if (pi.Name == "Style") + Suggestions = IFace.Styling.Keys + .Where (s => s.StartsWith (currentToken.AsString (_text), StringComparison.OrdinalIgnoreCase)).ToList (); + else if (pi.PropertyType.IsEnum) Suggestions = Enum.GetNames (pi.PropertyType) .Where (s => s.StartsWith (currentToken.AsString (_text), StringComparison.OrdinalIgnoreCase)).ToList (); else if (pi.PropertyType == typeof(bool)) @@ -113,6 +117,8 @@ namespace Crow MemberInfo mi = getCrowTypeMember ( eltTag.NameToken.Value.AsString (_text), attribNode.NameToken.Value.AsString (_text)); if (mi is PropertyInfo pi) { + if (pi.Name == "Style") + Suggestions = IFace.Styling.Keys.ToList (); if (pi.PropertyType.IsEnum) Suggestions = Enum.GetNames (pi.PropertyType).ToList (); else if (pi.PropertyType == typeof(bool)) @@ -125,7 +131,7 @@ namespace Crow } } } - } + } } else if (currentToken.Type != TokenType.AttributeValueClose && currentToken.Type != TokenType.EmptyElementClosing && currentToken.Type != TokenType.ClosingSign && @@ -133,8 +139,8 @@ namespace Crow if (currentToken.Type == TokenType.AttributeName) Suggestions = getAllCrowTypeMembers (eltStartTag.NameToken.Value.AsString (_text)) .Where (s => s.Name.StartsWith (currentToken.AsString (_text), StringComparison.OrdinalIgnoreCase)).ToList (); - else - Suggestions = getAllCrowTypeMembers (eltStartTag.NameToken.Value.AsString (_text)).ToList (); + //else if (currentToken.Type == TokenType.ElementName) + // Suggestions = getAllCrowTypeMembers (eltStartTag.NameToken.Value.AsString (_text)).ToList (); } else { /*SyntaxNode curNode = source.FindNodeIncludingPosition (pos); Console.WriteLine ($"Current Node: {curNode}"); @@ -221,39 +227,42 @@ namespace Crow public override void onKeyDown(object sender, KeyEventArgs e) { - if (suggestionsActive) { - switch (e.Key) { - case Key.Escape: - hideOverlay (); - return; - case Key.Left: - case Key.Right: - hideOverlay (); - break; - case Key.End: - case Key.Home: - case Key.Down: - case Key.Up: - case Key.PageDown: - case Key.PageUp: - overlay.onKeyDown (this, e); - return; - case Key.Tab: - case Key.Enter: - case Key.KeypadEnter: - completeToken (); + TextSpan selection = Selection; + + if (SelectionIsEmpty) { + if (suggestionsActive) { + switch (e.Key) { + case Key.Escape: + hideOverlay (); + return; + case Key.Left: + case Key.Right: + hideOverlay (); + break; + case Key.End: + case Key.Home: + case Key.Down: + case Key.Up: + case Key.PageDown: + case Key.PageUp: + overlay.onKeyDown (this, e); + return; + case Key.Tab: + case Key.Enter: + case Key.KeypadEnter: + completeToken (); + return; + } + } else if (e.Key == Key.Space && IFace.Ctrl) { + tryGetSuggestions (); return; } - } else if (e.Key == Key.Space && IFace.Ctrl) { - tryGetSuggestions (); - return; - } - - TextSpan selection = Selection; - if (e.Key == Key.Tab && !selection.IsEmpty) { + } else if (e.Key == Key.Tab && !selection.IsEmpty) { int lineStart = lines.GetLocation (selection.Start).Line; int lineEnd = lines.GetLocation (selection.End).Line; + disableSuggestions = true; + if (IFace.Shift) { for (int l = lineStart; l <= lineEnd; l++) { if (Text[lines[l].Start] == '\t') @@ -270,13 +279,15 @@ namespace Crow for (int l = lineStart; l <= lineEnd; l++) update (new TextChange (lines[l].Start, 0, "\t")); } + + selectionStart = new CharLocation (lineStart, 0); + CurrentLoc = new CharLocation (lineEnd, lines[lineEnd].Length); - selectionStart = new CharLocation (lineStart, 0); - CurrentLoc = new CharLocation (lineEnd, lines[lineEnd].Length); + disableSuggestions = false; return; } - base.onKeyDown(sender, e); + base.onKeyDown(sender, e); } protected override void drawContent (Context gr) { diff --git a/Samples/common/src/ImlParsing/Syntax.cs b/Samples/common/src/ImlParsing/Syntax.cs index a38e1558..92c9eec3 100644 --- a/Samples/common/src/ImlParsing/Syntax.cs +++ b/Samples/common/src/ImlParsing/Syntax.cs @@ -236,7 +236,7 @@ namespace Crow public XmlSource Source => Root.source; public bool Contains (int pos) => EndToken.HasValue ? - StartToken.Start <= pos && EndToken.Value.End > pos : false; + StartToken.Start <= pos && EndToken.Value.End >= pos : false; public void Dump (int level = 0) { Console.WriteLine ($"{new string('\t', level)}{this}"); diff --git a/Samples/common/src/ImlParsing/TokenType.cs b/Samples/common/src/ImlParsing/TokenType.cs index 3289d5ae..baf25f32 100644 --- a/Samples/common/src/ImlParsing/TokenType.cs +++ b/Samples/common/src/ImlParsing/TokenType.cs @@ -24,17 +24,17 @@ namespace Crow Punctuation = 0x0400, PI_Start = 0x0401,// '<?' PI_End = 0x0402,// '?>' - Operator = 0x0800, - EqualSign = 0x0801, - AttributeValue = 0x2000, - AttributeValueOpen = 0x2001, - AttributeValueClose = 0x2002, - Keyword = 0x1000, ElementOpen = 0x0403,// '<' EndElementOpen = 0x0404,// '</' EmptyElementClosing = 0x0405,// '/>' ClosingSign = 0x0406,// '>' DTDObjectOpen = 0x04A0,// '<!' + Operator = 0x0800, + EqualSign = 0x0801, + Keyword = 0x1000, + AttributeValue = 0x2000, + AttributeValueOpen = 0x2001, + AttributeValueClose = 0x2002, Content, } }
\ No newline at end of file diff --git a/Samples/common/src/ImlParsing/XmlSource.cs b/Samples/common/src/ImlParsing/XmlSource.cs index 0942486f..86eb1e24 100644 --- a/Samples/common/src/ImlParsing/XmlSource.cs +++ b/Samples/common/src/ImlParsing/XmlSource.cs @@ -39,7 +39,7 @@ namespace Crow } public Token FindTokenIncludingPosition (int pos) { - if (tokens == null || tokens.Length == 0) + if (pos == 0 || tokens == null || tokens.Length == 0) return default; int idx = Array.BinarySearch (tokens, 0, tokens.Length, new Token () {Start = pos}); diff --git a/Samples/common/src/SampleBase.cs b/Samples/common/src/SampleBase.cs index 0c381048..75f998cd 100644 --- a/Samples/common/src/SampleBase.cs +++ b/Samples/common/src/SampleBase.cs @@ -44,17 +44,28 @@ namespace Samples public Version CrowVersion => Assembly.GetAssembly(typeof(Widget)).GetName().Version; + static void showMsgBox (object sender) { + Widget w = sender as Widget; + Command cmd = w.DataSource as Command; + MessageBox.ShowModal(w.IFace, MessageBox.Type.Information, $"{cmd.Caption} CLICKED"); + } + #region Test values for Binding public CommandGroup Commands, AllCommands; public CommandGroup EditCommands = new CommandGroup("Edit Commands", - new Command("Edit command 1", (sender) => MessageBox.ShowModal((sender as Widget).IFace, MessageBox.Type.Information, "Edit comand 1 clicked")), - new Command("Edit command 2 a bit longer", (sender) => MessageBox.ShowModal((sender as Widget).IFace, MessageBox.Type.Information, "Edit comand 2 clicked"), null, false), - new Command("Edit command three", (sender) => MessageBox.ShowModal((sender as Widget).IFace, MessageBox.Type.Information, "Edit comand 3 clicked")) + new Command("Edit command 1", (sender) => showMsgBox (sender)), + new Command("Edit command 2 a bit longer", (sender) => showMsgBox (sender), null, false), + new Command("Edit command three", (sender) => showMsgBox (sender)), + new CommandGroup("Subedit menu", + new Command("Subedit command 1", (sender) => showMsgBox (sender)), + new Command("Subedit command 2 a bit longer", (sender) => showMsgBox (sender), null, false), + new Command("Subedit command three", (sender) => showMsgBox (sender)) + ) ); public CommandGroup FileCommands = new CommandGroup("File Commands", - new Command("File command 1", (sender) => MessageBox.ShowModal((sender as Widget).IFace, MessageBox.Type.Information, "File comand 1 clicked")), - new Command("File command 2 a bit longer", (sender) => MessageBox.ShowModal((sender as Widget).IFace, MessageBox.Type.Information, "File comand 2 clicked")), - new Command("File command three", (sender) => MessageBox.ShowModal((sender as Widget).IFace, MessageBox.Type.Information, "File comand 3 clicked")) + new Command("File command 1", (sender) => showMsgBox (sender)), + new Command("File command 2 a bit longer", (sender) => showMsgBox (sender)), + new Command("File command three", (sender) => showMsgBox (sender)) ); void initCommands() @@ -323,29 +334,38 @@ namespace Samples string curSources = ""; + bool boolVal = true; public string CurSources { - get { return curSources; } - set - { + get => curSources; + set { if (value == curSources) return; curSources = value; NotifyValueChanged(curSources); } } - bool boolVal = true; public bool BoolVal { - get { return boolVal; } - set - { + get => boolVal; + set { if (boolVal == value) return; boolVal = value; NotifyValueChanged(boolVal); } } + public Color AllWidgetBackground { + get => Configuration.Global.Get<Color> (nameof(AllWidgetBackground)); + set { + if (value == AllWidgetBackground) + return; + Configuration.Global.Set (nameof(AllWidgetBackground), value); + NotifyValueChanged (value); + } + } + + diff --git a/Samples/common/src/SampleBaseForEditor.cs b/Samples/common/src/SampleBaseForEditor.cs index 54ad8777..6c6b60b8 100644 --- a/Samples/common/src/SampleBaseForEditor.cs +++ b/Samples/common/src/SampleBaseForEditor.cs @@ -101,13 +101,23 @@ namespace Samples public bool DebugLogToFile { get => Configuration.Global.Get<bool> (nameof(DebugLogToFile)); set { - if (DebugLogToFile != value) + if (DebugLogToFile == value) return; Configuration.Global.Set (nameof(DebugLogToFile), value); NotifyValueChanged(DebugLogToFile); DbgLogger.ConsoleOutput = !value; } } + public string DebugLogFilePath { + get => Configuration.Global.Get<string> (nameof (DebugLogFilePath)); + set { + if (CurrentFile == value) + return; + Configuration.Global.Set (nameof (DebugLogFilePath), value); + NotifyValueChanged (DebugLogFilePath); + } + } + protected static void initDebugLog () { DbgLogger.IncludeEvents = DbgEvtType.None; DbgLogger.DiscardEvents = DbgEvtType.All; @@ -279,6 +289,8 @@ namespace Samples } public void goUpDirClick (object sender, MouseButtonEventArgs e) { + if (string.IsNullOrEmpty (CurrentDir)) + return; string root = Directory.GetDirectoryRoot (CurrentDir); if (CurrentDir == root) return; diff --git a/Samples/common/ui/Interfaces/Divers/2.crow b/Samples/common/ui/Interfaces/Divers/2.crow index a1896248..885c3ba0 100644 --- a/Samples/common/ui/Interfaces/Divers/2.crow +++ b/Samples/common/ui/Interfaces/Divers/2.crow @@ -1,9 +1,9 @@ <?xml version="1.0"?> -<VerticalStack Fit="true"> - <TextBox Font="droid, 20" Text="test text box" Width="Stretched"/> - <HorizontalStack Margin="5" Fit="true" MouseEnter="{Background=White}" MouseLeave="{Background=Transparent}"> - <Label Focusable="true" Text="left" Width="80" Height="30" Background="DarkBlue" TextAlignment="Left"/> - <Label Focusable="true" Text="centered" Width="80" Height="30" Background="DarkBlue" TextAlignment="Center"/> - <Label Focusable="true" Text="right" Width="80" Height="30" Background="DarkBlue" TextAlignment="Right"/> +<VerticalStack Fit="true" Spacing="0"> + <TextBox Font="droid, 20" Text="multiline text box" Width="Stretched" Multiline="true"/> + <HorizontalStack Background="DarkSlateGrey" Margin="15" Spacing="15" Fit="true" MouseEnter="{Background=Jet}" MouseLeave="{Background=Grey}"> + <TextBox Focusable="true" Text="left" Width="80" Height="30" TextAlignment="Left"/> + <TextBox Focusable="true" Text="centered" Width="80" Height="30" TextAlignment="Center"/> + <TextBox Focusable="true" Text="right" Width="80" Height="30" TextAlignment="Right"/> </HorizontalStack> </VerticalStack>
\ No newline at end of file diff --git a/Samples/common/ui/Interfaces/Divers/3.crow b/Samples/common/ui/Interfaces/Divers/3.crow deleted file mode 100644 index a1f5e95d..00000000 --- a/Samples/common/ui/Interfaces/Divers/3.crow +++ /dev/null @@ -1,377 +0,0 @@ -<?xml version="1.0"?> -<HorizontalStack Fit="true"> - <VerticalStack Fit="true" Name="vsFps" Spacing="10" > - <ProgressBar CornerRadius="5" Background="DimGrey" Margin="1" Maximum="1000" Value="{fps}" Width="200" Height="15"/> - <HorizontalStack Fit="true"> - <Label Text="Memory:" Width="50" TextAlignment="Right"/> - <Label Text="{memory}" Font="droid,12" TextAlignment="Center" - Background="vgradient|0:RoyalBlue|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Text="Update:" Width="50" TextAlignment="Right"/> - <Label Name="labUpdate" Text="{update}" Font="droid,12" Width="80" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Text="Layouting:" Width="50" TextAlignment="Right"/> - <Label Name="labLayouting" Text="{layouting}" Font="droid,12" Width="80" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Text="Drawing:" Width="50" TextAlignment="Right"/> - <Label Name="labDrawing" Text="{drawing}" Font="droid,12" Width="80" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Name="captionFps" Text="Fps:" Width="50" TextAlignment="Right"/> - <Label Name="valueFps" Text="{fps}" Font="droid , 12" Width="50" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Text="Min:" Width="50" TextAlignment="Right"/> - <Label Text="{fpsMin}" Font="droid , 12" Width="50" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Text="Max:" Width="50" TextAlignment="Right"/> - <Label Text="{fpsMax}" Font="droid , 12" Width="50" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Text="Update:" Width="50" TextAlignment="Right"/> - <Label Name="labUpdate" Text="{update}" Font="droid,12" Width="80" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Text="Layouting:" Width="50" TextAlignment="Right"/> - <Label Name="labLayouting" Text="{layouting}" Font="droid,12" Width="80" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Text="Drawing:" Width="50" TextAlignment="Right"/> - <Label Name="labDrawing" Text="{drawing}" Font="droid,12" Width="80" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Name="captionFps" Text="Fps:" Width="50" TextAlignment="Right"/> - <Label Name="valueFps" Text="{fps}" Font="droid , 12" Width="50" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Text="Min:" Width="50" TextAlignment="Right"/> - <Label Text="{fpsMin}" Font="droid , 12" Width="50" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Text="Max:" Width="50" TextAlignment="Right"/> - <Label Text="{fpsMax}" Font="droid , 12" Width="50" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Text="Update:" Width="50" TextAlignment="Right"/> - <Label Name="labUpdate" Text="{update}" Font="droid,12" Width="80" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Text="Layouting:" Width="50" TextAlignment="Right"/> - <Label Name="labLayouting" Text="{layouting}" Font="droid,12" Width="80" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Text="Drawing:" Width="50" TextAlignment="Right"/> - <Label Name="labDrawing" Text="{drawing}" Font="droid,12" Width="80" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Name="captionFps" Text="Fps:" Width="50" TextAlignment="Right"/> - <Label Name="valueFps" Text="{fps}" Font="droid , 12" Width="50" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Text="Min:" Width="50" TextAlignment="Right"/> - <Label Text="{fpsMin}" Font="droid , 12" Width="50" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Text="Max:" Width="50" TextAlignment="Right"/> - <Label Text="{fpsMax}" Font="droid , 12" Width="50" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - </VerticalStack> - <VerticalStack Fit="true" Name="vsFps" Spacing="10" > - <HorizontalStack Fit="true"> - <Label Text="Update:" Width="50" TextAlignment="Right"/> - <Label Name="labUpdate" Text="{update}" Font="droid,12" Width="80" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Text="Layouting:" Width="50" TextAlignment="Right"/> - <Label Name="labLayouting" Text="{layouting}" Font="droid,12" Width="80" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Text="Drawing:" Width="50" TextAlignment="Right"/> - <Label Name="labDrawing" Text="{drawing}" Font="droid,12" Width="80" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Name="captionFps" Text="Fps:" Width="50" TextAlignment="Right"/> - <Label Name="valueFps" Text="{fps}" Font="droid , 12" Width="50" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Text="Min:" Width="50" TextAlignment="Right"/> - <Label Text="{fpsMin}" Font="droid , 12" Width="50" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Text="Max:" Width="50" TextAlignment="Right"/> - <Label Text="{fpsMax}" Font="droid , 12" Width="50" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Text="Update:" Width="50" TextAlignment="Right"/> - <Label Name="labUpdate" Text="{update}" Font="droid,12" Width="80" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Text="Layouting:" Width="50" TextAlignment="Right"/> - <Label Name="labLayouting" Text="{layouting}" Font="droid,12" Width="80" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Text="Drawing:" Width="50" TextAlignment="Right"/> - <Label Name="labDrawing" Text="{drawing}" Font="droid,12" Width="80" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Name="captionFps" Text="Fps:" Width="50" TextAlignment="Right"/> - <Label Name="valueFps" Text="{fps}" Font="droid , 12" Width="50" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Text="Min:" Width="50" TextAlignment="Right"/> - <Label Text="{fpsMin}" Font="droid , 12" Width="50" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Text="Max:" Width="50" TextAlignment="Right"/> - <Label Text="{fpsMax}" Font="droid , 12" Width="50" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Text="Update:" Width="50" TextAlignment="Right"/> - <Label Name="labUpdate" Text="{update}" Font="droid,12" Width="80" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Text="Layouting:" Width="50" TextAlignment="Right"/> - <Label Name="labLayouting" Text="{layouting}" Font="droid,12" Width="80" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Text="Drawing:" Width="50" TextAlignment="Right"/> - <Label Name="labDrawing" Text="{drawing}" Font="droid,12" Width="80" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Name="captionFps" Text="Fps:" Width="50" TextAlignment="Right"/> - <Label Name="valueFps" Text="{fps}" Font="droid , 12" Width="50" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Text="Min:" Width="50" TextAlignment="Right"/> - <Label Text="{fpsMin}" Font="droid , 12" Width="50" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Text="Max:" Width="50" TextAlignment="Right"/> - <Label Text="{fpsMax}" Font="droid , 12" Width="50" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - </VerticalStack> - <VerticalStack Fit="true" Name="vsFps" Spacing="10" > - <HorizontalStack Fit="true"> - <Label Text="Update:" Width="50" TextAlignment="Right"/> - <Label Name="labUpdate" Text="{update}" Font="droid,12" Width="80" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Text="Layouting:" Width="50" TextAlignment="Right"/> - <Label Name="labLayouting" Text="{layouting}" Font="droid,12" Width="80" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Text="Drawing:" Width="50" TextAlignment="Right"/> - <Label Name="labDrawing" Text="{drawing}" Font="droid,12" Width="80" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Name="captionFps" Text="Fps:" Width="50" TextAlignment="Right"/> - <Label Name="valueFps" Text="{fps}" Font="droid , 12" Width="50" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Text="Min:" Width="50" TextAlignment="Right"/> - <Label Text="{fpsMin}" Font="droid , 12" Width="50" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Text="Max:" Width="50" TextAlignment="Right"/> - <Label Text="{fpsMax}" Font="droid , 12" Width="50" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Text="Update:" Width="50" TextAlignment="Right"/> - <Label Name="labUpdate" Text="{update}" Font="droid,12" Width="80" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Text="Layouting:" Width="50" TextAlignment="Right"/> - <Label Name="labLayouting" Text="{layouting}" Font="droid,12" Width="80" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Text="Drawing:" Width="50" TextAlignment="Right"/> - <Label Name="labDrawing" Text="{drawing}" Font="droid,12" Width="80" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Name="captionFps" Text="Fps:" Width="50" TextAlignment="Right"/> - <Label Name="valueFps" Text="{fps}" Font="droid , 12" Width="50" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Text="Min:" Width="50" TextAlignment="Right"/> - <Label Text="{fpsMin}" Font="droid , 12" Width="50" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Text="Max:" Width="50" TextAlignment="Right"/> - <Label Text="{fpsMax}" Font="droid , 12" Width="50" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Text="Update:" Width="50" TextAlignment="Right"/> - <Label Name="labUpdate" Text="{update}" Font="droid,12" Width="80" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Text="Layouting:" Width="50" TextAlignment="Right"/> - <Label Name="labLayouting" Text="{layouting}" Font="droid,12" Width="80" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Text="Drawing:" Width="50" TextAlignment="Right"/> - <Label Name="labDrawing" Text="{drawing}" Font="droid,12" Width="80" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Name="captionFps" Text="Fps:" Width="50" TextAlignment="Right"/> - <Label Name="valueFps" Text="{fps}" Font="droid , 12" Width="50" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Text="Min:" Width="50" TextAlignment="Right"/> - <Label Text="{fpsMin}" Font="droid , 12" Width="50" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Text="Max:" Width="50" TextAlignment="Right"/> - <Label Text="{fpsMax}" Font="droid , 12" Width="50" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - </VerticalStack> - <VerticalStack Fit="true" Name="vsFps" Spacing="10" > - <HorizontalStack Fit="true"> - <Label Text="Update:" Width="50" TextAlignment="Right"/> - <Label Name="labUpdate" Text="{update}" Font="droid,12" Width="80" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Text="Layouting:" Width="50" TextAlignment="Right"/> - <Label Name="labLayouting" Text="{layouting}" Font="droid,12" Width="80" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Text="Drawing:" Width="50" TextAlignment="Right"/> - <Label Name="labDrawing" Text="{drawing}" Font="droid,12" Width="80" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Name="captionFps" Text="Fps:" Width="50" TextAlignment="Right"/> - <Label Name="valueFps" Text="{fps}" Font="droid , 12" Width="50" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Text="Min:" Width="50" TextAlignment="Right"/> - <Label Text="{fpsMin}" Font="droid , 12" Width="50" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Text="Max:" Width="50" TextAlignment="Right"/> - <Label Text="{fpsMax}" Font="droid , 12" Width="50" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Text="Update:" Width="50" TextAlignment="Right"/> - <Label Name="labUpdate" Text="{update}" Font="droid,12" Width="80" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Text="Layouting:" Width="50" TextAlignment="Right"/> - <Label Name="labLayouting" Text="{layouting}" Font="droid,12" Width="80" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Text="Drawing:" Width="50" TextAlignment="Right"/> - <Label Name="labDrawing" Text="{drawing}" Font="droid,12" Width="80" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Name="captionFps" Text="Fps:" Width="50" TextAlignment="Right"/> - <Label Name="valueFps" Text="{fps}" Font="droid , 12" Width="50" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Text="Min:" Width="50" TextAlignment="Right"/> - <Label Text="{fpsMin}" Font="droid , 12" Width="50" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Text="Max:" Width="50" TextAlignment="Right"/> - <Label Text="{fpsMax}" Font="droid , 12" Width="50" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Text="Update:" Width="50" TextAlignment="Right"/> - <Label Name="labUpdate" Text="{update}" Font="droid,12" Width="80" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Text="Layouting:" Width="50" TextAlignment="Right"/> - <Label Name="labLayouting" Text="{layouting}" Font="droid,12" Width="80" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Text="Drawing:" Width="50" TextAlignment="Right"/> - <Label Name="labDrawing" Text="{drawing}" Font="droid,12" Width="80" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Name="captionFps" Text="Fps:" Width="50" TextAlignment="Right"/> - <Label Name="valueFps" Text="{fps}" Font="droid , 12" Width="50" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Text="Min:" Width="50" TextAlignment="Right"/> - <Label Text="{fpsMin}" Font="droid , 12" Width="50" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - <HorizontalStack Fit="true"> - <Label Text="Max:" Width="50" TextAlignment="Right"/> - <Label Text="{fpsMax}" Font="droid , 12" Width="50" TextAlignment="Center" - Background="vgradient|0:SeaGreen|1:Black"/> - </HorizontalStack> - </VerticalStack> -</HorizontalStack>
\ No newline at end of file diff --git a/Samples/common/ui/Interfaces/Divers/5.crow b/Samples/common/ui/Interfaces/Divers/5.crow deleted file mode 100644 index 7e3df064..00000000 --- a/Samples/common/ui/Interfaces/Divers/5.crow +++ /dev/null @@ -1,64 +0,0 @@ -<?xml version="1.0"?> -<HorizontalStack Fit="true" Margin="5"> - <VerticalStack Fit="true" Margin="2" Spacing="2"> - <TextRun Text="text run test"/> -<!-- <Label Text="label test"/> - <TextBox Text="text box test"/> - <Button Caption="test button"/>--> -<!-- <CheckBox Caption="test checkbox"/> - <RadioButton Caption="test radiobutton"/> - <ComboBox/> - <Popper Caption="test popper"> - <Label Text="label test"/> - </Popper> - <Expandable Caption="test expandable"> - <Label Text="label test"/> - </Expandable> - <Border > - <Label Text="border test" Margin="3"/> - </Border> - <GroupBox Caption="Group box" > - <Label Text="border test" Margin="3"/> - </GroupBox> - <Container Fit="true" Background="DimGrey" Margin="3"> - <Widget Width="20" Height="20" Background="LightGrey"/> - </Container>--> -<!-- <ProgressBar Height="10" Width="150" Background="DimGrey" Value="50" /> - <Slider Value="5" Width="150" Height="10"/> - <ScrollBar Orientation="Horizontal" Maximum="100" Value="50" Height="16" Width="150"/> - <Spinner Value="100"/>--> - </VerticalStack> -<!-- <VerticalStack Width="150" Height="Fit" Margin="2" Spacing="2"> - <TextRun Text="text run test" Width="Stretched"/> - <Label Text="label test" Width="Stretched"/> - <TextBox Text="text box test" Width="Stretched"/> - <Button Caption="test button" Width="Stretched"/> - <CheckBox Caption="test checkbox" Width="Stretched"/> - <RadioButton Caption="test radiobutton" Width="Stretched"/> - <ComboBox Width="Stretched"/> - <Popper Caption="test popper" Width="Stretched"> - <Label Text="label test"/> - </Popper> - <Expandable Caption="test expandable" Width="Stretched"> - <Label Text="label test"/> - </Expandable> - <Border Width="Stretched"> - <Label Text="border test" Margin="3"/> - </Border> - <GroupBox Caption="Group box" Width="Stretched"> - <Label Text="border test" Margin="3"/> - </GroupBox> - <Container Height="Fit" Width="Stretched" Background="DimGrey" Margin="3"> - <Widget Width="20" Height="20" Background="LightGrey"/> - </Container> - <ProgressBar Height="10" Width="Stretched" Background="DimGrey" Value="50" /> - <Slider Value="5" Width="Stretched" Height="10"/> - <ScrollBar Orientation="Horizontal" Maximum="100" Value="50" Height="16" Width="Stretched"/> - <Spinner Value="100" Width="Stretched"/> - </VerticalStack>--> -</HorizontalStack> -<!--<HorizontalStack Fit="true" Background="RoyalBlue" Margin="5"> - <Widget Background="Red" Width="30" Height="20"/> - <Spinner Maximum="10000000000" SmallIncrement="10" Value="0"/> - <Widget Background="Green" Width="30" Height="20"/> -</HorizontalStack>-->
\ No newline at end of file diff --git a/Samples/common/ui/Interfaces/Divers/6.crow b/Samples/common/ui/Interfaces/Divers/6.crow deleted file mode 100644 index f537a71d..00000000 --- a/Samples/common/ui/Interfaces/Divers/6.crow +++ /dev/null @@ -1,6 +0,0 @@ -<?xml version="1.0"?> -<VerticalStack Fit="true" Background="DimGrey" Margin="5"> -<!-- <RadioButton/>--> - <Label Text="a" Width="Stretched" Background="Red"/> - <Label Text="{fps}" HorizontalAlignment="Right" Background="LimeGreen"/> -</VerticalStack> diff --git a/Samples/common/ui/Interfaces/Divers/chess.crow b/Samples/common/ui/Interfaces/Divers/chess.crow deleted file mode 100644 index 30b86d46..00000000 --- a/Samples/common/ui/Interfaces/Divers/chess.crow +++ /dev/null @@ -1,19 +0,0 @@ -<?xml version="1.0"?> -<HorizontalStack Height="Fit" Background="vgradient|0:Grey|0.3:Jet|0.7:Jet|1:Black" VerticalAlignment="Bottom" Margin="10"> - <CheckBox Caption="Hint" IsChecked="{²EnableHint}"/> - <Button Caption="Undo" MouseClick="onUndoClick"/> - <Button Caption="N" MouseClick="onNewGameClick"/> - <Button Caption="Options" MouseClick="onOptionsClick"/> - <Widget Width="Stretched" Height="1"/> - <Button Caption="Quit" MouseClick="onQuitClick"/> - <VerticalStack Style="hsStatus" > - <Label Style="labStatus" Text="State:"/> - <Label Style="labStatus2" Text="{CurrentState}" /> - </VerticalStack > - <VerticalStack Style="hsStatus" > - <Label Style="labStatus" Text="Hover:"/> - <Label Style="labStatus2" Text="{SelCell}"/> - </VerticalStack> - <Image Width="30" Height="20" Path="#Crow.Icons.IconAlerte.svg" Visible="{StockfishNotFound}"/> - <Label Text="Stockfish not found" Font="droid bold, 10" Visible="{StockfishNotFound}"/> -</HorizontalStack> diff --git a/Samples/common/ui/Interfaces/Divers/circleMeter.crow b/Samples/common/ui/Interfaces/Divers/circleMeter.crow new file mode 100644 index 00000000..07c9d6e5 --- /dev/null +++ b/Samples/common/ui/Interfaces/Divers/circleMeter.crow @@ -0,0 +1,18 @@ +<VerticalStack Background="DarkGrey" Margin="10"> + <Wrapper Height="Fit"> + <Spinner Template="#ui.spinner.template" Caption="Min" Value="{²../../sld.Minimum}" Width="Fit"/> + <Spinner Template="#ui.spinner.template" Caption="Max" Value="{²../../sld.Maximum}" Width="Fit"/> + <Spinner Template="#ui.spinner.template" Caption="Value" Value="{²../../sld.Value}" + Minimum="{../../sld.Minimum}" Maximum="{../../sld.Maximum}" Width="Fit"/> + <Spinner Name="sa" Template="#ui.spinner.template" Caption="Start Angle" Value="{²../../cm.StartAngle}" Width="Fit" Maximum="360"/> + <Spinner Name="ea" Template="#ui.spinner.template" Caption="End Angle" Value="{²../../cm.EndAngle}" Width="Fit" Maximum="360"/> + <Spinner Template="#ui.spinner.template" Caption="Backline width" Value="{²../../cm.BackgroundLineWidth}" Width="Fit" Minimum="1"/> + <Spinner Template="#ui.spinner.template" Caption="Line width" Value="{²../../cm.LineWidth}" Width="Fit" Minimum="1"/> + </Wrapper> + <Slider Name="sld" Background="Onyx" Value="30"/> + <Group Background="DimGrey"> + <CircleMeter Name="cm" Background="Onyx" Foreground="RoyalBlue" Margin="20" + Value="{../../sld.Value}" Minimum="{../../sld.Minimum}" Maximum="{../../sld.Maximum}"/> + <Label Text="{../cm.Value}" Font="consola bold, 40" /> + </Group> +</VerticalStack>
\ No newline at end of file diff --git a/Samples/common/ui/Interfaces/Divers/colorPicker.crow b/Samples/common/ui/Interfaces/Divers/colorPicker.crow index f7e9a0bc..dc4a6abe 100644 --- a/Samples/common/ui/Interfaces/Divers/colorPicker.crow +++ b/Samples/common/ui/Interfaces/Divers/colorPicker.crow @@ -2,6 +2,6 @@ <VerticalStack> <ColorPicker CurrentColor="{²../go.Background}" Name="colorPicker" Background="DimGrey" Width="250" /> <Widget Name="go" Width="100" Height="60" Background="DarkBlue"/> - <Widget Name="go" Width="100" Height="60" Background="{../colorPicker.CurrentColor}"/> + <Widget Width="100" Height="60" Background="{../colorPicker.CurrentColor}"/> <Label Text="{../colorPicker.CurrentColor}"/> </VerticalStack>
\ No newline at end of file diff --git a/Samples/common/ui/Interfaces/Divers/colorPicker2.crow b/Samples/common/ui/Interfaces/Divers/colorPicker2.crow index da1a8830..95d00ec6 100644 --- a/Samples/common/ui/Interfaces/Divers/colorPicker2.crow +++ b/Samples/common/ui/Interfaces/Divers/colorPicker2.crow @@ -1,7 +1,7 @@ <?xml version="1.0"?> <VerticalStack> - <ColorPicker CurrentColor="{²../go.Background}" Name="colorPicker" Background="DimGrey" Margin="5" Width="300" Template="#ui.ColorPicker.template" /> <Widget Name="go" Width="100" Height="60" Background="DarkBlue"/> - <Widget Name="go" Width="100" Height="60" Background="{../colorPicker.CurrentColor}"/> + <Widget Width="100" Height="60" Background="{../colorPicker.CurrentColor}"/> <Label Text="{../colorPicker.CurrentColor}"/> + <ColorPicker CurrentColor="{²../go.Background}" Name="colorPicker" Background="DimGrey" MinimumSize="0,0" Width="300" Template="#ui.ColorPicker.template" /> </VerticalStack>
\ No newline at end of file diff --git a/Samples/common/ui/Interfaces/Divers/gauge2.crow b/Samples/common/ui/Interfaces/Divers/gauge2.crow new file mode 100644 index 00000000..c5b94cab --- /dev/null +++ b/Samples/common/ui/Interfaces/Divers/gauge2.crow @@ -0,0 +1,16 @@ +<HorizontalStack Margin="20" Background="Jet"> + <VerticalStack Width="Fit" Background="DarkSlateGrey" Margin="10" Height="Fit"> + <HorizontalStack Height="Fit" Spacing="10"> + <Label Text="Value:"/> + <Label Text="{../../slider.Value}" Background="Onyx" Margin="1" Width="40" TextAlignment="Right"/> + </HorizontalStack> + <Slider Name="slider" Height="10" Width="200" Background="DarkGrey" + Minimum="0" Maximum="100" Value="50" Inverted="{../cb.IsChecked}"/> + <CheckBox Name="cb" Caption="Inverted" /> + </VerticalStack> + <Gauge Height="20" Width="200" Foreground="RoyalBlue" Background="DarkGrey" Margin="2" Value="{../slider.Value}" + Inverted="{../cb.IsChecked}" /> + <Gauge Height="200" Width="20" Foreground="RoyalBlue" Background="DarkGrey" Margin="2" Value="{../slider.Value}" + Inverted="{../cb.IsChecked}" Orientation="Vertical" /> + +</HorizontalStack>
\ No newline at end of file diff --git a/Samples/common/ui/Interfaces/Divers/progress.crow b/Samples/common/ui/Interfaces/Divers/progress.crow index b4086cd6..761a04c4 100644 --- a/Samples/common/ui/Interfaces/Divers/progress.crow +++ b/Samples/common/ui/Interfaces/Divers/progress.crow @@ -4,7 +4,7 @@ <Group> <Gauge Background="DarkGrey" Foreground="RoyalBlue" Height="Stretched" Orientation="{./Orientation}" Minimum="{./Minimum}" Maximum="{./Maximum}" Value="{./Value}"/> - <Label Foreground="White" Text="{ProgressMessage}" Width="Stretched" Margin="3" Background="Transparent" Height="Fit"/> + <Label Foreground="White" Text="{./Caption}" Width="Stretched" Margin="3" Background="Transparent" Height="Fit"/> </Group> </Template> </ProgressBar> diff --git a/Samples/common/ui/Interfaces/Divers/temp.crow b/Samples/common/ui/Interfaces/Divers/temp.crow deleted file mode 100644 index 633bd600..00000000 --- a/Samples/common/ui/Interfaces/Divers/temp.crow +++ /dev/null @@ -1,4 +0,0 @@ -<VerticalStack> - <Label Text='Hello World' Background='MediumSeaGreen' Margin='10'/> - <CheckBox I -</VerticalStack>
\ No newline at end of file diff --git a/Samples/common/ui/Interfaces/Divers/test1.1.crow b/Samples/common/ui/Interfaces/Divers/test1.1.crow deleted file mode 100644 index 052c872c..00000000 --- a/Samples/common/ui/Interfaces/Divers/test1.1.crow +++ /dev/null @@ -1,15 +0,0 @@ -<?xml version="1.0"?> -<Group Name="TopGroup" Width="500" Height="400" Margin="5" - Focusable="True" Background="Yellow"> - <Group Name="InnerGroup" Width="Fit" Height="Fit" Margin="50" - VerticalAlignment="Top" HorizontalAlignment="Left" - Focusable="True" Background="Green"> - <Image VerticalAlignment="Bottom" - Name="PhaseOverlay1" Width="100" Height="100" Path="#Crow.Icons.crow.svg" Background="Red"/> - <Image Top="100" - Name="PhaseOverlay2" Width="100" Height="100" Path="#Crow.Icons.crow.svg" Background="Red"/> - </Group> - <Image VerticalAlignment="Center" HorizontalAlignment="Right" - Name="PhaseOverlay0" Width="100" Height="100" Path="#Crow.Icons.crow.svg" Background="Red"/> - -</Group>
\ No newline at end of file diff --git a/Samples/common/ui/Interfaces/Divers/test1.2.crow b/Samples/common/ui/Interfaces/Divers/test1.2.crow deleted file mode 100644 index 00fb7d22..00000000 --- a/Samples/common/ui/Interfaces/Divers/test1.2.crow +++ /dev/null @@ -1,20 +0,0 @@ -<?xml version="1.0"?> -<Container Background="Green" Height="400" Width="400"> -<VerticalStack Margin="10" Background="DarkBlue" Height="Fit" Width="Stretched"> - <Label Text="label11" Width="Stretched"/> - <Label Text="label21"/> - <HorizontalStack Width="Fit" Height="Fit" Margin="5" - Focusable="True" Background="Blue"> - <Label Text="label12"/> - <Label Text="label22"/> - <Label Text="label32"/> - <Label Text="label42"/> - <Label Text="label52"/> - </HorizontalStack> - <Label Text="label33" Background="Green" Width="Stretched"/> - <Button/> - <Label Text="label43"/> - <Label Text="label53"/> - -</VerticalStack> -</Container>
\ No newline at end of file diff --git a/Samples/common/ui/Interfaces/Divers/test1.crow b/Samples/common/ui/Interfaces/Divers/test1.crow deleted file mode 100644 index b3c58fa8..00000000 --- a/Samples/common/ui/Interfaces/Divers/test1.crow +++ /dev/null @@ -1,9 +0,0 @@ -<?xml version="1.0"?> -<Container Name="TopContainer" Width="400" Height="350" - Margin="20" Focusable="True" Background="Yellow"> - <Container Name="MiddleContainer" Width="50%" Height="Stretched" - Margin="20" Focusable="True" Background="Green"> - <Image VerticalAlignment="Bottom" - Name="PhaseOverlay" Width="100" Height="100" Path="#Crow.Icons.crow.svg" Background="Red"/> - </Container> -</Container>
\ No newline at end of file diff --git a/Samples/common/ui/Interfaces/Divers/testCtxMenu.crow b/Samples/common/ui/Interfaces/Divers/testCtxMenu.crow index 5fd6072a..1c37ee84 100644 --- a/Samples/common/ui/Interfaces/Divers/testCtxMenu.crow +++ b/Samples/common/ui/Interfaces/Divers/testCtxMenu.crow @@ -1,4 +1,4 @@ <?xml version="1.0"?> <Widget Margin="10" Width="50%" Height="50%" Focusable="true" Background="hgradient|0:Red|0.25:Blue|0.5:Green|0.75:Yellow|1:Red" - MinimumSize="50,50" ContextCommands="{Commands}"/>
\ No newline at end of file + MinimumSize="50,50" ContextCommands="{AllCommands}"/>
\ No newline at end of file diff --git a/Samples/common/ui/Interfaces/Divers/testPopUpdate.crow b/Samples/common/ui/Interfaces/Divers/testPopUpdate.crow new file mode 100644 index 00000000..84610531 --- /dev/null +++ b/Samples/common/ui/Interfaces/Divers/testPopUpdate.crow @@ -0,0 +1,12 @@ +<Popper Background='MediumSeaGreen' Margin='0' Fit="true"> + <Template> + <Label/> + </Template> + <Border Name="bd" Background="Grey" Width="200" Height="100"> + <Container Name="ct"> + <Label Fit="true" + MouseDown="{Background=Yellow}" + MouseUp="{Background=Transparent}"/> + </Container> + </Border> +</Popper>
\ No newline at end of file diff --git a/Samples/common/ui/Interfaces/Divers/testSlider.crow b/Samples/common/ui/Interfaces/Divers/testSlider.crow index a2fb0862..d7050000 100644 --- a/Samples/common/ui/Interfaces/Divers/testSlider.crow +++ b/Samples/common/ui/Interfaces/Divers/testSlider.crow @@ -1,59 +1,65 @@ <?xml version="1.0"?> <HorizontalStack Margin="50"> + <CheckBox Name="inverted" Background="DarkSlateGrey" Caption="Inverted" Width="Fit" Foreground="Black"/> + <VerticalStack Spacing="10" Width="50%"> - <Slider Background="DarkGrey" Height="20" Width="Stretched"/> - <Slider Background="RoyalBlue" Height="50" Width="Stretched" CursorSize="50"> + <Slider Background="DarkGrey" Height="20" Width="Stretched" Inverted="{../../inverted.IsChecked}"/> + <Slider Background="RoyalBlue" Height="50" Width="Stretched" CursorSize="50" Inverted="{../../inverted.IsChecked}"> <Template> <Group Background="DarkGrey" > - <Gauge Height="50%" Background="RoyalBlue" Value="{./Value}" Maximum="{./Maximum}" Minimum="{Minimum}" Orientation="{./Orientation}"/> + <Gauge Height="50%" Background="Onyx" Value="{./Value}" Maximum="{./Maximum}" Minimum="{Minimum}" Orientation="{./Orientation}" + Inverted="{./Inverted}"/> <Container Name="Cursor" Background="White" > <Label Text="{./Value}" Foreground="Black"/> </Container> </Group> </Template> </Slider> - <Slider Background="Transparent" Margin="2" Height="10" Width="Stretched"/> - <Slider Background="Transparent" CursorSize="10" Height="12" > + <Slider Background="Transparent" Margin="2" Height="10" Width="Stretched" Inverted="{../../inverted.IsChecked}"/> + <Slider Background="Transparent" CursorSize="10" Height="12" Inverted="{../../inverted.IsChecked}"> <Template> <Group Background="DarkGrey" > - <Gauge Height="50%" Background="RoyalBlue" Value="{./Value}" Maximum="{./Maximum}" Minimum="{Minimum}" Orientation="{./Orientation}"/> + <Gauge Height="50%" Background="Onyx" Value="{./Value}" Maximum="{./Maximum}" Minimum="{Minimum}" Orientation="{./Orientation}" + Inverted="{./Inverted}"/> <Widget Name="Cursor" Background="White" /> </Group> </Template> </Slider> - <Slider Height="10" Width="Stretched" /> + <Slider Height="10" Width="Stretched" Inverted="{../../inverted.IsChecked}" /> - <Slider ClipToClientRect='false' Background="DarkGrey" CursorSize="50" Height="12" CornerRadius="5" /> - <Slider ClipToClientRect='false' CacheEnabled='false' Background="Transparent" CursorSize="20" Height="12" Width="Stretched" /> + <Slider ClipToClientRect='false' Background="DarkGrey" CursorSize="50" Height="12" CornerRadius="5" Inverted="{../../inverted.IsChecked}" /> + <Slider ClipToClientRect='false' CacheEnabled='false' Background="Transparent" CursorSize="20" Height="12" Width="Stretched" Inverted="{../../inverted.IsChecked}" /> </VerticalStack> <HorizontalStack Spacing="10" > - <Slider Orientation="Vertical" Width="20" Height="Stretched"/> - <Slider Orientation="Vertical" Width="50" Height="Stretched" Background="RoyalBlue" CursorSize="50"> + <Slider Orientation="Vertical" Width="20" Height="Stretched" Inverted="{../../inverted.IsChecked}"/> + <Slider Orientation="Vertical" Width="50" Height="Stretched" Background="RoyalBlue" CursorSize="50" Inverted="{../../inverted.IsChecked}"> <Template> <Group Background="DarkGrey" > - <Gauge Width="50%" Background="RoyalBlue" Value="{./Value}" Maximum="{./Maximum}" Minimum="{Minimum}" Orientation="{./Orientation}"/> + <Gauge Width="50%" Background="Onyx" Value="{./Value}" Maximum="{./Maximum}" Minimum="{Minimum}" Orientation="{./Orientation}" + Inverted="{./Inverted}"/> <Container Name="Cursor" Background="White" > <Label Text="{./Value}" Foreground="Black"/> </Container> </Group> </Template> </Slider> - <Slider Orientation="Vertical" Width="10" Height="Stretched" Background="Transparent" Margin="2" /> - <Slider Orientation="Vertical" Width="12" Height="Stretched" Background="Transparent" CursorSize="10" > + <Slider Orientation="Vertical" Width="10" Height="Stretched" Background="Transparent" Margin="2" Inverted="{../../inverted.IsChecked}"/> + <Slider Orientation="Vertical" Width="12" Height="Stretched" Background="Transparent" CursorSize="10" Inverted="{../../inverted.IsChecked}"> <Template> <Group Background="DarkGrey" > - <Gauge Width="50%" Background="RoyalBlue" Value="{./Value}" Maximum="{./Maximum}" Minimum="{Minimum}" Orientation="{./Orientation}"/> + <Gauge Width="50%" Background="Onyx" Value="{./Value}" Maximum="{./Maximum}" Minimum="{Minimum}" Orientation="{./Orientation}" + Inverted="{./Inverted}"/> <Widget Name="Cursor" Background="White" /> </Group> </Template> </Slider> - <Slider Width="10" /> + <Slider Width="10" Orientation="Vertical" Inverted="{../../inverted.IsChecked}"/> - <Slider Width="12" Height="Stretched" Orientation="Vertical" ClipToClientRect='false' Background="DarkGrey" CursorSize="50" CornerRadius="5" /> - <Slider Width="12" Height="Stretched" Orientation="Vertical" ClipToClientRect='false' CacheEnabled='false' Background="Transparent" CursorSize="20" /> + <Slider Width="12" Height="Stretched" Orientation="Vertical" ClipToClientRect='false' Background="DarkGrey" CursorSize="50" CornerRadius="5" Inverted="{../../inverted.IsChecked}"/> + <Slider Width="12" Height="Stretched" Orientation="Vertical" ClipToClientRect='false' CacheEnabled='false' Background="Transparent" CursorSize="20" Inverted="{../../inverted.IsChecked}"/> </HorizontalStack> </HorizontalStack>
\ No newline at end of file diff --git a/Samples/common/ui/Interfaces/Divers/test_stack.crow b/Samples/common/ui/Interfaces/Divers/test_stack.crow deleted file mode 100644 index 044fd7f0..00000000 --- a/Samples/common/ui/Interfaces/Divers/test_stack.crow +++ /dev/null @@ -1,25 +0,0 @@ -<?xml version="1.0"?> -<VerticalStack Background="DarkBlue" Height="300" Width="200"> -<!-- <Label Text="label11" Width="Stretched" Background="Green"/> - <Label Text="label21"/>--> - <HorizontalStack Width="Fit" Height="Fit" Margin="5" - Focusable="True" Background="Blue"> - - <Label Text="label12"/> - <VerticalStack Background="Red" Fit="true"> - <Label Text="label99"/> - <Label Text="label999"/> - </VerticalStack> - <Label Text="label22"/> -<!-- <Label Text="label32"/> - <Label Text="label42"/> - <Label Text="label52"/>--> - </HorizontalStack> -<!-- <Label Text="label33" Background="Green" Width="Stretched"/>--> -<!-- <Label Text="label43"/>--> -<!-- <Border Margin="10"> - <Label Text="label53" Background="Red" Height="Stretched" CornerRadius="10"/> - </Border>--> - <Label Text="label43"/> - <Label Text="label43"/> -</VerticalStack> diff --git a/Samples/common/ui/Interfaces/Experimental/allWidgets.crow b/Samples/common/ui/Interfaces/Experimental/allWidgets.crow new file mode 100644 index 00000000..4b659db8 --- /dev/null +++ b/Samples/common/ui/Interfaces/Experimental/allWidgets.crow @@ -0,0 +1,99 @@ +<TabView Background="DimGrey"> + <VerticalStack Name="Base" Background="Black" Margin="1" > + <HorizontalStack > + <GroupBox Style="allWidgetCell" Caption="Label" > + <Label/> + </GroupBox> + <GroupBox Style="allWidgetCell" Caption="TextBox"> + <TextBox/> + </GroupBox> + <GroupBox Style="allWidgetCell" Caption="Button"> + <Button/> + </GroupBox> + <GroupBox Style="allWidgetCell" Caption="CheckBox" > + <CheckBox/> + </GroupBox> + <GroupBox Style="allWidgetCell" Caption="RadioButton"> + <RadioButton/> + </GroupBox> + </HorizontalStack> + <HorizontalStack Height="25%" > + <GroupBox Style="allWidgetCell" Caption="Expandable"> + <Expandable/> + </GroupBox> + <GroupBox Style="allWidgetCell" Caption="Popper"> + <Popper/> + </GroupBox> + <GroupBox Style="allWidgetCell" Caption="Popper"> + <Menu> + <MenuItem Width="Fit" Caption="menu1"> + <MenuItem Caption="test"/> + <MenuItem Caption="test un peu plus long"/> + <MenuItem Caption="test2"/> + </MenuItem> + <MenuItem Width="Fit" Caption="menu2"> + <MenuItem Caption="test menu2"/> + <MenuItem Caption="test menu2 un peu plus long"/> + <MenuItem Caption="test2 menu2" /> + </MenuItem> + <MenuItem Width="Fit" Caption="menu3"/> + </Menu> + </GroupBox> + <GroupBox Style="allWidgetCell" Caption="ComboBox"> + <DirectoryView /> + </GroupBox> + </HorizontalStack> + <HorizontalStack Height="25%" > + <GroupBox Style="allWidgetNamedCell" Caption="Spinner" > + <Spinner/> + </GroupBox> + <GroupBox Style="allWidgetNamedCell" Caption="Slider"> + <Slider/> + </GroupBox> + <GroupBox Style="allWidgetNamedCell" Caption="ListBox"> + <ListBox Data="{TestList}" Height="60%" Width="80%"/> + </GroupBox> + <GroupBox Style="allWidgetNamedCell" Caption="ComboBox"> + <ComboBox Data="{TestList}"/> + </GroupBox> + </HorizontalStack> + <HorizontalStack Height="25%" > + <GroupBox Style="allWidgetNamedCell" Caption="Border"> + <Border Height="50%" Width="80%"/> + </GroupBox> + <GroupBox Style="allWidgetCell" Caption="GroupBox"> + <GroupBox Height="50%" Width="80%"/> + </GroupBox> + <GroupBox Style="allWidgetNamedCell" Caption="ProgressBar"> + <ProgressBar Value="40" /> + </GroupBox> + <GroupBox Style="allWidgetNamedCell" Caption="Vertical ScrollBar"> + <ScrollBar Height="80%" Maximum="10" /> + </GroupBox> + <GroupBox Style="allWidgetNamedCell" Caption="Horizontal ScrollBar"> + <ScrollBar Style="HScrollBar" Width="80%" Maximum="10" /> + </GroupBox> + </HorizontalStack> + </VerticalStack> + <HorizontalStack Name="Advanced" Background="DarkGrey" IsVisible="false"> + <VerticalStack Width="50%" > + <GroupBox Style="allWidgetNamedCell" Height="50%" Width="Stretched" Caption="MesageBox"> + <MessageBox Height="80%" Width="80%"/> + </GroupBox> + <GroupBox Style="allWidgetNamedCell" Height="Stretched" Width="Stretched" Caption="FileDialog"> + <ColorPicker Height="80%" Width="80%"/> + </GroupBox> + </VerticalStack> + <GroupBox Style="allWidgetNamedCell" Width="Stretched" Caption="FileDialog"> + <FileDialog Height="80%" Width="80%"/> + </GroupBox> + </HorizontalStack> + <HorizontalStack Name="windows" Background="DarkGrey" IsVisible="false"> + <GroupBox Style="allWidgetNamedCell" Caption="Window" Width="50%" > + <Window Width="80%" Height="80%" VerticalAlignment="Center" HorizontalAlignment="Center"/> + </GroupBox> + <GroupBox Style="allWidgetNamedCell" Caption="DockWindow" Width="50%" > + <DockWindow Width="80%" Height="80%" VerticalAlignment="Center" HorizontalAlignment="Center"/> + </GroupBox> + </HorizontalStack> +</TabView>
\ No newline at end of file diff --git a/Samples/common/ui/Interfaces/Experimental/allWidgets2.crow b/Samples/common/ui/Interfaces/Experimental/allWidgets2.crow new file mode 100644 index 00000000..f805a3d4 --- /dev/null +++ b/Samples/common/ui/Interfaces/Experimental/allWidgets2.crow @@ -0,0 +1,114 @@ +<VerticalStack Name="Base" Background="{AllWidgetBackground}" Margin="1" > + <HorizontalStack Height="15%"> + <GroupBox Style="allWidgetCell2" Caption="Label" > + <Label/> + </GroupBox> + <GroupBox Style="allWidgetCell2" Caption="TextBox"> + <TextBox/> + </GroupBox> + <GroupBox Style="allWidgetCell2" Caption="Button"> + <Button /> + </GroupBox> + <GroupBox Style="allWidgetCell2" Caption="CheckBox" > + <CheckBox /> + </GroupBox> + <GroupBox Style="allWidgetCell2" Caption="RadioButton"> + <RadioButton/> + </GroupBox> + </HorizontalStack> + <HorizontalStack Height="15%"> + <GroupBox Style="allWidgetCell2" Caption="Spinner" > + <Spinner/> + </GroupBox> + <GroupBox Style="allWidgetCell2" Caption="Slider"> + <Slider/> + </GroupBox> + <GroupBox Style="allWidgetCell2" Caption="ProgressBar"> + <ProgressBar Value="40" /> + </GroupBox> + </HorizontalStack> + <HorizontalStack Height="20%" > + <GroupBox Style="allWidgetCell2" Caption="Border"> + <Border > + <Label/> + </Border> + </GroupBox> + <GroupBox Style="allWidgetCell2" Caption="GroupBox"> + <GroupBox > + <Label/> + </GroupBox> + </GroupBox> + <GroupBox Style="allWidgetCell2" Caption="Container"> + <Container> + <Label/> + </Container> + </GroupBox> + <GroupBox Style="allWidgetCell2" Caption="VerticalStack"> + <VerticalStack> + <Label/> + <Label/> + <Label/> + </VerticalStack> + </GroupBox> + <GroupBox Style="allWidgetCell2" Caption="HorizontalStack"> + <HorizontalStack> + <Label/> + <Label/> + <Label/> + </HorizontalStack> + </GroupBox> + </HorizontalStack> + <HorizontalStack Height="20%" > + <GroupBox Style="allWidgetCell2" Caption="Expandable"> + <Expandable> + <Label/> + </Expandable> + </GroupBox> + <GroupBox Style="allWidgetCell2" Caption="Popper"> + <Popper> + <Label/> + </Popper> + </GroupBox> + <GroupBox Style="allWidgetCell2" Caption="ListBox"> + <ListBox Data="{TestList}" /> + </GroupBox> + <GroupBox Style="allWidgetCell2" Caption="ComboBox"> + <ComboBox Data="{TestList}"/> + </GroupBox> + <GroupBox Style="allWidgetCell2" Caption="ColorPicker"> + <ColorPicker Template="Interfaces/colorPicker.tmp" CurrentColor="{²AllWidgetBackground}"/> + </GroupBox> + </HorizontalStack> + <HorizontalStack Height="25%" > + <GroupBox Style="allWidgetCell2" Caption="Vertical ScrollBar"> + <ScrollBar Maximum="10" /> + </GroupBox> + <GroupBox Style="allWidgetCell2" Caption="Horizontal ScrollBar"> + <ScrollBar Style="HScrollBar" Maximum="10" /> + </GroupBox> + <GroupBox Style="allWidgetCell2" Caption="TabView"> + <TabView > + <Widget Name="tab1" Background="Grey"/> + <Widget Name="tab2" Background="DarkSlateGrey" IsVisible="false"/> + <Widget Name="tab3" Background="DarkRed" IsVisible="false"/> + </TabView > + </GroupBox> + <GroupBox Style="allWidgetCell2" Caption="Table"> + <Table Columns="Column1,Fit;Column2,Fit;Column3,Stretched" > + <TableRow Height="Fit" > + <Label/> + <Label/> + <Label/> + </TableRow> + <TableRow Height="Fit" > + <Label/> + <Label/> + <Label/> + </TableRow> + <TableRow Height="Fit" > + <Label/> + </TableRow> + </Table> + </GroupBox> + </HorizontalStack> +</VerticalStack> diff --git a/Samples/common/ui/Interfaces/Experimental/multiColorPick2.crow b/Samples/common/ui/Interfaces/Experimental/multiColorPick2.crow index 0d3c04e7..5d6e2364 100644 --- a/Samples/common/ui/Interfaces/Experimental/multiColorPick2.crow +++ b/Samples/common/ui/Interfaces/Experimental/multiColorPick2.crow @@ -11,7 +11,7 @@ </HorizontalStack> </Template>/> <TabView MinimumSize="{../MinimumPopupSize}" Width="200" Height="200" > - <ColorPicker Name="HSV" CurrentColor="{²../../../CurrentColor}" Background="Onyx"/> + <ColorPicker Name="HSV" CurrentColor="{²../../../CurrentColor}" Background="Onyx" BubbleMouseEvent="false"/> <ColorPicker IsVisible="false" Name="Names" CurrentColor="{²../../../CurrentColor}" Height="Stretched" Background="Onyx"> <Template> <ListBox Width="Stretched" Data="{./AvailableColors}" SelectedItemChanged="./onSelectedItemChanged"> @@ -28,7 +28,7 @@ </ListBox> </Template> </ColorPicker> - </TabView> + </TabView> </Popper> </Template> </ColorPicker> diff --git a/Samples/common/ui/Interfaces/Experimental/popperTest.crow b/Samples/common/ui/Interfaces/Experimental/popperTest.crow new file mode 100644 index 00000000..c0106c17 --- /dev/null +++ b/Samples/common/ui/Interfaces/Experimental/popperTest.crow @@ -0,0 +1,2 @@ + +<Label Background="RebeccaPurple"/>
\ No newline at end of file diff --git a/Samples/common/ui/Interfaces/Experimental/tabviewWithScrollTabName.crow b/Samples/common/ui/Interfaces/Experimental/tabviewWithScrollTabName.crow new file mode 100644 index 00000000..4b29646e --- /dev/null +++ b/Samples/common/ui/Interfaces/Experimental/tabviewWithScrollTabName.crow @@ -0,0 +1,40 @@ +<TabView Orientation="Horizontal"> + <Template> + <GenericStack Orientation="{./OppositeOrientation}" Spacing="0" Background="{./Background}"> + <ListBox Data="{./Items}" Height="Fit" HorizontalAlignment="Left" VerticalAlignment="Top" SelectedItem="{²./SelectedItem}"> + <Template> + <VerticalStack Spacing="0" > + <Scroller Name="ItemsScroller" > + <GenericStack Orientation="{../../../../../Orientation}" Width="Fit" Name="ItemsContainer" HorizontalAlignment="Left"/> + </Scroller> + <ScrollBar Orientation="Horizontal" Foreground="RoyalBlue" Height="6" Width="Stretched" CornerRadius="3" + Value="{²../ItemsScroller.ScrollX}" + LargeIncrement="{../ItemsScroller.PageWidth}" SmallIncrement="1" + CursorRatio="{../ItemsScroller.ChildWidthRatio}" Maximum="{../ItemsScroller.MaxScrollX}"> + <Template> + <Container Margin="1" Background="{./Background}"> + <Widget Name="Cursor" Background="{./Foreground}" CornerRadius="{./CornerRadius}"/> + </Container> + </Template> + </ScrollBar> + </VerticalStack> + </Template> + <ItemTemplate> + <ListItem Fit="true" Background="${InactiveTabItem}" IsSelected="{IsVisible}" Margin="5" + Selected="{.DataSource.Visible='true'};{Background=.DataSource.Background}" + Unselected="{.DataSource.Visible='false'};{Background=${InactiveTabItem}}"> + <Label Text="{Name}" Width="200" /> + </ListItem> + </ItemTemplate> + </ListBox> + <Group Name="ItemsContainer" /> + </GenericStack> + </Template> + <GroupBox Name="item 1" Caption="item 1" IsVisible="true" Background="Violet"/> + <GroupBox Name="item 2" Caption="item 2" IsVisible="false" Background="CornflowerBlue"/> + <GroupBox Name="item 3" Caption="item 3" IsVisible="false" Background="Red"/> + <GroupBox Name="item 4" Caption="item 4" IsVisible="false" Background="Green"/> + <GroupBox Name="item 5" Caption="item 5" IsVisible="false" Background="Brown"/> + <GroupBox Name="item 6" Caption="item 6" IsVisible="false" Background="RoyalBlue"/> + <GroupBox Name="item 7" Caption="item 7" IsVisible="false" Background="Yellow"/> +</TabView>
\ No newline at end of file diff --git a/Samples/common/ui/Interfaces/Experimental/testButton.crow b/Samples/common/ui/Interfaces/Experimental/testButton.crow new file mode 100644 index 00000000..a1b9fd5f --- /dev/null +++ b/Samples/common/ui/Interfaces/Experimental/testButton.crow @@ -0,0 +1 @@ +<Button Caption='Hello World' />
\ No newline at end of file diff --git a/Samples/common/ui/Interfaces/Experimental/testColorPickerTemplate.crow b/Samples/common/ui/Interfaces/Experimental/testColorPickerTemplate.crow new file mode 100644 index 00000000..7c7ebe13 --- /dev/null +++ b/Samples/common/ui/Interfaces/Experimental/testColorPickerTemplate.crow @@ -0,0 +1,3 @@ +<VerticalStack Height="Fit" Background="DarkBlue"> + <ColorPicker Template="Interfaces/colorPicker.tmp" Background="Red"/> +</VerticalStack>
\ No newline at end of file diff --git a/Samples/common/ui/Interfaces/Experimental/testScroll.crow b/Samples/common/ui/Interfaces/Experimental/testScroll.crow new file mode 100644 index 00000000..8316a5ce --- /dev/null +++ b/Samples/common/ui/Interfaces/Experimental/testScroll.crow @@ -0,0 +1,12 @@ +<Button Width="100" Height="200"> + <Template> +<VerticalStack > + <Scroller Name="ItemsScroller" Background="Red" Width="Stretched"> + <Label Text='Hello World and another part of text to test scrolling' Background='MediumSeaGreen' Margin='0' Fit="true" HorizontalAlignment="Left"/> + </Scroller> + <ScrollBar Style="HScrollBar" Value="{²../ItemsScroller.ScrollX}" + LargeIncrement="{../ItemsScroller.PageWidth}" SmallIncrement="1" + CursorRatio="{../ItemsScroller.ChildWidthRatio}" Maximum="{../ItemsScroller.MaxScrollX}"/> +</VerticalStack> + </Template> +</Button>
\ No newline at end of file diff --git a/Samples/common/ui/Interfaces/Experimental/testTypeViewer.goml b/Samples/common/ui/Interfaces/Experimental/testTypeViewer.goml deleted file mode 100644 index caa454fc..00000000 --- a/Samples/common/ui/Interfaces/Experimental/testTypeViewer.goml +++ /dev/null @@ -1,10 +0,0 @@ -<?xml version="1.0"?> - - <VerticalStack Height="Fit" Width="250" Name="hstack" Margin="0" Spacing="0"> - <Border Height="Fit" Width="Stretched" BorderWidth="2" CornerRadius="10" Background="SteelBlue"> - <Label Name="labName" Text="{Name}" Width="Stretched" Height="Fit" Margin="3"/> - </Border> - <ListBox Data="{Members}" Width="Stretched" Height="400" ItemTemplate="Interfaces/tmpMembers.goml" Focusable="true"> - - </ListBox> - </VerticalStack> diff --git a/Samples/common/ui/Interfaces/TemplatedContainer/0.crow b/Samples/common/ui/Interfaces/TemplatedContainer/0.crow deleted file mode 100644 index 5b267402..00000000 --- a/Samples/common/ui/Interfaces/TemplatedContainer/0.crow +++ /dev/null @@ -1,13 +0,0 @@ -<?xml version="1.0"?> -<Expandable Fit="true" Caption="Test expandable" Background="DimGrey"> - <VerticalStack Margin="5" > - <CheckBox Name="chk1" /> - <CheckBox Name="chk2" IsChecked="true"/> - <CheckBox Name="chk3" /> - <CheckBox Name="chk4" /> - <HorizontalStack Fit="true" Margin="2" Background="SeaGreen"> - <Label Name="captionFps" Text="Fps:" Width="30" TextAlignment="Right"/> - <Label Name="valueFps" Text="{fps}" Font="droid , 12" Width="Fit" TextAlignment="Center" Background="SeaGreen"/> - </HorizontalStack> - </VerticalStack> -</Expandable> diff --git a/Samples/common/ui/Interfaces/TemplatedContainer/6.crow b/Samples/common/ui/Interfaces/TemplatedContainer/6.crow deleted file mode 100644 index 641d58f9..00000000 --- a/Samples/common/ui/Interfaces/TemplatedContainer/6.crow +++ /dev/null @@ -1,21 +0,0 @@ -<Expandable Width="Stretched" Background="Grey"> - <Expandable Width="Stretched" Background="LightBlue"> - <Expandable Width="Stretched" Background="Green"> - <Expandable Width="Stretched" Background="LimeGreen"> - <Expandable Width="Stretched" Background="DimGrey"> - <Expandable Width="Stretched" Background="Yellow"> - <Expandable Width="Stretched" Background="SeaGreen"> - <Expandable Width="Stretched" Background="Blue"> - <Expandable Width="Stretched" Background="RoyalBlue"> - <Expandable Width="Stretched" Background="Green"> - <Label Background="Red" Text="{fps}"/> - </Expandable> - </Expandable> - </Expandable> - </Expandable> - </Expandable> - </Expandable> - </Expandable> - </Expandable> - </Expandable> - </Expandable>
\ No newline at end of file diff --git a/Samples/common/ui/Interfaces/TemplatedGroup/menu0.crow b/Samples/common/ui/Interfaces/TemplatedGroup/menu0.crow index 0465c644..1d157431 100644 --- a/Samples/common/ui/Interfaces/TemplatedGroup/menu0.crow +++ b/Samples/common/ui/Interfaces/TemplatedGroup/menu0.crow @@ -1,18 +1,10 @@ <?xml version="1.0"?> <Menu Data="{AllCommands}"> - <ItemTemplate DataType="Crow.Command"> - <Button Command="{}"> - <Template> - <Label Text="{./Caption}" Width="Stretched" Height="Stretched" Margin="3" - MouseEnter="{Background=${ControlHighlight}}" - MouseLeave="{Background=Transparent}"/> - </Template> - </Button> - </ItemTemplate> + <ItemTemplate DataType="Crow.Command" Path="Interfaces/menuCommand.itmp"/> <ItemTemplate DataType="Crow.CommandGroup" > <MenuItem Data="{Commands}" Width="Fit" IsEnabled="{CanExecute}"> <Template> - <Popper PopDirection="Bottom" Caption="{Caption}" + <Popper PopDirection="Bottom" Caption="{Caption}" Width="Fit" MouseEnter="{Background=${ControlHighlight}}" MouseLeave="{Background=Transparent}"> <Template> @@ -22,15 +14,7 @@ <VerticalStack Name="ItemsContainer" Fit="true" Background="Jet"/> </Popper> </Template> - <ItemTemplate DataType="Crow.Command"> - <Button Command="{}" Width="Stretched"> - <Template> - <Label Text="{./Caption}" Width="Stretched" Height="Stretched" Margin="3" - - MouseEnter="{Background=${ControlHighlight}}" - MouseLeave="{Background=Transparent}"/> - </Template> - </Button> </ItemTemplate> + <ItemTemplate DataType="Crow.Command" Path="Interfaces/menuCommand.itmp"/> <ItemTemplate DataType="Crow.CommandGroup" > <MenuItem Data="{Commands}" Width="Stretched" IsEnabled="{CanExecute}"> <Template> @@ -46,15 +30,7 @@ </Border> </Popper> </Template> - <ItemTemplate DataType="Crow.Command"> - <Button Command="{}" Width="Stretched"> - <Template> - <Label Text="{./Caption}" Width="Stretched" Height="Stretched" Margin="3" - MouseEnter="{Background=${ControlHighlight}}" - MouseLeave="{Background=Transparent}"/> - </Template> - </Button> - </ItemTemplate> + <ItemTemplate DataType="Crow.Command" Path="Interfaces/menuCommand.itmp"/> </MenuItem> </ItemTemplate> </MenuItem> diff --git a/Samples/common/ui/Interfaces/TemplatedGroup/menu1.crow b/Samples/common/ui/Interfaces/TemplatedGroup/menu1.crow new file mode 100644 index 00000000..e8f95115 --- /dev/null +++ b/Samples/common/ui/Interfaces/TemplatedGroup/menu1.crow @@ -0,0 +1,20 @@ +<?xml version="1.0"?> +<Menu Data="{AllCommands}"> + <ItemTemplate DataType="Crow.Command" Path="Interfaces/menuCommand.itmp"/> + <ItemTemplate DataType="Crow.CommandGroup" > + <MenuItem Data="{Commands}" Width="Fit" IsEnabled="{CanExecute}" + ItemTemplate="Interfaces/menuItem.itmp"> + <Template> + <Popper PopDirection="Bottom" Caption="{Caption}" Width="Fit" + MouseEnter="{Background=${ControlHighlight}}" + MouseLeave="{Background=Transparent}"> + <Template> + <Label Text="{./Caption}" Width="Stretched" Height="Fit" Margin="3" + Background="{./Background}"/> + </Template> + <VerticalStack Name="ItemsContainer" Fit="true" Background="Jet"/> + </Popper> + </Template> + </MenuItem> + </ItemTemplate> +</Menu>
\ No newline at end of file diff --git a/Samples/common/ui/Interfaces/TemplatedGroup/menu2.crow b/Samples/common/ui/Interfaces/TemplatedGroup/menu2.crow new file mode 100644 index 00000000..0a62cf8c --- /dev/null +++ b/Samples/common/ui/Interfaces/TemplatedGroup/menu2.crow @@ -0,0 +1,10 @@ +<?xml version="1.0"?> +<Menu Data="{AllCommands}" > + <ItemTemplate DataType="Crow.Command" Path="Interfaces/menuCommand.itmp"/> + <ItemTemplate DataType="Crow.CommandGroup" > + <MenuItem Data="{Commands}" Width="Fit" IsEnabled="{CanExecute}" + Template="Interfaces/menuItem.template" + ItemTemplate="Interfaces/menuItem.itmp"> + </MenuItem> + </ItemTemplate> +</Menu>
\ No newline at end of file diff --git a/Samples/common/ui/Interfaces/TemplatedGroup/menu3.crow b/Samples/common/ui/Interfaces/TemplatedGroup/menu3.crow new file mode 100644 index 00000000..d58c9653 --- /dev/null +++ b/Samples/common/ui/Interfaces/TemplatedGroup/menu3.crow @@ -0,0 +1,34 @@ +<?xml version="1.0"?> +<Menu Data="{AllCommands}" > + <ItemTemplate DataType="Crow.Command" Path="Interfaces/menuCommand.itmp"/> + <ItemTemplate DataType="Crow.CommandGroup" > + <MenuItem Data="{Commands}" Width="Fit" IsEnabled="{CanExecute}"> + <Template> + <Popper PopDirection="Bottom" Caption="{Caption}" Width="Fit" IsPopped="{²./IsOpened}" + MouseEnter="{Background=${ControlHighlight}}" + MouseLeave="{Background=Transparent}"> + <Template> + <Label Text="{./Caption}" Width="Stretched" Height="Fit" Margin="3" + Background="{./Background}"/> + </Template> + <VerticalStack Margin="0" Name="ItemsContainer" Fit="true" Background="Jet"/> + </Popper> + </Template> + <ItemTemplate DataType="Crow.Command" Path="#Crow.MenuButton.template"/> + <ItemTemplate DataType="Crow.CommandGroup" Data="Commands"> + <Popper PopDirection="Right" Caption="{Caption}" IsEnabled="{CanExecute}" Width="Stretched" + PopWidth="{./PopWidth}" PopHeight="{./PopHeight}" + MouseEnter="{Background=${ControlHighlight}}" + MouseLeave="{Background=Transparent}"> + <Template> + <HorizontalStack Background="{./Background}" Width="Stretched" Height="Stretched" Margin="3"> + <Label Text="{./Caption}" Width="Fit" Height="Stretched"/> + <Label Text="..."/> + </HorizontalStack> + </Template> + <VerticalStack Margin="0" Name="ItemsContainer" Width="{../PopWidth}" Height="{../PopHeight}" Background="${MenuBackground}"/> + </Popper> + </ItemTemplate> + </MenuItem> + </ItemTemplate> +</Menu>
\ No newline at end of file diff --git a/Samples/common/ui/Interfaces/Wrapper/1.1.crow b/Samples/common/ui/Interfaces/Wrapper/1.1.crow index 6afbff21..29658b77 100644 --- a/Samples/common/ui/Interfaces/Wrapper/1.1.crow +++ b/Samples/common/ui/Interfaces/Wrapper/1.1.crow @@ -1,6 +1,6 @@ <?xml version="1.0"?> -<Window Caption="Vertical Wrapper" Width="50%" Height="90%"> - <Wrapper Orientation="Vertical" Height="Stretched" Width="Fit" Margin="5" Background="MediumSeaGreen" Spacing="1" > +<Window Caption="Vertical Wrapper" Width="50%" Height="Fit"> + <Wrapper Orientation="Vertical" Height="Stretched" Width="Stretched" Margin="5" Background="MediumSeaGreen" Spacing="2" > <Widget Width="50" Height="50" Background="SeaGreen"/> <Widget Width="50" Height="50" Background="SeaGreen"/> <Widget Width="50" Height="50" Background="SeaGreen"/> diff --git a/Samples/common/ui/Interfaces/Wrapper/1.crow b/Samples/common/ui/Interfaces/Wrapper/1.crow index 58c79eea..ed0d6419 100644 --- a/Samples/common/ui/Interfaces/Wrapper/1.crow +++ b/Samples/common/ui/Interfaces/Wrapper/1.crow @@ -1,6 +1,6 @@ <?xml version="1.0"?> -<Window Caption="Vertical Wrapper" Width="50%" Height="50%"> - <Wrapper Orientation="Vertical" Height="Fit" Width="Fit" Margin="5" Background="MediumSeaGreen" Spacing="1" > +<Window Caption="Vertical Wrapper" Width="50%" Height="Fit"> + <Wrapper Orientation="Vertical" Height="Stretched" Width="Stretched" Margin="5" Background="MediumSeaGreen" Spacing="2" > <Widget Width="50" Height="50" Background="SeaGreen"/> <Widget Width="50" Height="50" Background="SeaGreen"/> <Widget Width="50" Height="50" Background="SeaGreen"/> diff --git a/Samples/common/ui/Interfaces/colorPicker.tmp b/Samples/common/ui/Interfaces/colorPicker.tmp new file mode 100644 index 00000000..085e17ad --- /dev/null +++ b/Samples/common/ui/Interfaces/colorPicker.tmp @@ -0,0 +1,29 @@ +<Popper Margin="0" Caption="{./CurrentColor}" Background="{./Background}" > + <Template> + <HorizontalStack Margin="3" Spacing="3" Background="{./Background}"> + <Border Width="18" Height="12" CornerRadius="3" + Background="{../../../CurrentColor}"> + </Border> + <Label Width="Stretched" Text="{./Caption}" /> + </HorizontalStack> + </Template>/> + <TabView MinimumSize="{../MinimumPopupSize}" Width="200" Height="200" > + <ColorPicker Name="HSV" CurrentColor="{²../../../CurrentColor}" Background="Onyx" BubbleMouseEvent="false"/> + <ColorPicker IsVisible="false" Name="Names" CurrentColor="{²../../../CurrentColor}" Height="Stretched" Background="Onyx"> + <Template> + <ListBox Width="Stretched" Data="{./AvailableColors}" SelectedItemChanged="./onSelectedItemChanged"> + <Template> + <Scroller Name="scroller1" Margin="5" ClipToClientRect="true" Background="Onyx"> + <Wrapper Name="ItemsContainer" Height="Fit" VerticalAlignment="Top"/> + </Scroller> + </Template> + <ItemTemplate> + <Border Width="16" Height="16" Background="{}" Foreground="Transparent" Tooltip="{}" + MouseEnter="{Foreground=Black}" + MouseLeave="{Foreground=Transparent}"/> + </ItemTemplate> + </ListBox> + </Template> + </ColorPicker> + </TabView> +</Popper>
\ No newline at end of file diff --git a/Samples/common/ui/Interfaces/grpBox.tmp b/Samples/common/ui/Interfaces/grpBox.tmp new file mode 100644 index 00000000..54504129 --- /dev/null +++ b/Samples/common/ui/Interfaces/grpBox.tmp @@ -0,0 +1,5 @@ +<Group Background="{./Background}"> + <Container Name="Content" Margin="0" MinimumSize="70,10"/> + <Label Font="sans, 10" Foreground="DarkGrey" Text="{./Caption}" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="4"/> + <Label Font="sans, 10" Foreground="White" Text="{./Caption}" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="2"/> +</Group> diff --git a/Samples/common/ui/Interfaces/grpBox2.tmp b/Samples/common/ui/Interfaces/grpBox2.tmp new file mode 100644 index 00000000..0fa98922 --- /dev/null +++ b/Samples/common/ui/Interfaces/grpBox2.tmp @@ -0,0 +1,10 @@ +<VerticalStack Margin="2" Background="Transparent" + MouseEnter = "{Background=DarkGrey};{lab.Foreground=SkyBlue}" + MouseLeave = "{Background=Transparent};{lab.Foreground=DarkGrey}"> + <!--<Group Height="Fit"> + <Label Font="sans, 10" Foreground="DarkGrey" Text="{./Caption}" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="4"/> + <Label Font="sans, 10" Foreground="White" Text="{./Caption}" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="2"/> + </Group>--> + <Label Name="lab" Font="sans, 9" Foreground="DarkGrey" Text="{./Caption}" Margin="1"/> + <Container Name="Content" Margin="5" Background="{AllWidgetBackground}"/> +</VerticalStack> diff --git a/Samples/common/ui/Interfaces/grpBoxUnamed.tmp b/Samples/common/ui/Interfaces/grpBoxUnamed.tmp new file mode 100644 index 00000000..8ea9ad98 --- /dev/null +++ b/Samples/common/ui/Interfaces/grpBoxUnamed.tmp @@ -0,0 +1 @@ +<Container Background="{./Background}" Name="Content" Margin="0" MinimumSize="70,10"/> diff --git a/Samples/common/ui/Interfaces/menuCommand.itmp b/Samples/common/ui/Interfaces/menuCommand.itmp new file mode 100644 index 00000000..abc3ff2c --- /dev/null +++ b/Samples/common/ui/Interfaces/menuCommand.itmp @@ -0,0 +1,8 @@ +<?xml version="1.0"?> +<Button Command="{}" Width="Stretched"> + <Template> + <Label Text="{./Caption}" Width="Stretched" Height="Stretched" Margin="3" + MouseEnter="{Background=${ControlHighlight}}" + MouseLeave="{Background=Transparent}"/> + </Template> +</Button> diff --git a/Samples/common/ui/Interfaces/menuItem.itmp b/Samples/common/ui/Interfaces/menuItem.itmp new file mode 100644 index 00000000..04bc10a6 --- /dev/null +++ b/Samples/common/ui/Interfaces/menuItem.itmp @@ -0,0 +1,13 @@ +<?xml version="1.0"?> +<ItemTemplate DataType="Crow.Command" Path="Interfaces/menuCommand.itmp"/> +<ItemTemplate DataType="Crow.CommandGroup" Data="Commands"> + <Popper PopDirection="Right" Caption="{Caption}" IsEnabled="{CanExecute}" Width="Stretched" + MouseEnter="{Background=${ControlHighlight}}" + MouseLeave="{Background=Transparent}"> + <Template> + <Label Text="{./Caption}" Width="Stretched" Height="Stretched" Margin="3" + Background="{./Background}"/> + </Template> + <VerticalStack Margin="0" Name="ItemsContainer" Fit="true" Background="Jet"/> + </Popper> +</ItemTemplate> diff --git a/Samples/common/ui/Interfaces/menuItem.template b/Samples/common/ui/Interfaces/menuItem.template new file mode 100644 index 00000000..1735e34b --- /dev/null +++ b/Samples/common/ui/Interfaces/menuItem.template @@ -0,0 +1,12 @@ +<?xml version="1.0"?> +<Popper PopDirection="Bottom" Caption="{Caption}" Width="Stretched" IsPopped="{²./IsOpened}" + MouseEnter="{Background=${ControlHighlight}}" + MouseLeave="{Background=Transparent}"> + <Template> + <Label Text="{./Caption}" Width="Stretched" Height="Fit" Margin="3" + Background="{./Background}"/> + </Template> + <VerticalStack Margin="0" Name="ItemsContainer" Fit="true" Background="Jet"/> +</Popper> + + diff --git a/Samples/common/ui/templates/ColorPicker.template b/Samples/common/ui/templates/ColorPicker.template index b7c0ce4b..085e17ad 100644 --- a/Samples/common/ui/templates/ColorPicker.template +++ b/Samples/common/ui/templates/ColorPicker.template @@ -1,5 +1,4 @@ -<?xml version="1.0"?> -<Popper Margin="0" Caption="{./CurrentColor}" Background="{./Background}" > +<Popper Margin="0" Caption="{./CurrentColor}" Background="{./Background}" > <Template> <HorizontalStack Margin="3" Spacing="3" Background="{./Background}"> <Border Width="18" Height="12" CornerRadius="3" @@ -7,9 +6,9 @@ </Border> <Label Width="Stretched" Text="{./Caption}" /> </HorizontalStack> - </Template> + </Template>/> <TabView MinimumSize="{../MinimumPopupSize}" Width="200" Height="200" > - <ColorPicker Name="HSV" CurrentColor="{²../../../CurrentColor}" Background="Onyx"/> + <ColorPicker Name="HSV" CurrentColor="{²../../../CurrentColor}" Background="Onyx" BubbleMouseEvent="false"/> <ColorPicker IsVisible="false" Name="Names" CurrentColor="{²../../../CurrentColor}" Height="Stretched" Background="Onyx"> <Template> <ListBox Width="Stretched" Data="{./AvailableColors}" SelectedItemChanged="./onSelectedItemChanged"> diff --git a/Samples/common/ui/templates/perfMsr.crow b/Samples/common/ui/templates/perfMsr.crow index 06f7ae3c..9f8a77f8 100644 --- a/Samples/common/ui/templates/perfMsr.crow +++ b/Samples/common/ui/templates/perfMsr.crow @@ -1,6 +1,6 @@ -<?xml version="1.0"?> +<?xml version="1.0"?> - <VerticalStack Spacing="1" Height="Fit" Width="Stretched"> + <VerticalStack Spacing="1" Height="Fit" Width="Stretched" Background="DarkGrey"> <HorizontalStack Background="DarkSlateGrey"> <Label Text="{Name}" Width="Stretched" Font="doid bold, 10" Margin="2"/> <Button Caption="Reset" MouseClick="onResetClick" Height="Fit"/> diff --git a/Samples/common/ui/templates/spinner.template b/Samples/common/ui/templates/spinner.template new file mode 100644 index 00000000..a9313358 --- /dev/null +++ b/Samples/common/ui/templates/spinner.template @@ -0,0 +1,18 @@ +<?xml version="1.0" ?> +<Border Style="ControlBorder" Background="{./Background}" CornerRadius="{./CornerRadius}" Margin="1"> + <VerticalStack Spacing="0"> + <HorizontalStack Spacing="4"> + <Label Text="{./Caption}" Style="ControlCaption" Margin="2"/> + <TextBox Style="ControlEditableText" Foreground="{./Foreground}" Font="{./Font}" Width="Stretched" Margin="2" + Text="{²./Value}" TextAlignment="Right" Background="Jet" /> + <VerticalStack Width="16" Height="Stretched" Spacing="1" Margin="1"> + <Shape KeepProportions="false" Margin="0" Style="ArrowBut" Height="50%" MouseDown="./onUp" Size="10,10" Path="M 4.5,0.5 L 9.5,9.5 L 0.5,9.5 Z F"/> + <Shape KeepProportions="false" Margin="0" Style="ArrowBut" Height="50%" MouseDown="./onDown" Size="10,10" Path="M 0.5,0.5 L 9.5,0.5 L 4.5,9.5 Z F"/> + </VerticalStack> + </HorizontalStack> + <Slider Background="Onyx" Foreground="Grey" Height="6" Value="{²./Value}" Minimum="{./Minimum}" Maximum="{./Maximum}" + Width = "Stretched" + MouseEnter="{Foreground=${ControlHighlight}}" + MouseLeave="{Foreground=Grey}" /> + </VerticalStack> +</Border> |