]> O.S.I.I.S - jp/crow.git/commitdiff
wip
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Wed, 12 Dec 2018 18:46:09 +0000 (19:46 +0100)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Wed, 12 Dec 2018 18:46:09 +0000 (19:46 +0100)
22 files changed:
Crow/Crow.NetStd.csproj
Crow/Templates/MessageBox.template
Crow/src/GraphicObjects/GraphicObject.cs
Crow/src/GraphicObjects/Group.cs
Crow/src/GraphicObjects/Label.cs
Crow/src/Instantiator.cs
Crow/src/ItemTemplate.cs
Crow/src/Style.cs
Crow/src/StyleReader.cs
CrowIDE/src/DesignInterface.cs
CrowIDE/src/Editors/CodeBuffer/TextEditor.cs
CrowIDE/src/Editors/ImlSchematicEditor.cs
CrowIDE/src/Editors/Parsers/CSharpParser.cs
CrowIDE/src/Editors/SourceEditor.cs
CrowIDE/src/MemberView/MembersView.cs
CrowIDE/src/MemberView/PropertyContainer.cs
CrowIDE/src/ProjectTree/ProjectFile.cs
CrowIDE/src/ProjectTree/ProjectItem.cs
CrowIDE/ui/editors/EditPaneItems.template
CrowIDE/ui/editors/IMLEdit.itemp
CrowIDE/ui/editors/SourceEditor.crow
CrowIDE/ui/editors/SrcEdit.itemp

index 3bbd24087bdda967e70d1d1cbe4a9901ed788f5a..11c069322df9cabc9a5905811a13b2e93a17e5b1 100644 (file)
@@ -17,7 +17,8 @@
     <EnableDefaultCompileItems>false</EnableDefaultCompileItems>
     <PackOnBuild>true</PackOnBuild>
     <PackageId>Crow</PackageId>
-    <PackageVersion>0.8</PackageVersion>
+    <PackageVersion>0.8.0-beta</PackageVersion>
+<!--    <PackageVersionSuffix>-beta</PackageVersionSuffix>not working-->
     <Authors>JP Bruyère</Authors>
     <Title>C# Rapid Open Widget Toolkit</Title>
     <PackageLicenseUrl>https://opensource.org/licenses/MIT</PackageLicenseUrl>
@@ -25,6 +26,7 @@
     <PackageProjectUrl>https://github.com/jpbruyere/Crow/wiki</PackageProjectUrl>
     <PackageTags>Crow Widget Interface GUI C# .Net Mono</PackageTags>
     <PackageCopyright>Copyright 2013-2018</PackageCopyright>
+    <PackageReleaseNotes></PackageReleaseNotes>
     <Owners>JP Bruyère</Owners>
   </PropertyGroup>
    
@@ -34,9 +36,6 @@
   </PropertyGroup>
   
   <ItemGroup>
-    <PackageReference Include="System.Reflection.Emit.ILGeneration" Version="4.3.0" />
-    <PackageReference Include="System.Reflection.Emit.Lightweight" Version="4.3.0" />
-
     <Compile Include="src\**\*.cs" Exclude="src\Mono.Cairo\NativeMethods-internal.cs" />
         
     <EmbeddedResource Include="Templates\*.*">
index 54016de67771fd2bfe701fd0228866edc4dcf05b..c68bdd717aa5c8a704cb614cb60912f13e8ae3a5 100644 (file)
@@ -17,9 +17,9 @@
                                <GraphicObject Width="5" Height="5"/>
                        </HorizontalStack>
                </Border>
-               <HorizontalStack Margin="5" Width="Stretched">
+               <HorizontalStack Margin="5" >
                        <Image Name="Image" Width="50" Height="30" Path="{./MsgIcon}" />
-                       <Label Margin="5" Font="{./Font}" Width="Stretched" Text="{./Message}"                          
+                       <Label Margin="5" Font="{./Font}" Text="{./Message}"                            
                                TextAlignment="Center"
                                Multiline="true" />             
                </HorizontalStack>
index f4445908416d425e7507170c91551cab937d30a5..fb4f6393adb2190d862db75372b9e3203531ae5f 100644 (file)
@@ -74,7 +74,7 @@ namespace Crow
                //public Dictionary<string,FileLocation> design_iml_locations = new Dictionary<string, FileLocation>();
                public Dictionary<string,FileLocation> design_style_locations = new Dictionary<string, FileLocation>();
 
