GlobalSection(MonoDevelopProperties) = preSolution
Policies = $0
$0.StandardHeader = $1
- $1.Text = @Copyright (c) ${Year} ${AuthorName} <${AuthorEmail}>\n\nThis code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
+ $1.Text = @Copyright (c) 2013-${Year} ${AuthorName} <${AuthorEmail}>\n\nThis code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
$0.DotNetNamingPolicy = $2
$0.TextStylePolicy = $3
$3.EolMarker = Unix
}
HArrowBut {
MouseRepeat="true";
- Focusable="true";
+ Focusable="true";
Foreground="Onyx";
Background="vgradient|0:Grey|1:DimGrey";
MouseDown="{Background=vgradient|0:White|0.4:DarkBlue|1:Jet}";
Orientation = "Horizontal";
}
EnumSelector {
- Orientation = "Vertical";
- Height = "Fit";
- Spacing = "0";
+ Width = "Fit";
+ Height = "Fit";
}
labColor {
Margin="2";
<Border BorderWidth="1" Foreground="{./Foreground}" Background="{./Background}">
<GenericStack Orientation="{./Orientation}" Spacing="0">
<Shape Style="HArrowBut" MouseDown="./onScrollBack"
- Margin="1" Width="6" Size="10,10" Path="M 0.5,4.5 L 9.5,0.5 L 9.5,9.5 Z"/>
+ Margin="1" Width="6" Size="10,10" Path="M 0.5,4.5 L 9.5,0.5 L 9.5,9.5 Z G"/>
<Slider Name="Slider"
Orientation="{./Orientation}"
Value="{²./Value}"
Background="Transparent"
Foreground="{./Foreground}"/>
<Shape Style="HArrowBut" MouseDown="./onScrollForth"
- Margin="1" Width="6" Size="10,10" Path="M 0.5,0.5 L 9.5,4.5 L 0.5,9.5 Z"/>
+ Margin="1" Width="6" Size="10,10" Path="M 0.5,0.5 L 9.5,4.5 L 0.5,9.5 Z G"/>
</GenericStack>
</Border>
\ No newline at end of file
<Border BorderWidth="1" Foreground="{./Foreground}" Background="{./Background}">
<GenericStack Orientation="{./Orientation}" Spacing="0">
<Shape Style="ArrowBut" MouseDown="./onScrollBack"
- Margin="1" Height="6" Size="10,10" Path="M 4.5,0.5 L 9.5,9.5 L 0.5,9.5 Z"/>
+ Margin="1" Height="6" Size="10,10" Path="M 4.5,0.5 L 9.5,9.5 L 0.5,9.5 Z G"/>
<Slider Name="Slider"
Orientation="{./Orientation}"
Value="{²./Value}"
Foreground="{./Foreground}"
Background="Transparent"/>
<Shape Style="ArrowBut" MouseDown="./onScrollForth"
- Margin="1" Height="6" Size="10,10" Path="M 0.5,0.5 L 9.5,0.5 L 4.5,9.5 Z"/>
+ Margin="1" Height="6" Size="10,10" Path="M 0.5,0.5 L 9.5,0.5 L 4.5,9.5 Z G"/>
</GenericStack>
</Border>
\ No newline at end of file
Text="{²./Value}" TextAlignment="Right" Margin="0"/>
</Border>
<VerticalStack MinimumSize="13,13" Width="16" Height="Stretched" Spacing="1" Margin="1">
- <Shape 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"/>
- <Shape 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"/>
+ <Shape 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 G"/>
+ <Shape 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 G"/>
</VerticalStack>
</HorizontalStack>
-//
-// Enums.cs
+// Copyright (c) 2013-2020 Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
//
-// Author:
-// Jean-Philippe Bruyère <jp.bruyere@hotmail.com>
-//
-// Copyright (c) 2013-2017 Jean-Philippe Bruyère
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
+// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
namespace Crow
{
- public enum Orientation
+ public enum Orientation
{
Horizontal,
Vertical
+// Copyright (c) 2013-2020 Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
//
-// Container.cs
-//
-// Author:
-// Jean-Philippe Bruyère <jp.bruyere@hotmail.com>
-//
-// Copyright (c) 2013-2017 Jean-Philippe Bruyère
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
+// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
using System;
using System.Xml.Serialization;
/// Convenient widget for selecting value among enum values. This is a templated control
/// expecting a 'Group' widget named 'Content' inside the template to handle the enum values display.
/// </summary>
+ /// <remarks>
+ /// Instanced RadioButton's names are set to enum values, and Tags are populated with a string build with
+ /// 'IconsPrefix+EnumValueName+IconsExtension to ease associating icons with values.
+ /// There's many other way to use this control, for examples see 'testEnumSelector.crow' in the samples directory.
+ /// </remarks>
public class EnumSelector : TemplatedControl
{
#region CTOR
#region private fields
Enum enumValue;
Type enumType;
- string rbStyle;
+ string rbStyle, iconsPrefix, iconsExtension;
IML.Instantiator radioButtonITor;
#endregion
#region public properties
+ [DefaultValue ("#Icons.")]
+ public string IconsPrefix {
+ get => iconsPrefix;
+ set {
+ if (iconsPrefix == value)
+ return;
+ iconsPrefix = value;
+ forceRefresh ();
+ NotifyValueChanged ("IconsPrefix", iconsPrefix);
+ }
+ }
+ [DefaultValue (".svg")]
+ public string IconsExtension {
+ get => iconsExtension;
+ set {
+ if (iconsExtension == value)
+ return;
+ iconsExtension = value;
+ forceRefresh ();
+ NotifyValueChanged ("IconsExtension", iconsExtension);
+ }
+ }
/// <summary>
/// Enum values are presented with RadioButton controls. Here you may specify a template to use
/// for the radio buttons.
return;
rbStyle = value;
radioButtonITor = null;
- //force refresh to use new template if values are already displayed
- if (enumValue != null) {
- Enum tmp = enumValue;
- enumValue = null;
- EnumValue = tmp;
- }
+ forceRefresh ();
NotifyValueChanged ("RadioButtonStyle", rbStyle);
}
}
RadioButton rb = radioButtonITor.CreateInstance<RadioButton> ();
rb.Caption = en;
rb.LogicalParent = this;
+ rb.Tag = $"{iconsPrefix}{en}{IconsExtension}";
if (enumValue.ToString () == en)
rb.IsChecked = true;
rb.Checked += (sender, e) => (((RadioButton)sender).LogicalParent as EnumSelector).EnumValue = (Enum)Enum.Parse (enumType, (sender as RadioButton).Caption);
enumValueContainer.AddChild (rb);
}
-
+
+ } else {
+ foreach (RadioButton rb in enumValueContainer.Children) {
+ if (rb.Caption == enumValue.ToString ())
+ rb.IsChecked = true;
+ else if (rb.IsChecked)
+ rb.IsChecked = false;
+ }
}
} else
enumValueContainer.ClearChildren ();
}
#endregion
+ //force refresh to use new template if values are already displayed
+ void forceRefresh ()
+ {
+ if (enumValue != null) {
+ Enum tmp = enumValue;
+ enumValue = null;
+ EnumValue = tmp;
+ }
+ }
}
}
-//
-// GroupBox.cs
+// Copyright (c) 2013-2020 Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
//
-// Author:
-// Jean-Philippe Bruyère <jp.bruyere@hotmail.com>
-//
-// Copyright (c) 2013-2017 Jean-Philippe Bruyère
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
+// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
using System;
using System.Xml.Serialization;
_orientation = value;
NotifyValueChanged ("Orientation", _orientation);
if (_orientation == Orientation.Horizontal)
- NotifyValueChanged ("ScrollBackShape", "M 1.5,3.5 L 6.5,0.5 L 6.5,6.5 Z");
+ NotifyValueChanged ("ScrollBackShape", "M 1.5,3.5 L 6.5,0.5 L 6.5,6.5 Z G");
else
- NotifyValueChanged ("ScrollBackShape", "M 4.5,0.5 L 9.5,9.5 L 0.5,9.5 Z");
+ NotifyValueChanged ("ScrollBackShape", "M 4.5,0.5 L 9.5,9.5 L 0.5,9.5 Z G");
RegisterForGraphicUpdate ();
}
namespace Crow
{
+ /// <summary>
+ /// String Parser for drawing shape
+ /// </summary>
+ /// <remarks>
+ /// All fields are separated by one or more space. Each statement is composed of one letter followed by 0 to n
+ /// double parameters. The following list enumerate available instructions:
+ /// - M x y: Move to (x,y) absolute coordinate.
+ /// - m x y: Relative move to by x in the horizontal direction and y in the vertical.
+ /// - L x y: Line to (x,y)
+ /// - l x y: trace line from current point by moving pen by x and y in each direction.
+ /// - R x y w h: draw rectangle at (x,y) with width and height equal to w and h.
+ /// - C x1 y1 x2 y2 x3 y3: draw bezier curve with current point as first control point, and parameters as others.
+ /// - c x1 y1 x2 y2 x3 y3: draw bezier curve with control points relative to current position.
+ /// - A x y r a1 a2: draw positive arc at (x,y) with radius r from angle a1 to angle a2.
+ /// - N x y r a1 a2: draw negative arc at (x,y) with radius r from angle a1 to angle a2.
+ /// - Z: close path
+ /// - F: fill path.
+ /// - f: fill preserve.
+ /// - G: stroke path.
+ /// - g: stroke preserve.
+ /// - S x: set line width to x.
+ /// - O r g b a: set solid color as source with rgba values.
+ /// </remarks>
public class PathParser : StringReader
{
- public PathParser (string str) : base (str) {}
+ public PathParser (string str) : base (str) { }
- double readDouble () {
- StringBuilder tmp = new StringBuilder();
+ double readDouble ()
+ {
+ StringBuilder tmp = new StringBuilder ();
- while (Peek () >= 0) {
- char c = (char)Read();
- if (c.IsWhiteSpaceOrNewLine()) {
+ while (Peek () >= 0) {
+ char c = (char)Read ();
+ if (c.IsWhiteSpaceOrNewLine ()) {
if (tmp.Length == 0)
continue;
else
break;
} else if (c == ',')
- break;
+ break;
tmp.Append (c);
}
return double.Parse (tmp.ToString ());
}
- public void Draw (Context gr) {
- while (Peek () >= 0) {
- char c = (char)Read ();
- if (c.IsWhiteSpaceOrNewLine ())
- continue;
- switch (c) {
- case 'M':
- gr.MoveTo (readDouble (), readDouble ());
- break;
- case 'm':
- gr.RelMoveTo (readDouble (), readDouble ());
- break;
- case 'L':
- gr.LineTo (readDouble (), readDouble ());
- break;
- case 'l':
- gr.RelLineTo (readDouble (), readDouble ());
- break;
- case 'C':
- gr.CurveTo (readDouble (), readDouble (), readDouble (), readDouble (), readDouble (), readDouble ());
- break;
- case 'c':
- gr.RelCurveTo (readDouble (), readDouble (), readDouble (), readDouble (), readDouble (), readDouble ());
- break;
- case 'Z':
- gr.ClosePath ();
- break;
- case 'F':
- gr.Fill ();
- break;
- case 'G':
- gr.Stroke ();
- break;
- default:
- throw new Exception ("Invalid character in path string of Shape control");
+ public void Draw (Context gr, bool measure = false)
+ {
+ try {
+ while (Peek () >= 0) {
+ char c = (char)Read ();
+ if (c.IsWhiteSpaceOrNewLine ())
+ continue;
+ switch (c) {
+ case 'M':
+ gr.MoveTo (readDouble (), readDouble ());
+ break;
+ case 'm':
+ gr.RelMoveTo (readDouble (), readDouble ());
+ break;
+ case 'L':
+ gr.LineTo (readDouble (), readDouble ());
+ break;
+ case 'l':
+ gr.RelLineTo (readDouble (), readDouble ());
+ break;
+ case 'R':
+ gr.Rectangle (readDouble (), readDouble (), readDouble (), readDouble ());
+ break;
+ case 'C':
+ gr.CurveTo (readDouble (), readDouble (), readDouble (), readDouble (), readDouble (), readDouble ());
+ break;
+ case 'c':
+ gr.RelCurveTo (readDouble (), readDouble (), readDouble (), readDouble (), readDouble (), readDouble ());
+ break;
+ case 'A':
+ gr.Arc (readDouble (), readDouble (), readDouble (), readDouble (), readDouble ());
+ break;
+ case 'N':
+ gr.ArcNegative (readDouble (), readDouble (), readDouble (), readDouble (), readDouble ());
+ break;
+ case 'Z':
+ gr.ClosePath ();
+ break;
+ case 'f':
+ if (measure)
+ continue;
+ gr.FillPreserve ();
+ break;
+ case 'g':
+ if (measure)
+ break;
+ gr.StrokePreserve ();
+ break;
+ case 'F':
+ if (measure)
+ break;
+ gr.Fill ();
+ break;
+ case 'G':
+ if (measure)
+ break;
+ gr.Stroke ();
+ break;
+ case 'S':
+ gr.LineWidth = readDouble ();
+ break;
+ case 'O':
+ if (measure) {
+ readDouble (); readDouble (); readDouble (); readDouble ();
+ break;
+ }
+ gr.SetSourceRGBA (readDouble (), readDouble (), readDouble (), readDouble ());
+ break;
+ default:
+ throw new Exception ("Invalid character in path string of Shape control");
+ }
}
- }
+ } catch (Exception ex) {
+ System.Diagnostics.Debug.WriteLine ($"Error parsing path: {ex.Message}");
+ }
}
}
+ /// <summary>
+ /// Widget for drawing a shape define with a path expression as defined in the PathParser.
+ /// </summary>
public class Shape : Widget
{
#region CTOR
- protected Shape () : base() {}
- public Shape (Interface iface) : base (iface) {}
+ protected Shape () : base () { }
+ public Shape (Interface iface) : base (iface) { }
#endregion
string path;
double strokeWidth;
- Size size;
-
+ Size size;
+ /// <summary>
+ /// Path expression, for syntax see 'PathParser'.
+ /// </summary>
public string Path {
get { return path; }
set {
RegisterForGraphicUpdate ();
}
}
- [DefaultValue(1.0)]
+ /// <summary>
+ /// Default stroke width, may be overriden by a 'S' command in the path string.
+ /// </summary>
+ /// <value>The width of the stoke.</value>
+ [DefaultValue (1.0)]
public double StokeWidth {
get { return strokeWidth; }
set {
RegisterForGraphicUpdate ();
}
}
- [DefaultValue("0,0")]
- public Size Size
- {
- get { return size; }
- set
- {
- if (size == value)
- return;
- size = value;
- contentSize = default(Size);
- NotifyValueChanged("Size", size);
- RegisterForLayouting(LayoutingType.Sizing);
- }
- }
- protected override void onDraw(Context gr)
- {
+ /// <summary>
+ /// View box
+ /// </summary>
+ /// <value>The size.</value>
+ [DefaultValue ("0,0")]
+ public Size Size {
+ get { return size; }
+ set {
+ if (size == value)
+ return;
+ size = value;
+ contentSize = default (Size);
+ NotifyValueChanged ("Size", size);
+ RegisterForLayouting (LayoutingType.Sizing);
+ }
+ }
+ protected override void onDraw (Context gr)
+ {
+ base.onDraw (gr);
- if (string.IsNullOrEmpty(path))
- return;
+ if (string.IsNullOrEmpty (path))
+ return;
- gr.Save();
+ gr.Save ();
- Rectangle r = ClientRectangle;
+ Rectangle r = ClientRectangle;
- double sx = (double)r.Width / (double)(contentSize.Width == 0? size.Width : contentSize.Width);
- double sy = (double)r.Height / (double)(contentSize.Height == 0 ? size.Height : contentSize.Height);
+ double sx = (double)r.Width / (double)(contentSize.Width == 0 ? size.Width : contentSize.Width);
+ double sy = (double)r.Height / (double)(contentSize.Height == 0 ? size.Height : contentSize.Height);
- gr.Translate(r.Left, r.Top);
- gr.Scale (sx,sy);
+ gr.Translate (r.Left, r.Top);
+ gr.Scale (sx, sy);
- using (PathParser parser = new PathParser (path))
- parser.Draw (gr);
-
- Background.SetAsSource (gr, r);
- gr.FillPreserve ();
gr.LineWidth = strokeWidth;
Foreground.SetAsSource (gr, r);
- gr.Stroke ();
- gr.Restore();
+
+ using (PathParser parser = new PathParser (path))
+ parser.Draw (gr);
+
+ gr.Restore ();
}
protected override int measureRawSize (LayoutingType lt)
{
if ((lt == LayoutingType.Width && contentSize.Width == 0) || (lt == LayoutingType.Height && contentSize.Height == 0)) {
- if (size != default(Size))
- contentSize = size;
- else
- {
- using (Surface drawing = new ImageSurface(Format.A1, 1, 1))
- {
- using (Context ctx = new Context(drawing))
- {
- using (PathParser parser = new PathParser (path))
- parser.Draw (ctx);
- Rectangle r = ctx.StrokeExtents();
- contentSize = new Size(r.Right, r.Bottom);
- }
- }
- }
+ if (size != default (Size))
+ contentSize = size;
+ else {
+ using (Context ctx = new Context (IFace.surf)) {
+ using (PathParser parser = new PathParser (path))
+ parser.Draw (ctx, true);
+ Rectangle r = ctx.StrokeExtents ();
+ contentSize = new Size (r.Right, r.Bottom);
+ }
+ }
}
return lt == LayoutingType.Width ?
- contentSize.Width + 2 * Margin: contentSize.Height + 2 * Margin;
+ contentSize.Width + 2 * Margin : contentSize.Height + 2 * Margin;
}
}
}
<Authors>Jean-Philippe Bruyère</Authors>
<LangVersion>7.2</LangVersion>
- <CrowVersion>0.8.8</CrowVersion>
+ <CrowVersion>0.8.9</CrowVersion>
<CrowPackageVersion>$(CrowVersion)-beta</CrowPackageVersion>
- <CrowStbSharp>true</CrowStbSharp>
+ <CrowStbSharp>true</CrowStbSharp>
</PropertyGroup>
</Project>
//testFiles = new string [] { @"Interfaces/Experimental/testDock.crow" };
//testFiles = new string [] { @"Interfaces/Divers/welcome.crow" };
//testFiles = new string [] { @"Interfaces/TemplatedGroup/3.crow" };
- //testFiles = new string [] { @"Interfaces/Divers/perfMeasures.crow" };
- testFiles = new string [] { @"Interfaces/Divers/colorPicker2.crow" };
+ //testFiles = new string [] { @"Interfaces/Divers/testShape.crow" };
+ testFiles = new string [] { @"Interfaces/TemplatedControl/testEnumSelector.crow" };
+ //testFiles = new string [] { @"Interfaces/Divers/colorPicker2.crow" };
testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/GraphicObject", "*.crow")).ToArray ();
testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Container", "*.crow")).ToArray ();
testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Group", "*.crow")).ToArray ();
NotifyValueChanged ("IntValue", intValue);
}
}
+ VerticalAlignment currentVAlign;
+ public VerticalAlignment CurrentVAlign {
+ get => currentVAlign;
+ set {
+ if (currentVAlign == value)
+ return;
+ currentVAlign = value;
+ NotifyValueChanged ("CurrentVAlign", currentVAlign);
+ }
+ }
void onSpinnerValueChange (object sender, ValueChangeEventArgs e)
{
if (e.MemberName != "Value")
<ItemGroup>
<ProjectReference Include="..\..\Crow\Crow.csproj" />
</ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Remove="..\common\ui\templates\test.style" />
+ </ItemGroup>
<ItemGroup>
<Datas Include="..\data\**\*.*">
<Link>data\%(RecursiveDir)%(Filename)%(Extension)</Link>
<LogicalName>ui.%(Filename)%(Extension)</LogicalName>
<Link>Templates\%(Filename)%(Extension)</Link>
</EmbeddedResource>
- </ItemGroup>
+ <EmbeddedResource Include="..\common\samples.style" />
+ <EmbeddedResource Include="..\common\ui\images\**\*.*">
+ <LogicalName>images.%(Filename)%(Extension)</LogicalName>
+ <Link>Images\%(Filename)%(Extension)</Link>
+ </EmbeddedResource>
+ <EmbeddedResource Include="..\common\ui\Icons\*.*">
+ <LogicalName>Icons.%(Filename)%(Extension)</LogicalName>
+ <Link>Icons\%(Filename)%(Extension)</Link>
+ </EmbeddedResource>
+ </ItemGroup>
</Project>
\ No newline at end of file
}
-
+ public static class Extensions
+ {
+ public static Fill GetIcon (this Alignment align)
+ {
+ return (Crow.Fill)Fill.Parse ("#images.valign.svg");
+ }
+ }
}
\ No newline at end of file
--- /dev/null
+FpsLabel {
+ Width = "30";
+ Font = "droid, 10";
+ Margin = "0";
+ TextAlignment = "Center";
+}
+FpsDisp {
+ Font = "droid bold, 10";
+ Width = "60";
+ Margin = "0";
+ CornerRadius = "3";
+ TextAlignment = "Center";
+ Background = "MediumSeaGreen";
+}
+HStackMeasure {
+ Margin = "2";
+ Width = "Fit";
+ Height = "Fit";
+ Background = "DimGrey";
+}
+CheckBox2 {
+ Template= "Interfaces/CheckBox2.imlt";
+ Background = "Jet";
+ Checked="{Background=MediumSeaGreen}";
+ Unchecked = "{Background=Jet}";
+}
+CheckBox3 {
+ Template= "Interfaces/CheckBox2.imlt";
+ Background = "Jet";
+ Width = "Stretched";
+ Height = "Fit";
+ CornerRadius = "5";
+ Checked="{Background=MediumSeaGreen}";
+ Unchecked = "{Background=Jet}";
+}
+labPerf {
+ Font = "droid, 8";
+ Width = "50%";
+}
+labPerfVal{
+ Font = "droid, 8";
+ Width = "50%";
+}
+DbgLogViewer{
+ Background = "Onyx";
+ Font = "mono, 8";
+ Foreground = "LightGrey";
+ Focusable = "true";
+}
+DockWindow{
+ Background = "0.1,0.1,0.1,0.5";
+}
+
+valignStyle {
+ Template="#ui.enumSingleSVG.itmp";
+ Checked="{Background=MediumSeaGreen}";
+ Unchecked = "{Background=Black}";
+ //Initialized="GetDrawModeIcon";
+ //Initialized="{Background=Blue}";
+}
+valignStyle2 {
+ Template="#ui.enumGetIcons.itmp";
+ Checked="{Background=MediumSeaGreen}";
+ Unchecked = "{Background=Black}";
+ //Initialized="GetDrawModeIcon";
+ //Initialized="{Background=Blue}";
+}
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generated by IcoMoon.io -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16">
+<rect fill="#00000000" stroke="#444444" stroke-width="1" x="0.5" y="0.5" width="15" height="15"/>
+<line id="Bottom" fill="#00000000" stroke="#444444" stroke-width="4" x1="1.5" y1="12.5" x2="14.5" y2="12.5" />
+</svg>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generated by IcoMoon.io -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16">
+<rect fill="#00000000" stroke="#444444" stroke-width="1" x="0.5" y="0.5" width="15" height="15"/>
+<line id="Center" fill="#00000000" stroke="#444444" stroke-width="4" x1="1.5" y1="8" x2="14.5" y2="8" />
+</svg>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generated by IcoMoon.io -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16">
+<rect fill="#00000000" stroke="#444444" stroke-width="1" x="0.5" y="0.5" width="15" height="15"/>
+<line id="Top" fill="#00000000" stroke="#444444" stroke-width="4" x1="1.5" y1="3.5" x2="14.5" y2="3.5" />
+</svg>
</VerticalStack>
<Splitter />
<VerticalStack Width="50%">
- <RadioButton Style="RadioButton2" />
- <RadioButton Style="RadioButton2" />
- <RadioButton Style="RadioButton2" />
- <RadioButton Style="RadioButton2" />
+ <RadioButton Style="CheckBox2" />
+ <RadioButton Style="CheckBox2" />
+ <RadioButton Style="CheckBox2" />
+ <RadioButton Style="CheckBox2" />
</VerticalStack>
</HorizontalStack>
</GroupBox>
<?xml version="1.0"?>
-<Container Fit="true" Background="Red" Tooltip="test tooltip" >
- <Shape Foreground="Transparent" Background="DimGrey" Size="11,11" Path="M 5.5,0.5 L 10.5,10.5 L 0.5,10.5 Z"
- MouseEnter="{Background=hgradient|0:DimGrey|0.5:RoyalBlue|1:Black}"
- MouseLeave="{Background=DimGrey}"/>
-</Container>
\ No newline at end of file
+<VerticalStack>
+ <TextBox Text="{²../shape.Path}"/>
+ <Shape Margin="0" Width="400" Height="400" Name="shape" Foreground="Blue" Background="DimGrey" Size="100,100" Path="M 5.5,0.5 L 10.5,10.5 L 0.5,10.5 Z G"/>
+</VerticalStack>
\ No newline at end of file
<?xml version="1.0"?>
-<HorizontalStack Width="Stretched" Height="Fit" Margin="5" Background="Mantis">
+<HorizontalStack Width="Stretched" Height="Fit" Margin="5" Background="RoyalBlue">
<Widget Background="Carmine" Width="10%" Height="20"/>
<Widget Background="Carmine" Width="Stretched" Height="20"/>
<Widget Background="Carmine" Width="10%" Height="20"/>
--- /dev/null
+<?xml version="1.0"?>
+<VerticalStack Spacing="5" Margin="5">
+ <Image Path="#images.valign.svg" Fit="True" Background="White" Margin="5" SvgSub="{²CurrentVAlign}"/>
+ <Border Height="100" Width="Fit" Background="Jet">
+ <Label Margin="5" Text="vertical aligned text" VerticalAlignment="{CurrentVAlign}" Background="DarkBlue"/>
+ </Border>
+ <EnumSelector Name="valign" Caption="Vertical Alignment" EnumValue="{²CurrentVAlign}" />
+ <EnumSelector RadioButtonStyle="CheckBox3" Name="valign" Caption="Vertical Alignment" EnumValue="{²CurrentVAlign}" >
+ <Template>
+ <VerticalStack Name="Content" Width="100"/>
+ </Template>
+ </EnumSelector>
+ <EnumSelector RadioButtonStyle="CheckBox2" Name="valign" Caption="Vertical Alignment" EnumValue="{²CurrentVAlign}" />
+ <EnumSelector RadioButtonStyle="valignStyle" Name="valign1" Caption="Vertical Alignment" EnumValue="{²CurrentVAlign}" />
+ <EnumSelector RadioButtonStyle="valignStyle2" Name="valign2" Caption="Vertical Alignment" EnumValue="{²CurrentVAlign}" />
+</VerticalStack>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generated by IcoMoon.io -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16">
+<rect fill="#00000000" stroke="#444444" stroke-width="1" x="0.5" y="0.5" width="15" height="15"/>
+<line id="Top" fill="#00000000" stroke="#444444" stroke-width="4" x1="1.5" y1="3.5" x2="14.5" y2="3.5" />
+<line id="Center" fill="#00000000" stroke="#444444" stroke-width="4" x1="1.5" y1="8" x2="14.5" y2="8" />
+<line id="Bottom" fill="#00000000" stroke="#444444" stroke-width="4" x1="1.5" y1="12.5" x2="14.5" y2="12.5" />
+</svg>
-<Label Font="{./Font}" Text="{./Caption}" Height="{./HeightPolicy}" Width="{./WidthPolicy}"
+<Label Font="{./Font}" Text="{./Caption}" CornerRadius="{./CornerRadius}"
Margin="3"
Background="{./Background}"
Foreground="DimGrey"
-<Label Font="{./Font}" Text="{./Caption}" CornerRadius="{./CornerRadius}"
- Margin="3"
- Background="{./Background}"
- Foreground="DimGrey"
- TextAlignment="Center"
- MouseEnter="{Foreground=White}"
- MouseLeave="{Foreground=DimGrey}"/>
\ No newline at end of file
+<Border Foreground="Grey" MouseEnter="{Foreground=White}" MouseLeave="{Foreground=Grey}">
+ <Image Path="{./Tag}" Fit="True" Margin="1" CornerRadius="{./CornerRadius}"
+ Background="{./Background}"/>
+</Border>
\ No newline at end of file
--- /dev/null
+<Border Foreground="Grey" MouseEnter="{Foreground=White}" MouseLeave="{Foreground=Grey}">
+ <Image Path="#images.valign.svg" Fit="True" Margin="1" SvgSub="{./Caption}" CornerRadius="{./CornerRadius}"
+ Background="{./Background}"/>
+</Border>
\ No newline at end of file
-FpsLabel {
- Width = "30";
- Font = "droid, 10";
- Margin = "0";
- TextAlignment = "Center";
-}
-FpsDisp {
- Font = "droid bold, 10";
- Width = "60";
- Margin = "0";
- CornerRadius = "3";
- TextAlignment = "Center";
- Background = "MediumSeaGreen";
-}
-HStackMeasure {
- Margin = "2";
- Width = "Fit";
- Height = "Fit";
- Background = "DimGrey";
-}
-CheckBox2 {
- Template= "Interfaces/CheckBox2.imlt";
- Background = "Jet";
- Checked="{Background=MediumSeaGreen}";
- Unchecked = "{Background=Jet}";
-}
-RadioButton2 {
- Template="Interfaces/CheckBox2.imlt";
- Background = "Jet";
- Checked = "{Background=MediumSeaGreen}";
- Unchecked = "{Background=Jet}";
-}
-labPerf {
- Font = "droid, 8";
- Width = "50%";
-}
-labPerfVal{
- Font = "droid, 8";
- Width = "50%";
-}
-DbgLogViewer{
- Background = "Onyx";
- Font = "mono, 8";
- Foreground = "LightGrey";
- Focusable = "true";
-}
-DockWindow{
- Background = "0.1,0.1,0.1,0.5";
-}
+
\ No newline at end of file