]> O.S.I.I.S - jp/crow.git/commitdiff
CrowIDE, ObservableList, include Crow.Coding
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Tue, 13 Feb 2018 05:53:18 +0000 (06:53 +0100)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Tue, 13 Feb 2018 05:53:18 +0000 (06:53 +0100)
66 files changed:
Crow.csproj
Crow.sln
CrowIDE/CrowIDE.csproj
CrowIDE/src/CrowIDE.cs
CrowIDE/src/DesignInterface.cs [new file with mode: 0644]
CrowIDE/src/EditPane.cs [new file with mode: 0644]
CrowIDE/src/ImlVisualEditor.cs
CrowIDE/src/MembersView.cs
CrowIDE/src/Project.cs
CrowIDE/src/ProjectNodes.cs [new file with mode: 0644]
CrowIDE/src/Solution.cs
CrowIDE/ui/CrowIDE.crow [new file with mode: 0644]
CrowIDE/ui/EditPane.template [new file with mode: 0644]
CrowIDE/ui/EditPaneItems.template [new file with mode: 0644]
CrowIDE/ui/MembersView.template
CrowIDE/ui/MenuItem.template
CrowIDE/ui/TabItem.template [new file with mode: 0644]
CrowIDE/ui/icons/basic_floppydisk.svg [new file with mode: 0644]
CrowIDE/ui/icons/blank-file.svg [new file with mode: 0644]
CrowIDE/ui/icons/center-align.svg [new file with mode: 0644]
CrowIDE/ui/icons/cogwheel.svg [new file with mode: 0644]
CrowIDE/ui/icons/copy-file.svg [new file with mode: 0644]
CrowIDE/ui/icons/edit.svg [new file with mode: 0644]
CrowIDE/ui/icons/file-code.svg [new file with mode: 0644]
CrowIDE/ui/icons/folder.svg [new file with mode: 0644]
CrowIDE/ui/icons/font-file.svg [new file with mode: 0644]
CrowIDE/ui/icons/inbox.svg [new file with mode: 0644]
CrowIDE/ui/icons/light-bulb.svg [new file with mode: 0644]
CrowIDE/ui/icons/outbox.svg [new file with mode: 0644]
CrowIDE/ui/icons/paragraph.svg [new file with mode: 0644]
CrowIDE/ui/icons/paste-on-document.svg [new file with mode: 0644]
CrowIDE/ui/icons/previous.svg [new file with mode: 0644]
CrowIDE/ui/icons/question.svg [new file with mode: 0644]
CrowIDE/ui/icons/reply.svg [new file with mode: 0644]
CrowIDE/ui/icons/scissors.svg [new file with mode: 0644]
CrowIDE/ui/icons/search.svg [new file with mode: 0644]
CrowIDE/ui/icons/share-arrow.svg [new file with mode: 0644]
CrowIDE/ui/icons/sign-out.svg [new file with mode: 0644]
CrowIDE/ui/icons/text-file.svg [new file with mode: 0644]
CrowIDE/ui/icons/text-label.svg [new file with mode: 0644]
CrowIDE/ui/icons/tools.svg [new file with mode: 0644]
CrowIDE/ui/icons/zoom-in.svg [new file with mode: 0644]
CrowIDE/ui/icons/zoom-out.svg [new file with mode: 0644]
CrowIDE/ui/imlEditor.crow [deleted file]
Default.style
Templates/ColorPicker.template
Templates/Spinner.template
Tests/BasicTests.cs
Tests/CrowWindow.cs
Tests/Interfaces/TabItem.template [new file with mode: 0644]
Tests/Interfaces/TemplatedContainer/testTabView.crow
Tests/Interfaces/TemplatedControl/testSpinner.crow
Tests/Tests.csproj
src/GraphicObjects/GraphicObject.cs
src/GraphicObjects/Group.cs
src/GraphicObjects/IMLContainer.cs [new file with mode: 0644]
src/GraphicObjects/MDIContainer.cs [new file with mode: 0644]
src/GraphicObjects/MessageBox.cs
src/GraphicObjects/PrivateContainer.cs
src/GraphicObjects/TabItem.cs
src/GraphicObjects/TabView.cs
src/GraphicObjects/TemplatedGroup.cs
src/IListChanged.cs [new file with mode: 0644]
src/Instantiator.cs
src/Interface.cs
src/ObservableList.cs [new file with mode: 0644]

