</EmbeddedResource>
<EmbeddedResource Include="Icons\compiler_error.svg" />
<EmbeddedResource Include="Icons\project.svg" />
+ <EmbeddedResource Include="Icons\crowproj.svg" />
<EmbeddedResource Include="Icons\projectRef.svg" />
<EmbeddedResource Include="Templates\DockWindow.template">
<LogicalName>Crow.DockWindow.template</LogicalName>
MouseEnter="{Foreground=DimGray}"
MouseLeave="{Foreground=Transparent}">
<HorizontalStack Spacing="1">
- <Image Margin="1" Width="9" Height="9" Focusable="true" MouseClick="./onClickForExpand"
+ <Image Margin="1" Width="9" Height="9" Focusable="true" MouseDown="./onClickForExpand"
Path="{./Image}"
Visible="{./IsExpandable}"
SvgSub="{./IsExpanded}"
MouseEnter="{Background=LightGray}"
MouseLeave="{Background=Transparent}"/>
<Image Margin="1" Width="14" Height="14"
- Path="#Crow.Icons.project.svg"/>
+ Path="#Crow.Icons.crowproj.svg"/>
<GraphicObject Width="2" Height="9" Background="Green" Visible="{IsStartupProject}"/>
<Label Text="{./Caption}"/>
</HorizontalStack>
MouseEnter="{Foreground=DimGray}"
MouseLeave="{Foreground=Transparent}">
<HorizontalStack Spacing="1">
- <Image Margin="1" Width="9" Height="9" Focusable="true" MouseClick="./onClickForExpand"
+ <Image Margin="1" Width="9" Height="9" Focusable="true" MouseDown="./onClickForExpand"
Path="{./Image}"
Visible="{./IsExpandable}"
SvgSub="{./IsExpanded}"
--- /dev/null
+<svg width="64" height="64" xmlns="http://www.w3.org/2000/svg">
+ <!-- Created with Method Draw - http://github.com/duopixel/Method-Draw/ -->
+ <g>
+ <rect opacity="1.0" rx="5" id="svg_1" height="59" width="59" y="2.5" x="2.5" stroke-width="6" stroke="#111111" fill="#bbbbcc"/>
+ <rect opacity="1.0" rx="5" id="svg_1" height="22" width="59" y="2.5" x="2.5" stroke-width="6" stroke="#111111" fill="#4455aa"/>
+<!-- <line stroke-linecap="undefined" stroke-linejoin="undefined" id="svg_2" y2="24.5" x2="61.5" y1="24.5" x1="2.5" stroke-width="6" stroke="#bbbbbb" fill="none"/>-->
+ </g>
+</svg>
\ No newline at end of file
height="64"
width="64">
<g>
- <path fill="#007fff" stroke="#111111" stroke-width="2" d="m1.655043,19.482317l17.905939,-17.913175l25.323143,0l17.905937,17.913175l0,25.333551l-17.905937,17.913147l-25.323143,0l-17.905939,-17.913147l0,-25.333551z" id="svg_2"/>
+ <path fill="#3333dd" stroke="#bbbbff" stroke-width="10" d="m1.655043,19.482317l17.905939,-17.913175l25.323143,0l17.905937,17.913175l0,25.333551l-17.905937,17.913147l-25.323143,0l-17.905939,-17.913147l0,-25.333551z" id="svg_2"/>
</g>
</svg>
+++ /dev/null
-// ------------------------------------------------------------------------------
-// <autogenerated>
-// This code was generated by a tool.
-// Mono Runtime Version: 4.0.30319.42000
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-// </autogenerated>
-// ------------------------------------------------------------------------------
-
-//
-//This source code was auto-generated by MonoXSD
-//
-namespace Schemas {
-
-}
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
-[assembly: AssemblyVersion ("0.5.*")]
+[assembly: AssemblyVersion ("0.7.1.*")]
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
MouseEnter="{Foreground=DimGray}"
MouseLeave="{Foreground=Transparent}">
<HorizontalStack Spacing="1">
- <Image Margin="1" Width="9" Height="9" Focusable="true" MouseClick="./onClickForExpand"
+ <Image Margin="1" Width="9" Height="9" Focusable="true" MouseDown="./onClickForExpand"
Path="{./Image}"
Visible="{./IsExpandable}"
SvgSub="{./IsExpanded}"
class BasicTests : CrowWindow
{
public BasicTests ()
- : base(1280, 800,"test: press <F3> to toogle test files")
+ : base(800, 600,"test: press <F3> to toogle test files")
{
}
int idx = 0;
string[] testFiles;
+ public Version CrowVersion {
+ get {
+ return System.Reflection.Assembly.GetAssembly(typeof(GraphicObject)).GetName().Version;
+ }
+ }
+
#region Test values for Binding
public List<Crow.Command> Commands;
public int intValue = 500;
this.KeyDown += KeyboardKeyDown1;
- //testFiles = new string [] { @"Interfaces/Unsorted/testFileDialog.crow" };
- //testFiles = new string [] { @"Interfaces/Divers/colorPicker.crow" };
testFiles = new string [] { @"Interfaces/Divers/welcome.crow" };
- //testFiles = new string [] { @"Interfaces/TemplatedContainer/testTabView.crow" };
- //testFiles = new string [] { @"Interfaces/TemplatedControl/testSpinner.crow" };
- //testFiles = new string [] { @"Interfaces/DragAndDrop/0.crow" };
- //testFiles = new string [] { @"Interfaces/TemplatedControl/testItemTemplateTag.crow" };
- testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/TemplatedControl", "*.crow")).ToArray ();
- testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Divers", "*.crow")).ToArray ();
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 ();
testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Stack", "*.crow")).ToArray ();
-
+ testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/TemplatedControl", "*.crow")).ToArray ();
testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/TemplatedContainer", "*.crow")).ToArray ();
testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/TemplatedGroup", "*.crow")).ToArray ();
testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Splitter", "*.crow")).ToArray ();
testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Wrapper", "*.crow")).ToArray ();
+ testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Divers", "*.crow")).ToArray ();
testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/DragAndDrop", "*.crow")).ToArray ();
- testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Unsorted", "*.crow")).ToArray ();
+ //testFiles = testFiles.Concat (Directory.GetFiles (@"Interfaces/Experimental", "*.crow")).ToArray ();
Load(testFiles[idx]).DataSource = this;
}
void KeyboardKeyDown1 (object sender, OpenTK.Input.KeyboardKeyEventArgs e)
{
+ try {
+
if (e.Key == OpenTK.Input.Key.Escape) {
Quit (null, null);
return;
else
return;
- try {
ClearInterface ();
if (idx == testFiles.Length)
GraphicObject obj = Load (testFiles[idx]);
obj.DataSource = this;
} catch (Exception ex) {
- MessageBox.Show (CurrentInterface, MessageBox.Type.Error, ex.Message + "\n" + ex.InnerException);
+ MessageBox.Show (CurrentInterface, MessageBox.Type.Error, ex.Message + "\n" + ex.InnerException.Message);
}
}
// void Tv_SelectedItemChanged (object sender, SelectionChangeEventArgs e)
{
Console.WriteLine ("button clicked:" + send.ToString());
}
-// void onAddTabButClick(object sender, MouseButtonEventArgs e){
-//
-// TabView tv = ifaceControl.CrowInterface.FindByName("tabview1") as TabView;
-// if (tv == null)
-// return;
-// tv.AddChild (new TabItem () { Caption = "NewTab" });
-// }
+ void onAddTabButClick(object sender, MouseButtonEventArgs e){
+
+ TabView tv = FindByName("tabview1") as TabView;
+ if (tv == null)
+ return;
+ //tv.AddChild (new TabItem (CurrentInterface) { Caption = "NewTab" });
+ lock (CurrentInterface.UpdateMutex) {
+ tv.AddChild (Crow.IML.Instantiator.CreateFromImlFragment
+ (@"<TabItem Caption='New tab' Background='Blue'><Label/></TabItem>").CreateInstance (CurrentInterface));
+ }
+ }
[STAThread]
static void Main ()
{
<VerticalStack Width="30%" Margin="5">
<!-- <Border Margin="5" Height="Fit">
<Label Width="Stretched" Margin="1" Text="{../../dv.SelectedItem}"/>
- </Border>-->
-<!-- <Border Margin="5" Height="30%">
+ </Border>
+ <Border Margin="5" Height="30%">
<DirectoryView Name="dv" CurrentDirectory="/" Margin="1"/>
</Border>
<Splitter/>-->
--- /dev/null
+<?xml version="1.0"?>
+<GraphicObject 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
+++ /dev/null
-<?xml version="1.0"?>
-<Docker Background="Jet" Margin = "0" Focusable="true" >
- <DockWindow Focusable="true" Caption="View 1" Width="100" Height="100"><GraphicObject Background="Green"/></DockWindow>
- <DockWindow Focusable="true" Caption="View 2" Resizable = "true" Width="100" Height="100"><GraphicObject Background="Blue"/></DockWindow>
- <DockWindow Focusable="true" Caption="View 3" Resizable = "true" Width="100" Height="100"><GraphicObject Background="Yellow"/></DockWindow>
- <DockWindow Focusable="true" Caption="View 4" Resizable = "true" Width="100" Height="100"><GraphicObject Background="Black"/></DockWindow>
-</Docker>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0"?>
+<FileDialog Caption="Open File" CurrentDirectory="/" SearchPattern="*.*"/>
+
--- /dev/null
+<?xml version="1.0"?>
+<IMLContainer Path="Interfaces/Divers/colorPicker.crow"/>
\ No newline at end of file
<VerticalStack Fit="true">
<HorizontalStack Fit="true" Background="hgradient|0:DarkRed|1:Transparent" Margin="5">
<Label Text="SCALED PROPORTIONNAL" Width="150"/>
- <Image Width="50%" Height="Fit" Background="vgradient|0:SkyBlue|1:White" Path="#Tests.image.crow0.svg"/>
+ <Image Width="10%" Height="Fit" Background="vgradient|0:SkyBlue|1:White" Path="#Tests.image.crow0.svg"/>
<Image Margin="10" Background="vgradient|0:SkyBlue|1:White" Path="#Tests.image.crow0.svg" />
<Image Background="vgradient|0:SkyBlue|1:White" Width="20" Height="20" Path="#Tests.image.crow0.svg" />
<Image Margin="2" Background="vgradient|0:SkyBlue|1:White" Width="20" Height="20" Path="#Tests.image.crow0.svg" />
<?xml version="1.0"?>
-<VerticalStack Fit="true" VerticalAlignment="Top" Background="0.7,0.7,0.7,0.5"
- Margin="10" CornerRadius="10">
- <Label Font="20" Text="Press <F3> to cycle into the examples"/>
- <Label Font="20" Text="Those are basic tests used to validate changes"/>
- <Label Font="20" Text="{fps}"/>
-</VerticalStack>
\ No newline at end of file
+<Border BorderStyle="Sunken" Fit="true" Background="0.7,0.7,0.7,0.5" CornerRadius="10">
+ <VerticalStack Margin="20">
+ <Image Path="#Crow.Images.Icons.crow.svg"/>
+<!-- <Label Font="Times bold, 60" Text="C.R.O.W"/>-->
+ <HorizontalStack Fit="true" DataSource="{CrowVersion}" Spacing="0">
+ <Label Foreground="Black" Font="mono, 12" Text="version: "/>
+ <Label Foreground="Black" Font="mono, 12" Text="{Major}"/>
+ <Label Foreground="Black" Font="mono, 12" Text="."/>
+ <Label Foreground="Black" Font="mono, 12" Text="{Minor}"/>
+ <Label Foreground="Black" Font="mono, 12" Text="."/>
+ <Label Foreground="Jet" Font="mono, 12" Text="{Build}"/>
+ </HorizontalStack>
+ <GraphicObject Height="30"/>
+ <Label Font="20" Text="Press <F2> and <F3> to cycle into the examples"/>
+ <Label Font="20" Text="Those are basic tests used to validate changes,"/>
+ <GraphicObject Height="30"/>
+ <Label Foreground="Jet" Font="20" Text="<F5> => File dialog example"/>
+ <Label Foreground="Jet" Font="20" Text="<F6> => Window example"/>
+ </VerticalStack>
+</Border>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0"?>
+<!--<Docker Background="Jet" Margin = "0" Focusable="true" >
+ <DockWindow Focusable="true" Caption="View 1" Width="100" Height="100"><GraphicObject Background="Green"/></DockWindow>
+ <DockWindow Focusable="true" Caption="View 2" Resizable = "true" Width="100" Height="100"><GraphicObject Background="Blue"/></DockWindow>
+ <DockWindow Focusable="true" Caption="View 3" Resizable = "true" Width="100" Height="100"><GraphicObject Background="Yellow"/></DockWindow>
+ <DockWindow Focusable="true" Caption="View 4" Resizable = "true" Width="100" Height="100"><GraphicObject Background="Black"/></DockWindow>
+</Docker>-->
+<!--<Group Background="Jet" Margin = "0" Focusable="true" >
+ <Window Top="100" Left="100" Focusable="true" Caption="View 1" Width="300" Height="300"><GraphicObject Background="Green" Focusable="true" MouseEnter="{Background=Gray}" MouseLeave="{Background=Green}"/></Window>
+ <Window Top="200" Left="200" Focusable="true" Caption="View 2" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Blue" MouseEnter="{Background=Gray}" MouseLeave="{Background=Blue}"/></Window>
+ <Window Top="300" Left="300" Focusable="true" Caption="View 3" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Yellow" MouseEnter="{Background=Gray}" MouseLeave="{Background=Yellow}"/></Window>
+ <Window Top="400" Left="400" Focusable="true" Caption="View 4" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Black" MouseEnter="{Background=Gray}" MouseLeave="{Background=Black}"/></Window>
+</Group>-->
+<Docker Background="Jet" Margin = "0" Focusable="true" >
+ <DockWindow Top="100" Left="100" Focusable="true" Caption="View 1" Width="300" Height="300"><GraphicObject Background="Green" Focusable="true" MouseEnter="{Background=Gray}" MouseLeave="{Background=Green}"/></DockWindow>
+ <DockWindow Top="200" Left="200" Focusable="true" Caption="View 2" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Blue" MouseEnter="{Background=Gray}" MouseLeave="{Background=Blue}"/></DockWindow>
+ <DockWindow Top="300" Left="300" Focusable="true" Caption="View 3" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Yellow" MouseEnter="{Background=Gray}" MouseLeave="{Background=Yellow}"/></DockWindow>
+ <DockWindow Top="400" Left="400" Focusable="true" Caption="View 4" Resizable = "true" Width="300" Height="300"><GraphicObject Focusable="true" Background="Black" MouseEnter="{Background=Gray}" MouseLeave="{Background=Black}"/></DockWindow>
+</Docker>
\ No newline at end of file
--- /dev/null
+<?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>
+++ /dev/null
-<?xml version="1.0"?>
-<GraphicObject MouseEnter="{Background=Red}" MouseLeave="{Background=Green}" 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
</TabItem>
</TabView>
<Button Background="vgradient|0:DimGray|1:Black" HorizontalAlignment="Right"
- Caption="Add new tab" Width="Fit" Height="30" MouseClick="onAddTabButClick"/>
+ Caption="Add new tab" Width="Fit" Height="30" MouseDown="onAddTabButClick"/>
</VerticalStack>
<?xml version="1.0"?>
-<TreeView IsRoot="true" Name="treeView" Data="{CurDirectory}" Background="DimGray">
- <ItemTemplate DataType="System.IO.FileInfo">
- <HorizontalStack Focusable="true" Height="Fit" Width="Stretched" >
- <Image Margin="2" Width="14" Height="14"
- Path="#Crow.Images.Icons.file.svg"/>
- <Label Text="{Name}" Width="Stretched"
- MouseEnter="{Background=hgradient|0:BlueCrayola|1:Transparent}"
- MouseLeave="{Background=Transparent}"/>
- </HorizontalStack>
- </ItemTemplate>
- <ItemTemplate DataType="System.IO.DirectoryInfo" Data="GetFileSystemInfos">
- <Expandable Caption="{Name}" >
- <Template>
- <VerticalStack>
- <HorizontalStack Spacing="1" Height="Fit"
- MouseEnter="{Background=hgradient|0:BlueCrayola|1:Transparent}"
- MouseLeave="{Background=Transparent}">
- <Image Margin="2" Width="12" Height="12"
- Visible="{./HasContent}"
- Path="{./Image}"
- SvgSub="{./IsExpanded}"/>
- <Image Margin="2" Width="14" Height="14"
- Path="#Crow.Images.Icons.folder.svg"/>
- <Label Text="{./Caption}"/>
- </HorizontalStack>
- <Container Name="Content" Visible="false"/>
- </VerticalStack>
- </Template>
- <HorizontalStack Height="Fit">
- <GraphicObject Width="12" Height="10"/>
- <TreeView Name="List" Height="Fit">
- <Template>
- <VerticalStack Height="Fit" Name="ItemsContainer"/>
- </Template>
- </TreeView>
- </HorizontalStack>
- </Expandable>
- </ItemTemplate>
-</TreeView>
+<Border Margin="5" Height="90%" Width="50%">
+ <DirectoryView Name="dv" CurrentDirectory="/" Margin="1"/>
+</Border>
\ No newline at end of file
<Template>
<Border BorderWidth="1">
<HorizontalStack Margin="1">
- <Scroller Name="scroller1"
+ <Scroller Name="scroller1"
Margin="2" VerticalScrolling="true" ScrollY="{../scrollbar1.Value}">
<VerticalStack Height="Fit" MinimumSize="10,10"
- Name="ItemsContainer" Margin="0"
- VerticalAlignment="Top"
- HorizontalAlignment="Left"/>
+ Name="ItemsContainer" Margin="0" VerticalAlignment="Top"/>
</Scroller>
- <ScrollBar Name="scrollbar1" Value="{../scroller1.ScrollY}"
- Maximum="{../scroller1.MaximumScroll}" Orientation="Vertical"
- Width="14"/>
+ <ScrollBar Name="scrollbar1" Value="{²../scroller1.ScrollY}"
+ LargeIncrement="{../scroller1.PageHeight}" SmallIncrement="30" CursorSize="{../scroller1.ChildHeightRatio}"
+ Maximum="{../scroller1.MaximumScroll}" Orientation="Vertical"
+ Width="14" />
</HorizontalStack>
</Border>
</Template>
</ItemTemplate>
</ListBox>
<HorizontalStack Fit="true" HorizontalAlignment="Right">
- <Button Caption="Load list" MouseClick="OnLoadList"/>
- <Button Caption="Clear" MouseClick="OnClear"/>
+ <Button Caption="Load list" MouseDown="OnLoadList"/>
+ <Button Caption="Clear" MouseDown="OnClear"/>
</HorizontalStack>
</VerticalStack>
</Border>
Margin="20" Background="DarkGray">
<HorizontalStack Fit="true" Margin="5" Background="SkyBlue">
- <Spinner Value="{IntValue}" ValueChanged="onSpinnerValueChange"/>
+ <Spinner Name="sp1" Value="5" ValueChanged="onSpinnerValueChange"/>
<Spinner Value="5"/>
<Spinner Value="5"/>
- <Button/>
</HorizontalStack>
- <IMLContainer Path="Interfaces/Divers/colorPicker.crow"/>
</VerticalStack>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0"?>
-<FileDialog Caption="Open File" CurrentDirectory="/" SearchPattern="*.*"/>
-
+++ /dev/null
-<?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>
<OutputType>Exe</OutputType>
<RootNamespace>Tests</RootNamespace>
<AssemblyName>Tests</AssemblyName>
- <StartupObject>Tests.BasicTests</StartupObject>
+ <StartupObject>Tests.Showcase</StartupObject>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ReleaseVersion>0.5</ReleaseVersion>
<None Include="Interfaces\Divers\welcome.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="Interfaces\Unsorted\testTypeViewer.goml">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
<None Include="Interfaces\Divers\testPropLess.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Interfaces\Divers\3.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="Interfaces\Divers\testDock.crow">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
<None Include="Interfaces\TemplatedContainer\0.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Interfaces\Divers\test2WayBinding.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="Interfaces\Unsorted\testFileDialog.crow">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
<None Include="Interfaces\Divers\perfMeasures.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Interfaces\Divers\testShape.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="Interfaces\GraphicObject\testCtxMenu.crow">
+ <None Include="Interfaces\DragAndDrop\0.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="Interfaces\DragAndDrop\0.crow">
+ <None Include="Interfaces\Divers\testIMLContainer.crow">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="Interfaces\Divers\testCtxMenu.crow">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="Interfaces\Divers\testFileDialog.crow">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="Interfaces\Experimental\testTypeViewer.goml">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="Interfaces\Experimental\testDock.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<Folder Include="Interfaces\Group\" />
<Folder Include="Interfaces\Divers\" />
<Folder Include="Interfaces\Splitter\" />
- <Folder Include="Interfaces\Unsorted\" />
<Folder Include="Interfaces\Wrapper\" />
<Folder Include="Interfaces\TemplatedControl\" />
<Folder Include="Interfaces\TemplatedContainer\" />
<Folder Include="GraphicObjects\" />
<Folder Include="Tutorials\" />
<Folder Include="Interfaces\DragAndDrop\" />
+ <Folder Include="Interfaces\Experimental\" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="image\tetra.png">
NotifyValueChanged ("IsDocked", isDocked);
}
}
- public override void OnLayoutChanges (LayoutingType layoutType)
- {
- base.OnLayoutChanges (layoutType);
-
- if (isDocked)
- return;
-
- Docker dv = Parent as Docker;
- if (dv == null)
- return;
-
- Rectangle dvCliRect = dv.ClientRectangle;
-
- if (layoutType == LayoutingType.X) {
- if (Slot.X < dv.DockingThreshold)
- dock (Alignment.Left);
- else if (Slot.Right > dvCliRect.Width - dv.DockingThreshold)
- dock (Alignment.Right);
- }else if (layoutType == LayoutingType.Y) {
- if (Slot.Y < dv.DockingThreshold)
- dock (Alignment.Top);
- else if (Slot.Bottom > dvCliRect.Height - dv.DockingThreshold)
- dock (Alignment.Bottom);
+ public Alignment DockingPosition {
+ get { return docking; }
+ set {
+ if (docking == value)
+ return;
+ docking = value;
+ NotifyValueChanged ("DockingPosition", DockingPosition);
}
}
-
- public override void onMouseMove (object sender, MouseMoveEventArgs e)
+ protected override void onDrop (object sender, DragDropEventArgs e)
{
- lastMousePos = e.Position;
-
- if (this.HasFocus && e.Mouse.IsButtonDown (MouseButton.Left) && IsDocked) {
- Docker dv = Parent as Docker;
- if (docking == Alignment.Left) {
- if (lastMousePos.X - undockingMousePosOrig.X > dv.DockingThreshold)
- undock ();
- } else if (docking == Alignment.Right) {
- if (undockingMousePosOrig.X - lastMousePos.X > dv.DockingThreshold)
- undock ();
- } else if (docking == Alignment.Top) {
- if (lastMousePos.Y - undockingMousePosOrig.Y > dv.DockingThreshold)
- undock ();
- } else if (docking == Alignment.Bottom) {
- if (undockingMousePosOrig.Y - lastMousePos.Y > dv.DockingThreshold)
- undock ();
+ base.onDrop (sender, e);
+ Docker dv = Parent as Docker;
+ dv.Dock (this);
+ }
+ public override bool PointIsIn (ref Point m)
+ {
+ if (!base.PointIsIn(ref m))
+ return false;
+
+ Group p = Parent as Group;
+ if (p != null) {
+ lock (p.Children) {
+ for (int i = p.Children.Count - 1; i >= 0; i--) {
+ if (p.Children [i] == this)
+ break;
+ if (p.Children [i].Slot.ContainsOrIsEqual (m)) {
+ return false;
+ }
+ }
}
- return;
}
-
- base.onMouseMove (sender, e);
+ return Slot.ContainsOrIsEqual(m);
}
- public override void onMouseDown (object sender, MouseButtonEventArgs e)
- {
- base.onMouseDown (sender, e);
- if (this.HasFocus && IsDocked && e.Button == MouseButton.Left)
- undockingMousePosOrig = lastMousePos;
- }
+// public override void OnLayoutChanges (LayoutingType layoutType)
+// {
+// base.OnLayoutChanges (layoutType);
+//
+// if (isDocked)
+// return;
+
+// Docker dv = Parent as Docker;
+// if (dv == null)
+// return;
+//
+// Rectangle dvCliRect = dv.ClientRectangle;
+//
+// if (layoutType == LayoutingType.X) {
+// if (Slot.X < dv.DockingThreshold)
+// dock (Alignment.Left);
+// else if (Slot.Right > dvCliRect.Width - dv.DockingThreshold)
+// dock (Alignment.Right);
+// }else if (layoutType == LayoutingType.Y) {
+// if (Slot.Y < dv.DockingThreshold)
+// dock (Alignment.Top);
+// else if (Slot.Bottom > dvCliRect.Height - dv.DockingThreshold)
+// dock (Alignment.Bottom);
+// }
+// }
+//
+// public override void onMouseMove (object sender, MouseMoveEventArgs e)
+// {
+// lastMousePos = e.Position;
+//
+// if (this.HasFocus && e.Mouse.IsButtonDown (MouseButton.Left) && IsDocked) {
+// Docker dv = Parent as Docker;
+// if (docking == Alignment.Left) {
+// if (lastMousePos.X - undockingMousePosOrig.X > dv.DockingThreshold)
+// undock ();
+// } else if (docking == Alignment.Right) {
+// if (undockingMousePosOrig.X - lastMousePos.X > dv.DockingThreshold)
+// undock ();
+// } else if (docking == Alignment.Top) {
+// if (lastMousePos.Y - undockingMousePosOrig.Y > dv.DockingThreshold)
+// undock ();
+// } else if (docking == Alignment.Bottom) {
+// if (undockingMousePosOrig.Y - lastMousePos.Y > dv.DockingThreshold)
+// undock ();
+// }
+// return;
+// }
+//
+// base.onMouseMove (sender, e);
+// }
+// public override void onMouseDown (object sender, MouseButtonEventArgs e)
+// {
+// base.onMouseDown (sender, e);
+//
+// if (this.HasFocus && IsDocked && e.Button == MouseButton.Left)
+// undockingMousePosOrig = lastMousePos;
+// }
// protected override void onBorderMouseEnter (object sender, MouseMoveEventArgs e)
// {
using System;
using System.Xml.Serialization;
using System.ComponentModel;
+using Crow.IML;
namespace Crow
{
public class Docker : Group
{
+ static Instantiator instStack, instSplit, instSpacer;
#region CTOR
+ static Docker () {
+ instStack = Instantiator.CreateFromImlFragment(@"<GenericStack Background='Blue' AllowDrop='true' DragEnter='onStackDragEnter'/>");
+ instSplit = Instantiator.CreateFromImlFragment(@"<Splitter/>");
+ instSpacer = Instantiator.CreateFromImlFragment(@"<GraphicObject Background='Red' IsEnabled='false'/>");
+ }
public Docker () : base ()
{
}
#endregion
+ GenericStack rootStack = null;
+
+ public override void AddChild (GraphicObject g)
+ {
+ DockWindow dw = g as DockWindow;
+ if (dw == null)
+ throw new Exception ("Docker accept only DockWindow as child");
+
+ base.AddChild (g);
+
+ dw.LogicalParent = this;
+ }
+ public override void RemoveChild (GraphicObject child)
+ {
+ child.LogicalParent = null;
+
+
+ base.RemoveChild (child);
+ }
+
+ GenericStack mainStack = null;
int dockingThreshold;
[XmlAttributeAttribute][DefaultValue(10)]
}
}
+ bool showDockingTarget = false;
+ Alignment dockingDirection = Alignment.Center;
+ int dockingDiv = 5;
+
public override void onMouseMove (object sender, MouseMoveEventArgs e)
{
if (CurrentInterface.DragAndDropOperation?.DragSource as DockWindow != null) {
DockWindow dw = CurrentInterface.DragAndDropOperation?.DragSource as DockWindow;
- if (CurrentInterface.DragAndDropOperation.DragSource.Parent == this && !dw.IsDocked)
- dw.MoveAndResize (e.XDelta, e.YDelta);
- }
+ if (CurrentInterface.DragAndDropOperation.DragSource.Parent == this && !dw.IsDocked)
+ dw.MoveAndResize (e.XDelta, e.YDelta);
+ Rectangle r = ClientRectangle;
+ int vTreshold = r.Height / dockingDiv;
+ int hTreshold = r.Width / dockingDiv;
+
+
+ bool showDock = true;
+
+ if (dw.Slot.Left < hTreshold)
+ dockingDirection = Alignment.Left;
+ else if (dw.Slot.Right > r.Right - hTreshold)
+ dockingDirection = Alignment.Right;
+ else if (dw.Slot.Top < vTreshold)
+ dockingDirection = Alignment.Top;
+ else if (dw.Slot.Bottom > r.Bottom - vTreshold)
+ dockingDirection = Alignment.Bottom;
+ else {
+ dockingDirection = Alignment.Center;
+ showDock = false;
+ }
+
+ showDockingTarget = showDock;
+
+ RegisterForGraphicUpdate ();
+
+ //System.Diagnostics.Debug.WriteLine ("Dock: {0}", dockingDirection);
+ } else
+ showDockingTarget = false;
base.onMouseMove (sender, e);
}
+ protected override void onDragEnter (object sender, DragDropEventArgs e)
+ {
+ base.onDragEnter (sender, e);
+ }
+ void onStackDragEnter (object sender, DragDropEventArgs e)
+ {
+ base.onDragEnter (sender, e);
+
+ mainStack = sender as GenericStack;
+ }
+ protected override void onDraw (Cairo.Context gr)
+ {
+ gr.Save ();
+
+ Rectangle rBack = new Rectangle (Slot.Size);
+
+ Background.SetAsSource (gr, rBack);
+ CairoHelpers.CairoRectangle (gr, rBack, CornerRadius);
+ gr.Fill ();
+
+ if (ClipToClientRect) {
+ //clip to client zone
+ CairoHelpers.CairoRectangle (gr, ClientRectangle, CornerRadius);
+ gr.Clip ();
+ }
+
+ lock (Children) {
+ foreach (GraphicObject g in Children) {
+ if (CurrentInterface.DragAndDropOperation?.DragSource == g)
+ continue;
+ g.Paint (ref gr);
+ }
+ }
+
+ if (showDockingTarget) {
+ Rectangle r;
+ if (mainStack == null)
+ r = ClientRectangle;
+ else
+ r = mainStack.ClientRectangle;
+
+ switch (dockingDirection) {
+ case Alignment.Top:
+ gr.Rectangle (r.Left, r.Top, r.Width, r.Height / dockingDiv);
+ break;
+ case Alignment.Bottom:
+ gr.Rectangle (r.Left, r.Bottom - r.Height / dockingDiv, r.Width, r.Height / dockingDiv);
+ break;
+ case Alignment.Left:
+ gr.Rectangle (r.Left, r.Top, r.Width / dockingDiv, r.Height);
+ break;
+ case Alignment.Right:
+ gr.Rectangle (r.Right - r.Width / dockingDiv, r.Top, r.Width / dockingDiv, r.Height);
+ break;
+ }
+ gr.LineWidth = 1;
+ gr.SetSourceRGBA (0.4, 0.4, 0.9, 0.4);
+ gr.FillPreserve ();
+ gr.SetSourceRGBA (0.9, 0.9, 1.0, 0.8);
+ gr.Stroke ();
+ }
+
+ if (CurrentInterface.DragAndDropOperation != null)
+ CurrentInterface.DragAndDropOperation.DragSource.Paint (ref gr);
+
+
+ gr.Restore ();
+ }
+
+ public void Dock(DockWindow dw){
+ if (dockingDirection == Alignment.Center)
+ return;
+ lock (CurrentInterface.UpdateMutex) {
+
+ Splitter splitter = instSplit.CreateInstance<Splitter> (CurrentInterface);
+
+ dw.Resizable = false;
+ dw.Left = dw.Top = 0;
+ this.RemoveChild (dw);
+
+ Rectangle r;
+ if (mainStack == null) {
+ mainStack = instStack.CreateInstance<GenericStack> (CurrentInterface);
+ this.AddChild (mainStack);
+ this.putWidgetOnBottom (mainStack);
+ r = ClientRectangle;
+ } else
+ r = mainStack.ClientRectangle;
+
+ int vTreshold = r.Height / dockingDiv;
+ int hTreshold = r.Width / dockingDiv;
+
+ switch (dockingDirection) {
+ case Alignment.Top:
+ dw.Width = Measure.Stretched;
+ mainStack.Orientation = Orientation.Vertical;
+ mainStack.AddChild (dw);
+ mainStack.AddChild (splitter);
+ //mainStack.AddChild (instSpacer.CreateInstance (CurrentInterface));
+ break;
+ case Alignment.Bottom:
+ dw.Width = Measure.Stretched;
+ mainStack.Orientation = Orientation.Vertical;
+ //mainStack.AddChild (instSpacer.CreateInstance (CurrentInterface));
+ mainStack.AddChild (splitter);
+ mainStack.AddChild (dw);
+ break;
+ case Alignment.Left:
+ dw.Height = Measure.Stretched;
+ mainStack.Orientation = Orientation.Horizontal;
+ mainStack.AddChild (dw);
+ mainStack.AddChild (splitter);
+ //mainStack.AddChild (instSpacer.CreateInstance (CurrentInterface));
+ break;
+ case Alignment.Right:
+ dw.Height = Measure.Stretched;
+ mainStack.Orientation = Orientation.Horizontal;
+ //mainStack.AddChild (instSpacer.CreateInstance (CurrentInterface));
+ mainStack.AddChild (splitter);
+ mainStack.AddChild (dw);
+ break;
+ }
+
+ }
+ }
+ protected override void onDrop (object sender, DragDropEventArgs e)
+ {
+ base.onDrop (sender, e);
+ }
}
}
if (parent == value)
return;
DataSourceChangeEventArgs e = new DataSourceChangeEventArgs (parent, value);
- lock (this)
+ lock (CurrentInterface.LayoutMutex) {
parent = value;
-
- onParentChanged (this, e);
+ }
+ onParentChanged (this, e);
+
}
}
[XmlIgnore]public ILayoutable LogicalParent {
//prevent setting null causing stack overflow in specific case
if (dse.NewDataSource == dse.OldDataSource)
return;
-
- OnDataSourceChanged (this, dse);
+ lock (CurrentInterface.LayoutMutex) {
+ OnDataSourceChanged (this, dse);
+ }
NotifyValueChanged ("DataSource", DataSource);
}
/// fired when drag and drop operation start
/// </summary>
protected virtual void onStartDrag (object sender, DragDropEventArgs e){
- CurrentInterface.HoverWidget = this.focusParent;
+ CurrentInterface.HoverWidget = null;
IsDragged = true;
StartDrag.Raise (this, e);
Debug.WriteLine(this.ToString() + " : START DRAG => " + e.ToString());
#if DEBUG_UPDATE
Debug.WriteLine (string.Format("ClippingRegistration -> {0}", this.ToString ()));
#endif
- IsQueueForRedraw = false;
- if (Parent == null)
- return;
- Parent.RegisterClip (LastPaintedSlot);
- Parent.RegisterClip (Slot);
+ lock(CurrentInterface.LayoutMutex){
+ IsQueueForRedraw = false;
+ if (Parent == null)
+ return;
+ Parent.RegisterClip (LastPaintedSlot);
+ Parent.RegisterClip (Slot);
+ }
}
/// <summary>
/// Add clip rectangle to this.clipping and propagate up to root
set { _multiSelect = value; }
}
public virtual void AddChild(GraphicObject g){
- lock (children) {
+ lock (Children) {
g.Parent = this;
Children.Add (g);
}
CurrentInterface.HoverWidget = null;
}
- lock (children)
+ lock (Children)
Children.Remove(child);
- child.Dispose ();
if (child == largestChild && Width == Measure.Fit)
searchLargestChild ();
searchTallestChild ();
this.RegisterForLayouting (LayoutingType.Sizing | LayoutingType.ArrangeChildren);
+
+ }
+ public virtual void DeleteChild(GraphicObject child)
+ {
+ RemoveChild (child);
+ child.Dispose ();
}
public virtual void InsertChild (int idx, GraphicObject g) {
- lock (children) {
+ lock (Children) {
g.Parent = this;
Children.Insert (idx, g);
}
g.LayoutChanged += OnChildLayoutChanges;
g.RegisterForLayouting (LayoutingType.Sizing | LayoutingType.ArrangeChildren);
}
- public virtual void RemoveChild (int idx) {
- RemoveChild (children[idx]);
+ public virtual void DeleteChild (int idx) {
+ DeleteChild (children[idx]);
}
public virtual void ClearChildren()
{
- lock (children) {
+ lock (Children) {
while (Children.Count > 0) {
GraphicObject g = Children [Children.Count - 1];
g.LayoutChanged -= OnChildLayoutChanges;
{
if (Children.Contains(w))
{
- lock (children) {
+ lock (Children) {
Children.Remove (w);
Children.Add (w);
}
{
if (Children.Contains(w))
{
- lock (children) {
+ lock (Children) {
Children.Remove (w);
Children.Insert (0, w);
}
public override void OnDataSourceChanged (object sender, DataSourceChangeEventArgs e)
{
base.OnDataSourceChanged (this, e);
- lock (children) {
+ lock (Children) {
foreach (GraphicObject g in children)
if (g.localDataSourceIsNull & g.localLogicalParentIsNull)
g.OnDataSourceChanged (g, e);
if (Name == nameToFind)
return this;
GraphicObject tmp = null;
- lock (children) {
+ lock (Children) {
foreach (GraphicObject w in Children) {
tmp = w.FindByName (nameToFind);
if (tmp != null)
gr.Clip ();
}
- lock (children) {
+ lock (Children) {
foreach (GraphicObject g in Children) {
g.Paint (ref gr);
}
gr.Clip ();
}
- lock (children) {
+ lock (Children) {
foreach (GraphicObject c in Children) {
if (!c.Visible)
continue;
}
base.checkHoverWidget (e);
}
+// public override bool PointIsIn (ref Point m)
+// {
+// if (!base.PointIsIn (ref m))
+// return false;
+// if (CurrentInterface.HoverWidget == this)
+// return true;
+// lock (Children) {
+// for (int i = Children.Count - 1; i >= 0; i--) {
+// if (Children [i].Slot.ContainsOrIsEqual (m) && !(bool)CurrentInterface.HoverWidget?.IsOrIsInside(Children[i])) {
+// return false;
+// }
+// }
+// }
+// return true;
+// }
#endregion
protected override void Dispose (bool disposing)
close ();
}
public static MessageBox Show (Interface iface, Type msgBoxType, string message, string okMsg = "", string cancelMsg = ""){
- //lock (Interface.CurrentInterface.UpdateMutex) {
+ lock (iface.UpdateMutex) {
MessageBox mb = new MessageBox (iface);
mb.CurrentInterface.AddWidget (mb);
mb.MsgType = msgBoxType;
if (!string.IsNullOrEmpty(cancelMsg))
mb.CancelMessage = cancelMsg;
return mb;
- //}
+ }
}
}
}
public bool HoldCursor = false;
public override bool PointIsIn (ref Point m)
{
- TabView tv = Parent as TabView;
- bool tmp = base.PointIsIn (ref m);
+ if (!base.PointIsIn (ref m))
+ return false;
if (m.Y < tabThickness)
return TabTitle.Slot.ContainsOrIsEqual (m);
else
- return this.isSelected && tmp;
+ return this.isSelected;
}
public override void onMouseDown (object sender, MouseButtonEventArgs e)
{
}
public void butCloseTabClick (object sender, MouseButtonEventArgs e){
QueryClose.Raise (this, null);
+ //if tab is used as a templated item root in a templatedGroup, local datasource
+ //is not null, in this case, removing the data entries will delete automatically the item
+ if (localDataSourceIsNull)
+ (Parent as TabView).DeleteChild (this);
}
#endregion
SelectedTab = ti.ViewIndex = Children.Count - 1;
}
- public override void RemoveChild (GraphicObject child)
+ public override void DeleteChild (GraphicObject child)
{
TabItem ti = child as TabItem;
if (ti == null)
if (selectedTab > Children.Count - 2)
SelectedTab--;
- base.RemoveChild (child);
+ base.DeleteChild (child);
}
public override bool ArrangeChildren { get { return true; } }
if (this.isPaged) {
int p = e.Index / itemPerPage;
int i = e.Index % itemPerPage;
- (items.Children [p] as Group).RemoveChild (i);
+ (items.Children [p] as Group).DeleteChild (i);
} else
- items.RemoveChild (e.Index);
+ items.DeleteChild (e.Index);
}
void Ol_ListAdd (object sender, ListChangedEventArg e)
public virtual void RemoveItem(GraphicObject g)
{
g.LogicalParent = null;
- items.RemoveChild (g);
+ items.DeleteChild (g);
if (items.Children.Count == 0)
NotifyValueChanged ("HasChildren", false);
}
// isPaged = true;
// }
- for (int i = 0; i < _data.Count; i++) {
+ for (int i = 0; i < _data.Count; i++) {
loadItem (_data[i], page, _dataTest);
+ if (loadingThread.cancelRequested)
+ break;
}
// if (page == items)
iTemp = ItemTemplates ["default"];
}
- lock (CurrentInterface.LayoutMutex) {
+ //lock (CurrentInterface.LayoutMutex) {
g = iTemp.CreateInstance(CurrentInterface);
page.AddChild (g);
// if (isPaged)
g.LogicalParent = this;
g.MouseDown += itemClick;
- }
+ //}
if (iTemp.Expand != null && g is Expandable) {
(g as Expandable).Expand += iTemp.Expand;
if (Parent is Interface)
(Parent as Interface).DeleteWidget (this);
else if (Parent is Group)
- (Parent as Group).RemoveChild (this);
+ (Parent as Group).DeleteChild (this);
else if (Parent is PrivateContainer)
(Parent as Container).Child = null;
}
GraphicObject g = null;
while (DrawingQueue.Count > 0) {
lock (DrawingQueue)
- g = DrawingQueue.Dequeue ();
- lock (g)
- g.ClippingRegistration ();
+ g = DrawingQueue.Dequeue ();
+ g.ClippingRegistration ();
}
#if MEASURE_TIME