<Compile Include="src\ScrollingEventArgs.cs" />
<Compile Include="src\GraphicObjects\Trend.cs" />
<Compile Include="src\GraphicObjects\Splitter.cs" />
+ <Compile Include="src\GraphicObjects\TreeView.cs" />
+ <Compile Include="src\GraphicObjects\TabView.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
- <Reference Include="System.Drawing" />
<Reference Include="System.Xml" />
<Reference Include="glib-sharp, Version=3.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
<Package>glib-sharp-3.0</Package>
</Reference>
<Reference Include="Mono.Cairo" />
<Reference Include="rsvg2-sharp, Version=2.18.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
+ <Reference Include="System.Drawing" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
<EmbeddedResource Include="Images\crow0.svg">
<LogicalName>Crow.image.crow0.svg</LogicalName>
</EmbeddedResource>
+ <EmbeddedResource Include="Templates\TreeView.crow" />
+ <EmbeddedResource Include="Templates\TreeViewItem.crow" />
</ItemGroup>
<ItemGroup>
<None Include="README.md" />
<?xml version="1.0"?>
-<!--<Border BorderWidth="1" Margin="1" MinimumSize="0;100" Height="{TemplatedHeight}" Width="{TemplatedWidth}" Background="Gray">
- <VerticalStack Name="List" Margin="1" Height="{TemplatedHeight}" Width="{TemplatedWidth}"/>
-</Border>-->
<Border BorderWidth="1" Margin="1" MinimumSize="20;20" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}" >
<Scroller Name="scroller1" Margin="1" VerticalScrolling="true"
Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}">
--- /dev/null
+<Border Background="DimGray" BorderWidth="1" Margin="1" MinimumSize="100;100"
+ Width="{../TemplatedWidth}" Height="{../TemplatedHeight}">
+ <VerticalStack
+ Height="0" Width="0" Name="List" Margin="0" VerticalAlignment="Top"/>
+
+</Border>
+
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--<Container Fit="true" Margin="0" Focusable="true" Background="Gray"
+ MouseEnter="{Background=SteelBlue}"
+ MouseLeave="{Background=Gray}">
+ <Label Text="{}"/>
+</Container>-->
+<Expandable Caption="{}">
+ <Template>
+ <Border BorderWidth="1" Foreground="LightGray" Height="{../TemplatedHeight}" Width="{../TemplatedWidth}"
+ MouseClick="../onMouseClick">
+ <VerticalStack Height="{../../TemplatedHeight}" Width="{../../TemplatedWidth}">
+ <HorizontalStack Spacing="1" Height="-1" Width="{../../../TemplatedWidth}">
+ <Image Margin="2" Width="12" Height="12" Path="{../../../../Image}" SvgSub="{../../../../SvgSub}"/>
+ <Label Text="{../../../../Caption}" Width="{../../../../TemplatedWidth}"/>
+ </HorizontalStack>
+ <Container Name="Content" Visible="false" Height="{../../../TemplatedHeight}" Width="{../../../TemplatedWidth}"/>
+ </VerticalStack>
+ </Border>
+ </Template>
+</Expandable>
+<!-- <VerticalStack
+ Height="{../TemplatedHeight}" Width="{../TemplatedWidth}"
+ MouseClick="../onMouseClick">
+ <HorizontalStack Spacing="1" Height="-1" Width="{../../TemplatedWidth}">
+ <Image Margin="2" Width="12" Height="12" Path="{../../../Image}" SvgSub="{../../../SvgSub}"/>
+ <Label Text="{../../../Caption}" Width="{../../../TemplatedWidth}"/>
+ </HorizontalStack>
+ <ListBox Name="Content" Visible="false"
+ Height="-1" Width="{../../TemplatedWidth}"/>
+ </VerticalStack>-->
+
int frameCpt = 0;
int idx = 0;
string[] testFiles = {
+ "testImage.crow",
+ "testOutOfClipUpdate.crow",
+ "test_Listbox.goml",
+ "testTreeView.crow",
"0.crow",
"1.crow",
"testWindow.goml",
"testScrollbar.goml",
"testGroupBox.goml",
"testGrid.goml",
- "test_Listbox.goml",
"testButton.crow",
"testBorder.goml",
// "testButton2.crow",
"test2WayBinding.crow",
"fps.goml",
- "testImage.crow",
"test4.goml",
"2.crow",
"test1.goml",
return;
NotifyValueChanged ("alignment", Enum.Parse(typeof(Alignment), rb.Caption));
}
+ public IList<String> List2 = new List<string>(new string[]
+ {
+ "string1",
+ "string2",
+ "string3",
+ "string4",
+ "string5",
+ "string6",
+ "string7",
+ "string8",
+ "string8",
+ "string8",
+ "string8",
+ "string8",
+ "string8",
+ "string9"
+ }
+ );
IList<Color> testList = Color.ColorDic.ToList();
public IList<Color> TestList {
set{
<?xml version="1.0"?>
<VerticalStack Fit="true">
<GraphicObject CornerRadius="5" Height="10" Width="600" Background="vgradient|0:Transparent|0,5:White|1:Transparent"/>
- <HorizontalStack Fit="true">
+ <HorizontalStack Fit="true" HorizontalAlignment="Left">
<Border Fit="true" CornerRadius="10" BorderWidth="1">
<VerticalStack Margin="10">
<CheckBox IsChecked="false" Caption="Check 1" Background="hgradient|0:LimeGreen|1:Transparent"/>
<VerticalStack Margin="10">
<RadioButton IsChecked="false" Caption="Choice 1" Background="hgradient|0:DarkRed|1:Transparent"/>
<Splitter/>
- <RadioButton IsChecked="false" Caption="Choice 2" Background="hgradient|0:DarkRed|1:Transparent"/>
+ <RadioButton Width="0" IsChecked="false" Caption="Choice 2" Background="hgradient|0:DarkRed|1:Transparent"/>
<RadioButton IsChecked="true" Caption="Choice 3" Background="hgradient|0:DarkRed|1:Transparent"/>
<RadioButton IsChecked="false" Caption="Choice 4" Background="hgradient|0:DarkRed|1:Transparent"/>
</VerticalStack>
</Border>
<Splitter Thickness="3" />
- <Border Fit="true" CornerRadius="10" BorderWidth="1" MinimumSize="200;200">
+ <Border Fit="true" CornerRadius="10" BorderWidth="1" MaximumSize="150;150" MinimumSize="50;50">
<VerticalStack Margin="10">
<Label Text="label 1" Background="hgradient|0:BlueCrayola|1:Transparent"/>
<Label Text="label 2" Background="hgradient|0:BlueCrayola|1:Transparent"/>
<Label Text="label 3" Background="hgradient|0:BlueCrayola|1:Transparent"/>
- <Label Text="label 4" Background="hgradient|0:BlueCrayola|1:Transparent"/>
+ <Label Text="label 4" Width="0" Background="hgradient|0:BlueCrayola|1:Transparent"/>
</VerticalStack>
</Border>
<Splitter/>
--- /dev/null
+<?xml version="1.0"?>
+<Container Width="200" Height="100" Background="DimGray" Margin="5">
+ <Container Width="0" Height="300" Background="DarkBlue">
+ <Label Text="{fps}" Background="BlueCrayola" VerticalAlignment="Center"/>
+ </Container>
+</Container>
--- /dev/null
+<?xml version="1.0"?>
+<TreeView Height="400" Width="200" Data="{List2}" ItemTemplate="#Crow.Templates.TreeViewItem.crow"/>
\ No newline at end of file
<None Include="Interfaces\clip4.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
+ <None Include="Interfaces\testTreeView.crow">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="Interfaces\testOutOfClipUpdate.crow">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
</ItemGroup>
<ItemGroup>
<Folder Include="Interfaces\" />
using System;
-
-
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-//using OpenTK.Graphics.OpenGL;
-
-using Cairo;
-
-using winColors = System.Drawing.Color;
-using System.Diagnostics;
-using System.Xml.Serialization;
using OpenTK.Input;
using System.ComponentModel;
+using System.Xml.Serialization;
namespace Crow
{
[DefaultTemplate("#Crow.Templates.CheckBox.goml")]
- public class CheckBox : TemplatedControl
- {
+ public class CheckBox : TemplatedControl
+ {
string caption;
string image;
bool isChecked;
public event EventHandler Unchecked;
#region GraphicObject overrides
-// [XmlAttributeAttribute()][DefaultValue(-1)]
-// public override int Height {
-// get { return base.Height; }
-// set { base.Height = value; }
-// }
- [XmlAttributeAttribute()][DefaultValue(true)]//overiden to get default to true
+ [XmlAttributeAttribute()][DefaultValue(true)]
public override bool Focusable
{
get { return base.Focusable; }
using System;
-
-
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-//using OpenTK.Graphics.OpenGL;
-
-using Cairo;
-
-using winColors = System.Drawing.Color;
-using System.Diagnostics;
-using System.Xml.Serialization;
using OpenTK.Input;
using System.ComponentModel;
-using System.Xml;
-using System.IO;
+using System.Xml.Serialization;
namespace Crow
{
[DefaultTemplate("#Crow.Templates.Expandable.goml")]
public class Expandable : TemplatedContainer
- {
+ {
+ #region CTOR
+ public Expandable() : base()
+ {
+ }
+ #endregion
+
+ #region Private fields
bool _isExpanded;
string caption;
string image;
Container _contentContainer;
+ #endregion
+ #region Event Handlers
public event EventHandler Expand;
public event EventHandler Collapse;
+ #endregion
+
+ #region GraphicObject overrides
+ [XmlAttributeAttribute()][DefaultValue(true)]
+ public override bool Focusable
+ {
+ get { return base.Focusable; }
+ set { base.Focusable = value; }
+ }
+ #endregion
public override GraphicObject Content {
get {
_contentContainer.SetChild(value);
}
}
-
- public Expandable() : base()
- {
- }
-
protected override void loadTemplate(GraphicObject template = null)
{
base.loadTemplate (template);
_contentContainer = this.child.FindByName ("Content") as Container;
}
-
- [XmlAttributeAttribute()][DefaultValue(true)]//overiden to get default to true
- public override bool Focusable
+ public override void onMouseClick (object sender, MouseButtonEventArgs e)
{
- get { return base.Focusable; }
- set { base.Focusable = value; }
+ IsExpanded = !IsExpanded;
+ base.onMouseClick (sender, e);
}
- [XmlAttributeAttribute()][DefaultValue(-1)]
- public override int Height {
- get { return base.Height; }
- set { base.Height = value; }
+ public override void ResolveBindings ()
+ {
+ base.ResolveBindings ();
+ if (Content != null)
+ Content.ResolveBindings ();
}
+ #region Public properties
[XmlAttributeAttribute()][DefaultValue("Expandable")]
public string Caption {
get { return caption; }
NotifyValueChanged ("SvgSub", "collapsed");
}
}
+ #endregion
public virtual void onExpand(object sender, EventArgs e)
{
Collapse.Raise (this, e);
}
-
- public override void onMouseClick (object sender, MouseButtonEventArgs e)
- {
- IsExpanded = !IsExpanded;
- base.onMouseClick (sender, e);
- }
- public override void ResolveBindings ()
- {
- base.ResolveBindings ();
- if (Content != null)
- Content.ResolveBindings ();
- }
}
}
using System;
using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-//using OpenTK.Graphics.OpenGL;
-using System.Drawing.Imaging;
+using System.ComponentModel;
using System.Diagnostics;
-using OpenTK.Input;
-
-using Cairo;
-
-using System.Xml.Serialization;
+using System.Linq;
using System.Reflection;
-using System.ComponentModel;
-using System.IO;
-//using System.Xml;
-using System.Xml;
-using System.Runtime.CompilerServices;
using System.Reflection.Emit;
+using System.Runtime.CompilerServices;
+using System.Xml.Serialization;
+using Cairo;
+using OpenTK.Input;
namespace Crow
{
using System;
using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Drawing;
-using System.Diagnostics;
-using Cairo;
-using System.Xml.Serialization;
using System.ComponentModel;
+using System.Xml.Serialization;
+using Cairo;
+using OpenTK.Input;
+
namespace Crow
{
#region Mouse handling
- public override void checkHoverWidget (OpenTK.Input.MouseMoveEventArgs e)
+ public override void checkHoverWidget (MouseMoveEventArgs e)
{
if (HostContainer.hoverWidget != this) {
HostContainer.hoverWidget = this;
using System;
-
-
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-//using OpenTK.Graphics.OpenGL;
-
-using Cairo;
-
-using winColors = System.Drawing.Color;
-using System.Diagnostics;
using System.Xml.Serialization;
-using OpenTK.Input;
using System.ComponentModel;
-using System.Xml;
-using System.IO;
namespace Crow
{
using System;
-
-
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-//using OpenTK.Graphics.OpenGL;
-
-using Cairo;
-
-using winColors = System.Drawing.Color;
-using System.Diagnostics;
using System.Xml.Serialization;
-using OpenTK.Input;
using System.ComponentModel;
-using System.Xml;
-using System.IO;
+using OpenTK.Input;
namespace Crow
{
using System;
-
-
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-//using OpenTK.Graphics.OpenGL;
-
-using Cairo;
-
-using winColors = System.Drawing.Color;
-using System.Diagnostics;
-using System.Xml.Serialization;
using OpenTK.Input;
using System.ComponentModel;
+using System.Xml.Serialization;
namespace Crow
{
public event EventHandler Unchecked;
#region GraphicObject overrides
- [XmlAttributeAttribute()][DefaultValue(true)]//overiden to get default to true
+ [XmlAttributeAttribute()][DefaultValue(true)]
public override bool Focusable
{
get { return base.Focusable; }
set { base.Focusable = value; }
}
- [XmlAttributeAttribute()][DefaultValue(-1)]
- public override int Height {
- get { return base.Height; }
- set { base.Height = value; }
- }
#endregion
[XmlAttributeAttribute()][DefaultValue("RadioButton")]
{
Group pg = Parent as Group;
if (pg != null) {
- foreach (RadioButton c in pg.Children.OfType<RadioButton>())
+ for (int i = 0; i < pg.Children.Count; i++) {
+ RadioButton c = pg.Children [i] as RadioButton;
+ if (c == null)
+ continue;
c.IsChecked = (c == this);
+ }
} else
IsChecked = !IsChecked;
using System;
-
-
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-//using OpenTK.Graphics.OpenGL;
-
-using Cairo;
-
-using winColors = System.Drawing.Color;
-using System.Diagnostics;
using System.Xml.Serialization;
-using OpenTK.Input;
using System.ComponentModel;
+using OpenTK.Input;
namespace Crow
{
-using System;
+//
+// Scroller.cs
+//
+// Author:
+// Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
+//
+// Copyright (c) 2016 jp
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+using System;
+using System.Xml.Serialization;
+using System.ComponentModel;
using System.Diagnostics;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Drawing;
using Cairo;
-using System.Xml.Serialization;
using OpenTK.Input;
-using System.ComponentModel;
namespace Crow
{
}
#endregion
-
public Scroller()
: base(){}
{
return base.ScreenCoordinates (r) - new Point((int)ScrollX,(int)ScrollY);
}
-// protected override void onDraw (Context gr)
-// {
-// gr.Save ();
-// //gr.ResetClip ();
-//
-// base.onDraw (gr);
-// gr.Restore ();
-// }
protected override void onDraw (Context gr)
{
Rectangle rBack = new Rectangle (Slot.Size);
child.Paint (ref gr);
gr.Restore ();
}
-
-// public override void Paint (ref Context ctx)
-// {
-// ctx.Save ();
-// //ctx.ResetClip ();
-// ctx.Translate (-ScrollX, -ScrollY);
-// base.Paint (ref ctx);
-// ctx.Restore ();
-// }
-// public override void registerClipRect ()
-// {
-// HostContainer.redrawClip.AddRectangle (base.ScreenCoordinates(Slot));
-// }
-
-
}
}
--- /dev/null
+//
+// TabView.cs
+//
+// Author:
+// Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
+//
+// Copyright (c) 2016 jp
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+using System;
+
+namespace Crow
+{
+ public class TabView
+ {
+ public TabView ()
+ {
+ }
+ }
+}
+
--- /dev/null
+//
+// TreeView.cs
+//
+// Author:
+// Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
+//
+// Copyright (c) 2016 jp
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+using System;
+
+namespace Crow
+{
+ //treeview expect expandable child (or not)
+ //if their are expandable, some functions and events are added
+ [DefaultTemplate("#Crow.Templates.TreeView.crow")]
+ public class TreeView : ListBox
+ {
+ public TreeView () : base()
+ {
+ }
+ }
+}
+
-// Released to the public domain. Use, modify and relicense at will.
+//
+// OpenTKGameWindow.cs
+//
+// Author:
+// Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
+//
+// Copyright (c) 2016 jp
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
using System;
using System.Collections.Generic;
using System.Diagnostics;
-using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Threading;
using OpenTK.Graphics.OpenGL;
using OpenTK.Input;
-
-
namespace Crow
{
public class OpenTKGameWindow : GameWindow, ILayoutable, IGOLibHost