index a8b47dc80ba1a5e51c1809ee44f397a5e96f21e7..4de640dd190ca5d47864cfd94220c9c7b6fcc72b 100644 (file)
     <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" />
index 5fc9079fa00801de87694084d1ff5da14ab6d424..61aaa3af8775aeb9a09a749f64f9daf9dd49ede9 100644 (file)
--- a/Crow.sln
+++ b/Crow.sln
@@ -9,6 +9,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Crow.Test", "Crow.Test\Crow
 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
@@ -22,32 +24,46 @@ Global
                {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
@@ -55,7 +71,6 @@ Global
                $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
index 6dc82f3ff39fae7ef0c58bdbbe143adff60edd13..8caa22a3941ebc38283fbc47d786d11b6170d1eb 100644 (file)
     <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>
index 315f148a7b374b08cad2039e9fa4974d5bb3711e..fda596b3d693f17186fa07166935bad90f7f87cc 100644 (file)
@@ -31,91 +31,48 @@ using System.IO;
 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 ()
@@ -129,44 +86,43 @@ namespace CrowIDE
                {
                }
                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 {
@@ -176,7 +132,7 @@ namespace CrowIDE
                        }
                }
                public Solution CurrentSolution {
-                       get { return CurrentSolution; }
+                       get { return currentSolution; }
                        set {
                                if (currentSolution == value)
                                        return;
@@ -184,12 +140,7 @@ namespace CrowIDE
                                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 {
@@ -208,9 +159,6 @@ namespace CrowIDE
                                NotifyValueChanged ("ReopenLastSolution", value);
                        }
                }
-               void openFileDialog () {                        
-                       AddWidget (instFileDlg.CreateInstance(CurrentInterface)).DataSource = this;
-               }
 
                public void onFileOpen (object sender, EventArgs e)
                {
diff --git a/CrowIDE/src/DesignInterface.cs b/CrowIDE/src/DesignInterface.cs
new file mode 100644 (file)
index 0000000..ae104fe
--- /dev/null
@@ -0,0 +1,138 @@
+//
+// 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;           
+               }
+       }
+}
+
diff --git a/CrowIDE/src/EditPane.cs b/CrowIDE/src/EditPane.cs
new file mode 100644 (file)
index 0000000..a110390
--- /dev/null
@@ -0,0 +1,57 @@
+//
+// 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);
+                       }
+               }
+       }
+}
+
index e238a7062fa2252ff3ad795f48e749505ff104c7..55c7b0c60de5d02f834d871baa2489dc4409802f 100644 (file)
@@ -34,21 +34,23 @@ namespace CrowIDE
                #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; }
@@ -81,6 +83,17 @@ namespace CrowIDE
                                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; }
                }
@@ -100,14 +113,8 @@ namespace CrowIDE
                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; }
@@ -212,19 +219,19 @@ namespace CrowIDE
                }
                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)
                {
@@ -264,8 +271,8 @@ namespace CrowIDE
                        }
 
                        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));
@@ -285,6 +292,42 @@ namespace CrowIDE
                }
                #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;
@@ -297,14 +340,14 @@ namespace CrowIDE
                        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;
@@ -317,11 +360,11 @@ namespace CrowIDE
                                                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;
                                                        }
                                                }
@@ -331,18 +374,18 @@ namespace CrowIDE
 
 
                                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);
                                        }
                                }
                        }
@@ -352,9 +395,7 @@ namespace CrowIDE
                                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;
                                        }
                                }
