]> O.S.I.I.S - jp/crow.git/commitdiff
change namespace of CrowIDE to Crow.Coding, move editor source inside, crowIde wip
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Sat, 24 Feb 2018 10:51:12 +0000 (11:51 +0100)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Sat, 24 Feb 2018 10:51:12 +0000 (11:51 +0100)
Crow.Test/Crow.Test.csproj
Crow.Test/Test.cs
Crow.sln
Tests/InterfaceControler.cs
src/GraphicObjects/TabItem.cs
src/Instantiator.cs
src/Interface.cs
src/StyleReader.cs

index fb59dd1e183762505ad3c0995cad35826af3d83f..cf7b10a02e8fa54289ff6e79231f12c069dedb4b 100644 (file)
     <DebugSymbols>true</DebugSymbols>
     <DebugType>full</DebugType>
     <Optimize>false</Optimize>
-    <OutputPath>bin\Debug</OutputPath>
     <DefineConstants>DEBUG;</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     <Optimize>true</Optimize>
-    <OutputPath>bin\Release</OutputPath>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
index e21177f89f376336c68654b8a9c07cf334adab24..d4d978569712a9db61149fdc8ccc2b891c5619bd 100644 (file)
@@ -36,6 +36,7 @@ namespace UnitTest
                public void Init ()
                {
                        iface = new Interface ();
+                       iface.Init ();
                        iface.ProcessResize (bounds);
                }
 
index 61aaa3af8775aeb9a09a749f64f9daf9dd49ede9..4d3e4799a67c4b3fde83e9f15040bd191ec63be1 100644 (file)
--- a/Crow.sln
+++ b/Crow.sln
@@ -9,8 +9,6 @@ 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
@@ -31,39 +29,27 @@ Global
                {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
@@ -71,6 +57,7 @@ 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 5098e1199b8247aeab3e17550c60867c16526a03..034cab39334911ef337ac2a523f1204cda0d6f0c 100644 (file)
@@ -134,6 +134,7 @@ namespace Crow
                        iRect = ifaceBounds;
 
                        CrowInterface = new Interface ();
+                       CrowInterface.Init ();
 
                        #if MEASURE_TIME
                        PerfMeasures = new List<PerformanceMeasure> (
index eab0cb0d170de090a419510726372225ea5e6ce3..676904b53aa4b45252e98933f0c9456fcb92ae63 100644 (file)
@@ -217,7 +217,7 @@ namespace Crow
                        //if tab is used as a templated item root in a templatedGroup, local datasource
                        //is not null, in this case, removing the data entries will delete automatically the item
                        if (localDataSourceIsNull)
-                               (Parent as TabView).DeleteChild (this);
+                               (Parent as TabView)?.DeleteChild (this);
                }
                #endregion
 
index 2481206abdf5bcd22759daee60d1c4594d688170..82797a607115aee6b43231a54832950a2e54c2dd 100644 (file)
@@ -134,7 +134,7 @@ namespace Crow.IML
                                        return new Instantiator (_iface, s);
                                }
                        } catch (Exception ex) {
-                               throw new Exception ("Error loading IML fragment:\n" + fragment + "\n", ex);
+                               throw new Exception ("IML Error: " + ex.Message);
                        }
                }
                #endregion
index 5174e37e698a44eb8cd65c410817b0764d546417..5d7f77209038b74049b1ae136e4a908760104373 100644 (file)
@@ -97,14 +97,17 @@ namespace Crow
                        FontRenderingOptions.SubpixelOrder = SubpixelOrder.Rgb;
                }
                public Interface(){
-                       CurrentInterface = this;
                        CultureInfo.DefaultThreadCurrentCulture = System.Globalization.CultureInfo.InvariantCulture;
+               }
+               #endregion
+
+               public void Init () {
+                       CurrentInterface = this;
                        loadStyling ();
                        findAvailableTemplates ();
                        initTooltip ();
                        initContextMenus ();
                }
-               #endregion
 
                #region Static and constants
                /// <summary>
@@ -125,7 +128,7 @@ namespace Crow
                public static int DeviceRepeatInterval = 40;
                /// <summary>Tabulation size in Text controls</summary>
                public static int TabSize = 4;
-               public static string LineBreak = "\r\n";
+               public static string LineBreak = "\n";
                /// <summary> Allow rendering of interface in development environment </summary>
                public static bool DesignerMode = false;
                /// <summary> Disable caching for a widget if this threshold is reached </summary>