-               internal void design_add_style_location (string memberName, string path, int line, int col) {
+               internal void design_add_style_location (string memberName, string path, int line, int col) {                   
                        if (design_style_locations.ContainsKey(memberName)){
                                Console.WriteLine ("default value localtion already set for {0}{1}.{2}", this.GetType().Name, this.design_id, memberName);
                                return;
@@ -376,7 +376,7 @@ namespace Crow
                [XmlIgnore]public virtual Rectangle ClientRectangle {
                        get {
                                Rectangle cb = Slot.Size;
-                               cb.Inflate ( - Margin);
+                               cb.Inflate ( - margin);
                                return cb;
                        }
                }
@@ -621,7 +621,7 @@ namespace Crow
                                if (width == value)
                                        return;
                                if (value.IsFixed) {
-                                       if (value < MinimumSize.Width || (value > MaximumSize.Width && MaximumSize.Width > 0))
+                                       if (value < minimumSize.Width || (value > maximumSize.Width && maximumSize.Width > 0))
                                                return;
                                }
                                Measure old = width;
@@ -662,7 +662,7 @@ namespace Crow
                                if (height == value)
                                        return;
                                if (value.IsFixed) {
-                                       if (value < MinimumSize.Height || (value > MaximumSize.Height && MaximumSize.Height > 0))
+                                       if (value < minimumSize.Height || (value > maximumSize.Height && maximumSize.Height > 0))
                                                return;
                                }
                                Measure old = height;
@@ -790,7 +790,7 @@ namespace Crow
                                NotifyValueChanged ("Background", background);
                                RegisterForRedraw ();
                                if (background is SolidColor) {
-                                       if ((Background as SolidColor).Equals (Color.Clear))
+                                       if ((background as SolidColor).Equals (Color.Clear))
                                                clearBackground = true;
                                }
                        }
@@ -1046,9 +1046,9 @@ namespace Crow
 
                        Type thisType = this.GetType ();
 
-                       if (!string.IsNullOrEmpty (Style)) {
-                               if (IFace.DefaultValuesLoader.ContainsKey (Style)) {
-                                       IFace.DefaultValuesLoader [Style] (this);
+                       if (!string.IsNullOrEmpty (style)) {
+                               if (IFace.DefaultValuesLoader.ContainsKey (style)) {
+                                       IFace.DefaultValuesLoader [style] (this);
                                        onInitialized (this, null);
                                        return;
                                }
@@ -1069,10 +1069,10 @@ namespace Crow
                        //2: class name
                        //3: style may have been registered with their ressource ID minus .style extention
                        //   those files being placed in a Styles folder
-                       string styleKey = Style;
-                       if (!string.IsNullOrEmpty (Style)) {
-                               if (IFace.Styling.ContainsKey (Style)) {
-                                       styling.Add (IFace.Styling [Style]);
+                       string styleKey = style;
+                       if (!string.IsNullOrEmpty (style)) {
+                               if (IFace.Styling.ContainsKey (style)) {
+                                       styling.Add (IFace.Styling [style]);
                                }
                        }
                        if (IFace.Styling.ContainsKey (thisType.FullName)) {
@@ -1147,20 +1147,11 @@ namespace Crow
                                        continue;
 
                                object defaultValue;
-                               string name = "";
-                               XmlAttributeAttribute xaa = (XmlAttributeAttribute)pi.GetCustomAttribute (typeof(XmlAttributeAttribute));
-                               if (xaa != null) {
-                                       if (string.IsNullOrEmpty (xaa.AttributeName))
-                                               name = pi.Name;
-                                       else
-                                               name = xaa.AttributeName;
-                               }else
-                                       name = pi.Name;
-                               
+
                                int styleIndex = -1;
                                if (styling.Count > 0){
                                        for (int i = 0; i < styling.Count; i++) {
-                                               if (styling[i].ContainsKey (name)){
+                                               if (styling[i].ContainsKey (pi.Name)){
                                                        styleIndex = i;
                                                        break;
                                                }
@@ -1168,15 +1159,15 @@ namespace Crow
                                }
                                if (styleIndex >= 0){
                                        if (pi.PropertyType.IsEnum)//maybe should be in parser..
-                                               defaultValue = Enum.Parse(pi.PropertyType, (string)styling[styleIndex] [name], true);
+                                               defaultValue = Enum.Parse(pi.PropertyType, (string)styling[styleIndex] [pi.Name], true);
                                        else
-                                               defaultValue = styling[styleIndex] [name];
+                                               defaultValue = styling[styleIndex] [pi.Name];
 
                                        #if DESIGN_MODE
                                        if (defaultValue != null){
-                                               FileLocation fl = styling[styleIndex].Locations[name];
+                                               FileLocation fl = styling[styleIndex].Locations[pi.Name];
                                                il.Emit (OpCodes.Ldloc_0);
-                                               il.Emit (OpCodes.Ldstr, name);
+                                               il.Emit (OpCodes.Ldstr, pi.Name);
                                                il.Emit (OpCodes.Ldstr, fl.FilePath);
                                                il.Emit (OpCodes.Ldc_I4, fl.Line);
                                                il.Emit (OpCodes.Ldc_I4, fl.Column);
@@ -1184,7 +1175,7 @@ namespace Crow
 
                                                il.Emit (OpCodes.Ldloc_0);
                                                il.Emit (OpCodes.Ldfld, typeof(GraphicObject).GetField("design_style_values"));
-                                               il.Emit (OpCodes.Ldstr, name);
+                                               il.Emit (OpCodes.Ldstr, pi.Name);
                                                il.Emit (OpCodes.Ldstr, defaultValue.ToString());
                                                il.Emit (OpCodes.Call, CompilerServices.miDicStrStrAdd);
                                        }
@@ -1377,7 +1368,7 @@ namespace Crow
                                r.Width -= r.Right - cb.Right;
                        if (r.Bottom > cb.Bottom)
                                r.Height -= r.Bottom - cb.Bottom;
-                       if (CacheEnabled && !IsDirty)
+                       if (cacheEnabled && !IsDirty)
                                Clipping.UnionRectangle (r);
                        if (Parent == null)
                                return;
@@ -1414,7 +1405,7 @@ namespace Crow
                /// <summary> return size of content + margins </summary>
                protected virtual int measureRawSize (LayoutingType lt) {
                        return lt == LayoutingType.Width ?
-                               contentSize.Width + 2 * Margin: contentSize.Height + 2 * Margin;
+                               contentSize.Width + 2 * margin: contentSize.Height + 2 * margin;
                }
                /// <summary> By default in groups, LayoutingType.ArrangeChildren is reset </summary>
                public virtual void ChildrenLayoutingConstraints(ref LayoutingType layoutType){
@@ -1490,13 +1481,13 @@ namespace Crow
 
                        switch (layoutType) {
                        case LayoutingType.X:
-                               if (Left == 0) {
+                               if (left == 0) {
 
                                        if (Parent.RegisteredLayoutings.HasFlag (LayoutingType.Width) ||
                                            RegisteredLayoutings.HasFlag (LayoutingType.Width))
                                                return false;
 
-                                       switch (HorizontalAlignment) {
+                                       switch (horizontalAlignment) {
                                        case HorizontalAlignment.Left:
                                                Slot.X = 0;
                                                break;
@@ -1508,7 +1499,7 @@ namespace Crow
                                                break;
                                        }
                                } else
-                                       Slot.X = Left;
+                                       Slot.X = left;
 
                                if (LastSlots.X == Slot.X)
                                        break;
@@ -1520,13 +1511,13 @@ namespace Crow
                                LastSlots.X = Slot.X;
                                break;
                        case LayoutingType.Y:
-                               if (Top == 0) {
+                               if (top == 0) {
 
                                        if (Parent.RegisteredLayoutings.HasFlag (LayoutingType.Height) ||
                                            RegisteredLayoutings.HasFlag (LayoutingType.Height))
                                                return false;
 
-                                       switch (VerticalAlignment) {
+                                       switch (verticalAlignment) {
                                        case VerticalAlignment.Top://this could be processed even if parent Height is not known
                                                Slot.Y = 0;
                                                break;
@@ -1538,7 +1529,7 @@ namespace Crow
                                                break;
                                        }
                                } else
-                                       Slot.Y = Top;
+                                       Slot.Y = top;
 
                                if (LastSlots.Y == Slot.Y)
                                        break;
@@ -1550,7 +1541,7 @@ namespace Crow
                                LastSlots.Y = Slot.Y;
                                break;
                        case LayoutingType.Width:
-                               if (Visible) {
+                               if (isVisible) {
                                        if (Width.IsFixed)
                                                Slot.Width = Width;
                                        else if (Width == Measure.Fit) {
@@ -1566,11 +1557,11 @@ namespace Crow
                                                return false;
 
                                        //size constrain
-                                       if (Slot.Width < MinimumSize.Width) {
-                                               Slot.Width = MinimumSize.Width;
+                                       if (Slot.Width < minimumSize.Width) {
+                                               Slot.Width = minimumSize.Width;
                                                //NotifyValueChanged ("WidthPolicy", Measure.Stretched);
-                                       } else if (Slot.Width > MaximumSize.Width && MaximumSize.Width > 0) {
-                                               Slot.Width = MaximumSize.Width;
+                                       } else if (Slot.Width > maximumSize.Width && maximumSize.Width > 0) {
+                                               Slot.Width = maximumSize.Width;
                                                //NotifyValueChanged ("WidthPolicy", Measure.Stretched);
                                        }
                                } else
@@ -1586,7 +1577,7 @@ namespace Crow
                                LastSlots.Width = Slot.Width;
                                break;
                        case LayoutingType.Height:
-                               if (Visible) {
+                               if (isVisible) {
                                        if (Height.IsFixed)
                                                Slot.Height = Height;
                                        else if (Height == Measure.Fit) {
@@ -1602,11 +1593,11 @@ namespace Crow
                                                return false;
 
                                        //size constrain
-                                       if (Slot.Height < MinimumSize.Height) {
-                                               Slot.Height = MinimumSize.Height;
+                                       if (Slot.Height < minimumSize.Height) {
+                                               Slot.Height = minimumSize.Height;
                                                //NotifyValueChanged ("HeightPolicy", Measure.Stretched);
-                                       } else if (Slot.Height > MaximumSize.Height && MaximumSize.Height > 0) {
-                                               Slot.Height = MaximumSize.Height;
+                                       } else if (Slot.Height > maximumSize.Height && maximumSize.Height > 0) {
+                                               Slot.Height = maximumSize.Height;
                                                //NotifyValueChanged ("HeightPolicy", Measure.Stretched);
                                        }
                                } else
@@ -1641,7 +1632,7 @@ namespace Crow
 
                        Rectangle rBack = new Rectangle (Slot.Size);
 
-                       Background.SetAsSource (gr, rBack);
+                       background.SetAsSource (gr, rBack);
                        CairoHelpers.CairoRectangle (gr, rBack, cornerRadius);
                        gr.Fill ();
 
@@ -1769,7 +1760,7 @@ namespace Crow
                {
                        if (parent == null)
                                return false;
-                       if (!(Visible & isEnabled)||IsDragged)
+                       if (!(isVisible & isEnabled)||IsDragged)
                                return false;
                        if (!parent.PointIsIn(ref m))
                                return false;
@@ -1778,7 +1769,7 @@ namespace Crow
                }
                public virtual bool MouseIsIn(Point m)
                {                       
-                       return (!(Visible & isEnabled)||IsDragged) ? false : PointIsIn (ref m);
+                       return (!(isVisible & isEnabled)||IsDragged) ? false : PointIsIn (ref m);
                }
                public virtual void checkHoverWidget(MouseMoveEventArgs e)
                {
@@ -1791,7 +1782,7 @@ namespace Crow
                }
                public virtual void onMouseMove(object sender, MouseMoveEventArgs e)
                {
-                       if (AllowDrag & HasFocus & e.Mouse.LeftButton == ButtonState.Pressed) {
+                       if (allowDrag & hasFocus & e.Mouse.LeftButton == ButtonState.Pressed) {
                                if (IFace.DragAndDropOperation == null) {
                                        IFace.DragAndDropOperation = new DragDropEventArgs (this);
                                        onStartDrag (this, IFace.DragAndDropOperation);
@@ -1815,12 +1806,12 @@ namespace Crow
                        Debug.WriteLine("MOUSE DOWN => " + this.ToString());
                        #endif
 
-                       if (this.Focusable && !Interface.FocusOnHover) {
+                       if (focusable && !Interface.FocusOnHover) {
                                BubblingMouseButtonEventArg be = e as BubblingMouseButtonEventArg;
                                if (be.Focused == null) {
                                        be.Focused = this;
                                        IFace.FocusedWidget = this;
-                                       if (e.Button == MouseButton.Right && this.ContextCommands != null)
+                                       if (e.Button == MouseButton.Right && contextCommands != null)
                                                IFace.ShowContextMenu (this);                                   
                                }
                        }
@@ -1924,6 +1915,8 @@ namespace Crow
                #endregion
 
                protected virtual void onFocused(object sender, EventArgs e){
+                       if (IFace.FocusedWidget != this)
+                               IFace.FocusedWidget = this;
                        #if DEBUG_FOCUS
                        Debug.WriteLine("Focused => " + this.ToString());
                        #endif
index 13fdcd49d95821eac52e9c1a02078e227fed22fa..435d6e54ece014dce30c6fdf80122f195e284fcb 100644 (file)
@@ -298,9 +298,8 @@ namespace Crow
 
                        childrenRWLock.EnterReadLock ();
 
-                       foreach (GraphicObject g in Children) {
-                               g.Paint (ref gr);
-                       }
+                       for (int i = 0; i < Children.Count; i++) 
+                               Children[i].Paint (ref gr);                     
 
                        childrenRWLock.ExitReadLock ();
                        gr.Restore ();
index 6aba6ee0f99d56242f281d3ab2c5181390949d02..1a7a00107d29132dd6cc87ba19d24c0a95fb8755 100644 (file)
@@ -462,8 +462,8 @@ namespace Crow
                                                cachedTextSize.Height = (int)Math.Ceiling ((fe.Ascent+fe.Descent) * Math.Max (1, lines.Count)) + Margin * 2;
 
                                                try {
-                                                       foreach (string s in lines) {
-                                                               string l = s.Replace ("\t", new String (' ', Interface.TabSize));
+                                                       for (int i = 0; i < lines.Count; i++) {
+                                                               string l = lines[i].Replace ("\t", new String (' ', Interface.TabSize));
 
                                                                TextExtents tmp = gr.TextExtents (l);
 
index c59043b80a246e618ddbfc14ceecbe20ee7b12fa..4f9ee733c5ca7c2d429ff5c59aeb607e2b28a72a 100644 (file)
@@ -333,6 +333,8 @@ namespace Crow.IML
                                                } else {
                                                        using (Stream stream = iface.GetStreamFromPath (itemTemplatePath)) {
                                                                //itemtemplate files may have multiple root nodes
+                                                               if (stream == null)
+                                                                       Debugger.Break ();
                                                                XmlReaderSettings itrSettings = new XmlReaderSettings { ConformanceLevel = ConformanceLevel.Fragment };
                                                                using (XmlReader itr = XmlReader.Create (stream, itrSettings)) {                                                                        
                                                                        while (itr.Read ()) {
index fc893718b429a22355cf1c73318cef7403f740b7..05d7c268e96855a2e91e7f3c4e2385f529647b89 100644 (file)
@@ -180,6 +180,8 @@ namespace Crow
                        gotoItemsContainerNotFound = il.DefineLabel ();
 
                        il.Emit (OpCodes.Ldarg_1);//load sender of expand event
+                       //TODO:double check if items container could be known when expand del is created
+                       //to avoid a find by name
                        il.Emit(OpCodes.Ldstr, "ItemsContainer");//load name to find
                        il.Emit (OpCodes.Callvirt, CompilerServices.miFindByName);
                        il.Emit (OpCodes.Stloc_0);//save items container as loc0
@@ -288,7 +290,7 @@ namespace Crow
                                }
                                miGetDatas = piDatas.GetGetMethod ();
                                if (miGetDatas == null)
-                                       throw new Exception ("Read only property for fetching data in ItemTemplate: " + fetchMethodName);
+                                       throw new Exception ("Write only property for fetching data in ItemTemplate: " + fetchMethodName);
                        }
 
                        il.Emit (OpCodes.Callvirt, miGetDatas);
index 58f09f335797c4a13f0e0278e1dbc3555f1e833d..5ca434a0732511e20c1cb003e25c88d1bc0ac114 100644 (file)
@@ -33,11 +33,13 @@ namespace Crow
                public string FilePath;
                public int Line;
                public int Column;
+               public int Length;
 
-               public FileLocation(string filePath, int line, int column){
+               public FileLocation(string filePath, int line, int column, int length = 0){
                        FilePath = filePath;
                        Line = line;
                        Column = column;
+                       Length = length;
                }
                public override string ToString ()
                {
index c50083eb6af6d61242fafa07aa9b14f0594da132..16a70b80996e7a9beb73a062e0676d736da9b71c 100644 (file)
@@ -160,7 +160,7 @@ namespace Crow
                                                        continue;
                                                styling [tc] [currentProperty] = token;
                                                #if DESIGN_MODE
-                                               styling [tc].Locations[currentProperty] = new FileLocation(resId, line,column);
+                                               styling [tc].Locations[currentProperty] = new FileLocation(resId, line, column - token.Length - 1, token.Length);
                                                #endif
                                                //System.Diagnostics.Debug.WriteLine ("Style: {3} : {0}.{1} = {2}", tc, currentProperty, token, resId);
                                        }
index 7d9b8ad89684acf361a82e330fbb34add6526683..aa82c34dc9682826b3afddf28771f3ddbd84b1f0 100644 (file)
@@ -84,13 +84,9 @@ namespace Crow.Coding
                public override GraphicObject Load (string path)
                {
                        ProjectFile pi;
-                       try {
-                               
-                               if (ProjFile.Project.solution.GetProjectFileFromPath (path, out pi))
-                                       return CreateITorFromIMLFragment (pi.Source).CreateInstance();                                  
-                       } catch (Exception ex) {
-                               
-                       }
+
+                       if (ProjFile.Project.solution.GetProjectFileFromPath (path, out pi))
+                               return CreateITorFromIMLFragment (pi.Source).CreateInstance();                                  
                
                        return null;
                }
@@ -100,9 +96,7 @@ namespace Crow.Coding
                        if (ProjFile.Project.solution.GetProjectFileFromPath (path, out pi)) {
                                return new FileStream (pi.AbsolutePath, FileMode.Open); 
                        }
-                       
-                       Console.WriteLine ("File not found: {0}", path);
-                       return null;
+                       throw new Exception ($"In Design File not found: {path}");
                }
                public override bool ProcessMouseMove (int x, int y)
                {
index 3faa15f1ce644ff65b919444a8b2ca516c9e7bee..214594067d2d5b83a9e83561d0e1eda58a4d091e 100644 (file)
@@ -485,7 +485,7 @@ namespace Crow.Text
                }
                public override void onMouseDown (object sender, MouseButtonEventArgs e)
                {
-                       if (!this.Focusable)
+                       if (!Focusable)
                                return;
 
                        base.onMouseDown (sender, e);
index f7b1bb65cad9e384bea13e32029a6c7c071663c0..e31d1f544d8c4476adb9907d3a9477b92286ef32 100644 (file)
@@ -79,7 +79,7 @@ namespace Crow.Coding
                                RegisterForRedraw ();
                        }
                }
-               [XmlAttributeAttribute]public GraphicObject SelectedItem {
+               public GraphicObject SelectedItem {
                        get { return selectedItem; }
                        set {
                                if (selectedItem == value)
index 62090bc1acfb1295e3ec9ec0f7a4b4631b9ad7f2..11e7259839af95807f5fa27ed7209750f19c133a 100644 (file)
@@ -349,10 +349,12 @@ namespace Crow.Coding
                                        }
 
                                        switch (cl.Tokens [tokPtr].Type) {
+                                       case TokenType.BlockCommentStart:
                                        case TokenType.OpenBlock:
                                                currentNode = addChildNode (currentNode, cl, tokPtr);
                                                break;
-                                       case TokenType.CloseBlock:                                              
+                                       case TokenType.CloseBlock:
+                                       case TokenType.BlockCommentEnd:
                                                closeNodeAndGoUp (ref currentNode, cl);
                                                break;
                                        case TokenType.Preprocessor:
@@ -369,7 +371,7 @@ namespace Crow.Coding
                                }
                                ptrLine++;
                        }
-                       ptrLine = 0;
+                       /*ptrLine = 0;
                        while (ptrLine < buffer.LineCount) {
                                CodeLine cl = buffer [ptrLine];
                                if (cl.IsFoldable) {
@@ -377,7 +379,7 @@ namespace Crow.Coding
                                                cl.IsFolded = true;
                                }
                                ptrLine++;
-                       }
+                       }*/
                }
        }
 }
index 0be5cfc6d25ed6bf2e8bf91e9c4d61efa49f6463..d1e1ba8e40a1cd83e1e28d1527596540580ca65e 100644 (file)
@@ -214,9 +214,9 @@ namespace Crow.Coding
                {
                        Debug.WriteLine("\t\tSourceEditor updateEditorFromProjFile");
 
-                       buffer.editMutex.EnterWriteLock ();
+                       //buffer.editMutex.EnterWriteLock ();
                        loadSource ();
-                       buffer.editMutex.ExitWriteLock ();
+                       //buffer.editMutex.ExitWriteLock ();
 
                        isDirty = false;
                        oldSource = projFile.Source;
@@ -564,7 +564,7 @@ namespace Crow.Coding
                                                mgFg = Color.White;
                                        else
                                                mgFg = Color.LightGrey;
-                               }else if (buffer.CurrentLine == lineIndex) {
+                               }else if (buffer.CurrentLine == lineIndex && HasFocus) {
                                        mgFg = Color.Black;
                                        mgBg = Color.DarkGrey;
                                }
@@ -997,7 +997,14 @@ namespace Crow.Coding
                        buffer.GotoWordEnd ();
                        buffer.SetSelEndPos ();
                }
-
+               public void MakeSelection (int lineStart, int colStart, int lineEnd, int colEnd) {
+                       buffer.CurrentLine = lineStart;
+                       buffer.CurrentColumn = colStart;
+                       buffer.SetSelStartPos ();
+                       buffer.CurrentLine = lineEnd;
+                       buffer.CurrentColumn = colEnd;
+                       buffer.SetSelEndPos ();
+               }
                public override void onMouseWheel (object sender, MouseWheelEventArgs e)
                {
                        base.onMouseWheel (sender, e);
index d8a9ddcd7660bc2d9de1ba9cb9e787ad93d01b5f..359973b04ea1dccf77ca04960abf7cfe08c0c640 100644 (file)
@@ -40,7 +40,7 @@ namespace Crow.Coding
                //Dictionary<string,PropertyContainer[]> propContainersCache = new Dictionary<string, PropertyContainer[]>();
                Dictionary<string,List<CategoryContainer>> categoryContainersCache = new Dictionary<string,List<CategoryContainer>> ();
 
-               [XmlAttributeAttribute][DefaultValue(null)]
+               [DefaultValue(null)]
                public virtual object Instance {
                        get { return instance; }
                        set {
index b4e54f6bab70d393f16b934b5bc0dea0d12f8605..af3eea6ef40632fb43670de9d6cf5a3fa4fefa26 100644 (file)
@@ -177,7 +177,7 @@ namespace Crow.Coding
 
 
                public Fill LabForeground {
-                       get { return IsSetByIML ? Color.DarkBlue : HasStyling ? Color.Black : Color.DimGrey;}
+                       get { return IsSetByIML ? Color.DarkBlue : HasStyling ? Color.Black : Color.Grey;}
                }
 
                /// <summary>
@@ -202,12 +202,15 @@ namespace Crow.Coding
                        ProjectFile pf;
                        if (!mview.ProjectNode.Project.TryGetProjectFileFromPath ("#" + fl.FilePath, out pf))
                                return;
-                       Solution s = mview.ProjectNode.Project.solution;
-                       if (!s.OpenedItems.Contains (pf))                               
-                               s.OpenedItems.AddElement (pf);
-                       Debug.WriteLine (fl);
+
+                       if (!pf.IsOpened)
+                               pf.Open ();
+
                        pf.CurrentLine = fl.Line;
                        pf.CurrentColumn = fl.Column;
+
+                       pf.IsSelected = true;
+
                }
 
                public override string ToString ()
index 2c60c32ceb01083d195a73e879c9c97b26e6da1e..611f1d8b058cc6bd8e02724222a4e318d10f5467 100644 (file)
@@ -315,21 +315,11 @@ namespace Crow.Coding
                        if (IsDirty) {
                                MessageBox mb = MessageBox.ShowModal (CrowIDE.MainIFace,
                                                        MessageBox.Type.YesNoCancel, $"{DisplayName} has unsaved changes.\nSave it now?");
-                               mb.Yes += onClickSaveAndCloseNow;
-                               mb.No += onClickCloseNow;
+                               mb.Yes += (object _sender, EventArgs _e) => { Save (); Close (); };
+                               mb.No += (object _sender, EventArgs _e) => Close();
                        } else
                                Close ();
                }
-
-               void onClickCloseNow (object sender, EventArgs e)
-               {
-                       Close ();
-               }
-               void onClickSaveAndCloseNow (object sender, EventArgs e)
-               {
-                       Save ();
-                       Close ();
-               }
        }
 }
 
index 89889ca3d1dca395c46ed99127cddf15ff15297b..695e372bafc61d425d7a8e9789af0a6e56711e99 100644 (file)
@@ -45,14 +45,11 @@ namespace Crow.Coding
 
         public override Picture Icon {
             get {
-                Console.WriteLine("extension="+Extension);
-
                 switch (Extension)
                 {
                     case ".cs":
                         return new SvgPicture("#icons.cs-file.svg");
-                    case ".crow":
-                        Console.WriteLine("loading icons.xml-file");
+                    case ".crow":                        
                         return new SvgPicture("#icons.xml-file.svg");
                     case ".xml":
                         return new SvgPicture("#icons.xml-file.svg");
index 5e71222810e51e4e6d55f79ebdb97a72d344772d..16db55f62e46be097520d339e4d84775c4d31ed6 100644 (file)
@@ -8,6 +8,7 @@
 <ItemTemplate Path="#Crow.Coding.ui.editors.SrcEdit.itemp" DataType=".cs"/>
 <ItemTemplate Path="#Crow.Coding.ui.editors.SrcEdit.itemp" DataType=".style"/>
 <ItemTemplate Path="#Crow.Coding.ui.editors.IMLEdit.itemp" DataType=".crow"/>
+<ItemTemplate Path="#Crow.Coding.ui.editors.IMLEdit.itemp" DataType=".itemp"/>
 <ItemTemplate Path="#Crow.Coding.ui.editors.IMLEdit.itemp" DataType=".template"/>
 <ItemTemplate DataType=".goml">
        <TabItem Caption="{DisplayName}" QueryClose="OnQueryClose">
index 84c0063262bc58763c0d9a93a86671ff752edc70..b90594f0b211032fd474d1e98f9e231b1176ea74 100644 (file)
@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <TabItem QueryClose="OnQueryClose" IsSelected="{²IsSelected}" Template="#Crow.Coding.EditTabItem.template">
-
        <VerticalStack>
         <VerticalStack Height="60%">
                <Label DataSource="{../editor.HoverWidget}" Width="Stretched" Margin="2" Text="{Name}"/>
@@ -11,7 +10,7 @@
                                                VerticalAlignment="Top" HorizontalAlignment="Left" Margin="4"
                                                ContextCommands="{/Commands}"
                                                AllowDrop="true" AllowDrag="true" Focusable="true"
-                                               UpdateEnabled="{../../../../../../IsSelected}"
+                                               UpdateEnabled="{IsSelected}"
                                                ProjectNode="{}" SelectedItem="{²SelectedItem}"/>
                                </Scroller>
                                <ScrollBar Name="scrollbar1" Orientation="Vertical"                    
index eb4cfd80df6be349b214ff6d73ee6acb3ef4d3b0..3f1115bd1811876868d5a4578e5092cd497a271a 100644 (file)
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <VerticalStack>
        <HorizontalStack >
-               <SourceEditor Focusable="true" Name="editor" Font="monospace, 12" VerticalAlignment="Top" Margin="10"
-                               CurrentLine="{²CurrentLine}" CurrentColumn="{²CurrentColumn}"
+               <SourceEditor Focusable="true" Name="editor" Font="monospace, 12" VerticalAlignment="Top" Margin="2"
+                               CurrentLine="{²CurrentLine}" CurrentColumn="{²CurrentColumn}" HasFocus="{IsSelected}"
                                Foreground="Jet" Background="White" Width="Stretched" Height="Stretched"
                                ProjectNode="{}"  KeyDown="textView_KeyDown"/>
                <ScrollBar Name="scrollbarY" Value="{²../editor.ScrollY}"
index 4f473515a914905d3176e3072a7b4bc9daea9064..1d29e8c1648421b668f2de77127672b5058434a9 100644 (file)
@@ -1,4 +1,4 @@
 <?xml version="1.0" encoding="UTF-8" ?>
-<TabItem Caption="{DisplayName}" QueryClose="OnQueryClose" Template="#Crow.Coding.EditTabItem.template">
+<TabItem QueryClose="OnQueryClose" IsSelected="{²IsSelected}" Template="#Crow.Coding.EditTabItem.template">
        <IMLContainer Path="#Crow.Coding.ui.editors.SourceEditor.crow"/>
 </TabItem>
\ No newline at end of file