index 67c712bda2bb76bf2fa983d6a930bdf3ee7e0431..00d3023eaa86998c0a1ae03c02105a1d6bf3a805 100644 (file)
@@ -93,6 +93,10 @@ namespace CrowIDE
                                        return;
                                instance = value;
                                NotifyValueChanged ("Instance", instance);
+                               if (Instance is GraphicObject)
+                                       NotifyValueChanged ("SelectedItemName", (Instance as GraphicObject).Name);
+                               else
+                                       NotifyValueChanged ("SelectedItemName", "");
 
                                if (instance == null) {
                                        Data = null;
index 2c72431181e2c7d630344249c2a83151860278c3..ac675713fd9402b1de1b64bb443bf46468528799 100644 (file)
@@ -28,16 +28,18 @@ using System.Xml;
 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; }
@@ -120,7 +122,7 @@ namespace CrowIDE
                                        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) {
@@ -159,6 +161,25 @@ namespace CrowIDE
                        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);
+               }       
        }
 }
 
diff --git a/CrowIDE/src/ProjectNodes.cs b/CrowIDE/src/ProjectNodes.cs
new file mode 100644 (file)
index 0000000..5be419a
--- /dev/null
@@ -0,0 +1,158 @@
+//
+// 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
+
+       }
+}
+
index 888bf684c4f2ce9f81425760526f5ddad4fd4f65..aba707e49dbc65025b3d51d38d12977fad672116 100644 (file)
@@ -19,8 +19,9 @@ using System.Reflection;
 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;
@@ -30,8 +31,64 @@ namespace CrowIDE{
        /// <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>
@@ -53,7 +110,7 @@ namespace CrowIDE{
            [ExcludeFromCodeCoverage]
            public override string ToString()
            {
-               return "Solution, name = " + name;
+               return "Solution: " + name;
            }
 
            /// <summary>
@@ -76,6 +133,7 @@ namespace CrowIDE{
                        }
                }
 
+               #region Solution properties
            double slnVer;                                      // 11.00 - vs2010, 12.00 - vs2015
 
            /// <summary>
@@ -119,13 +177,18 @@ namespace CrowIDE{
            {
                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>
@@ -272,7 +335,7 @@ namespace CrowIDE{
                    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);
@@ -285,5 +348,6 @@ namespace CrowIDE{
 
                return s;
            } //LoadSolution
-       } //class Solution
+               #endregion
+       } 
 }
diff --git a/CrowIDE/ui/CrowIDE.crow b/CrowIDE/ui/CrowIDE.crow
new file mode 100644 (file)
index 0000000..d778d9e
--- /dev/null
@@ -0,0 +1,49 @@
+<?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>
diff --git a/CrowIDE/ui/EditPane.template b/CrowIDE/ui/EditPane.template
new file mode 100644 (file)
index 0000000..73644d6
--- /dev/null
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<TabView Name="ItemsContainer" Orientation="Horizontal" Spacing="24"/>
diff --git a/CrowIDE/ui/EditPaneItems.template b/CrowIDE/ui/EditPaneItems.template
new file mode 100644 (file)
index 0000000..fca1821
--- /dev/null
@@ -0,0 +1,43 @@
+<?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>
index 92f132f30067c68a12d53c165ffaba03a7154d14..362380e8d73040f5f1169e15fb737242b4e211fa 100755 (executable)
@@ -2,7 +2,7 @@
 <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">
index 94b93459dac4cc549ef4af011407ccd5023c3dd4..5752b088ce7607ae7c589da03eafe79ba7f2f9c1 100644 (file)
@@ -1,22 +1,22 @@
 <?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">