@@ -254,7 +257,7 @@ namespace Crow
                                .GetManifestResourceNames ()
                                .Where (r => r.EndsWith (".style", StringComparison.OrdinalIgnoreCase))) {
                                using (Stream stream = assembly.GetManifestResourceStream (s)) {
-                                       new StyleReader (this, stream, s);
+                                       new StyleReader (this.Styling, stream, s);
                                }
 
                        }
@@ -278,9 +281,10 @@ namespace Crow
                /// Resource ID must be 'fullClassName.template' (not case sensitive)
                /// Those found in application assembly have priority to the default Crow's one
                /// </summary>
-               public Dictionary<string, string> DefaultTemplates = new Dictionary<string, string>();
+               public Dictionary<string, string> DefaultTemplates;
                /// <summary>Finds available default templates at startup</summary>
                void findAvailableTemplates(){
+                       DefaultTemplates = new Dictionary<string, string>();
                        searchTemplatesOnDisk ("./");
                        string defTemplatePath = System.IO.Path.Combine (CrowConfigRoot, "defaultTemplates");
                        searchTemplatesOnDisk (defTemplatePath);
@@ -375,7 +379,7 @@ namespace Crow
                /// </summary>
                /// <returns>new instance of graphic object created</returns>
                /// <param name="path">path of the iml file to load</param>
-               public GraphicObject Load (string path)
+               public virtual GraphicObject Load (string path)
                {
                        //try {
                                return GetInstantiator (path).CreateInstance ();
@@ -388,7 +392,7 @@ namespace Crow
                /// </summary>
                /// <returns>new Instantiator</returns>
                /// <param name="path">path of the iml file to load</param>
-               public Instantiator GetInstantiator(string path){
+               public virtual Instantiator GetInstantiator(string path){
                        if (!Instantiators.ContainsKey(path))
                                Instantiators [path] = new Instantiator(this, path);
                        return Instantiators [path];
@@ -397,7 +401,7 @@ namespace Crow
                /// try to fetch the requested one in the cache or create it.
                /// They have additional properties for recursivity and
                /// custom display per item type</summary>
-               public ItemTemplate GetItemTemplate(string path){
+               public virtual ItemTemplate GetItemTemplate(string path){
                        if (!Instantiators.ContainsKey(path))
                                Instantiators [path] = new ItemTemplate(this, path);
                        return Instantiators [path] as ItemTemplate;
@@ -1052,7 +1056,7 @@ namespace Crow
                GraphicObject ToolTipContainer = null;
                volatile bool tooltipVisible = false;
 
-               void initTooltip () {
+               protected void initTooltip () {
                        ToolTipContainer = Load  ("#Crow.Tooltip.template");
                        Thread t = new Thread (toolTipThreadFunc);
                        t.IsBackground = true;
@@ -1093,7 +1097,7 @@ namespace Crow
 
                #region Contextual menu
                MenuItem ctxMenuContainer;
-               void initContextMenus (){
+               protected void initContextMenus (){
                        ctxMenuContainer = Load  ("#Crow.ContextMenu.template") as MenuItem;
                }
 
index 2603709195337afb23fe0dffdfe71530676f0684..5a00a594e915a3bdfc79817601ccc87586f1ff74 100644 (file)
@@ -43,7 +43,7 @@ namespace Crow
                int column = 1;
                int line = 1;
 
-               public StyleReader (Interface iface, Stream stream, string resId)
+               public StyleReader (Dictionary<string, Style> styling, Stream stream, string resId)
                        : base(stream)
                {
                        resourceId = resId;
@@ -137,11 +137,11 @@ namespace Crow
                                                        string expression = token.Trim ();
 
                                                        foreach (string tc in targetsClasses) {
-                                                               if (!iface.Styling.ContainsKey (tc))
-                                                                       iface.Styling [tc] = new Style ();
-                                                               else if (iface.Styling [tc].ContainsKey (currentProperty))
+                                                               if (!styling.ContainsKey (tc))
+                                                                       styling [tc] = new Style ();
+                                                               else if (styling [tc].ContainsKey (currentProperty))
                                                                        continue;
-                                                               iface.Styling [tc] [currentProperty] = expression;
+                                                               styling [tc] [currentProperty] = expression;
                                                        }
                                                        token = "";
                                                }