<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
- <DefineConstants>DEBUG_UPDATE0;DEBUG_FOCUS0;DEBUG_LAYOUTING0;TRACE0;DEBUG;MEASURE_TIME;DEBUG_LOAD0;DEBUG_BINDING0;DEBUG_CLIP_RECTANGLE0</DefineConstants>
+ <DefineConstants>DEBUG_UPDATE0;DEBUG_FOCUS0;DEBUG_LAYOUTING0;TRACE0;DEBUG;MEASURE_TIME;DEBUG_LOAD0;DEBUG_BINDING;DEBUG_CLIP_RECTANGLE0</DefineConstants>
<Optimize>false</Optimize>
+ <OutputPath>$(SolutionDir)build\Debug</OutputPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<Optimize>true</Optimize>
<DefineConstants>__linux__</DefineConstants>
+ <OutputPath>$(SolutionDir)build\Release</OutputPath>
</PropertyGroup>
<ItemGroup>
<Compile Include="src\Colors.cs" />
<Compile Include="src\IML\IMLContext.cs" />
<Compile Include="src\Mono.Cairo\MeshPattern.cs" />
<Compile Include="src\GraphicObjects\Shape.cs" />
+ <Compile Include="src\GraphicObjects\MDIContainer.cs" />
+ <Compile Include="src\IListChanged.cs" />
+ <Compile Include="src\ObservableList.cs" />
+ <Compile Include="src\GraphicObjects\IMLContainer.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="System" />
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CrowIDE", "CrowIDE\CrowIDE.csproj", "{B6D911CD-1D09-42FC-B300-9187190F2AE1}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Crow.Coding", "..\gts\CrowEdit\Crow.Coding\Crow.Coding.csproj", "{78842EE4-8A2F-4C75-AEC6-C95F15AD3994}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
{74289092-9F70-4941-AFCB-DFD7BE2140B6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{74289092-9F70-4941-AFCB-DFD7BE2140B6}.Release|Any CPU.Build.0 = Release|Any CPU
{B6D911CD-1D09-42FC-B300-9187190F2AE1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {B6D911CD-1D09-42FC-B300-9187190F2AE1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B6D911CD-1D09-42FC-B300-9187190F2AE1}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {B6D911CD-1D09-42FC-B300-9187190F2AE1}.Release|Any CPU.Build.0 = Release|Any CPU
{C2980F9B-4798-4C05-99E2-E174810F7C7B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C2980F9B-4798-4C05-99E2-E174810F7C7B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C2980F9B-4798-4C05-99E2-E174810F7C7B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C2980F9B-4798-4C05-99E2-E174810F7C7B}.Release|Any CPU.Build.0 = Release|Any CPU
+ {78842EE4-8A2F-4C75-AEC6-C95F15AD3994}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {78842EE4-8A2F-4C75-AEC6-C95F15AD3994}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {78842EE4-8A2F-4C75-AEC6-C95F15AD3994}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {78842EE4-8A2F-4C75-AEC6-C95F15AD3994}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
Policies = $0
$0.StandardHeader = $1
$1.Text = @\n${FileName}\n \nAuthor:\n ${AuthorName} <${AuthorEmail}>\n\nCopyright (c) 2013-2017 Jean-Philippe Bruyère\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the "Software"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.
- $1.IncludeInNewFiles = True
$0.DotNetNamingPolicy = $2
- $2.DirectoryNamespaceAssociation = None
- $2.ResourceNamePolicy = FileFormatDefault
$0.TextStylePolicy = $3
- $3.FileWidth = 120
- $3.TabsToSpaces = False
$3.EolMarker = Unix
- $3.inheritsSet = VisualStudio
- $3.inheritsScope = text/plain
$3.scope = text/x-csharp
$0.CSharpFormattingPolicy = $4
$4.AfterDelegateDeclarationParameterComma = True
- $4.inheritsSet = Mono
- $4.inheritsScope = text/x-csharp
$4.scope = text/x-csharp
+ $4.IndentSwitchSection = False
+ $4.NewLinesForBracesInProperties = False
+ $4.NewLinesForBracesInAccessors = False
+ $4.NewLinesForBracesInAnonymousMethods = False
+ $4.NewLinesForBracesInControlBlocks = False
+ $4.NewLinesForBracesInAnonymousTypes = False
+ $4.NewLinesForBracesInObjectCollectionArrayInitializers = False
+ $4.NewLinesForBracesInLambdaExpressionBody = False
+ $4.NewLineForElse = False
+ $4.NewLineForCatch = False
+ $4.NewLineForFinally = False
+ $4.NewLineForMembersInObjectInit = False
+ $4.NewLineForMembersInAnonymousTypes = False
+ $4.NewLineForClausesInQuery = False
+ $4.SpacingAfterMethodDeclarationName = True
+ $4.SpaceAfterMethodCallName = True
+ $4.SpaceBeforeOpenSquareBracket = True
$0.VersionControlPolicy = $5
$5.CommitMessageStyle = $6
$6.Indent = @\t
$6.LastFilePostfix = "@:\n "
$6.LineAlign = 0
$6.Wrap = False
- $5.inheritsSet = Mono
description = @C.R.O.W. c# Rapid Open Widgets\n\nCrow is a pure c# widget toolkit with XML definition of interface, bindings, styling...\n
version = 0.5
EndGlobalSection
<StartWorkingDirectory>%24{SolutionDir}\build\%24{ProjectConfigName}</StartWorkingDirectory>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
+ <PropertyGroup Condition=" '$(RunConfiguration)' == 'Custom Command' ">
+ <StartAction>Program</StartAction>
+ <StartProgram>%24{TargetName}</StartProgram>
+ <StartWorkingDirectory>%24{SolutionDir}\build\%24{ProjectConfigName}</StartWorkingDirectory>
+ <ConsolePause>false</ConsolePause>
+ </PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Project>{C2980F9B-4798-4C05-99E2-E174810F7C7B}</Project>
<Name>Crow</Name>
</ProjectReference>
+ <ProjectReference Include="..\..\gts\CrowEdit\Crow.Coding\Crow.Coding.csproj">
+ <Project>{78842EE4-8A2F-4C75-AEC6-C95F15AD3994}</Project>
+ <Name>Crow.Coding</Name>
+ </ProjectReference>
</ItemGroup>
<ItemGroup>
<Compile Include="src\CrowIDE.cs" />
<Compile Include="..\Tests\InterfaceControler.cs">
<Link>src\InterfaceControler.cs</Link>
</Compile>
+ <Compile Include="src\DesignInterface.cs" />
+ <Compile Include="src\EditPane.cs" />
+ <Compile Include="src\ProjectNodes.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="ui\" />
<Folder Include="images\" />
</ItemGroup>
<ItemGroup>
- <EmbeddedResource Include="ui\imlEditor.crow" />
<EmbeddedResource Include="images\save.svg" />
<EmbeddedResource Include="ui\IDE.style" />
<EmbeddedResource Include="ui\MembersView.template">
</EmbeddedResource>
<EmbeddedResource Include="ui\ProjectTree.template" />
<EmbeddedResource Include="ui\MembersItem.template" />
+ <EmbeddedResource Include="ui\EditPane.template">
+ <LogicalName>CrowIDE.EditPane.template</LogicalName>
+ </EmbeddedResource>
+ <EmbeddedResource Include="ui\EditPaneItems.template" />
+ <EmbeddedResource Include="ui\CrowIDE.crow" />
+ <EmbeddedResource Include="ui\icons\blank-file.svg" />
+ <EmbeddedResource Include="ui\icons\sign-out.svg" />
+ <EmbeddedResource Include="ui\icons\copy-file.svg" />
+ <EmbeddedResource Include="ui\icons\paste-on-document.svg" />
+ <EmbeddedResource Include="ui\icons\scissors.svg" />
+ <EmbeddedResource Include="ui\icons\reply.svg" />
+ <EmbeddedResource Include="ui\icons\share-arrow.svg" />
+ <EmbeddedResource Include="ui\icons\question.svg" />
+ <EmbeddedResource Include="ui\icons\inbox.svg" />
+ <EmbeddedResource Include="ui\icons\outbox.svg" />
+ <EmbeddedResource Include="ui\icons\tools.svg" />
+ <EmbeddedResource Include="ui\TabItem.template">
+ <LogicalName>Crow.TabItem.template</LogicalName>
+ </EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Include="ui\test.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
+ <None Include="ui\icons\center-align.svg" />
+ <None Include="ui\icons\cogwheel.svg" />
+ <None Include="ui\icons\edit.svg" />
+ <None Include="ui\icons\file-code.svg" />
+ <None Include="ui\icons\folder.svg" />
+ <None Include="ui\icons\font-file.svg" />
+ <None Include="ui\icons\light-bulb.svg" />
+ <None Include="ui\icons\paragraph.svg" />
+ <None Include="ui\icons\previous.svg" />
+ <None Include="ui\icons\search.svg" />
+ <None Include="ui\icons\text-file.svg" />
+ <None Include="ui\icons\text-label.svg" />
+ <None Include="ui\icons\zoom-in.svg" />
+ <None Include="ui\icons\zoom-out.svg" />
+ <None Include="ui\icons\basic_floppydisk.svg" />
</ItemGroup>
</Project>
using Crow.IML;
using System.Xml;
using System.Linq;
+using Crow.Coding;
namespace CrowIDE
{
- public enum ItemType {
- ReferenceGroup,
- Reference,
- ProjectReference,
- VirtualGroup,
- Folder,
- None,
- Compile,
- EmbeddedResource,
- }
-
- public class ProjectNode {
- ItemType type;
- string name;
-
- public Project Project;
-
- List<ProjectNode> childNodes = new List<ProjectNode>();
-
- public virtual ItemType Type {
- get { return type; }
- }
- public virtual string DisplayName {
- get { return name; }
- }
- public List<ProjectNode> ChildNodes {
- get { return childNodes; }
- }
-
- public void SortChilds () {
- foreach (ProjectNode pn in childNodes)
- pn.SortChilds ();
- childNodes = childNodes.OrderBy(c=>c.Type).ThenBy(cn=>cn.DisplayName).ToList();
- }
+ class CrowIDE : CrowWindow
+ {
+ public Command CMDNew, CMDOpen, CMDSave, CMDSaveAs, CMDQuit,
+ CMDUndo, CMDRedo, CMDCut, CMDCopy, CMDPaste, CMDHelp,
+ CMDAbout, CMDOptions,
+ CMDViewGTExp, CMDViewProps, CMDViewProj, CMDViewProjProps,
+ CMDCompile;
+
+ void initCommands () {
+ CMDNew = new Command(new Action(() => newFile())) { Caption = "New", Icon = new SvgPicture("#CrowIDE.ui.icons.blank-file.svg"), CanExecute = false};
+ CMDOpen = new Command(new Action(() => openFileDialog())) { Caption = "Open...", Icon = new SvgPicture("#CrowIDE.ui.icons.outbox.svg")};
+ CMDSave = new Command(new Action(() => saveFileDialog())) { Caption = "Save", Icon = new SvgPicture("#CrowIDE.ui.icons.inbox.svg"), CanExecute = false};
+ CMDSaveAs = new Command(new Action(() => saveFileDialog())) { Caption = "Save As...", Icon = new SvgPicture("#CrowIDE.ui.icons.inbox.svg"), CanExecute = false};
+ CMDQuit = new Command(new Action(() => Quit (null, null))) { Caption = "Quit", Icon = new SvgPicture("#CrowIDE.ui.icons.sign-out.svg")};
+ CMDUndo = new Command(new Action(() => undo())) { Caption = "Undo", Icon = new SvgPicture("#CrowIDE.ui.icons.reply.svg"), CanExecute = false};
+ CMDRedo = new Command(new Action(() => redo())) { Caption = "Redo", Icon = new SvgPicture("#CrowIDE.ui.icons.share-arrow.svg"), CanExecute = false};
+ CMDCut = new Command(new Action(() => Quit (null, null))) { Caption = "Cut", Icon = new SvgPicture("#CrowIDE.ui.icons.scissors.svg"), CanExecute = false};
+ CMDCopy = new Command(new Action(() => Quit (null, null))) { Caption = "Copy", Icon = new SvgPicture("#CrowIDE.ui.icons.copy-file.svg"), CanExecute = false};
+ CMDPaste = new Command(new Action(() => Quit (null, null))) { Caption = "Paste", Icon = new SvgPicture("#CrowIDE.ui.icons.paste-on-document.svg"), CanExecute = false};
+ CMDHelp = new Command(new Action(() => System.Diagnostics.Debug.WriteLine("help"))) { Caption = "Help", Icon = new SvgPicture("#CrowIDE.ui.icons.question.svg")};
+ CMDOptions = new Command(new Action(() => openOptionsDialog())) { Caption = "Editor Options", Icon = new SvgPicture("#CrowIDE.ui.icons.tools.svg")};
- #region CTOR
- public ProjectNode (Project project, ItemType _type, string _name) : this(project){
- type = _type;
- name = _name;
- }
- public ProjectNode (Project project){
- Project = project;
- }
- #endregion
- }
- public class ProjectItem : ProjectNode {
- public XmlNode node;
- public string Path {
- get {
- return node.Attributes["Include"]?.Value.Replace('\\','/');
- }
- }
- public override ItemType Type {
- get {
- return (ItemType)Enum.Parse (typeof(ItemType), node.Name, true);
- }
- }
- public override string DisplayName {
- get {
- return Type == ItemType.Reference ?
- Path :
- Path.Split ('\\', '/').LastOrDefault();
- }
+ CMDViewGTExp = new Command(new Action(() => loadWindow ("#CrowIDE.ui.GTreeExplorer.crow"))) { Caption = "Graphic Tree Explorer"};
+ CMDViewProps = new Command(new Action(() => loadWindow ("#CrowIDE.ui.MemberView.crow"))) { Caption = "Properties View"};
+ CMDCompile = new Command(new Action(() => compileSolution())) { Caption = "Compile"};
+ CMDViewProj = new Command(new Action(() => loadWindow ("#CrowIDE.ui.CSProjExplorer.crow"))) { Caption = "Project Explorer"};
+ CMDViewProjProps = new Command(new Action(loadProjProps) ){ Caption = "Project Properties"};
}
- public ProjectItem (Project project, XmlNode _node) : base (project){
- node = _node;
+ void openFileDialog () {
+ AddWidget (instFileDlg.CreateInstance(CurrentInterface)).DataSource = this;
}
- }
-
+ void openOptionsDialog(){}
+ void newFile() {}
+ void saveFileDialog() {}
+ void undo() {}
+ void redo() {}
- class CrowIDE : CrowWindow
- {
- public Command CMDSave = new Command(new Action(() => System.Diagnostics.Debug.WriteLine("Save"))) { Caption = "Save", Icon = new SvgPicture("#Crow.Icons.open-file.svg")};
-// public Command CMDSave = new Command(actionOpenFile) { Caption = "Open...", Icon = new SvgPicture("#Crow.Icons.open-file.svg")};
-// public Command CMDQuit = new Command(actionOpenFile) { Caption = "Open...", Icon = new SvgPicture("#Crow.Icons.open-file.svg")};
- public Command CMDCut = new Command(new Action(() => System.Diagnostics.Debug.WriteLine("Cut"))) { Caption = "Cut", Icon = new SvgPicture("#Crow.Icons.scissors.svg")};
- public Command CMDCopy = new Command(new Action(() => System.Diagnostics.Debug.WriteLine("Copy"))) { Caption = "Copy", Icon = new SvgPicture("#Crow.Icons.copy-file.svg")};
- public Command CMDPaste = new Command(new Action(() => System.Diagnostics.Debug.WriteLine("Paste"))) { Caption = "Paste", Icon = new SvgPicture("#Crow.Icons.paste-on-document.svg")};
- public Command CMDHelp = new Command(new Action(() => System.Diagnostics.Debug.WriteLine("Help"))) { Caption = "Help", Icon = new SvgPicture("#Crow.Icons.question.svg")};
-
- public Command CMDLoad, CMDQuit, CMDViewGTExp, CMDViewProps, CMDViewProj, CMDViewProjProps;
[STAThread]
static void Main ()
{
}
ImlVisualEditor imlVE;
+ SourceEditor srcEditor;
Instantiator instFileDlg;
Solution currentSolution;
- Project currentProject;
- TreeView tv;
-
- public IList<Project> Projects { get {return null;}}
protected override void OnLoad (EventArgs e)
{
base.OnLoad (e);
- ReopenLastSolution = true;
-
instFileDlg = Instantiator.CreateFromImlFragment
("<FileDialog Caption='Open File' CurrentDirectory='{²CurrentDirectory}' SearchPattern='*.*' OkClicked='onFileOpen'/>");
- CMDLoad = new Command(new Action(()=>openFileDialog())) { Caption = "Open", Icon = new SvgPicture("#Crow.Icons.open-file.svg")};
- CMDQuit = new Command(new Action(() => Quit (null, null))) { Caption = "Quit", Icon = new SvgPicture("#Crow.Icons.exit-symbol.svg")};
- CMDViewGTExp = new Command(new Action(() => loadWindow ("#CrowIDE.ui.GTreeExplorer.crow"))) { Caption = "Graphic Tree Explorer"};
- CMDViewProps = new Command(new Action(() => loadWindow ("#CrowIDE.ui.MemberView.crow"))) { Caption = "Properties View"};
- CMDViewProj = new Command(new Action(() => loadWindow ("#CrowIDE.ui.CSProjExplorer.crow"))) { Caption = "Project Explorer"};
- CMDViewProjProps = new Command(new Action(loadProjProps) ){ Caption = "Project Properties"};
+ initCommands ();
+
this.KeyDown += CrowIDE_KeyDown;
//this.CrowInterface.LoadInterface ("#CrowIDE.ui.imlEditor.crow").DataSource = this;
//GraphicObject go = this.CrowInterface.LoadInterface (@"ui/test.crow");
- GraphicObject go = CurrentInterface.AddWidget (@"#CrowIDE.ui.imlEditor.crow");
+ GraphicObject go = AddWidget (@"#CrowIDE.ui.CrowIDE.crow");
imlVE = go.FindByName ("crowContainer") as ImlVisualEditor;
- go.DataSource = this;
-
if (ReopenLastSolution && !string.IsNullOrEmpty(LastOpenSolution))
CurrentSolution = Solution.LoadSolution (LastOpenSolution);
+
+ go.DataSource = this;
+
}
void loadProjProps () {
- loadWindow ("#CrowIDE.ui.ProjectProperties.crow", currentProject);
+ //loadWindow ("#CrowIDE.ui.ProjectProperties.crow", currentProject);
+ }
+ void compileSolution () {
+ //ProjectItem pi = CurrentSolution.SelectedItem;
+ Project p = CurrentSolution?.Projects[1];
+ if (p == null)
+ return;
+ p.Compile ();
}
public string CurrentDirectory {
}
}
public Solution CurrentSolution {
- get { return CurrentSolution; }
+ get { return currentSolution; }
set {
if (currentSolution == value)
return;
NotifyValueChanged ("CurrentSolution", currentSolution);
}
}
- public string LastOpenProject {
- get { return Crow.Configuration.Get<string>("LastOpenProject");}
- set {
- Crow.Configuration.Set ("LastOpenProject", value);
- }
- }
+
public string LastOpenSolution {
get { return Crow.Configuration.Get<string>("LastOpenSolution");}
set {
NotifyValueChanged ("ReopenLastSolution", value);
}
}
- void openFileDialog () {
- AddWidget (instFileDlg.CreateInstance(CurrentInterface)).DataSource = this;
- }
public void onFileOpen (object sender, EventArgs e)
{
--- /dev/null
+//
+// DesignInterface.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.
+using System;
+using Crow;
+using System.Globalization;
+
+namespace CrowIDE
+{
+ public class DesignInterface : Interface, IValueChange
+ {
+ #region IValueChange implementation
+ /// <summary>
+ /// Raise to notify that the value of a property has changed, the binding system
+ /// rely mainly on this event. the member name may not be present in the class, this is
+ /// used in **propertyless** bindings, this allow to raise custom named events without needing
+ /// to create an new one in the class or a new property.
+ /// </summary>
+ public event EventHandler<ValueChangeEventArgs> ValueChanged;
+ /// <summary>
+ /// Helper function to raise the value changed event
+ /// </summary>
+ public virtual void NotifyValueChanged(string MemberName, object _value)
+ {
+ //Debug.WriteLine ("Value changed: {0}->{1} = {2}", this, MemberName, _value);
+ ValueChanged.Raise(this, new ValueChangeEventArgs(MemberName, _value));
+ }
+ #endregion
+ public DesignInterface ()
+ {
+ CurrentInterface = this;
+ CultureInfo.DefaultThreadCurrentCulture = System.Globalization.CultureInfo.InvariantCulture;
+ }
+
+ public override bool ProcessMouseMove (int x, int y)
+ {
+ int deltaX = x - Mouse.X;
+ int deltaY = y - Mouse.Y;
+ Mouse.X = x;
+ Mouse.Y = y;
+ MouseMoveEventArgs e = new MouseMoveEventArgs (x, y, deltaX, deltaY);
+ e.Mouse = Mouse;
+
+ if (ActiveWidget != null) {
+ //TODO, ensure object is still in the graphic tree
+ //send move evt even if mouse move outside bounds
+ ActiveWidget.onMouseMove (this, e);
+ if (!ActiveWidget.IsDragged)//if active is dragged, process mouse move as it was not visible.
+ return true;
+ }
+
+ if (HoverWidget != null) {
+
+ //check topmost graphicobject first
+ GraphicObject tmp = HoverWidget;
+ GraphicObject topc = null;
+ while (tmp is GraphicObject) {
+ topc = tmp;
+ tmp = tmp.LogicalParent as GraphicObject;
+ }
+ int idxhw = GraphicTree.IndexOf (topc);
+ if (idxhw != 0) {
+ int i = 0;
+ while (i < idxhw) {
+ if (GraphicTree [i].localLogicalParentIsNull) {
+ if (GraphicTree [i].MouseIsIn (e.Position)) {
+ while (HoverWidget != null) {
+ HoverWidget.onMouseLeave (HoverWidget, e);
+ HoverWidget = HoverWidget.LogicalParent as GraphicObject;
+ }
+
+ GraphicTree [i].checkHoverWidget (e);
+ return true;
+ }
+ }
+ i++;
+ }
+ }
+
+ if (HoverWidget.MouseIsIn (e.Position)) {
+ if (!(HoverWidget is TemplatedControl))
+ HoverWidget.checkHoverWidget (e);
+ return true;
+ } else {
+ HoverWidget.onMouseLeave (HoverWidget, e);
+ //seek upward from last focused graph obj's
+ while (HoverWidget.LogicalParent as GraphicObject != null) {
+ HoverWidget = HoverWidget.LogicalParent as GraphicObject;
+ if (HoverWidget.MouseIsIn (e.Position)) {
+ HoverWidget.checkHoverWidget (e);
+ return true;
+ } else
+ HoverWidget.onMouseLeave (HoverWidget, e);
+ }
+ }
+ }
+
+ //top level graphic obj's parsing
+ lock (GraphicTree) {
+ for (int i = 0; i < GraphicTree.Count; i++) {
+ GraphicObject g = GraphicTree [i];
+ if (g.MouseIsIn (e.Position)) {
+ if (!(HoverWidget is TemplatedControl))
+ g.checkHoverWidget (e);
+ if (g is Window)
+ PutOnTop (g);
+ return true;
+ }
+ }
+ }
+ HoverWidget = null;
+ return false;
+ }
+ }
+}
+
--- /dev/null
+//
+// EditPane.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.
+using System;
+using Crow;
+using System.Linq;
+
+namespace CrowIDE
+{
+ public class EditPane : TemplatedGroup
+ {
+ public EditPane () : base()
+ {
+ }
+ public override object SelectedItem {
+ get { return base.SelectedItem; }
+ set {
+ base.SelectedItem = value;
+ //Items.FirstOrDefault (i=>i.DataSource == value).
+ }
+ }
+ object selectedItemElement = null;
+
+ public object SelectedItemElement {
+ get { return selectedItemElement; }
+ set {
+ if (selectedItemElement == value)
+ return;
+ selectedItemElement = value;
+ NotifyValueChanged ("SelectedItemElement", selectedItemElement);
+ }
+ }
+ }
+}
+
#region CTOR
public ImlVisualEditor () : base()
{
- imlVE = new Interface ();
+ imlVE = new DesignInterface ();
Thread t = new Thread (interfaceThread);
t.IsBackground = true;
t.Start ();
}
#endregion
- Interface imlVE;
+ DesignInterface imlVE;
Instantiator itor;
- string imlSource;
GraphicObject selectedItem;
+ string imlSource;
+ ProjectItem projectItem;
bool drawGrid;
int gridSpacing;
+
[XmlAttributeAttribute][DefaultValue(true)]
public bool DrawGrid {
get { return drawGrid; }
RegisterForRedraw ();
}
}
+ /// <summary>Pointer is over the widget</summary>
+ public virtual GraphicObject HoverWidget
+ {
+ get { return imlVE.HoverWidget; }
+ set {
+ if (HoverWidget == value)
+ return;
+ imlVE.HoverWidget = value;
+ NotifyValueChanged ("HoverWidget", HoverWidget);
+ }
+ }
[XmlIgnore]public List<LQIList> LQIs {
get { return imlVE.LQIs; }
}
public string ImlPath {
get { return projectItem?.Path; }
}
- ProjectItem projectItem;
- Project project;
- [XmlAttributeAttribute]
- public Project Project {
- get { return project; }
- set { project = value; }
- }
+
[XmlAttributeAttribute]
public ProjectNode ProjectNode {
get { return projectItem; }
}
public override void onMouseMove (object sender, MouseMoveEventArgs e)
{
- base.onMouseMove (sender, e);
- GraphicObject oldHW = imlVE.HoverWidget;
+ //base.onMouseMove (sender, e);
+ GraphicObject oldHW = HoverWidget;
Rectangle scr = this.ScreenCoordinates (this.getSlot ());
ProcessMouseMove (e.X - scr.X, e.Y - scr.Y);
- if (oldHW == imlVE.HoverWidget)
+ if (oldHW == HoverWidget)
return;
RegisterForRedraw ();
}
public override void onMouseDown (object sender, MouseButtonEventArgs e)
{
- base.onMouseDown (sender, e);
- SelectedItem = imlVE.HoverWidget;
+ //base.onMouseDown (sender, e);
+ SelectedItem = HoverWidget;
}
protected override void onDraw (Cairo.Context gr)
{
}
Rectangle hr;
- if (imlVE.HoverWidget != null) {
- hr = imlVE.HoverWidget.ScreenCoordinates (imlVE.HoverWidget.getSlot ());
+ if (HoverWidget != null) {
+ hr = HoverWidget.ScreenCoordinates (HoverWidget.getSlot ());
// gr.SetSourceColor (Color.LightGray);
// gr.DrawCote (new Cairo.PointD (hr.X, hr.Center.Y), new Cairo.PointD (hr.Right, hr.Center.Y));
// gr.DrawCote (new Cairo.PointD (hr.Center.X, hr.Y), new Cairo.PointD (hr.Center.X, hr.Bottom));
}
#endregion
+ void WidgetCheckOver (GraphicObject go, MouseMoveEventArgs e){
+ Type tGo = go.GetType();
+ if (typeof(TemplatedGroup).IsAssignableFrom (tGo)) {
+
+ } else if (typeof(TemplatedContainer).IsAssignableFrom (tGo)) {
+ TemplatedContainer c = go as TemplatedContainer;
+ if (c.Content?.MouseIsIn (e.Position) == true) {
+ WidgetCheckOver (c.Content, e);
+ return;
+ }
+ } else if (typeof(TemplatedControl).IsAssignableFrom (tGo)) {
+ } else if (typeof(Group).IsAssignableFrom (tGo)) {
+ Group c = go as Group;
+ for (int i = c.Children.Count -1; i >= 0; i--) {
+ if (c.Children[i].MouseIsIn (e.Position)) {
+ WidgetCheckOver (c.Children[i], e);
+ return;
+ }
+ }
+ } else if (typeof(Crow.Container).IsAssignableFrom (tGo)) {
+ Crow.Container c = go as Crow.Container;
+ if (c.Child?.MouseIsIn (e.Position)==true) {
+ WidgetCheckOver (c.Child, e);
+ return;
+ }
+ }
+ HoverWidget = go;
+ WidgetMouseEnter (go, e);
+ }
+ void WidgetMouseLeave (GraphicObject go, MouseMoveEventArgs e){
+
+ }
+ void WidgetMouseEnter (GraphicObject go, MouseMoveEventArgs e){
+
+ }
+ void WidgetMouseMove (GraphicObject go, MouseMoveEventArgs e){}
public bool ProcessMouseMove(int x, int y)
{
int deltaX = x - imlVE.Mouse.X;
if (imlVE.ActiveWidget != null) {
//TODO, ensure object is still in the graphic tree
//send move evt even if mouse move outside bounds
- imlVE.ActiveWidget.onMouseMove (this, e);
+ WidgetMouseMove (imlVE.ActiveWidget, e);
return true;
}
- if (imlVE.HoverWidget != null) {
+ if (HoverWidget != null) {
//TODO, ensure object is still in the graphic tree
//check topmost graphicobject first
- GraphicObject tmp = imlVE.HoverWidget;
+ GraphicObject tmp = HoverWidget;
GraphicObject topc = null;
while (tmp is GraphicObject) {
topc = tmp;
if (imlVE.GraphicTree [i].LogicalParent == imlVE.GraphicTree [i].Parent) {
if (imlVE.GraphicTree [i].MouseIsIn (e.Position)) {
while (imlVE.HoverWidget != null) {
- imlVE.HoverWidget.onMouseLeave (imlVE.HoverWidget, e);
+ WidgetMouseLeave (imlVE.HoverWidget, e);
imlVE.HoverWidget = imlVE.HoverWidget.LogicalParent as GraphicObject;
}
- imlVE.GraphicTree [i].checkHoverWidget (e);
+ WidgetCheckOver (GraphicTree [i], e);
return true;
}
}
if (imlVE.HoverWidget.MouseIsIn (e.Position)) {
- imlVE.HoverWidget.checkHoverWidget (e);
+ WidgetCheckOver (imlVE.HoverWidget, (e));
return true;
} else {
- imlVE.HoverWidget.onMouseLeave (imlVE.HoverWidget, e);
+ WidgetMouseLeave (imlVE.HoverWidget, e);
//seek upward from last focused graph obj's
while (imlVE.HoverWidget.LogicalParent as GraphicObject != null) {
imlVE.HoverWidget = imlVE.HoverWidget.LogicalParent as GraphicObject;
if (imlVE.HoverWidget.MouseIsIn (e.Position)) {
- imlVE.HoverWidget.checkHoverWidget (e);
+ WidgetCheckOver (imlVE.HoverWidget, e);
return true;
} else
- imlVE.HoverWidget.onMouseLeave (imlVE.HoverWidget, e);
+ WidgetMouseLeave (imlVE.HoverWidget, e);
}
}
}
for (int i = 0; i < imlVE.GraphicTree.Count; i++) {
GraphicObject g = imlVE.GraphicTree [i];
if (g.MouseIsIn (e.Position)) {
- g.checkHoverWidget (e);
- if (g is Window)
- imlVE.PutOnTop (g);
+ WidgetCheckOver (g, e);
return true;
}
}
return;
instance = value;
NotifyValueChanged ("Instance", instance);
+ if (Instance is GraphicObject)
+ NotifyValueChanged ("SelectedItemName", (Instance as GraphicObject).Name);
+ else
+ NotifyValueChanged ("SelectedItemName", "");
if (instance == null) {
Data = null;
using System.IO;
using System.Collections.Generic;
using System.Linq;
+using Microsoft.CSharp;
+using System.CodeDom.Compiler;
namespace CrowIDE
-{
+{
public class Project {
string path;
XmlDocument xmlDoc;
XmlNode nodeProject;
XmlNode nodeProps;
XmlNodeList nodesItems;
- Solution solution;
+ public Solution solution;
public string Name {
get { return solution.projects.FirstOrDefault(p=>p.ProjectGuid == ProjectGuid).ProjectName; }
case ItemType.None:
case ItemType.EmbeddedResource:
ProjectNode curNode = root;
- string[] folds = pn.Path.Split ('\\', '/');
+ string[] folds = pn.Path.Split ('/');
for (int i = 0; i < folds.Length - 1; i++) {
ProjectNode nextNode = curNode.ChildNodes.FirstOrDefault (n => n.DisplayName == folds [i] && n.Type == ItemType.VirtualGroup);
if (nextNode == null) {
nodesItems = xmlDoc.SelectNodes ("/Project/ItemGroup");
}
+
+
+ public void Compile () {
+ CSharpCodeProvider cp = new CSharpCodeProvider();
+
+ CompilerParameters parameters = new CompilerParameters();
+
+ foreach (ProjectItem pi in Items.Where (p=>p.Type == ItemType.Reference)) {
+ parameters.ReferencedAssemblies.Add (pi.Path);
+ }
+
+ parameters.GenerateInMemory = true;
+ // True - exe file generation, false - dll file generation
+ parameters.GenerateExecutable = true;
+
+ string[] files = Items.Where (p => p.Type == ItemType.Compile).Select (p => p.AbsolutePath).ToArray();
+
+ CompilerResults results = cp.CompileAssemblyFromFile(parameters, files);
+ }
}
}
--- /dev/null
+//
+// ProjectNodes.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.
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Xml;
+using System.IO;
+using Crow;
+
+namespace CrowIDE
+{
+ public enum ItemType {
+ ReferenceGroup,
+ Reference,
+ ProjectReference,
+ VirtualGroup,
+ Folder,
+ None,
+ Compile,
+ EmbeddedResource,
+ }
+
+ public class ProjectNode : IValueChange
+ {
+ #region IValueChange implementation
+ public event EventHandler<ValueChangeEventArgs> ValueChanged;
+ public virtual void NotifyValueChanged(string MemberName, object _value)
+ {
+ ValueChanged.Raise(this, new ValueChangeEventArgs(MemberName, _value));
+ }
+ #endregion
+
+ #region CTOR
+ public ProjectNode (Project project, ItemType _type, string _name) : this(project){
+ type = _type;
+ name = _name;
+ }
+ public ProjectNode (Project project){
+ Project = project;
+ }
+ #endregion
+
+ ItemType type;
+ string name;
+ List<ProjectNode> childNodes = new List<ProjectNode>();
+
+ public Project Project;
+
+ public virtual ItemType Type {
+ get { return type; }
+ }
+ public virtual string DisplayName {
+ get { return name; }
+ }
+ public List<ProjectNode> ChildNodes {
+ get { return childNodes; }
+ }
+
+ public void SortChilds () {
+ foreach (ProjectNode pn in childNodes)
+ pn.SortChilds ();
+ childNodes = childNodes.OrderBy(c=>c.Type).ThenBy(cn=>cn.DisplayName).ToList();
+ }
+
+ }
+ public class ProjectItem : ProjectNode {
+ #region CTOR
+ public ProjectItem (Project project, XmlNode _node) : base (project){
+ node = _node;
+ }
+ #endregion
+
+ public XmlNode node;
+ object selectedItem;
+
+
+
+ public string Extension {
+ get { return System.IO.Path.GetExtension (Path); }
+ }
+ public string Path {
+ get {
+ return node.Attributes["Include"]?.Value.Replace('\\','/');
+ }
+ }
+ public string AbsolutePath {
+ get {
+ return System.IO.Path.Combine (Project.RootDir, Path);
+ }
+ }
+ public override ItemType Type {
+ get {
+ return (ItemType)Enum.Parse (typeof(ItemType), node.Name, true);
+ }
+ }
+ public override string DisplayName {
+ get {
+ return Type == ItemType.Reference ?
+ Path :
+ Path.Split ('/').LastOrDefault();
+ }
+ }
+ public string Source {
+ get {
+ using (StreamReader sr = new StreamReader (AbsolutePath)) {
+ return sr.ReadToEnd ();
+ }
+ }
+ }
+ public object SelectedItem {
+ get { return selectedItem; }
+ set {
+ if (selectedItem == value)
+ return;
+ selectedItem= value;
+ Project.solution.SelectedItemElement = value;
+ NotifyValueChanged ("SelectedItem", selectedItem);
+ }
+ }
+
+ public void OnQueryClose (object sender, EventArgs e){
+ Project.solution.CloseItem (this);
+ }
+ }
+ public class ImlProjectItem : ProjectItem
+ {
+ #region CTOR
+ public ImlProjectItem (Project project, XmlNode _node) : base (project, _node){
+ node = _node;
+ }
+ #endregion
+
+ }
+}
+
using System.Text;
using System.Text.RegularExpressions;
using System.Xml.Serialization;
+using Crow;
-namespace CrowIDE{
+namespace CrowIDE{
public class SolutionProject {
public string ProjectHostGuid;
public string ProjectName;
/// <summary>
/// .sln loaded into class.
/// </summary>
- public class Solution
+ public class Solution: IValueChange
{
+ #region IValueChange implementation
+ public event EventHandler<ValueChangeEventArgs> ValueChanged;
+ public virtual void NotifyValueChanged(string MemberName, object _value)
+ {
+ ValueChanged.Raise(this, new ValueChangeEventArgs(MemberName, _value));
+ }
+ #endregion
+
+ ObservableList<ProjectItem> openedItems = new ObservableList<ProjectItem>();
+ public ObservableList<ProjectItem> OpenedItems {
+ get { return openedItems; }
+ set {
+ if (openedItems == value)
+ return;
+ openedItems = value;
+ NotifyValueChanged ("OpenedItems", openedItems);
+ }
+ }
+ ProjectItem selectedItem = null;
+ object selectedItemElement = null;
+
+ public ProjectItem SelectedItem {
+ get { return selectedItem; }
+ set {
+ if (selectedItem == value)
+ return;
+ selectedItem = value;
+ NotifyValueChanged ("SelectedItem", selectedItem);
+ }
+ }
+ public object SelectedItemElement {
+ get { return selectedItemElement; }
+ set {
+ if (selectedItemElement == value)
+ return;
+ selectedItemElement = value;
+ NotifyValueChanged ("SelectedItemElement", selectedItemElement);
+ }
+ }
+
+ void onSelectedItemChanged (object sender, SelectionChangeEventArgs e){
+ ProjectItem pi = e.NewValue as ProjectItem;
+ if (pi == null)
+ return;
+ if (openedItems.Contains (pi))
+ return;
+ openedItems.AddElement (pi);
+ }
+ public void OnCloseTab (object sender, MouseButtonEventArgs e){
+
+ openedItems.RemoveElement ((sender as GraphicObject).DataSource as ProjectItem);
+ }
+ public void CloseItem (ProjectItem pi) {
+ openedItems.RemoveElement (pi);
+ }
+
/// <summary>
/// Solution name
/// </summary>
[ExcludeFromCodeCoverage]
public override string ToString()
{
- return "Solution, name = " + name;
+ return "Solution: " + name;
}
/// <summary>
}
}
+ #region Solution properties
double slnVer; // 11.00 - vs2010, 12.00 - vs2015
/// <summary>
{
return configurations.Select(x => x.Split('|')[0]).Distinct();
}
+ #endregion
+ #region CTOR
/// <summary>
/// Creates new solution.
/// </summary>
public Solution() { }
+ #endregion
+
+ #region Loading from SLN file
/// <summary>
/// Loads visual studio .sln solution
/// </summary>
String v = m4.Groups[1].Value;
new Regex("\\s*?({[A-F0-9-]+}) = ({[A-F0-9-]+})[\r\n]+", RegexOptions.Multiline).Replace(v, new MatchEvaluator(m5 =>
{
- String[] args = m5.Groups.Cast<Group>().Skip(1).Select(x => x.Value).ToArray();
+ String[] args = m5.Groups.Cast<System.Text.RegularExpressions.Group>().Skip(1).Select(x => x.Value).ToArray();
SolutionProject child = s.projects.Where(x => args[0] == x.ProjectGuid).FirstOrDefault();
SolutionProject parent = s.projects.Where(x => args[1] == x.ProjectGuid).FirstOrDefault();
// parent.nodes.Add(child);
return s;
} //LoadSolution
- } //class Solution
+ #endregion
+ }
}
--- /dev/null
+<?xml version="1.0"?>
+<Window Height="Stretched" Width="Stretched" >
+ <VerticalStack>
+ <Menu>
+ <MenuItem Caption="File" Width="Fit" PopWidth="120">
+ <MenuItem Command="{CMDNew}" />
+ <MenuItem Command="{CMDOpen}" />
+ <MenuItem Command="{CMDSave}" />
+ <MenuItem Command="{CMDSaveAs}" />
+ <MenuItem Command="{CMDQuit}" />
+ </MenuItem>
+ <MenuItem Caption="Edit" Name="edit" Width="Fit" PopWidth="100">
+ <MenuItem Command="{CMDUndo}" />
+ <MenuItem Command="{CMDRedo}" />
+ <MenuItem Command="{CMDCut}" />
+ <MenuItem Command="{CMDCopy}" />
+ <MenuItem Command="{CMDPaste}" />
+ <MenuItem Command="{CMDOptions}"/>
+ </MenuItem>
+ <MenuItem Caption="View" Fit="true" PopWidth="150">
+ <MenuItem Command="{CMDViewGTExp}"/>
+ <MenuItem Command="{CMDViewProps}"/>
+ <MenuItem Command="{CMDViewProj}"/>
+ </MenuItem>
+ <MenuItem Caption="Project" Fit="true" PopWidth="120">
+ <MenuItem Command="{CMDCompile}"/>
+ <MenuItem Command="{CMDViewProjProps}"/>
+ </MenuItem>
+ <MenuItem Caption="Help" Width="Fit" PopWidth="60">
+ <MenuItem Caption="About"/>
+ <MenuItem Command="{CMDHelp}"/>
+ </MenuItem>
+ </Menu>
+<!-- <HorizontalStack Height="Fit" Margin="2">
+ <Image Style="icon" Path="#CrowIDE.images.save.svg" MouseClick="onCommandSave"/>
+ </HorizontalStack>-->
+ <HorizontalStack DataSource="{CurrentSolution}">
+ <TreeView Name="treeview" Width="20%" Height="100%" IsRoot="true"
+ Data="{Projects}" SelectedItemChanged="onSelectedItemChanged"
+ ItemTemplate="#CrowIDE.ui.ProjectTree.template"/>
+ <Splitter/>
+ <EditPane SelectedItem="{²SelectedItem}" SelectedItemElement="{²SelectedItemElement}" Data="{OpenedItems}" DataTest="Extension"
+ ItemTemplate="#CrowIDE.ui.EditPaneItems.template"/>
+ <Splitter/>
+ <MembersView Width="30%" Instance="{SelectedItemElement}" DataTest="Type" Background="DimGray"
+ ItemTemplate="#CrowIDE.ui.MembersItem.template"/>
+ </HorizontalStack>
+ </VerticalStack>
+</Window>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" ?>
+<TabView Name="ItemsContainer" Orientation="Horizontal" Spacing="24"/>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" ?>
+<ItemTemplate>
+ <TabItem Caption="{DisplayName}" QueryClose="OnQueryClose"/>
+</ItemTemplate>
+<ItemTemplate DataType=".svg">
+ <TabItem Caption="{DisplayName}" QueryClose="OnQueryClose">
+ <Image Path="{AbsolutePath}"/>
+ </TabItem>
+</ItemTemplate>
+<ItemTemplate DataType=".crow">
+ <TabItem Caption="{DisplayName}" QueryClose="OnQueryClose">
+ <VerticalStack>
+ <Label Width="Stretched" Margin="1" Text="{HoverWidget}"/>
+ <ImlVisualEditor Height="60%" Margin="0" MinimumSize="10,10" Foreground="SkyBlue"
+ ProjectNode="{}" SelectedItem="{²SelectedItem}"
+ Name="crowContainer" Background="Onyx"/>
+ <Splitter/>
+ <HorizontalStack Height="Stretched" >
+ <SourceEditor Focusable="true" Name="editor" Font="monospace, 12" VerticalAlignment="Top" Margin="10"
+ Foreground="Jet" Background="White" Width="Stretched" Height="Stretched"
+ FilePath="{AbsolutePath}" KeyDown="textView_KeyDown"/>
+ <ScrollBar Name="scrollbarY" Value="{²../editor.ScrollY}"
+ LargeIncrement="{../editor.VisibleLines}"
+ CursorSize="{../editor.ChildHeightRatio}"
+ Maximum="{../editor.MaxScrollY}" Orientation="Vertical"
+ Width="14" />
+ </HorizontalStack>
+ <ScrollBar Name="scrollbarX" Value="{²../editor.ScrollX}"
+ Maximum="{../editor.MaxScrollX}" Orientation="Horizontal"
+ Height="14" />
+ <HorizontalStack Height="Fit">
+ <GraphicObject Height="5" Width="Stretched"/>
+ <GraphicObject Background="Red" Width="10" Height="10" Visible="{IsDirty}"/>
+ <Label Text="column:"/>
+ <Label Text="{../../editor.CurrentColumn}"/>
+ <Label Text="Line:"/>
+ <Label Text="{../../editor.CurrentLine}"/>
+ <Label Text="ScrollX:"/>
+ <Label Text="{../../editor.ScrollX}"/>
+ </HorizontalStack>
+ </VerticalStack>
+ </TabItem>
+</ItemTemplate>
<Window Template="#Crow.ToolWindow.template" Caption="Properties" MinimumSize="10,10" Width="Stretched" Height="Stretched">
<VerticalStack>
<Border Height="Fit">
- <Label TextAlignment="Left" Text="{../../../../Instance}" Width="Stretched"/>
+ <Label TextAlignment="Left" Text="{../../../../SelectedItemName}" Width="Stretched"/>
</Border>
<Scroller Name="scroller1" Margin="1" VerticalScrolling="true"
ValueChanged="./_scroller_ValueChanged">
<?xml version="1.0"?>
<Popper Font="{./Font}" Caption="{./Caption}" Background="{./Background}" PopDirection="{./PopDirection}"
Foreground = "{./Foreground}" CanPop="{./HasChildren}" MouseClick="./onMI_Click"
- IsPopped="{²./IsOpened}" PopWidth="{./PopWidth}" PopHeight="{./PopHeight}">
+ IsPopped="{²./IsOpened}" PopWidth="{./PopWidth}" PopHeight="{./PopHeight}" IsEnabled="{./IsEnabled}">
<Template>
- <Border Name="border1" Margin="4"
+ <Border Name="border1"
MouseEnter="{Foreground=vgradient|0:White|0.2:Gray|0.9:Gray|1:Black}"
MouseLeave="{Foreground=Transparent}"
MouseDown="{Foreground=vgradient|0:Black|0.05:Gray|0.85:Gray|1:White}"
MouseUp="{Foreground=vgradient|0:White|0.2:Gray|0.9:Gray|1:Black}"
+ MinimumSize = "40,0"
Foreground="Transparent"
Background="{./Background}">
- <HorizontalStack>
- <Image MaximumSize="12,12" Picture="{../../../../Icon}"/>
- <Label Text="{./Caption}"
- Foreground="{./Foreground}"
- Margin="1" HorizontalAlignment="Left"
- Font="{./Font}" />
- </HorizontalStack>
+ <HorizontalStack HorizontalAlignment="Left" Margin="1">
+ <Image MaximumSize="10,10" Picture="{../../../../Icon}"/>
+ <Label Text="{./Caption}"
+ Foreground="{./Foreground}"
+ Font="{./Font}" />
+ </HorizontalStack>
</Border>
</Template>
<Border Foreground="DimGray" Width="{../PopWidth}" Height="{../PopHeight}" Background="Onyx">
--- /dev/null
+<?xml version="1.0"?>
+<GenericStack Orientation="Vertical" Spacing="0"
+ Background="Onyx"
+ MouseEnter="{caption.Foreground=White}"
+ MouseLeave="{caption.Foreground=Gray}">
+ <HorizontalStack Margin="2" Left="{./TabOffset}"
+ Name="TabTitle"
+ HorizontalAlignment="Left"
+ Height="{./TabThickness}"
+ Width="Fit">
+ <Label Name="caption" Text="{./Caption}" Foreground="Gray"/>
+ <Border CornerRadius="5" BorderWidth="1" Foreground="Transparent" Height="12" Width="12"
+ MouseEnter="{Foreground=White}" MouseLeave="{Foreground=Transparent}">
+ <Image Focusable="true" Name="Image" Margin="0" Width="Stretched" Height="Stretched" Path="#Crow.Images.Icons.exit2.svg"
+ MouseClick="./butCloseTabClick"/>
+ </Border>
+ </HorizontalStack>
+ <Container Name="Content"/>
+</GenericStack>
+
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+ width="64px" height="64px" viewBox="0 0 64 64" enable-background="new 0 0 64 64" xml:space="preserve">
+<g>
+ <polygon fill="none" stroke="#000000" stroke-width="2" stroke-miterlimit="10" points="63,63 1,63 1,1 51,1 63,13 "/>
+</g>
+<rect x="7" y="31" fill="none" stroke="#000000" stroke-width="2" stroke-miterlimit="10" width="50" height="32"/>
+<line fill="none" stroke="#000000" stroke-width="2" stroke-miterlimit="10" x1="14" y1="39" x2="50" y2="39"/>
+<line fill="none" stroke="#000000" stroke-width="2" stroke-miterlimit="10" x1="14" y1="47" x2="50" y2="47"/>
+<line fill="none" stroke="#000000" stroke-width="2" stroke-miterlimit="10" x1="14" y1="55" x2="50" y2="55"/>
+<rect x="15" y="1" fill="none" stroke="#000000" stroke-width="2" stroke-miterlimit="10" width="34" height="19"/>
+<rect x="38" y="5" fill="none" stroke="#000000" stroke-width="2" stroke-miterlimit="10" width="5" height="11"/>
+</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">
+<path fill="#FFFFFF" d="M10 0h-8v16h12v-12l-4-4zM9 5h4v10h-10v-14h6v4zM10 4v-3l3 3h-3z"></path>
+</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">
+<path fill="#FFFFFF" d="M5 0h6v3h-6v-3z"></path>
+<path fill="#FFFFFF" d="M1 4h14v3h-14v-3z"></path>
+<path fill="#FFFFFF" d="M3 8h10v3h-10v-3z"></path>
+<path fill="#FFFFFF" d="M0 12h16v3h-16v-3z"></path>
+</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">
+<path fill="#FFFFFF" d="M15.2 6l-1.1-0.2c-0.1-0.2-0.1-0.4-0.2-0.6l0.6-0.9 0.5-0.7-2.6-2.6-0.7 0.5-0.9 0.6c-0.2-0.1-0.4-0.1-0.6-0.2l-0.2-1.1-0.2-0.8h-3.6l-0.2 0.8-0.2 1.1c-0.2 0.1-0.4 0.1-0.6 0.2l-0.9-0.6-0.7-0.4-2.5 2.5 0.5 0.7 0.6 0.9c-0.2 0.2-0.2 0.4-0.3 0.6l-1.1 0.2-0.8 0.2v3.6l0.8 0.2 1.1 0.2c0.1 0.2 0.1 0.4 0.2 0.6l-0.6 0.9-0.5 0.7 2.6 2.6 0.7-0.5 0.9-0.6c0.2 0.1 0.4 0.1 0.6 0.2l0.2 1.1 0.2 0.8h3.6l0.2-0.8 0.2-1.1c0.2-0.1 0.4-0.1 0.6-0.2l0.9 0.6 0.7 0.5 2.6-2.6-0.5-0.7-0.6-0.9c0.1-0.2 0.2-0.4 0.2-0.6l1.1-0.2 0.8-0.2v-3.6l-0.8-0.2zM15 9l-1.7 0.3c-0.1 0.5-0.3 1-0.6 1.5l0.9 1.4-1.4 1.4-1.4-0.9c-0.5 0.3-1 0.5-1.5 0.6l-0.3 1.7h-2l-0.3-1.7c-0.5-0.1-1-0.3-1.5-0.6l-1.4 0.9-1.4-1.4 0.9-1.4c-0.3-0.5-0.5-1-0.6-1.5l-1.7-0.3v-2l1.7-0.3c0.1-0.5 0.3-1 0.6-1.5l-1-1.4 1.4-1.4 1.4 0.9c0.5-0.3 1-0.5 1.5-0.6l0.4-1.7h2l0.3 1.7c0.5 0.1 1 0.3 1.5 0.6l1.4-0.9 1.4 1.4-0.9 1.4c0.3 0.5 0.5 1 0.6 1.5l1.7 0.3v2z"></path>
+<path fill="#FFFFFF" d="M8 4.5c-1.9 0-3.5 1.6-3.5 3.5s1.6 3.5 3.5 3.5 3.5-1.6 3.5-3.5c0-1.9-1.6-3.5-3.5-3.5zM8 10.5c-1.4 0-2.5-1.1-2.5-2.5s1.1-2.5 2.5-2.5 2.5 1.1 2.5 2.5c0 1.4-1.1 2.5-2.5 2.5z"></path>
+</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">
+<path fill="#FFFFFF" d="M13 3h-3l-3-3h-7v13h6v3h10v-10l-3-3zM7 1l2 2h-2v-2zM1 12v-11h5v3h3v8h-8zM15 15h-8v-2h3v-9h2v3h3v8zM13 6v-2l2 2h-2z"></path>
+</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">
+<path fill="#FFFFFF" d="M16 4c0 0 0-1-1-2s-1.9-1-1.9-1l-1.1 1.1v-2.1h-12v16h12v-8l4-4zM6.3 11.4l-0.6-0.6 0.3-1.1 1.5 1.5-1.2 0.2zM7.2 9.5l-0.6-0.6 5.2-5.2c0.2 0.1 0.4 0.3 0.6 0.5zM14.1 2.5l-0.9 1c-0.2-0.2-0.4-0.3-0.6-0.5l0.9-0.9c0.1 0.1 0.3 0.2 0.6 0.4zM11 15h-10v-14h10v2.1l-5.9 5.9-1.1 4.1 4.1-1.1 2.9-3v6z"></path>
+</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">
+<path fill="#FFFFFF" d="M10 0h-8v16h12v-12l-4-4zM9 5h4v10h-10v-14h6v4zM10 4v-3l3 3h-3z"></path>
+<path fill="#FFFFFF" d="M6.2 13h-0.7l-2-2.5 2-2.5h0.7l-2 2.5z"></path>
+<path fill="#FFFFFF" d="M9.8 13h0.7l2-2.5-2-2.5h-0.7l2 2.5z"></path>
+<path fill="#FFFFFF" d="M6.7 14h0.6l2.1-7h-0.8z"></path>
+</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">
+<path fill="#FFFFFF" d="M7 4l-1-2h-4l-1 2h-1v11h16v-11h-9zM15 14h-14v-9h0.6l1-2h2.6l1.2 2h8.6v9z"></path>
+</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">
+<path fill="#FFFFFF" d="M10 0h-8v16h12v-12l-4-4zM9 5h4v10h-10v-14h6v4zM10 4v-3l3 3h-3z"></path>
+<path fill="#FFFFFF" d="M5 7v2h2v5h2v-5h2v-2z"></path>
+</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">
+<path fill="#FFFFFF" d="M10 6v-6h-4v6h-2l4 5 4-5z"></path>
+<path fill="#FFFFFF" d="M13 1h-2v1h1.3l2.6 8h-3.9v2h-6v-2h-3.9l2.6-8h1.3v-1h-2l-3 9v5h16v-5z"></path>
+</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">
+<path fill="#FFFFFF" d="M11.7 1.9c-1-1.2-2.6-1.9-4.2-1.9s-3.2 0.7-4.2 1.9c-1 1.1-1.4 2.6-1.2 4 0.2 1.5 0.8 2.6 2.1 3.7 0.5 0.4 0.7 0.8 0.9 1.2 0 0.1 0.1 0.2 0.1 0.3-0.1 0.1-0.2 0.2-0.2 0.4 0 0.3 0.2 0.5 0.5 0.5-0.3 0-0.5 0.2-0.5 0.5s0.2 0.5 0.5 0.5c-0.3 0-0.5 0.2-0.5 0.5s0.2 0.5 0.5 0.5c-0.3 0-0.5 0.2-0.5 0.5s0.2 0.5 0.5 0.5h0.5c0 0.5 0.7 1 1.5 1s1.5-0.5 1.5-1h0.5c0.3 0 0.5-0.2 0.5-0.5s-0.2-0.5-0.5-0.5c0.3 0 0.5-0.2 0.5-0.5s-0.2-0.5-0.5-0.5c0.3 0 0.5-0.2 0.5-0.5s-0.2-0.5-0.5-0.5c0.3 0 0.5-0.2 0.5-0.5 0-0.2-0.1-0.3-0.2-0.4 0-0.1 0.1-0.1 0.1-0.2 0.2-0.4 0.4-0.8 0.9-1.2 1.3-1.1 1.9-2.2 2.1-3.8 0.2-1.4-0.2-2.8-1.2-4zM12 5.8c-0.2 1.3-0.7 2.2-1.8 3.2-0.6 0.5-0.9 1-1.2 1.4-0.2 0.5-0.3 0.6-0.5 0.6h-2c-0.2 0-0.3-0.1-0.5-0.6-0.2-0.4-0.5-1-1.1-1.6-1.3-1.1-1.6-2-1.8-3-0.2-1.1 0.2-2.3 0.9-3.2 0.9-1 2.2-1.6 3.5-1.6s2.6 0.6 3.5 1.6c0.7 0.9 1.1 2.1 1 3.2z"></path>
+<path fill="#FFFFFF" d="M11 5h-1c0-0.7-0.8-2-2-2v-1c1.8 0 3 1.8 3 3z"></path>
+</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">
+<path fill="#FFFFFF" d="M6 5v6h4v-6h2l-4-5-4 5z"></path>
+<path fill="#FFFFFF" d="M13 2h-2l0.9 1h0.4l2.6 8h-3.9v2h-6v-2h-3.9l2.6-8h0.4l0.9-1h-2l-3 9v5h16v-5z"></path>
+</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">
+<path fill="#FFFFFF" d="M5.5 0c-2.5 0-4.5 2-4.5 4.5s2 4.5 4.5 4.5h2.5v7h2v-14h1v14h2v-14h2v-2h-9.5z"></path>
+</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">
+<path fill="#FFFFFF" d="M13 4h-3v-4h-10v14h6v2h10v-9l-3-3zM3 1h4v1h-4v-1zM15 15h-8v-10h5v3h3v7zM13 7v-2l2 2h-2z"></path>
+</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">
+<path fill="#FFFFFF" d="M0 7.9l6-4.9v3c0 0 1.1 0 2 0 8 0 8 8 8 8s-1-4-7.8-4c-1.1 0-1.8 0-2.2 0v2.9l-6-5z"></path>
+</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">
+<path fill="#FFFFFF" d="M9 11h-3c0-3 1.6-4 2.7-4.6 0.4-0.2 0.7-0.4 0.9-0.6 0.5-0.5 0.3-1.2 0.2-1.4-0.3-0.7-1-1.4-2.3-1.4-2.1 0-2.5 1.9-2.5 2.3l-3-0.4c0.2-1.7 1.7-4.9 5.5-4.9 2.3 0 4.3 1.3 5.1 3.2 0.7 1.7 0.4 3.5-0.8 4.7-0.5 0.5-1.1 0.8-1.6 1.1-0.9 0.5-1.2 1-1.2 2z"></path>
+<path fill="#FFFFFF" d="M9.5 14c0 1.105-0.895 2-2 2s-2-0.895-2-2c0-1.105 0.895-2 2-2s2 0.895 2 2z"></path>
+</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">
+<path fill="#FFFFFF" d="M16 8c0-5-4.9-5-4.9-5h-5.1v-3l-6 6 6 6v-3h5.2c3.5 0 1.8 7 1.8 7s3-4.1 3-8z"></path>
+</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">
+<path fill="#FFFFFF" d="M16 3.1c0 0-2.1-1.1-3.5-1-0.3 0-0.5 0.1-0.7 0.2l-4.3 3.4-1.8-1.5c0.1-0.3 0.2-0.6 0.3-1 0.1-1.8-1.4-3.4-3.3-3.2-1.2 0.1-2.3 1-2.6 2.2-0.3 1.3 0.2 2.5 1.2 3.2l3.3 2.6-3.3 2.6c-1 0.7-1.5 1.9-1.2 3.2 0.3 1.2 1.4 2 2.6 2.2 1.9 0.2 3.4-1.4 3.2-3.2 0-0.3-0.1-0.7-0.3-1l1.8-1.5 4.3 3.4c0.2 0.1 0.4 0.2 0.7 0.2 1.4 0.1 3.5-1 3.5-1l-5.7-4.9 5.8-4.9zM2.8 4.6c-0.9-0.1-1.6-0.9-1.5-1.8s0.9-1.6 1.8-1.5c0.9 0.1 1.6 0.9 1.5 1.8 0 0.9-0.9 1.6-1.8 1.5zM3.1 14.7c-0.9 0.1-1.7-0.6-1.8-1.5s0.6-1.7 1.5-1.8c0.9-0.1 1.7 0.6 1.8 1.5s-0.6 1.7-1.5 1.8zM12.4 3.2c0 0 0.1 0 0.2 0 0.4 0 0.9 0.1 1.4 0.2l-6.8 5.7-0.9-1.1 6.1-4.8zM14 12.6c-0.5 0.2-1 0.3-1.4 0.2-0.1 0-0.2 0-0.2 0l-4-3.2 1-0.9 4.6 3.9z"></path>
+</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">
+<path fill="#FFFFFF" d="M15.7 14.3l-4.2-4.2c-0.2-0.2-0.5-0.3-0.8-0.3 0.8-1 1.3-2.4 1.3-3.8 0-3.3-2.7-6-6-6s-6 2.7-6 6 2.7 6 6 6c1.4 0 2.8-0.5 3.8-1.4 0 0.3 0 0.6 0.3 0.8l4.2 4.2c0.2 0.2 0.5 0.3 0.7 0.3s0.5-0.1 0.7-0.3c0.4-0.3 0.4-0.9 0-1.3zM6 10.5c-2.5 0-4.5-2-4.5-4.5s2-4.5 4.5-4.5 4.5 2 4.5 4.5-2 4.5-4.5 4.5z"></path>
+</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">
+<path fill="#FFFFFF" d="M10 3h-5.1c0 0-4.9 0-4.9 5 0 3.9 3 8 3 8s-1.7-7 1.8-7h5.2v3l6-6-6-6v3z"></path>
+</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">
+<path fill="#FFFFFF" d="M9 4v-3h-9v14h9v-3h-1v2h-7v-12h7v2z"></path>
+<path fill="#FFFFFF" d="M16 8l-5-4v2h-5v4h5v2z"></path>
+</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">
+<path fill="#FFFFFF" d="M10 0h-8v16h12v-12l-4-4zM9 5h4v10h-10v-14h6v4zM10 4v-3l3 3h-3z"></path>
+<path fill="#FFFFFF" d="M4 7h8v1h-8v-1z"></path>
+<path fill="#FFFFFF" d="M4 9h8v1h-8v-1z"></path>
+<path fill="#FFFFFF" d="M4 11h8v1h-8v-1z"></path>
+</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">
+<path fill="#FFFFFF" d="M12.5 4.9c-1.4 0-2.5 0.8-2.6 0.9l1.2 1.6c0 0 0.7-0.5 1.4-0.5 1.4 0 1.5 1.2 1.5 1.6-0.4-0.1-1.1-0.3-2-0.1-1.4 0.3-2.8 2-2.1 3.9 0.7 1.8 3.1 2.1 4.1 0.6v1h2v-5.3c0-2.7-1.9-3.7-3.5-3.7zM11.5 11.4c-0.1-1.9 1.5-1.9 2.5-1.8v1c0 1.2-2.3 2.3-2.5 0.8z"></path>
+<path fill="#FFFFFF" d="M6.9 14h2.1l-3.2-12h-2.7l-3.1 12h2.1l1-4h2.7l1.1 4zM3.6 8l0.8-3.2 0.9 3.2h-1.7z"></path>
+</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">
+<path fill="#FFFFFF" d="M10.3 8.2l-0.9 0.9 0.9 0.9-1.2 1.2 4.3 4.3c0.6 0.6 1.5 0.6 2.1 0s0.6-1.5 0-2.1l-5.2-5.2zM14.2 15c-0.4 0-0.8-0.3-0.8-0.8 0-0.4 0.3-0.8 0.8-0.8s0.8 0.3 0.8 0.8c0 0.5-0.3 0.8-0.8 0.8z"></path>
+<path fill="#FFFFFF" d="M3.6 8l0.9-0.6 1.5-1.7 0.9 0.9 0.9-0.9-0.1-0.1c0.2-0.5 0.3-1 0.3-1.6 0-2.2-1.8-4-4-4-0.6 0-1.1 0.1-1.6 0.3l2.9 2.9-2.1 2.1-2.9-2.9c-0.2 0.5-0.3 1-0.3 1.6 0 2.1 1.6 3.7 3.6 4z"></path>
+<path fill="#FFFFFF" d="M8 10.8l0.9-0.8-0.9-0.9 5.7-5.7 1.2-0.4 1.1-2.2-0.7-0.7-2.3 1-0.5 1.2-5.6 5.7-0.9-0.9-0.8 0.9c0 0 0.8 0.6-0.1 1.5-0.5 0.5-1.3-0.1-2.8 1.4-0.5 0.5-2.1 2.1-2.1 2.1s-0.6 1 0.6 2.2 2.2 0.6 2.2 0.6 1.6-1.6 2.1-2.1c1.4-1.4 0.9-2.3 1.3-2.7 0.9-0.9 1.6-0.2 1.6-0.2zM4.9 10.4l0.7 0.7-3.8 3.8-0.7-0.7z"></path>
+</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">
+<path fill="#FFFFFF" d="M15.7 14.3l-4.2-4.2c-0.2-0.2-0.5-0.3-0.8-0.3 0.8-1 1.3-2.4 1.3-3.8 0-3.3-2.7-6-6-6s-6 2.7-6 6 2.7 6 6 6c1.4 0 2.8-0.5 3.8-1.4 0 0.3 0 0.6 0.3 0.8l4.2 4.2c0.2 0.2 0.5 0.3 0.7 0.3s0.5-0.1 0.7-0.3c0.4-0.3 0.4-0.9 0-1.3zM6 10.5c-2.5 0-4.5-2-4.5-4.5s2-4.5 4.5-4.5 4.5 2 4.5 4.5-2 4.5-4.5 4.5z"></path>
+<path fill="#FFFFFF" d="M7 3h-2v2h-2v2h2v2h2v-2h2v-2h-2z"></path>
+</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">
+<path fill="#FFFFFF" d="M15.7 14.3l-4.2-4.2c-0.2-0.2-0.5-0.3-0.8-0.3 0.8-1 1.3-2.4 1.3-3.8 0-3.3-2.7-6-6-6s-6 2.7-6 6 2.7 6 6 6c1.4 0 2.8-0.5 3.8-1.4 0 0.3 0 0.6 0.3 0.8l4.2 4.2c0.2 0.2 0.5 0.3 0.7 0.3s0.5-0.1 0.7-0.3c0.4-0.3 0.4-0.9 0-1.3zM6 10.5c-2.5 0-4.5-2-4.5-4.5s2-4.5 4.5-4.5 4.5 2 4.5 4.5-2 4.5-4.5 4.5z"></path>
+<path fill="#FFFFFF" d="M3 5h6v2h-6v-2z"></path>
+</svg>
+++ /dev/null
-<?xml version="1.0"?>
-<Window Height="Stretched" Width="Stretched" >
- <VerticalStack>
- <Menu>
- <MenuItem Caption="File" Fit="True" PopWidth="150">
- <MenuItem Command="{CMDLoad}"/>
- <MenuItem Command="{CMDLoad}"/>
- <MenuItem Command="{CMDSave}"/>
- <MenuItem Command="{CMDQuit}"/>
- </MenuItem>
- <MenuItem Caption="Edit" Fit="true" PopWidth="120">
- <MenuItem Command="{CMDCut}"/>
- <MenuItem Command="{CMDCopy}"/>
- <MenuItem Command="{CMDPaste}"/>
- </MenuItem>
- <MenuItem Caption="Project" Fit="true" PopWidth="120">
- <MenuItem Command="{CMDViewProjProps}"/>
- </MenuItem>
- <MenuItem Caption="View" Fit="true" PopWidth="150">
- <MenuItem Command="{CMDViewGTExp}"/>
- <MenuItem Command="{CMDViewProps}"/>
- <MenuItem Command="{CMDViewProj}"/>
- </MenuItem>
- <MenuItem Caption="Help" Fit="true" PopWidth="150">
- <MenuItem Command="{CMDHelp}"/>
- <MenuItem Caption="About"/>
- </MenuItem>
- </Menu>
-<!-- <HorizontalStack Height="Fit" Margin="2">
- <Image Style="icon" Path="#CrowIDE.images.save.svg" MouseClick="onCommandSave"/>
- </HorizontalStack>-->
-<!-- <Border Margin="1" Background="Onyx" Height="Fit">
- <Label Width="Stretched" Margin="1" Text="{../../dv.SelectedItem}"/>
- </Border>-->
- <HorizontalStack>
- <TreeView Name="treeview" Width="20%" Height="100%" IsRoot="true"
- DataSource="{CurrentSolution}" Data="{Projects}"
- ItemTemplate="#CrowIDE.ui.ProjectTree.template"/>
- <Splitter/>
- <VerticalStack Width="Stretched">
- <ImlVisualEditor Height="60%" Margin="0" MinimumSize="10,10" Foreground="SkyBlue"
- Project="{CurrentProject}"
- ProjectNode="{../../../treeview.SelectedItem}" SelectedItem="{²SelectedItem}"
- Name="crowContainer" Background="Onyx"/>
- <Splitter/>
- <HorizontalStack Margin="10" MinimumSize="10,1">
- <Scroller Name="scroller1" Background="White"
- Margin="2" VerticalScrolling="true" ScrollY="{../scrollbar1.Value}"
- ValueChanged="./_scroller_ValueChanged">
- <TextBox Background="White" Height="Fit"
- VerticalAlignment="Top"
- TextAlignment="TopLeft" Font="mono, 12"
- Text="{²../../../crowContainer.ImlSource}" Multiline="true"/>
- </Scroller>
- <ScrollBar Name="scrollbar1" Value="{../scroller1.ScrollY}"
- Maximum="{../scroller1.MaximumScroll}" Orientation="Vertical"
- Width="14" />
- </HorizontalStack>
- </VerticalStack>
- <Splitter/>
- <MembersView Width="30%" Instance="{../crowContainer.SelectedItem}" DataTest="Type" Background="DimGray"
- ItemTemplate="#CrowIDE.ui.MembersItem.template"/>
- </HorizontalStack>
- </VerticalStack>
-</Window>
Focusable=true;
Foreground=Jet;
Background=hgradient|0:Gray|1:Jet;
- MouseDown={Background=hgradient|0:White|0.2:BlueCrayola|1:Jet};
+ MouseDown={Background=hgradient|0:White|0.4:BlueCrayola|1:Jet};
MouseUp={Background=hgradient|0:Gray|1:Jet};
MouseEnter={Foreground=Black};
MouseLeave={Foreground=Jet};
Width="128" Height="128"/>
<HueSelector Hue="{²./H}" Focusable="true" Name="hueSelector" Margin="0" Width="128" Height="20"/>
</VerticalStack>
- <VerticalStack Margin="5" Spacing="0">
+ <VerticalStack Margin="5" Spacing="1">
<GraphicObject Width="34" Height="21" Background="{./SelectedColor}"/>
<Label Focusable="true" Selectable="true" Width="Stretched" Text="{./HexColor}" />
<HorizontalStack Height="Fit">
<?xml version="1.0"?>
-<HorizontalStack MinimumSize="40,10" Name="hstack" Margin="0" Spacing="0">
- <Border BorderWidth="1" Width="80%" Background="White"
+<HorizontalStack MinimumSize="40,13" Name="hstack" Margin="0" Spacing="0">
+ <Border BorderWidth="1" Width="75%" Background="White"
Foreground="{./Foreground}" Margin="0">
<TextBox Foreground="{./Foreground}" Font="{./Font}" Width="Stretched"
Text="{²./Value}" TextAlignment="Right" Margin="0"/>
</Border>
- <VerticalStack MinimumSize="8,10" Width="20%" Height="Stretched" Spacing="0" Margin="0" Background="Red">
- <Button MouseRepeat="true" Width="Stretched" Height="50%" Margin="0" MouseClick="./onUp"
- Template="#Crow.Templates.ArrowBut.template">
- <Image Path="#Crow.Images.Icons.updown.svg" SvgSub="up" Margin="0"/>
- </Button>
- <Button MouseRepeat="true" Width="Stretched" Height="50%" Margin="0" MouseClick="./onDown"
- Template="#Crow.Templates.ArrowBut.template">
- <Image Path="#Crow.Images.Icons.updown.svg" SvgSub="down" Margin="0"/>
- </Button>
+ <VerticalStack MinimumSize="13,13" Width="25%" Height="Stretched" Spacing="0" Margin="0">
+ <Shape Style="ArrowBut" Height="50%" MouseClick="./onUp" Path="M 5.5,0.5 L 10.5,6.5 L 0.5,6.5 Z"/>
+ <Shape Style="ArrowBut" Height="50%" MouseClick="./onDown" Path="M 0.5,0.5 L 10.5,0.5 L 5.5,6.5 Z"/>
</VerticalStack>
</HorizontalStack>
//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/Divers/welcome.crow" };
+ //testFiles = new string [] { @"Interfaces/TemplatedContainer/testTabView.crow" };
+ testFiles = new string [] { @"Interfaces/TemplatedControl/testSpinner.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 ();
GraphicObject obj = Load (testFiles[idx]);
obj.DataSource = this;
} catch (Exception ex) {
- MessageBox.Show (MessageBox.Type.Error, ex.Message + "\n" + ex.InnerException);
+ MessageBox.Show (CurrentInterface, MessageBox.Type.Error, ex.Message + "\n" + ex.InnerException);
}
}
// void Tv_SelectedItemChanged (object sender, SelectionChangeEventArgs e)
addInterfaceControler (tmp);
return tmp;
}
+ public GraphicObject AddWidget (string path)
+ {
+ GraphicObject tmp = Load (path);
+ return tmp;
+ }
public GraphicObject AddWidget (GraphicObject g, int interfaceIdx = 0){
- if (ifaceControl.Count == 0)//create default orthogonal interface
- addInterfaceControler (new InterfaceControler (
- new Rectangle (0, 0, this.ClientRectangle.Width, this.ClientRectangle.Height)));
+ checkDefaultIFace ();
ifaceControl [interfaceIdx].CrowInterface.AddWidget (g);
return g;
}
--- /dev/null
+<?xml version="1.0"?>
+<GenericStack Orientation="Vertical" Spacing="0"
+ Background="Onyx"
+ MouseEnter="{caption.Foreground=White}"
+ MouseLeave="{caption.Foreground=Gray}">
+ <HorizontalStack Margin="2" Left="{./TabOffset}"
+ Name="TabTitle"
+ HorizontalAlignment="Left"
+ Height="{./TabThickness}"
+ Width="Fit">
+ <Label Name="caption" Text="{./Caption}" Foreground="Gray"/>
+ <Label Text="{./ViewIndex}" Foreground="Green"/>
+ <Label Text="{./TabOffset}" Foreground="Red"/>
+ <Border CornerRadius="5" BorderWidth="1" Foreground="Transparent" Height="12" Width="12"
+ MouseEnter="{Foreground=White}" MouseLeave="{Foreground=Transparent}">
+ <Image Focusable="true" Name="Image" Margin="0" Width="Stretched" Height="Stretched" Path="#Crow.Images.Icons.exit2.svg"
+ MouseClick="./butCloseTabClick"/>
+ </Border>
+ </HorizontalStack>
+ <Container Name="Content"/>
+</GenericStack>
+
<?xml version="1.0" encoding="UTF-8" ?>
<VerticalStack Height="50%" Width="80%">
+ <HorizontalStack Height="Fit">
+ <Label Text="Selected Tab:"/>
+ <Label Text="{../../tabview1.SelectedTab}"/>
+ </HorizontalStack>
<TabView Name="tabview1" Orientation="Horizontal" Spacing="24">
<TabItem Name="TabItem1" Caption="tab item 1">
<VerticalStack Margin="20">
<RadioButton/>
</VerticalStack>
</TabItem>
- <TabItem Name="TabItem2" Caption="tab item 3" Background="Gray">
+ <TabItem Name="TabItem3" Caption="tab item 3" Background="Gray">
<Container Margin="5" CornerRadius="2" >
<TextBox Margin="5" Multiline="true" TextAlignment="TopLeft"/>
</Container>
</TabItem>
- <TabItem Name="TabItem2" Caption="tab item 4" Margin="0" Background="Gray">
+ <TabItem Name="TabItem4" Caption="tab item 4" Margin="0" Background="Gray">
<TextBox/>
</TabItem>
</TabView>
<Spinner Value="5"/>
<Button/>
</HorizontalStack>
+ <IMLContainer Path="Interfaces/Divers/colorPicker.crow"/>
</VerticalStack>
\ No newline at end of file
<OutputType>Exe</OutputType>
<RootNamespace>Tests</RootNamespace>
<AssemblyName>Tests</AssemblyName>
- <StartupObject>Tests.Showcase</StartupObject>
+ <StartupObject>Tests.BasicTests</StartupObject>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ReleaseVersion>0.5</ReleaseVersion>
<StartWorkingDirectory>%24{SolutionDir}\build\%24{ProjectConfigName}</StartWorkingDirectory>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
+ <PropertyGroup Condition=" '$(RunConfiguration)' == 'Custom Command' ">
+ <StartAction>Program</StartAction>
+ <StartProgram>%24{TargetName}</StartProgram>
+ <StartWorkingDirectory>%24{SolutionDir}\build\%24{ProjectConfigName}</StartWorkingDirectory>
+ <ConsolePause>false</ConsolePause>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(RunConfiguration)' == 'Custom Command' ">
+ <StartAction>Program</StartAction>
+ <StartProgram>%24{TargetName}</StartProgram>
+ <StartWorkingDirectory>%24{SolutionDir}\build\%24{ProjectConfigName}</StartWorkingDirectory>
+ <ConsolePause>false</ConsolePause>
+ </PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<EmbeddedResource Include="Tutorials\test.crow">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
+ <EmbeddedResource Include="Interfaces\TabItem.template">
+ <LogicalName>Crow.TabItem.template</LogicalName>
+ </EmbeddedResource>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Crow.csproj">
this.RegisterForRedraw ();
}
}
+ #if DEBUG
+ [XmlIgnore]public string TreePath {
+ get { return this.GetType().Name + uid.ToString (); }
+ }
+ #endif
/// <summary>
/// Name is used in binding to reference other GraphicObjects inside the graphic tree
/// and by template controls to find special element in their template implementation such
OnDataSourceChanged (this, e);
}
internal bool localDataSourceIsNull { get { return dataSource == null; } }
- internal bool localLogicalParentIsNull { get { return logicalParent == null; } }
+ public bool localLogicalParentIsNull { get { return logicalParent == null; } }
public virtual void OnDataSourceChanged(object sender, DataSourceChangeEventArgs e){
DataSourceChanged.Raise (this, e);
public class Group : GraphicObject
{
#region CTOR
- protected Group () : base(){}
+ public Group () : base() {}
public Group(Interface iface) : base(iface){}
#endregion
this.RegisterForLayouting (LayoutingType.Sizing | LayoutingType.ArrangeChildren);
}
+ public virtual void InsertChild (int idx, GraphicObject g) {
+ lock (children) {
+ g.Parent = this;
+ Children.Insert (idx, g);
+ }
+ g.RegisteredLayoutings = LayoutingType.None;
+ g.LayoutChanged += OnChildLayoutChanges;
+ g.RegisterForLayouting (LayoutingType.Sizing | LayoutingType.ArrangeChildren);
+ }
+ public virtual void RemoveChild (int idx) {
+ RemoveChild (children[idx]);
+ }
public virtual void ClearChildren()
{
lock (children) {
--- /dev/null
+//
+// IMLContainer.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.
+using System;
+
+namespace Crow
+{
+ public class IMLContainer : PrivateContainer
+ {
+ public IMLContainer () : base()
+ {
+ }
+
+ string path;
+
+ public string Path {
+ get { return path; }
+ set {
+ if (path == value)
+ return;
+ path = value;
+ this.SetChild (CurrentInterface.Load (path));
+ NotifyValueChanged ("Path", path);
+ }
+ }
+ }
+}
+
--- /dev/null
+//
+// MDIContainer.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.
+using System;
+
+namespace Crow
+{
+ public class MDIContainer : Group
+ {
+ #region CTOR
+ public MDIContainer () : base()
+ {
+ }
+ #endregion
+
+ }
+}
+
Cancel.Raise (this, null);
close ();
}
- public static MessageBox Show (Type msgBoxType, string message, string okMsg = "", string cancelMsg = ""){
+ public static MessageBox Show (Interface iface, Type msgBoxType, string message, string okMsg = "", string cancelMsg = ""){
//lock (Interface.CurrentInterface.UpdateMutex) {
- MessageBox mb = new MessageBox (Interface.CurrentInterface);
+ MessageBox mb = new MessageBox (iface);
mb.CurrentInterface.AddWidget (mb);
mb.MsgType = msgBoxType;
mb.Message = message;
protected GraphicObject child;
- internal virtual void SetChild(GraphicObject _child)
+ protected virtual void SetChild(GraphicObject _child)
{
if (child != null) {
public override void checkHoverWidget (MouseMoveEventArgs e)
{
base.checkHoverWidget (e);
+
if (child != null)
if (child.MouseIsIn (e.Position))
child.checkHoverWidget (e);
using System.ComponentModel;
using System.Diagnostics;
using Cairo;
+using System.Linq;
namespace Crow
{
public TabItem (Interface iface) : base(iface){}
#endregion
+ public event EventHandler QueryClose;
+
#region Private fields
GraphicObject titleWidget;
int tabOffset;
internal GraphicObject TabTitle { get { return titleWidget; }}
#endregion
+ /// <summary>
+ /// order of redrawing, items can't be reordered in TemplatedGroup due to data linked, so we need another index
+ /// instead of children list order
+ /// </summary>
+ public int viewIndex = 0;
+ public virtual int ViewIndex {
+ get { return viewIndex; }
+ set {
+ if (viewIndex == value)
+ return;
+ viewIndex = value;
+ NotifyValueChanged ("ViewIndex", viewIndex);
+ }
+ }
+
[XmlAttributeAttribute][DefaultValue("18")]
public virtual Measure TabThickness {
get { return tabThickness; }
gr.LineTo (Slot.Width-0.5, Slot.Height-0.5);
gr.LineTo (0.5, Slot.Height-0.5);
gr.ClosePath ();
- gr.LineWidth = 2;
+ gr.LineWidth = 1;
Foreground.SetAsSource (gr);
gr.StrokePreserve ();
}
#region Mouse Handling
+ public bool HoldCursor = false;
+
public override bool MouseIsIn (Point m)
{
if (!(Visible & IsEnabled) || IsDragged)
return _contentContainer.ScreenCoordinates (_contentContainer.Slot).ContainsOrIsEqual (m)
|| mouseIsInTitle;
}
- bool holdCursor = false;
public override void onMouseDown (object sender, MouseButtonEventArgs e)
{
base.onMouseDown (sender, e);
- holdCursor = true;
+ HoldCursor = true;
}
public override void onMouseUp (object sender, MouseButtonEventArgs e)
{
base.onMouseUp (sender, e);
- holdCursor = false;
+ HoldCursor = false;
(Parent as TabView).UpdateLayout (LayoutingType.ArrangeChildren);
}
public override void onMouseMove (object sender, MouseMoveEventArgs e)
{
base.onMouseMove (sender, e);
- if (!(HasFocus&&holdCursor))
+ if (!(HasFocus && HoldCursor))
return;
TabView tv = Parent as TabView;
TabItem previous = null, next = null;
else if (tmp > Parent.getSlot ().Width - TabTitle.Slot.Width - tv.Spacing)
TabOffset = Parent.getSlot ().Width - TabTitle.Slot.Width - tv.Spacing;
else{
- int idx = tv.Children.IndexOf (this);
- if (idx > 0 && e.XDelta < 0) {
- previous = tv.Children [idx - 1] as TabItem;
-
+ TabItem[] tabItms = tv.Children.Cast<TabItem>().OrderBy (t=>t.ViewIndex).ToArray();
+ if (ViewIndex > 0 && e.XDelta < 0) {
+ previous = tabItms [ViewIndex - 1];
if (tmp < previous.TabOffset + previous.TabTitle.Slot.Width / 2) {
- tv.Children.RemoveAt (idx);
- tv.Children.Insert (idx - 1, this);
- tv.SelectedTab = idx - 1;
+ previous.ViewIndex = ViewIndex;
+ ViewIndex--;
tv.UpdateLayout (LayoutingType.ArrangeChildren);
}
- }else if (idx < tv.Children.Count - 1 && e.XDelta > 0) {
- next = tv.Children [idx + 1] as TabItem;
+ }else if (ViewIndex < tabItms.Length - 1 && e.XDelta > 0) {
+ next = tabItms [ViewIndex + 1];
if (tmp > next.TabOffset - next.TabTitle.Slot.Width / 2){
- tv.Children.RemoveAt (idx);
- tv.Children.Insert (idx + 1, this);
- tv.SelectedTab = idx + 1;
+ next.ViewIndex = ViewIndex;
+ ViewIndex++;
tv.UpdateLayout (LayoutingType.ArrangeChildren);
}
}
TabOffset = tmp;
}
}
- public void butCloseTabClick (object sender, MouseButtonEventArgs e){
- (Parent as TabView).RemoveChild(this);
+ public void butCloseTabClick (object sender, MouseButtonEventArgs e){
+ QueryClose.Raise (this, null);
}
#endregion
using System.ComponentModel;
using Cairo;
using System.Diagnostics;
+using System.Linq;
namespace Crow
{
public class TabView : Group
{
#region CTOR
- protected TabView() : base(){}
+ public TabView() : base(){}
public TabView (Interface iface) : base(iface){}
#endregion
int selectedTab = 0;
#endregion
-
#region public properties
[XmlAttributeAttribute()][DefaultValue(Orientation.Horizontal)]
public virtual Orientation Orientation
}
#endregion
+ void Ti_TabTitle_LayoutChanged (object sender, LayoutingEventArgs e)
+ {
+ if (e.LayoutType == LayoutingType.Width)
+ this.RegisterForLayouting (LayoutingType.ArrangeChildren);
+ }
+
public override void AddChild (GraphicObject child)
{
TabItem ti = child as TabItem;
throw new Exception ("TabView control accept only TabItem as child.");
ti.MouseDown += Ti_MouseDown;
-
- if (Children.Count == 0) {
- ti.IsSelected = true;
- SelectedTab = 0;
- }
+ ti.TabTitle.LayoutChanged += Ti_TabTitle_LayoutChanged;
base.AddChild (child);
+
+ SelectedTab = ti.ViewIndex = Children.Count - 1;
}
+
public override void RemoveChild (GraphicObject child)
{
- base.RemoveChild (child);
- if (selectedTab > Children.Count - 1)
+ TabItem ti = child as TabItem;
+ if (ti == null)
+ throw new Exception ("TabView control accept only TabItem as child.");
+
+ ti.MouseDown -= Ti_MouseDown;
+ ti.TabTitle.LayoutChanged -= Ti_TabTitle_LayoutChanged;
+
+ if (selectedTab > Children.Count - 2)
SelectedTab--;
- else
- SelectedTab = selectedTab;
+
+ base.RemoveChild (child);
}
+
public override bool ArrangeChildren { get { return true; } }
public override bool UpdateLayout (LayoutingType layoutType)
{
if (layoutType == LayoutingType.ArrangeChildren) {
int curOffset = Spacing;
- for (int i = 0; i < Children.Count; i++) {
- if (!Children [i].Visible)
+ TabItem[] tabItms = Children.Cast<TabItem>().OrderBy (t=>t.ViewIndex).ToArray();
+ for (int i = 0; i < tabItms.Length; i++) {
+ if (!tabItms [i].Visible)
continue;
- TabItem ti = Children [i] as TabItem;
- ti.TabOffset = curOffset;
+ if (!tabItms [i].HoldCursor)
+ tabItms [i].TabOffset = curOffset;
if (Orientation == Orientation.Horizontal) {
- if (ti.TabTitle.RegisteredLayoutings.HasFlag (LayoutingType.Width))
+ if (tabItms [i].TabTitle.RegisteredLayoutings.HasFlag (LayoutingType.Width))
return false;
- curOffset += ti.TabTitle.Slot.Width + Spacing;
+ curOffset += tabItms [i].TabTitle.Slot.Width + Spacing;
} else {
- if (ti.TabTitle.RegisteredLayoutings.HasFlag (LayoutingType.Height))
+ if (tabItms [i].TabTitle.RegisteredLayoutings.HasFlag (LayoutingType.Height))
return false;
- curOffset += ti.TabTitle.Slot.Height + Spacing;
+ curOffset += tabItms [i].TabTitle.Slot.Height + Spacing;
}
}
gr.Clip ();
}
- for (int i = 0; i < Children.Count; i++) {
- if (i == SelectedTab)
- continue;
- Children [i].Paint (ref gr);
- }
-
- if (SelectedTab < Children.Count && SelectedTab >= 0)
- Children [SelectedTab].Paint (ref gr);
+ lock (Children) {
+ TabItem[] tabItms = Children.Cast<TabItem> ().OrderBy (t => t.ViewIndex).ToArray ();
+ for (int i = 0; i < tabItms.Length; i++) {
+ if (tabItms [i] == Children [SelectedTab])
+ continue;
+ tabItms [i].Paint (ref gr);
+ }
+ if (SelectedTab < tabItms.Length && SelectedTab >= 0)
+ Children [SelectedTab].Paint (ref gr);
+ }
gr.Restore ();
}
Children[SelectedTab].checkHoverWidget (e);
return;
}
- for (int i = Children.Count - 1; i >= 0; i--) {
- TabItem ti = Children [i] as TabItem;
- if (ti.TabTitle.MouseIsIn(e.Position))
+ TabItem[] tabItms = Children.Cast<TabItem>().OrderBy (t=>t.ViewIndex).ToArray();
+ for (int i = tabItms.Length - 1; i >= 0; i--) {
+ if (tabItms [i].TabTitle.MouseIsIn(e.Position))
{
- Children[i].checkHoverWidget (e);
+ tabItms [i].checkHoverWidget (e);
return;
}
}
cancelLoadingThread ();
+ if (data is IObservableList) {
+ IObservableList ol = data as IObservableList;
+ ol.ListAdd -= Ol_ListAdd;
+ ol.ListRemove -= Ol_ListRemove;
+ }
+
data = value;
+ if (data is IObservableList) {
+ IObservableList ol = data as IObservableList;
+ ol.ListAdd += Ol_ListAdd;
+ ol.ListRemove += Ol_ListRemove;
+ }
+
NotifyValueChanged ("Data", data);
lock (CurrentInterface.LayoutMutex)
}
}
+ void Ol_ListRemove (object sender, ListChangedEventArg e)
+ {
+ if (this.isPaged) {
+ int p = e.Index / itemPerPage;
+ int i = e.Index % itemPerPage;
+ (items.Children [p] as Group).RemoveChild (i);
+ } else
+ items.RemoveChild (e.Index);
+ }
+
+ void Ol_ListAdd (object sender, ListChangedEventArg e)
+ {
+ if (this.isPaged) {
+ throw new NotImplementedException();
+// int p = e.Index / itemPerPage;
+// int i = e.Index % itemPerPage;
+// (items.Children [p] as Group).InsertChild (i, e.Element);
+ } else
+ loadItem (e.Index, items);
+ }
+
[XmlAttributeAttribute][DefaultValue("SteelBlue")]
public virtual Color SelectionBackground {
get { return selBackground; }
#endif
Group page;
- if (typeof(Wrapper).IsAssignableFrom (items.GetType ())) {
+ if (typeof(TabView).IsAssignableFrom (items.GetType ())||typeof(Wrapper).IsAssignableFrom (items.GetType ())) {
page = items;
itemPerPage = int.MaxValue;
} else if (typeof(GenericStack).IsAssignableFrom (items.GetType ())) {
isPaged = true;
} else {
page = Activator.CreateInstance (items.GetType ()) as Group;
+ page.CurrentInterface = items.CurrentInterface;
+ page.Initialize ();
page.Name = "page" + pageNum;
isPaged = true;
}
--- /dev/null
+//
+// IListChanged.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.
+using System;
+
+namespace Crow
+{
+ public class ListChangedEventArg : EventArgs {
+ public int Index;
+ public object Element;
+ public ListChangedEventArg (int index, object element) {
+ Index = index;
+ Element = element;
+ }
+ }
+ public interface IObservableList {
+ event EventHandler<ListChangedEventArg> ListAdd;
+ event EventHandler<ListChangedEventArg> ListRemove;
+ }
+}
+
System.Reflection.Emit.Label finish = il.DefineLabel ();
il.Emit (OpCodes.Br, finish);
il.MarkLabel (cancel);
- il.EmitWriteLine (string.Format ("Handler method '{0}' for '{1}' not found in new dataSource", bindingDef.TargetMember, sourceEvent.Name));
+ #if DEBUG_BINDING
+ il.EmitWriteLine (string.Format ("Handler method '{0}' for '{1}' NOT FOUND in new dataSource", bindingDef.TargetMember, sourceEvent.Name));
+ #endif
il.MarkLabel (finish);
+ #if DEBUG_BINDING
+ il.EmitWriteLine (string.Format ("Handler method '{0}' for '{1}' FOUND in new dataSource", bindingDef.TargetMember, sourceEvent.Name));
+ #endif
il.Emit (OpCodes.Ret);
//store dschange delegate in instatiator instance for access while instancing graphic object
/// <summary>
/// search for graphic object type in crow assembly, if not found,
- /// search for type independently of namespace in entry assembly
+ /// search for type independently of namespace in all the loaded assemblies
/// </summary>
+ /// <remarks>
+ /// </remarks>
/// <returns>the corresponding type object</returns>
/// <param name="typeName">graphic object type name without its namespace</param>
Type tryGetGOType (string typeName){
Type t = Type.GetType ("Crow." + typeName);
if (t != null)
- return t;
- Assembly a = Assembly.GetEntryAssembly ();
- foreach (Type expT in a.GetExportedTypes ()) {
- if (expT.Name == typeName)
- return expT;
+ return t;
+ foreach (Assembly a in AppDomain.CurrentDomain.GetAssemblies()) {
+ if (a.IsDynamic)
+ continue;
+ foreach (Type expT in a.GetExportedTypes ()) {
+ if (expT.Name == typeName)
+ return expT;
+ }
}
return null;
}
/// Each control need a ref to the root interface containing it, if not set in GraphicObject.currentInterface,
/// the ref of this one will be stored in GraphicObject.currentInterface
/// </summary>
- internal static Interface CurrentInterface;
+ protected static Interface CurrentInterface;
internal Stopwatch clickTimer = new Stopwatch();
internal GraphicObject eligibleForDoubleClick = null;
#endregion
/// <param name="path">path of the iml file to load</param>
public GraphicObject Load (string path)
{
- try {
+ //try {
return GetInstantiator (path).CreateInstance (this);
- } catch (Exception ex) {
- throw new Exception ("Error loading <" + path + ">:", ex);
- }
+ //} catch (Exception ex) {
+ // throw new Exception ("Error loading <" + path + ">:", ex);
+ //}
}
/// <summary>
/// Fetch instantiator from cache or create it.
}
}
/// <summary>Pointer is over the widget</summary>
- public GraphicObject HoverWidget
+ public virtual GraphicObject HoverWidget
{
get { return _hoverWidget; }
set {
/// <summary>Processes mouse move events from the root container, this function
/// should be called by the host on mouse move event to forward events to crow interfaces</summary>
/// <returns>true if mouse is in the interface</returns>
- public bool ProcessMouseMove(int x, int y)
+ public virtual bool ProcessMouseMove(int x, int y)
{
int deltaX = x - Mouse.X;
int deltaY = y - Mouse.Y;
--- /dev/null
+//
+// IListChanged.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.
+using System;
+using System.Collections.Generic;
+
+namespace Crow
+{
+ public class ObservableList<T> : List<T> , IObservableList {
+ public event EventHandler<ListChangedEventArg> ListAdd;
+ public event EventHandler<ListChangedEventArg> ListRemove;
+
+ public void AddElement (T elem) {
+ this.Add(elem);
+ ListAdd.Raise (this, new ListChangedEventArg (this.Count - 1, elem));
+ }
+ public void RemoveElement (T elem) {
+ int idx = this.IndexOf (elem);
+ this.RemoveAt (idx);
+ ListRemove.Raise (this, new ListChangedEventArg (idx, elem));
+ }
+ }
+}
+