diff --git a/CrowIDE/ui/TabItem.template b/CrowIDE/ui/TabItem.template
new file mode 100644 (file)
index 0000000..f82b79c
--- /dev/null
@@ -0,0 +1,20 @@
+<?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>
+
diff --git a/CrowIDE/ui/icons/basic_floppydisk.svg b/CrowIDE/ui/icons/basic_floppydisk.svg
new file mode 100644 (file)
index 0000000..55d901d
--- /dev/null
@@ -0,0 +1,15 @@
+<?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>
diff --git a/CrowIDE/ui/icons/blank-file.svg b/CrowIDE/ui/icons/blank-file.svg
new file mode 100644 (file)
index 0000000..8136979
--- /dev/null
@@ -0,0 +1,6 @@
+<?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>
diff --git a/CrowIDE/ui/icons/center-align.svg b/CrowIDE/ui/icons/center-align.svg
new file mode 100644 (file)
index 0000000..92e3fac
--- /dev/null
@@ -0,0 +1,9 @@
+<?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>
diff --git a/CrowIDE/ui/icons/cogwheel.svg b/CrowIDE/ui/icons/cogwheel.svg
new file mode 100644 (file)
index 0000000..c104c47
--- /dev/null
@@ -0,0 +1,7 @@
+<?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>
diff --git a/CrowIDE/ui/icons/copy-file.svg b/CrowIDE/ui/icons/copy-file.svg
new file mode 100644 (file)
index 0000000..63c2dd3
--- /dev/null
@@ -0,0 +1,6 @@
+<?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>
diff --git a/CrowIDE/ui/icons/edit.svg b/CrowIDE/ui/icons/edit.svg
new file mode 100644 (file)
index 0000000..73569d8
--- /dev/null
@@ -0,0 +1,6 @@
+<?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>
diff --git a/CrowIDE/ui/icons/file-code.svg b/CrowIDE/ui/icons/file-code.svg
new file mode 100644 (file)
index 0000000..2dc00db
--- /dev/null
@@ -0,0 +1,9 @@
+<?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>
diff --git a/CrowIDE/ui/icons/folder.svg b/CrowIDE/ui/icons/folder.svg
new file mode 100644 (file)
index 0000000..ee1f82b
--- /dev/null
@@ -0,0 +1,6 @@
+<?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>
diff --git a/CrowIDE/ui/icons/font-file.svg b/CrowIDE/ui/icons/font-file.svg
new file mode 100644 (file)
index 0000000..20beac1
--- /dev/null
@@ -0,0 +1,7 @@
+<?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>
diff --git a/CrowIDE/ui/icons/inbox.svg b/CrowIDE/ui/icons/inbox.svg
new file mode 100644 (file)
index 0000000..6aa6714
--- /dev/null
@@ -0,0 +1,7 @@
+<?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>
diff --git a/CrowIDE/ui/icons/light-bulb.svg b/CrowIDE/ui/icons/light-bulb.svg
new file mode 100644 (file)
index 0000000..4193a75
--- /dev/null
@@ -0,0 +1,7 @@
+<?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>
diff --git a/CrowIDE/ui/icons/outbox.svg b/CrowIDE/ui/icons/outbox.svg
new file mode 100644 (file)
index 0000000..bd8d7d9
--- /dev/null
@@ -0,0 +1,7 @@
+<?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>
diff --git a/CrowIDE/ui/icons/paragraph.svg b/CrowIDE/ui/icons/paragraph.svg
new file mode 100644 (file)
index 0000000..826aa63
--- /dev/null
@@ -0,0 +1,6 @@
+<?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>
diff --git a/CrowIDE/ui/icons/paste-on-document.svg b/CrowIDE/ui/icons/paste-on-document.svg
new file mode 100644 (file)
index 0000000..b0a705e
--- /dev/null
@@ -0,0 +1,6 @@
+<?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>
diff --git a/CrowIDE/ui/icons/previous.svg b/CrowIDE/ui/icons/previous.svg
new file mode 100644 (file)
index 0000000..566c8a3
--- /dev/null
@@ -0,0 +1,6 @@
+<?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>
diff --git a/CrowIDE/ui/icons/question.svg b/CrowIDE/ui/icons/question.svg
new file mode 100644 (file)
index 0000000..fb8e3d3
--- /dev/null
@@ -0,0 +1,7 @@
+<?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>
diff --git a/CrowIDE/ui/icons/reply.svg b/CrowIDE/ui/icons/reply.svg
new file mode 100644 (file)
index 0000000..d008cb3
--- /dev/null
@@ -0,0 +1,6 @@
+<?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>
diff --git a/CrowIDE/ui/icons/scissors.svg b/CrowIDE/ui/icons/scissors.svg
new file mode 100644 (file)
index 0000000..4b5a225
--- /dev/null
@@ -0,0 +1,6 @@
+<?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>
diff --git a/CrowIDE/ui/icons/search.svg b/CrowIDE/ui/icons/search.svg
new file mode 100644 (file)
index 0000000..4a931b3
--- /dev/null
@@ -0,0 +1,6 @@
+<?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>
diff --git a/CrowIDE/ui/icons/share-arrow.svg b/CrowIDE/ui/icons/share-arrow.svg
new file mode 100644 (file)
index 0000000..e0eb246
--- /dev/null
@@ -0,0 +1,6 @@
+<?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>
diff --git a/CrowIDE/ui/icons/sign-out.svg b/CrowIDE/ui/icons/sign-out.svg
new file mode 100644 (file)
index 0000000..c5951fc
--- /dev/null
@@ -0,0 +1,7 @@
+<?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>
diff --git a/CrowIDE/ui/icons/text-file.svg b/CrowIDE/ui/icons/text-file.svg
new file mode 100644 (file)
index 0000000..eafca90
--- /dev/null
@@ -0,0 +1,9 @@
+<?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>
diff --git a/CrowIDE/ui/icons/text-label.svg b/CrowIDE/ui/icons/text-label.svg
new file mode 100644 (file)
index 0000000..8fa9196
--- /dev/null
@@ -0,0 +1,7 @@
+<?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>
diff --git a/CrowIDE/ui/icons/tools.svg b/CrowIDE/ui/icons/tools.svg
new file mode 100644 (file)
index 0000000..5326f19
--- /dev/null
@@ -0,0 +1,8 @@
+<?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>
diff --git a/CrowIDE/ui/icons/zoom-in.svg b/CrowIDE/ui/icons/zoom-in.svg
new file mode 100644 (file)
index 0000000..60c41d1
--- /dev/null
@@ -0,0 +1,7 @@
+<?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>
diff --git a/CrowIDE/ui/icons/zoom-out.svg b/CrowIDE/ui/icons/zoom-out.svg
new file mode 100644 (file)
index 0000000..bd4eec3
--- /dev/null
@@ -0,0 +1,7 @@
+<?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>
diff --git a/CrowIDE/ui/imlEditor.crow b/CrowIDE/ui/imlEditor.crow
deleted file mode 100644 (file)
index 2b2fc8e..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-<?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>
index c5c04ea74e6eabebd30f23c92b8b28a4bf09af12..9a0f3f54fbae8cb6e5b90e68c458a0f01062eaaa 100644 (file)
@@ -157,7 +157,7 @@ ArrowBut {
        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};
index d6bda34644262b225228ed85e9c44e7c97df2416..f626bfea0fe174ec0192d3d725592baa87dfd809 100755 (executable)
@@ -8,7 +8,7 @@
                                        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">
index de1a4d824f6689657b211be92bf11ff9f1fa1c48..dd957d2532e45acf90857d023c11fd2b9d2b47b5 100755 (executable)
@@ -1,18 +1,12 @@
 <?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>
index e04f160e552f4150ce61f779c19f8a2ba9dd657a..a33470b00ac849e349eaad31cc07dce43c239aa3 100644 (file)
@@ -143,7 +143,9 @@ namespace Tests
 
                        //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 ();
@@ -203,7 +205,7 @@ namespace Tests
                                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)
index 9a0c4df0479eaf2525ba74c8a228f29fe50e824a..8ce0abb375afd90806a921ba1ad95a9dc3e8b8b4 100644 (file)
@@ -200,10 +200,13 @@ namespace Crow
                        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;
                }
diff --git a/Tests/Interfaces/TabItem.template b/Tests/Interfaces/TabItem.template
new file mode 100644 (file)
index 0000000..3691a2d
--- /dev/null
@@ -0,0 +1,22 @@
+<?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>
+
index fa33318b11408093c33dbe74c18504cd397a1444..63c898d9e3f07d094d51baf3e89beaf614ee8d56 100644 (file)
@@ -1,5 +1,9 @@
 <?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>
index 4efd587af5986289f19277ef6290d2f73e2f8de6..09f618be181beada32b110059922b21b1fe549d6 100755 (executable)
@@ -8,4 +8,5 @@
                <Spinner Value="5"/>
                <Button/>
        </HorizontalStack>
+       <IMLContainer Path="Interfaces/Divers/colorPicker.crow"/>
 </VerticalStack>
\ No newline at end of file
index 7fd3f6ed004a7861bb71c90501fdc793197c109c..5016b0ee01c276ec109afc1b34f7b0ab42fa375e 100644 (file)
@@ -8,7 +8,7 @@
     <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">
index e24e9b284ff307b822f1d5bb08abe1c3031fbea5..6ec60cf3e75e6969293342e81c13e4d8fc7120ab 100644 (file)
@@ -363,6 +363,11 @@ namespace Crow
                                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
@@ -785,7 +790,7 @@ namespace Crow
                                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);
index a940ee7e7cd034d4ceb1c82e278e6cc22b1752bf..c944eba256dc78d6897cda59d71ae22c6e030a05 100644 (file)
@@ -38,7 +38,7 @@ namespace Crow
        public class Group : GraphicObject
     {
                #region CTOR
-               protected Group () : base(){}
+               public Group () : base() {}
                public Group(Interface iface) : base(iface){}
                #endregion
 
@@ -90,6 +90,18 @@ namespace Crow
 
                        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) {
diff --git a/src/GraphicObjects/IMLContainer.cs b/src/GraphicObjects/IMLContainer.cs
new file mode 100644 (file)
index 0000000..a221a78
--- /dev/null
@@ -0,0 +1,50 @@
+//
+// 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);
+                       }
+               }
+       }
+}
+
diff --git a/src/GraphicObjects/MDIContainer.cs b/src/GraphicObjects/MDIContainer.cs
new file mode 100644 (file)
index 0000000..d8ce464
--- /dev/null
@@ -0,0 +1,40 @@
+//
+// 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
+
+       }
+}
+
index 7f945810095a69917b99fc26175ee583ccc7dd7b..e1c8cc876d31d6f26d7ab861181fe0988bb6f843 100644 (file)
@@ -134,9 +134,9 @@ namespace Crow
                        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;
index 5ee29e9498c3be9b0c1eafd3ab2273e2503e5411..e76b57a828debf8e2a52ec3b7cede086a873d009 100644 (file)
@@ -47,7 +47,7 @@ namespace Crow
 
                protected GraphicObject child;
 
-               internal virtual void SetChild(GraphicObject _child)
+               protected virtual void SetChild(GraphicObject _child)
                {
 
                        if (child != null) {
@@ -204,6 +204,7 @@ namespace Crow
                public override void checkHoverWidget (MouseMoveEventArgs e)
                {
                        base.checkHoverWidget (e);
+
                        if (child != null) 
                                if (child.MouseIsIn (e.Position)) 
                                        child.checkHoverWidget (e);
index b35c544c101dafb2a5381287e88235d72aad7985..d811ea5453eb57221151f789150db1e8278fd93c 100644 (file)
@@ -29,6 +29,7 @@ using System.Xml.Serialization;
 using System.ComponentModel;
 using System.Diagnostics;
 using Cairo;
+using System.Linq;
 
 namespace Crow
 {
@@ -39,6 +40,8 @@ namespace Crow
                public TabItem (Interface iface) : base(iface){}
                #endregion
 
+               public event EventHandler QueryClose;
+
                #region Private fields
                GraphicObject titleWidget;
                int tabOffset;
@@ -70,6 +73,21 @@ namespace Crow
                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; }
@@ -128,7 +146,7 @@ namespace Crow
                        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 ();
 
@@ -138,6 +156,8 @@ namespace Crow
                }
 
                #region Mouse Handling
+               public bool HoldCursor = false;
+
                public override bool MouseIsIn (Point m)
                {
                        if (!(Visible & IsEnabled) || IsDragged)
@@ -150,23 +170,22 @@ namespace Crow
                        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;
@@ -176,31 +195,28 @@ namespace Crow
                        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
 
index 7bf93abdb1e0a376b962f3b95b334d5ad94d56c0..3e776d3a46a5ded56e718ba3afaabd427666a4bf 100644 (file)
@@ -29,13 +29,14 @@ using System.Xml.Serialization;
 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
 
@@ -46,7 +47,6 @@ namespace Crow
                int selectedTab = 0;
                #endregion
 
-
                #region public properties
                [XmlAttributeAttribute()][DefaultValue(Orientation.Horizontal)]
                public virtual Orientation Orientation
@@ -92,6 +92,12 @@ namespace Crow
                }
                #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;
@@ -99,22 +105,28 @@ namespace Crow
                                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)
                {
@@ -122,19 +134,20 @@ namespace Crow
 
                        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;
                                        }
                                }
 
@@ -163,15 +176,17 @@ namespace Crow
                                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 ();
                }
 
@@ -191,11 +206,11 @@ namespace Crow
                                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;
                                }
                        }
index 34d5772700a81bf28226c31ba7a1aadb7760a6cd..069303dd0114f2097eda4956fdcbd0833a93472d 100644 (file)
@@ -172,8 +172,20 @@ namespace Crow
 
                                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)
@@ -193,6 +205,27 @@ namespace Crow
                        }
                }
 
+               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; }
@@ -311,7 +344,7 @@ namespace Crow
                        #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 ())) {
@@ -326,6 +359,8 @@ namespace Crow
                                isPaged = true;
                        } else {
                                page = Activator.CreateInstance (items.GetType ()) as Group;
+                               page.CurrentInterface = items.CurrentInterface;
+                               page.Initialize ();
                                page.Name = "page" + pageNum;
                                isPaged = true;
                        }
diff --git a/src/IListChanged.cs b/src/IListChanged.cs
new file mode 100644 (file)
index 0000000..b2b2337
--- /dev/null
@@ -0,0 +1,43 @@
+//
+// 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;             
+       }
+}
+
index b3f070e7d609d1ba7231e36c296cb49caf900c59..f5355c177755376a3e5af940a807db626e85e7ad 100644 (file)
@@ -560,8 +560,13 @@ namespace Crow.IML
                                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
@@ -1075,18 +1080,23 @@ namespace Crow.IML
 
                /// <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;
                }
index 992ff6f69950f4bbcbfc1c7c3832aaf560eb5aa9..d4cc63c40b3d3efcc2520b3fbb63bf7afb6d304b 100644 (file)
@@ -132,7 +132,7 @@ namespace Crow
                /// 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
@@ -337,11 +337,11 @@ namespace Crow
                /// <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.
@@ -409,7 +409,7 @@ namespace Crow
                        }
                }
                /// <summary>Pointer is over the widget</summary>
-               public GraphicObject HoverWidget
+               public virtual GraphicObject HoverWidget
                {
                        get { return _hoverWidget; }
                        set {
@@ -775,7 +775,7 @@ namespace Crow
                /// <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;
diff --git a/src/ObservableList.cs b/src/ObservableList.cs
new file mode 100644 (file)
index 0000000..c3d49e2
--- /dev/null
@@ -0,0 +1,46 @@
+//
+// 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));
+               }
+       }
+}
+