]> O.S.I.I.S - jp/crow.git/commitdiff
wip
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Thu, 15 Apr 2021 04:28:27 +0000 (06:28 +0200)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Thu, 15 Apr 2021 04:28:27 +0000 (06:28 +0200)
57 files changed:
Crow/Crow.csproj
Crow/Default.style
Crow/src/Colors.cs
Crow/src/DebugUtils/DbgEvent.cs
Crow/src/DebugUtils/DbgWidgetEvent.cs
Crow/src/DebugUtils/DbgWidgetRecord.cs
Crow/src/DebugUtils/DebugLogger.cs
Crow/src/EventArgs/ListChangedEventArg.cs
Crow/src/IML/CompilerServices.cs
Crow/src/IObservableList.cs
Crow/src/Interface.cs
Crow/src/ObservableList.cs
Crow/src/Widgets/Border.cs
Crow/src/Widgets/DockStack.cs
Crow/src/Widgets/DockWindow.cs
Crow/src/Widgets/HorizontalStack.cs
Crow/src/Widgets/Label.cs
Crow/src/Widgets/MenuItem.cs
Crow/src/Widgets/OldLabel.cs
Crow/src/Widgets/TabView.cs
Crow/src/Widgets/TemplatedGroup.cs
Crow/src/Widgets/Wrapper.cs
Samples/DebugLogAnalyzer/DebugLogAnalyzer.csproj
Samples/DebugLogAnalyzer/src/DbgEventWidget.cs
Samples/DebugLogAnalyzer/src/DbgLogViewer.cs
Samples/DebugLogAnalyzer/src/DebugInterfaceWidget.cs
Samples/DebugLogAnalyzer/src/Program.cs
Samples/DebugLogAnalyzer/ui/ComboBox.template [new file with mode: 0644]
Samples/DebugLogAnalyzer/ui/DbgEventTreeItems.itemp
Samples/DebugLogAnalyzer/ui/DbgEventView.template [new file with mode: 0644]
Samples/DebugLogAnalyzer/ui/DebugLog.crow
Samples/DebugLogAnalyzer/ui/WidgetRecord.itemp [new file with mode: 0644]
Samples/DebugLogAnalyzer/ui/dbg.style
Samples/DebugLogAnalyzer/ui/dockWindows/winLogGraph.crow [new file with mode: 0644]
Samples/DebugLogAnalyzer/ui/main.crow
Samples/ShowCase/ui/showcase.crow
Samples/common/Editor.cs
Samples/common/ui/Interfaces/Divers/fitListWithStretchedItems.crow [new file with mode: 0644]
Samples/common/ui/Interfaces/Divers/progress.crow [new file with mode: 0644]
Samples/common/ui/Interfaces/Divers/splitterWithScrollBar.crow [new file with mode: 0644]
Samples/common/ui/Interfaces/Experimental/menu.crow
Samples/common/ui/Interfaces/Experimental/menuAllCommands.crow [new file with mode: 0644]
Samples/common/ui/Interfaces/Experimental/menuAllCommands2.crow [new file with mode: 0644]
Samples/common/ui/Interfaces/Experimental/menuAllCommands3.crow [new file with mode: 0644]
Samples/common/ui/Interfaces/Experimental/menus.crow [new file with mode: 0644]
Samples/common/ui/Interfaces/Experimental/tabView1.crow [new file with mode: 0644]
Samples/common/ui/Interfaces/Experimental/tabViewUpdate.crow [new file with mode: 0644]
Samples/common/ui/Interfaces/Experimental/table.crow
Samples/common/ui/Interfaces/Experimental/tabviewOrientation.crow [new file with mode: 0644]
Samples/common/ui/Interfaces/Experimental/tabviewOrientationDynamic.crow [new file with mode: 0644]
Samples/common/ui/Interfaces/Experimental/tabviewTest.crow
Samples/common/ui/Interfaces/Experimental/tabviewTestVertical2.crow
Samples/common/ui/Interfaces/Experimental/treeViewMenu.crow [new file with mode: 0644]
Samples/common/ui/Interfaces/GraphicObject/blueLine.crow [new file with mode: 0644]
Samples/common/ui/Interfaces/Stack/StretchedInFit.crow
Samples/common/ui/Interfaces/Stack/StretchedInFit2.crow
Samples/common/ui/templates/MenuItem.itemp [new file with mode: 0644]

index 86b42dab2f191c3d5b6d77147440c56cb0675ca8..7004eb0d22cb40b24a385019008497a93c69e0ea 100644 (file)
@@ -31,7 +31,7 @@
        </PropertyGroup>
        <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
                <DebugType>full</DebugType>
-               <DefineConstants>$(DefineConstants);DEBUG;TRACE;_DEBUG_DISPOSE;_DEBUG_BINDING;_DEBUG_CLIP_RECTANGLE</DefineConstants>
+               <DefineConstants>$(DefineConstants);DEBUG;TRACE;_DEBUG_DISPOSE;_DEBUG_BINDING;_DEBUG_CLIP_RECTANGLE;_DEBUG_DRAGNDROP</DefineConstants>
                <CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
        </PropertyGroup>
        <ItemGroup Condition="$(TargetFramework.StartsWith('netstandard'))">
index 3c09d3b9fed7ac57e6dc09298cf028c712cdbcb6..f482eb0b85ab4a89c9c4992f275922cc8e89232c 100644 (file)
@@ -23,7 +23,7 @@ WindowTitleBarForeground = "White";
 
 MenuBackground = "Jet";
 
-InactiveTabItem = "Jet";
+InactiveTabItem = "DarkGrey";
 
 Button, CheckBox, RadioButton, ComboBox, Expandable,
 MessageBox, Popper, Slider, Spinner, TextBox {
@@ -292,4 +292,16 @@ ColorSlider {
 ColorPicker {
        Height="Fit";
        MinimumSize="200,100";  
+}
+TableRow {
+       Width="Stretched";
+}
+TableHeaderRow {
+       Height="Fit";
+       Width="Stretched";//TODO:Force it to stretched programmatically
+}
+TableHeaderLabel {
+       Margin = "1";
+       Background = "Jet";
+       Foreground = "LightGrey";
 }
\ No newline at end of file
index 1318764cd08d5c468a94e80a7ae6683b5983974f..c11520315830640c00b3a872263fbcfaa925bb8c 100644 (file)
@@ -13,7 +13,7 @@ namespace Crow
        {
                AliceBlue            = 0xF0F8FFFF,
                AntiqueWhite         = 0xFAEBD7FF,
-               Aqua                 = 0x00FFFFFF,
+               //Aqua                 = 0x00FFFFFF,
                Aquamarine           = 0x7FFFD4FF,
                Azure                = 0xF0FFFFFF,
                Beige                = 0xF5F5DCFF,
index 1c0b79af1b3ab35cf11ef1ef59654e6d09480a4c..c43cc15a876501a1b1d6ae718e4f19d14b17a9ae 100644 (file)
@@ -18,8 +18,8 @@ namespace Crow.DebugLogger
                public bool HasChildEvents => Events != null && Events.Count > 0;
                public override long Duration => end - begin;
                public double DurationMS => Math.Round ((double)Duration / Stopwatch.Frequency * 1000.0, 4);
-               public double BeginMS => Math.Round ((double)begin / Stopwatch.Frequency * 1000.0, 4);
-               public double EndMS => Math.Round ((double)end / Stopwatch.Frequency * 1000.0, 4);
+               public double BeginMS => Math.Round ((double)begin / Stopwatch.Frequency, 6);
+               public double EndMS => Math.Round ((double)end / Stopwatch.Frequency, 6);
                public virtual bool IsWidgetEvent => false;
                public virtual bool IsLayoutEvent => false;
 
index ae363999aba18f89686e64b935530975d7c1e01d..9b9a2b15192bf8bbf9fb0eff1614d6898377d071 100644 (file)
@@ -23,6 +23,10 @@ namespace Crow.DebugLogger
                public override Color Color {
                        get {
                                switch (type) {
+                               case DbgEvtType.GOMeasure:
+                               case DbgEvtType.GOSearchLargestChild:
+                               case DbgEvtType.GOSearchTallestChild:
+                                       return Colors.HotPink;
                                case DbgEvtType.GOClassCreation:
                                        return Colors.DarkSlateGrey;
                                case DbgEvtType.GOInitialization:
@@ -32,7 +36,7 @@ namespace Crow.DebugLogger
                                case DbgEvtType.GORegisterClip:
                                        return Colors.Turquoise;
                                case DbgEvtType.GOResetClip:
-                                       return Colors.DarkRed;
+                                       return Colors.DarkSalmon;
                                case DbgEvtType.GORegisterForGraphicUpdate:
                                        return Colors.LightPink;
                                case DbgEvtType.GOEnqueueForRepaint:
index 0dd676f7f096bc2abf59b4433f3ccad357ae394f..2fde7377e06465157fa4464828855c7933335231 100644 (file)
@@ -21,7 +21,7 @@ namespace Crow.DebugLogger
                public string name;
                //0 is the main graphic tree, for other obj tree not added to main tree, it range from 1->n
                //useful to track events for obj shown later, not on start
-               public int treeIndex;
+               public int InstanceIndex;
                public int yIndex;//index in parenting, the whole main graphic tree is one continuous suite
                public int xLevel;//depth
                public String Width;
@@ -34,10 +34,11 @@ namespace Crow.DebugLogger
                                return null;
                        string [] tmp = str.Trim ().Split (';');
                        g.name = tmp [0];
-                       g.yIndex = int.Parse (tmp [1]);
-                       g.xLevel = int.Parse (tmp [2]);
-                       g.Width = tmp [3];
-                       g.Height = tmp [4];
+                       g.InstanceIndex = int.Parse (tmp [1]);
+                       g.yIndex = int.Parse (tmp [2]);
+                       g.xLevel = int.Parse (tmp [3]);
+                       g.Width = tmp [4];
+                       g.Height = tmp [5];
                        return g;
                }
 
index eb096f80de6750ae1c0fa2c137c1836e7875219b..3a65ad556fcb28bf8e3f167c701a45eae4ea6db7 100644 (file)
@@ -104,10 +104,11 @@ namespace Crow
                        lock (logMutex) {
                                chrono.Stop ();
                                if (!startedEvents.ContainsKey (Thread.CurrentThread.ManagedThreadId))
-                                       throw new Exception ("Current thread has no event started");
+                                       throw new Exception ($"Current thread has no event started\n{new System.Diagnostics.StackTrace()}");
+
                                DbgLayoutEvent e = startedEvents[Thread.CurrentThread.ManagedThreadId].Pop () as DbgLayoutEvent;
                                if (e?.type != evtType)
-                                       throw new Exception ($"Begin/end event logging mismatch: {e.type}/{evtType}");
+                                       throw new Exception ($"Begin/end event logging mismatch: {e.type}/{evtType}\n{new System.Diagnostics.StackTrace()}");
                                e.end = chrono.ElapsedTicks;
                                e.SetLQI (lqi.LayoutType, lqi.result, lqi.Slot, lqi.NewSlot);
                                chrono.Start ();
@@ -177,23 +178,18 @@ namespace Crow
                        return evt;
                }
 
-               static void parseTree (Widget go, int level = 0, int y = 1) {
+               static void parseTree (Widget go, int xLevel = 1, int y = 0) {
                        if (go == null)
                                return;
 
                        go.yIndex = y;
-                       go.xLevel = level;
+                       go.xLevel = xLevel;
 
-                       Group gr = go as Group;
-                       if (gr != null) {
-                               foreach (Widget g in gr.Children) 
-                                       parseTree (g, level + 1, y + 1);
-
-                       } else {
-                               PrivateContainer pc = go as PrivateContainer;
-                               if (pc != null)
-                                       parseTree (pc.getTemplateRoot, level + 1, y + 1);                               
-                       }
+                       if (go is Group gr) {
+                               for (int i = 0; i < gr.Children.Count; i++)                             
+                                       parseTree (gr.Children[i], xLevel + 1, i);
+                       } else if (go is PrivateContainer pc)
+                               parseTree (pc.getTemplateRoot, xLevel + 1);             
                }
                static void saveEventList (StreamWriter s, List<DbgEvent> evts, int level = 0)
                {
@@ -235,23 +231,34 @@ namespace Crow
 #endif
                }
                [Conditional("DEBUG_LOG")]
-               public static void Save(Interface iface, Stream stream) {                       
+               public static void Save(Interface iface, Stream stream, int startingWidgetsIndex = -1, bool saveEvents = true) {                        
 #if DEBUG_LOG
                        using (StreamWriter writer = new StreamWriter (stream, Encoding.UTF8, 1024, true)) {
                                lock (logMutex)
                                lock (iface.UpdateMutex) {
                                        chrono.Stop();
-                                       foreach (Widget go in iface.GraphicTree)
-                                               parseTree (go);
 
-                                       writer.WriteLine ("[GraphicObjects]");
-                                       for (int i = 0; i < Widget.GraphicObjects.Count; i++) {
-                                               Widget g = Widget.GraphicObjects [i];
-                                               writer.WriteLine ($"{g.GetType ().Name};{g.yIndex};{g.xLevel};{g.Width};{g.Height}");
+                                       if (startingWidgetsIndex >= 0 ) {
+                                               foreach (Widget go in iface.GraphicTree)
+                                                       parseTree (go);
+
+                                               if (saveEvents)
+                                                       writer.WriteLine ("[GraphicObjects]");
+                                               for (int i = startingWidgetsIndex; i < Widget.GraphicObjects.Count; i++) {
+                                                       Widget g = Widget.GraphicObjects [i];
+                                                       writer.WriteLine ($"{g.GetType ().Name};{g.instanceIndex};{g.yIndex};{g.xLevel};{g.Width};{g.Height}");
+                                               }
                                        }
-                               
-                                       writer.WriteLine ("[Events]");
-                                       saveEventList (writer, events);
+
+                                       if (saveEvents) {
+                                               if (startingWidgetsIndex >= 0)                          
+                                                       writer.WriteLine ("[Events]");
+                                               saveEventList (writer, events);
+                                       }
+                                       if (startedEvents.Count > 0)
+                                               Console.WriteLine ($"[DebugLogger]Warning: Started events not null when events saved!");
+                                       startedEvents.Clear ();
+                                       events.Clear ();
                                        chrono.Start();
                                }
                        }
@@ -267,20 +274,24 @@ namespace Crow
                public static void Load (Stream stream, List<DbgEvent> events, List<DbgWidgetRecord> widgets)
                {                       
                        using (StreamReader reader = new StreamReader (stream)) {
-                       
-                               if (reader.ReadLine () != "[GraphicObjects]")
-                                       return;
-                               while (!reader.EndOfStream) {
-                                       string l = reader.ReadLine ();
-                                       if (l == "[Events]")
-                                               break;
-                                       DbgWidgetRecord o = DbgWidgetRecord.Parse (l);
-                                       o.listIndex = widgets.Count;
-                                       widgets.Add (o);
+                               
+                               if (widgets != null) {
+                                       if (events != null && reader.ReadLine () != "[GraphicObjects]")
+                                               return;
+                                       while (!reader.EndOfStream) {
+                                               string l = reader.ReadLine ();
+                                               if (l == "[Events]")
+                                                       break;
+                                               DbgWidgetRecord o = DbgWidgetRecord.Parse (l);
+                                               o.listIndex = widgets.Count;
+                                               widgets.Add (o);
+                                       }
                                }
 
-                               Stack<DbgEvent> startedEvents = new Stack<DbgEvent> ();
+                               if (events == null)
+                                       return;
 
+                               Stack<DbgEvent> startedEvents = new Stack<DbgEvent> ();
                                if (!reader.EndOfStream) {
                                        while (!reader.EndOfStream) {
                                                int level = 0;
@@ -308,12 +319,14 @@ namespace Crow
                                                        }
                                                }
                                                startedEvents.Push (evt);
-                                               if (evt.type.HasFlag (DbgEvtType.Widget)) {
+                                               /*if (evt.type.HasFlag (DbgEvtType.Widget)) {
                                                        DbgWidgetEvent dwe =  evt as DbgWidgetEvent;
                                                        if (dwe.InstanceIndex >= 0)
                                                                widgets [dwe.InstanceIndex].Events.Add (evt);
-                                               }
+                                               }*/
                                        }
+                                       startedEvents.Pop();
+
                                }
                        }
                }
index 3651e3baf8f311cebdbece8cf2e7dd2dd5891d2e..2d8553b8b74e8f85564fd20dafb9a0de2f65cb82 100644 (file)
@@ -2,6 +2,8 @@
 //
 // This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
 using System;
+using System.Collections.Generic;
+
 namespace Crow
 {
        public class ListChangedEventArg : EventArgs
@@ -14,4 +16,11 @@ namespace Crow
                        Element = element;
                }
        }
+       public class ListClearEventArg : EventArgs
+       {
+               public IEnumerable<object> Elements;
+               public ListClearEventArg (IEnumerable<object> elements) {                       
+                       Elements = elements;
+               }
+       }
 }
index fc22d1e1582f2528e7305ee54ab2783adb361824..644902f0fa2782146a7b8b6e1d721fd296629e30 100644 (file)
@@ -77,7 +77,7 @@ namespace Crow.IML
                internal static MethodInfo miGetDataSource = typeof(Widget).GetProperty("DataSource").GetGetMethod ();
                internal static EventInfo eiLogicalParentChanged = typeof(Widget).GetEvent("LogicalParentChanged");
 
-               internal static MethodInfo miIFaceCreateInstance = typeof(Interface).GetMethod ("CreateInstance", BindingFlags.Instance | BindingFlags.Public);
+               internal static MethodInfo miIFaceCreateInstance = typeof(Interface).GetMethods().First (m => m.Name == "CreateInstance" && m.IsGenericMethod == false);
                internal static MethodInfo miGetITemp = typeof(Interface).GetMethod ("GetItemTemplate", BindingFlags.Instance | BindingFlags.Public);
 
                internal static MethodInfo miAddITemp = typeof(Dictionary<string, ItemTemplate>).GetMethod ("set_Item", new Type[] { typeof(string), typeof(ItemTemplate) });
index 4fab1e81a8f6e1c3b727f7e521e5e9cb39294736..4c8ae2365fde8501dc6b07d0409b97d7e8952f52 100644 (file)
@@ -10,7 +10,7 @@ namespace Crow
                event EventHandler<ListChangedEventArg> ListAdd;
                event EventHandler<ListChangedEventArg> ListRemove;
                event EventHandler<ListChangedEventArg> ListEdit;
-               event EventHandler<ListChangedEventArg> ListClear;
+               event EventHandler<ListClearEventArg> ListClear;
 
                void Insert ();
                void Remove ();
index 5fc9d2b9e0beb4c5d9845fd2f8832f508d75efb1..60f0e22149e51645a5930dd1c80e3da3357fdc96 100644 (file)
@@ -721,6 +721,14 @@ namespace Crow
                                return tmp;
                        }
                }
+               public T LoadIMLFragment<T> (string imlFragment) where T : Widget
+                {
+                       lock (UpdateMutex) {
+                               T tmp = CreateITorFromIMLFragment (imlFragment).CreateInstance<T>();
+                               AddWidget (tmp);
+                               return tmp;
+                       }
+               }
                /// <summary>
                /// Create an instantiator bound to this interface from the IML fragment
                /// </summary>
@@ -746,6 +754,18 @@ namespace Crow
                                return tmp;
                        }
                }
+               public T Load<T> (string path) where T : Widget
+               {
+                       lock (UpdateMutex) {
+                               DbgLogger.StartEvent (DbgEvtType.IFaceLoad);
+
+                               T tmp = CreateInstance<T> (path);
+                               AddWidget (tmp);
+
+                               DbgLogger.EndEvent (DbgEvtType.IFaceLoad);
+                               return tmp;
+                       }
+               }
                /// <summary>
                /// Create an instance of a GraphicObject linked to this interface but not added to the GraphicTree
                /// </summary>
@@ -753,6 +773,8 @@ namespace Crow
                /// <param name="path">path of the iml file to load</param>
                public virtual Widget CreateInstance (string path)
                        => GetInstantiator (path).CreateInstance ();
+               public virtual T CreateInstance<T> (string path) where T : Widget
+                       => GetInstantiator (path).CreateInstance<T> ();
                /// <summary>
                /// Fetch instantiator from cache or create it.
                /// </summary>
@@ -985,13 +1007,6 @@ namespace Crow
 
                                ctx.PushGroup ();
 
-                               for (int i = 0; i < clipping.NumRectangles; i++)
-                                       ctx.Rectangle (clipping.GetRectangle (i));
-
-                               ctx.ClipPreserve ();
-                               ctx.Operator = Operator.Clear;
-                               ctx.Fill ();
-                               ctx.Operator = Operator.Over;                           
 
                                for (int i = GraphicTree.Count -1; i >= 0 ; i--){
                                        Widget p = GraphicTree[i];
@@ -1031,6 +1046,15 @@ namespace Crow
 #endif
 
                                ctx.PopGroupToSource ();
+                               
+                               for (int i = 0; i < clipping.NumRectangles; i++)
+                                       ctx.Rectangle (clipping.GetRectangle (i));
+
+                               ctx.ClipPreserve ();
+                               ctx.Operator = Operator.Clear;
+                               ctx.Fill ();
+                               ctx.Operator = Operator.Over;                           
+
 
                                ctx.Paint ();
                                        
@@ -1698,10 +1722,10 @@ namespace Crow
 
                        if (e.LayoutType == LayoutingType.X) {
                                if (ttc.Slot.Right > clientRectangle.Right)
-                                       ttc.Left = clientRectangle.Right - ttc.Slot.Width;                                              
+                                       ttc.Left = MousePosition.X - ttc.Slot.Width - 10;
                        }else if (e.LayoutType == LayoutingType.Y) {
                                if (ttc.Slot.Bottom > clientRectangle.Bottom)
-                                       ttc.Top = clientRectangle.Bottom - ttc.Slot.Height;
+                                       ttc.Top = MousePosition.Y - ttc.Slot.Height - 10;
                        }/*
                                if (ttc.Slot.Height < tc.ClientRectangle.Height) {
                                        if (PopDirection.HasFlag (Alignment.Bottom)) {
index 6d7b71c751704f018d1a7f4a25ba5f694d96c7a9..8cb648064aecdc0c6fc52a820fd7519ff51eac71 100644 (file)
@@ -5,6 +5,7 @@
 
 using System;
 using System.Collections.Generic;
+using System.Linq;
 
 namespace Crow
 {
@@ -21,7 +22,7 @@ namespace Crow
                public event EventHandler<ListChangedEventArg> ListAdd;
                public event EventHandler<ListChangedEventArg> ListRemove;
                public event EventHandler<ListChangedEventArg> ListEdit;
-               public event EventHandler<ListChangedEventArg> ListClear;
+               public event EventHandler<ListClearEventArg> ListClear;
                #endregion
 
                public ObservableList() : base () {}
@@ -57,13 +58,17 @@ namespace Crow
                }
                public new void Remove (T elem) {
                        int idx = IndexOf (elem);
-                       base.RemoveAt (idx);
+                       if (idx < 0)
+                               Console.WriteLine ($"ObsList.Remove idx < 0: {new System.Diagnostics.StackTrace()}");
+                       else
+                               base.RemoveAt (idx);
                        ListRemove.Raise (this, new ListChangedEventArg (idx, elem));
                }
                public new void Clear ()
                {
+                       ListClearEventArg eventArg = new ListClearEventArg (this.Cast<object>());
                        base.Clear ();
-                       ListClear.Raise (this, null);
+                       ListClear.Raise (this, eventArg);
                }
                public void Remove () {
                        if (selectedIndex < 0)
index b308f00f72cfa17403603e732b146876d9578efb..c702d9ac4440fb951a8334da1cf68552877f390b 100644 (file)
@@ -87,19 +87,19 @@ namespace Crow
                #endregion
 
                #region GraphicObject override
-               [XmlIgnore]public override Rectangle ClientRectangle {
+               /*[XmlIgnore]public override Rectangle ClientRectangle {
                        get {
                                Rectangle cb = base.ClientRectangle;
                                cb.Inflate (- BorderWidth);
                                return cb;
                        }
-               }
+               }*/
 
-               public override int measureRawSize (LayoutingType lt)
+               /*public override int measureRawSize (LayoutingType lt)
                {
                        int tmp = base.measureRawSize (lt);
                        return tmp < 0 ? tmp : tmp + 2 * BorderWidth;
-               }
+               }*/
                protected override void onDraw (Context gr)
                {
                        drawborder2 (gr);
index f0eaa1762d5bbc217b0839e015f450eaba8b951f..df1cc6f11e8c53da966b7e957cdb22f204cf7e68 100644 (file)
@@ -325,14 +325,14 @@ namespace Crow
                        dw.savedSlot = Rectangle.Parse (getConfAttrib (conf, ref i));
                        dw.wasResizable = Boolean.Parse (getConfAttrib (conf, ref i));
                        dw.Resizable = false;
-
-                       dw.IsDocked = true;
+                       
                        dw.DataSource = dataSource;
                        return dw;
                }
                void importConfig (string conf, ref int i, object dataSource) {                                         
                        if (conf [i++] != '(')
-                               return;                 
+                               return;
+                       DockWindow dw = null;                   
                        while (i < conf.Length - 4) {
                                string sc = conf.Substring (i, 4);
                                i += 4;
@@ -343,12 +343,17 @@ namespace Crow
                                        tv.Height = Measure.Parse (getConfAttrib (conf, ref i));
                                        this.AddChild (tv);
                                        i++;                                    
-                                       while (conf [i] != ')')
-                                               tv.AddItem (importDockWinConfig (conf, ref i, dataSource));
+                                       while (conf [i] != ')') {
+                                               dw = importDockWinConfig (conf, ref i, dataSource);
+                                               tv.AddItem (dw);
+                                               dw.IsDocked = true;
+                                       }
                                        i++;
                                        break;
-                               case "WIN;":                                    
-                                       this.AddChild (importDockWinConfig (conf, ref i, dataSource));
+                               case "WIN;":            
+                                       dw = importDockWinConfig (conf, ref i, dataSource);                     
+                                       this.AddChild (dw);
+                                       dw.IsDocked = true;
                                        break;
                                case "STK;":
                                        DockStack ds = new DockStack (IFace);
index 4c99c6373748f75a8ba85837d8077edc82b6ee0c..096ef0e15fc33eb632c518a4db0260fb30e94089 100644 (file)
@@ -31,10 +31,14 @@ namespace Crow
                                        return;
                                isDocked = value;
                                NotifyValueChangedAuto (isDocked);
-                               NotifyValueChanged ("IsFloating", !isDocked);
+                               NotifyValueChanged ("IsFloating", IsFloating);
+                               NotifyValueChanged ("IsDockedInTabView", IsDockedInTabView);
+                               NotifyValueChanged ("IsDockedInStack", IsDockedInStack);
                        }
                }
-               [XmlIgnore] public bool IsFloating { get { return !isDocked; }}
+               [XmlIgnore] public bool IsFloating => !isDocked;
+               [XmlIgnore] public bool IsDockedInTabView => LogicalParent is TabView;
+               [XmlIgnore] public bool IsDockedInStack => Parent is DockStack;
 
                public Alignment DockingPosition {
                        get { return docking; }
index 13676e30cc1e244e41a959f6b7233c3441b0caf3..b4fbea09dcd22a49d5a6b76d217730fe2b1b8b3a 100644 (file)
@@ -2,26 +2,23 @@
 //
 // This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
 
-
 namespace Crow
 {
        /// <summary>
        /// group control stacking its children horizontally
        /// </summary>
        public class HorizontalStack : GenericStack
-    {
+       {
                #region CTOR
-               protected HorizontalStack () : base(){}
-               public HorizontalStack(Interface iface) : base(iface)
-        {            
-        }
+               protected HorizontalStack() : base() { }
+               public HorizontalStack(Interface iface, string style = null) : base(iface, style) { }
                #endregion
 
-        [XmlIgnore]
-        public override Orientation Orientation
-        {
-            get => Orientation.Horizontal;
-            set { base.Orientation = Orientation.Horizontal; }
-        }
-    }
+               [XmlIgnore]
+               public override Orientation Orientation
+               {
+                       get => Orientation.Horizontal;
+                       set { base.Orientation = Orientation.Horizontal; }
+               }
+       }
 }
index f8574959823023375d6fe8ff9e97212893eea801..c8b4b2387b871db1dde7e9086e42c30e87d8f32f 100644 (file)
@@ -609,6 +609,8 @@ namespace Crow
                }
                public override int measureRawSize(LayoutingType lt)
                {
+                       DbgLogger.StartEvent(DbgEvtType.GOMeasure, this, lt);
+
                        if ((bool)lines?.IsEmpty)
                                getLines ();
 
@@ -624,6 +626,7 @@ namespace Crow
                                        measureTextBounds (gr);
                                }
                        }
+                       DbgLogger.EndEvent(DbgEvtType.GOMeasure);
                        return Margin * 2 + (lt == LayoutingType.Height ? cachedTextSize.Height : cachedTextSize.Width);
                }
                
index d56f521394594eeec1b2f5638ffa722600bfaadd..b00101a56ae30647bc4d05dd39f51b1aed126b6b 100644 (file)
@@ -151,8 +151,10 @@ namespace Crow
                        if (hasClick)
                                base.onMouseClick (sender, e);
 
-                       if (!IsOpened)
-                               (LogicalParent as Menu).AutomaticOpening = false;
+                       if (!IsOpened) 
+                               if (LogicalParent is Menu m)
+                                       m.AutomaticOpening = false;
+                       
                }
                void closeMenu () {
                        MenuItem tmp = LogicalParent as MenuItem;
index b7d62c1f61510ecb6602d0de4a00425b7a6568c0..17179ae392cd2481310f2e1848713aa789f9a6e2 100644 (file)
@@ -482,6 +482,8 @@ namespace Crow {
                }
                protected override void onDraw (Context gr)
                {
+                       DbgLogger.StartEvent(DbgEvtType.GODraw, this);
+
                        base.onDraw (gr);
 
                        gr.SelectFontFace (Font.Name, Font.Slant, Font.Wheight);
@@ -681,6 +683,7 @@ namespace Crow {
                        }
 
                        gr.Restore ();
+                       DbgLogger.EndEvent (DbgEvtType.GODraw);
                }
                #endregion
 
index 68538e8dc106651042c90e24e42ac18838dda190..8872b92b31de6e73004970f2d132c7498ae33e92 100644 (file)
@@ -27,6 +27,9 @@ namespace Crow
                                orientation = value;
                                NotifyValueChangedAuto (orientation);
                                NotifyValueChanged ("OppositeOrientation", OppositeOrientation);
+                               NotifyValueChanged ("TabWidth", TabWidth);
+                               NotifyValueChanged ("TabHeight", TabHeight);
+                               RegisterForLayouting (LayoutingType.Sizing);
                        }
                }
                public Orientation OppositeOrientation 
@@ -34,7 +37,28 @@ namespace Crow
                public Measure TabWidth
                        => orientation == Orientation.Vertical ? Measure.Stretched : Measure.Fit;               
                public Measure TabHeight
-                       => orientation == Orientation.Horizontal ? Measure.Stretched : Measure.Fit;             
+                       => orientation == Orientation.Horizontal ? Measure.Stretched : Measure.Fit;
+
+               public override void RemoveItem(Widget g, bool disposeChild = true)
+               {                       
+                       if (SelectedItem != g) {
+                               base.RemoveItem(g, disposeChild);
+                               return;
+                       }
+                               
+                       int idx = Items.IndexOf (g);
+                       base.RemoveItem(g, disposeChild);
+
+                       if (idx >= Items.Count)
+                               selectedItemContainer = Items.LastOrDefault();
+                       else
+                               selectedItemContainer = Items[idx];
+
+                       if (selectedItemContainer == null)
+                               return;
+                       selectedItemContainer.IsVisible = true;
+                       SelectedItem = selectedItemContainer;
+               }
        }
 }
 
index aea5c78db02b98b642edd4d4974c8433ab2f8e1a..a1ac759c15054daabe009e25f10b207e1453f1d6 100644 (file)
@@ -126,7 +126,7 @@ namespace Crow {
                }
 
                object selectedItem;
-               Widget selectedItemContainer = null;
+               protected Widget selectedItemContainer = null;
 
                [XmlIgnore]public virtual object SelectedItem{
                        get => selectedItem;
@@ -231,7 +231,7 @@ namespace Crow {
                                itemsContainer.Children [e.Index].DataSource = e.Element;
 
                }
-               void Ol_ListClear (object sender, ListChangedEventArg e) {
+               void Ol_ListClear (object sender, ListClearEventArg e) {
                        cancelLoadingThread ();                 
                        if (this.isPaged) {
                                throw new NotImplementedException ();
@@ -254,18 +254,20 @@ namespace Crow {
                        g.LogicalParent = this;
                        NotifyValueChanged ("HasChildren", true);
                }
-               public virtual void RemoveItem(Widget g)
-               {                               
-                       g.LogicalParent = null;
-                       itemsContainer.DeleteChild (g);
+               public virtual void RemoveItem(Widget g, bool disposeChild = true)
+               {                                                       
+                       if (disposeChild)
+                               itemsContainer.DeleteChild (g);
+                       else
+                               itemsContainer.RemoveChild (g);
                        if (itemsContainer.Children.Count == 0)
                                NotifyValueChanged ("HasChildren", false);
                }
 
                public virtual void ClearItems()
                {
-                       selectedItemContainer = null;
-                       SelectedItem = null;
+                       /*selectedItemContainer = null;
+                       SelectedItem = null;*/
 
                        itemsContainer.ClearChildren ();
                        NotifyValueChanged ("HasChildren", false);
@@ -455,9 +457,9 @@ namespace Crow {
                                        iTemp = ItemTemplates ["default"];
                        }
                        if (loadingThread == null)
-                               Monitor.Enter(IFace.LayoutMutex);
+                               Monitor.Enter(IFace.UpdateMutex);
                        else {
-                               while (!Monitor.TryEnter(IFace.LayoutMutex)) {
+                               while (!Monitor.TryEnter(IFace.UpdateMutex)) {
                                        if (loadingThread.cancelRequested)
                                                return;
                                        Thread.Sleep(1);
@@ -472,7 +474,7 @@ namespace Crow {
 //                             if (isPaged)
                                g.LogicalParent = this;
                                g.MouseClick += itemClick;
-                       Monitor.Exit (IFace.LayoutMutex);
+                       Monitor.Exit (IFace.UpdateMutex);
 
                        if (iTemp.Expand != null) {
                                Expandable e = g as Expandable;
@@ -588,14 +590,14 @@ namespace Crow {
                        /*if (dataParent is IValueChange vc) {
 
                        }*/
-                       if (datas is IObservableList ol) {
+                       /*if (datas is IObservableList ol) {
                                ol.ListAdd += (sender, e) => loadItem (e.Element, itemsContainer, dataTest);
                                ol.ListRemove += (sender, e) => itemsContainer.DeleteChild (e.Index);
                                ol.ListEdit += (sender, e) => itemsContainer.Children [e.Index].DataSource = e.Element;
                                ol.ListClear += (sender, e) => {        lock (IFace.UpdateMutex)
                                                                                                                itemsContainer.ClearChildren ();};
                                
-                       }
+                       }*/
                }
                void onDatasChanged (object sender, ValueChangeEventArgs e) {
                        
index a0fac5366f488e491d6280b37c95814435218e15..ead1f533e9ff2cf660670122b8abbff34a0a8895 100644 (file)
@@ -215,7 +215,7 @@ namespace Crow
                                return;
                        }
                        RegisterForLayouting (LayoutingType.ArrangeChildren);
-                       raiseLayoutChanged (new LayoutingEventArgs (layoutType));
+                       raiseLayoutChanged (layoutType);
                }
                #endregion
        }
index 057ee24cdd03b97c7d2299b0a7ee09cddc3fe323..54413ba68fda75610ccc2cbb16c0df946cb1f9ec 100644 (file)
@@ -7,7 +7,7 @@
                <Compile Include="src\**\*.cs"/>
        </ItemGroup>
        <ItemGroup>
-               <EmbeddedResource Include="ui\*.*">
+               <EmbeddedResource Include="ui\**\*.*">
                        <LogicalName>Dbg.%(Filename)%(Extension)</LogicalName>
                </EmbeddedResource>     
        </ItemGroup>
index 19666ee2633b2ca9605db91274b9a353c7ef5427..6af3f6dfd2b7bd6b58e6759e2b70bb536046971b 100644 (file)
@@ -10,6 +10,18 @@ using DebugLogAnalyzer;
 
 namespace Crow
 {
+       public class DbgEventView : TemplatedContainer {
+               DbgEvent evt;
+               public DbgEvent Event {
+                       get => evt;
+                       set {
+                               if (evt == value)
+                                       return;
+                               evt = value;
+                               NotifyValueChangedAuto (evt);
+                       }
+               }
+       }
        public class DbgEventWidget : Widget
        {
                public DbgEventWidget (){}
index 1273c9e6f52eae4412b88c179e350af598893113..d39cc62a6c56779490b5b1b70a1b074785ae4332 100644 (file)
@@ -300,7 +300,7 @@ namespace Crow
 
                                double penX = 5.0 * g.xLevel + cb.Left;
 
-                               if (g.yIndex == 0)
+                               if (g.xLevel == 0)
                                        gr.SetSource (Crow.Colors.LightSalmon);
                                else if (currentLine == g.listIndex)
                                        gr.SetSource(Colors.RoyalBlue);
@@ -434,11 +434,17 @@ namespace Crow
 
                        ctxR.Width = Math.Max (1, ctxR.Width);
                        ctx.Rectangle (ctxR);
-                       //ctx.SetSourceColor (Color.LightYellow);
-                       ctx.SetSource (Colors.Jet);
+                       ctx.SetSource (0.0,0.2,0.8,0.15);
+                       //ctx.SetSource (Colors.Jet);
                        ctx.Fill();
                        ctx.Operator = Cairo.Operator.Over;
 
+                       str = $"{ticksToMS(Math.Abs (selEnd - selStart))} (ms)";
+
+                       ctx.MoveTo (ctxR.Center.X - ctx.TextExtents (str).Width / 2, ctxR.Y + fe.Height);
+                       ctx.SetSource (Colors.Black);
+                       ctx.ShowText (str);
+
                }
                public override void OnLayoutChanges (LayoutingType layoutType)
                {
@@ -469,7 +475,7 @@ namespace Crow
                        int lastLine = hoverLine;
                        updateMouseLocalPos (e.Position);
 
-                       if (IFace.IsDown (Glfw.MouseButton.Left) && selStart >= 0)
+                       if ((IFace.IsDown (Glfw.MouseButton.Left) || IFace.IsDown (Glfw.MouseButton.Middle)) && selStart >= 0)
                                selEnd = hoverTick;
                        else if (IFace.IsDown(Glfw.MouseButton.Right)) {
                                if (lastTick >= 0 && hoverTick >= 0)
@@ -479,28 +485,30 @@ namespace Crow
                                updateMouseLocalPos (e.Position);
                        } else {
                                HoverWidget = (hoverLine < 0 || hoverLine >= widgets.Count) ? null : widgets [hoverLine];
-                               HoverEvent = hoverWidget?.Events.FirstOrDefault (ev => ev.begin <= hoverTick && ev.end >= hoverTick);
-                               Task.Run (() => findHoverEvent (hoverWidget, hoverTick));
+                               //HoverEvent = hoverWidget?.Events.FirstOrDefault (ev => ev.begin <= hoverTick && ev.end >= hoverTick);
+                               double tickPerPixel = (double)visibleTicks / ClientRectangle.Width;
+                               //Console.WriteLine ($"ticks per pixel: {tickPerPixel}");
+                               Task.Run (() => findHoverEvent (hoverWidget, hoverTick, (int)tickPerPixel));
                        }
 
                        RegisterForRepaint();
                        
                        e.Handled = true;
                        base.onMouseMove (sender, e);
-               }
-               void findHoverEvent (DbgWidgetRecord widget, long tick) {
-                       DbgEvent tmp = widget?.Events.FirstOrDefault (ev => ev.begin <= tick && ev.end >= tick);                        
+               }               
+               void findHoverEvent (DbgWidgetRecord widget, long tick, long precision = 0) {
+                       DbgEvent tmp = widget?.Events.FirstOrDefault (ev => ev.begin - precision <= tick && ev.end + precision >= tick);
                        if (tmp == null) {
-                               tmp = Events.Where(e=>e.type.HasFlag(DbgEvtType.IFace)).Where (ev => ev.begin <= tick && ev.end >= tick).FirstOrDefault();                              
+                               tmp = Events.Where(e=>e.type.HasFlag(DbgEvtType.IFace)).Where (ev => ev.begin - precision <= tick && ev.end + precision >= tick).FirstOrDefault();                              
                                while(tmp != null) {
-                                       DbgEvent che = tmp.Events?.Where(e=>e.type.HasFlag(DbgEvtType.IFace)).Where (ev => ev.begin <= tick && ev.end >= tick).FirstOrDefault();
+                                       DbgEvent che = tmp.Events?.Where(e=>e.type.HasFlag(DbgEvtType.IFace)).Where (ev => ev.begin - precision <= tick && ev.end + precision >= tick).FirstOrDefault();
                                        if (che == null)
                                                break;
                                        tmp = che;
                                }
                        } else {
                                while(tmp != null) {
-                                       DbgEvent che = tmp.Events?.OfType<DbgWidgetEvent>()?.Where(ev=>ev.InstanceIndex == widget.listIndex && ev.begin <= tick && ev.end >= tick).FirstOrDefault();
+                                       DbgEvent che = tmp.Events?.OfType<DbgWidgetEvent>()?.Where(ev=>ev.InstanceIndex == widget.listIndex && ev.begin - precision <= tick && ev.end + precision >= tick).FirstOrDefault();
                                        if (che == null)
                                                break;
                                        tmp = che;
@@ -510,21 +518,23 @@ namespace Crow
                }
                public override void onMouseClick(object sender, MouseButtonEventArgs e)
                {
-                       if (e.Button == Glfw.MouseButton.Left && selEnd < 0) {
-                               currentTick = hoverTick;
-                               currentLine = hoverLine;
-                               CurrentWidget = hoverWidget;
-                               CurrentEvent = hoverEvent;
+                       if (e.Button == Glfw.MouseButton.Left) {
+                               if (selEnd < 0) {
+                                       currentTick = hoverTick;
+                                       currentLine = hoverLine;
+                                       CurrentWidget = hoverWidget;
+                                       CurrentEvent = hoverEvent;
+                               }
+                               selStart = -1;
+                               selEnd = -1;
                        }
-                       selStart = -1;
-                       selEnd = -1;
 
                        e.Handled = true;
                        base.onMouseClick(sender, e);
                }
                public override void onMouseDown (object sender, MouseButtonEventArgs e)
                {
-                       if (e.Button == Glfw.MouseButton.Left) {
+                       if (e.Button == Glfw.MouseButton.Left || e.Button == Glfw.MouseButton.Middle) {
                                selStart = hoverTick;
                                selEnd = -1;
                        }
@@ -561,7 +571,9 @@ namespace Crow
 
                        if (IFace.Shift)
                                ScrollX -= (int)((double)(e.Delta * MouseWheelSpeed) / xScale);
-                       else if (IFace.Ctrl) {
+                       else if (IFace.Ctrl)
+                               ScrollY -= e.Delta * MouseWheelSpeed;
+                       else {
                                if (e.Delta > 0) {
                                        XScale *= 2.0;
                                } else {
@@ -569,8 +581,7 @@ namespace Crow
                                                XScale *= 0.5;
                                }
                                ScrollX = (long)(hoverTick - (long)((double)Math.Max(0, mousePos.X - (long)leftMargin) / xScale) - minTicks);
-                       }else
-                               ScrollY -= e.Delta * MouseWheelSpeed;
+                       }
                }
 
                public override void onKeyDown (object sender, KeyEventArgs e)
index 5432b05eaf6eac76017462d15eac70b02b6676fa..c6920ca585f7d2b91c115056e1b4732ce8f2a0c1 100644 (file)
@@ -12,6 +12,7 @@ using System.Diagnostics;
 using CrowDbgShared;
 using System.Collections.Generic;
 using Crow.DebugLogger;
+using System.Linq;
 
 namespace Crow
 {      
@@ -27,7 +28,10 @@ namespace Crow
                Type dbgIfaceType;
                Action<int, int> delResize;
                Func<int, int, bool> delMouseMove;
+               Func<float, bool> delMouseWheelChanged;
                Func<MouseButton, bool> delMouseDown, delMouseUp;
+               Func<char, bool> delKeyPress;
+               Func<Key, bool> delKeyDown, delKeyUp;
                Action delResetDirtyState;
                Action delResetDebugger;
                Action<object, string> delSaveDebugLog;
@@ -178,12 +182,24 @@ namespace Crow
                                delMouseMove = (Func<int, int, bool>)Delegate.CreateDelegate(typeof(Func<int, int, bool>),
                                                                                        dbgIFace, dbgIfaceType.GetMethod("OnMouseMove"));
 
+                               delMouseWheelChanged = (Func<float, bool>)Delegate.CreateDelegate(typeof(Func<float, bool>),
+                                                                                       dbgIFace, dbgIfaceType.GetMethod("OnMouseWheelChanged"));
+
+
                                delMouseDown = (Func<MouseButton, bool>)Delegate.CreateDelegate(typeof(Func<MouseButton, bool>),
                                                                                        dbgIFace, dbgIfaceType.GetMethod("OnMouseButtonDown"));
 
                                delMouseUp = (Func<MouseButton, bool>)Delegate.CreateDelegate(typeof(Func<MouseButton, bool>),
                                                                                        dbgIFace, dbgIfaceType.GetMethod("OnMouseButtonUp"));
 
+                               delKeyDown = (Func<Key, bool>)Delegate.CreateDelegate(typeof(Func<Key, bool>),
+                                                                                       dbgIFace, dbgIfaceType.GetMethod("OnKeyDown"));
+                               delKeyUp = (Func<Key, bool>)Delegate.CreateDelegate(typeof(Func<Key, bool>),
+                                                                                       dbgIFace, dbgIfaceType.GetMethod("OnKeyUp"));
+                               delKeyPress = (Func<char, bool>)Delegate.CreateDelegate(typeof(Func<char, bool>),
+                                                                                       dbgIFace, dbgIfaceType.GetMethod("OnKeyPress"));
+
+
                                delGetSurfacePointer = (IntPtrGetterDelegate)Delegate.CreateDelegate(typeof(IntPtrGetterDelegate),
                                                                                        dbgIFace, dbgIfaceType.GetProperty("SurfacePointer").GetGetMethod());
                                delSetSource = (Action<string>)Delegate.CreateDelegate(typeof(Action<string>),
@@ -218,19 +234,60 @@ namespace Crow
                }
                public override bool CacheEnabled { get => true; set => base.CacheEnabled = true; }
 
+               public override void onKeyDown(object sender, KeyEventArgs e)
+               {
+                       if (initialized) {
+                               try
+                               {                                       
+                                       e.Handled = delKeyDown (e.Key);
+                               }
+                               catch (System.Exception ex)
+                               {
+                                       Console.WriteLine($"[Error][DebugIFace key down]{ex}");
+                               }                               
+                       }
+                       base.onKeyDown(sender, e);
+               }
+               public override void onKeyUp(object sender, KeyEventArgs e)
+               {
+                       if (initialized) {
+                               try
+                               {                                       
+                                       e.Handled = delKeyUp (e.Key);
+                               }
+                               catch (System.Exception ex)
+                               {
+                                       Console.WriteLine($"[Error][DebugIFace key up]{ex}");
+                               }                               
+                       }
+                       base.onKeyUp(sender, e);
+               }
+               public override void onKeyPress(object sender, KeyPressEventArgs e)
+               {
+                       if (initialized) {
+                               try
+                               {                                       
+                                       e.Handled = delKeyPress (e.KeyChar);
+                               }
+                               catch (System.Exception ex)
+                               {
+                                       Console.WriteLine($"[Error][DebugIFace key press]{ex}");
+                               }                               
+                       }
+                       base.onKeyPress(sender, e);
+               }
                public override void onMouseMove(object sender, MouseMoveEventArgs e)
                {
                        if (initialized) {
                                try
                                {
                                        Point m = ScreenPointToLocal (e.Position);
-                                       delMouseMove (m.X, m.Y);
+                                       e.Handled = delMouseMove (m.X, m.Y);
                                }
                                catch (System.Exception ex)
                                {
                                        Console.WriteLine($"[Error][DebugIFace mouse move]{ex}");
-                               }
-                               e.Handled = true;
+                               }                               
                        }
                        base.onMouseMove(sender, e);
                }
@@ -239,13 +296,12 @@ namespace Crow
                        if (initialized) {                              
                                try
                                {
-                                       delMouseDown (e.Button);
+                                       e.Handled = delMouseDown (e.Button);
                                }
                                catch (System.Exception ex)
                                {
                                        Console.WriteLine($"[Error][DebugIFace mouse down]{ex}");
-                               }
-                               e.Handled=true;
+                               }                               
                        }
                        base.onMouseDown (sender, e);                   
                }
@@ -254,16 +310,29 @@ namespace Crow
                        if (initialized) {                              
                                try
                                {
-                                       delMouseUp (e.Button);                  
+                                       e.Handled = delMouseUp (e.Button);                      
                                }
                                catch (System.Exception ex)
                                {
                                        Console.WriteLine($"[Error][DebugIFace mouse up]{ex}");
-                               }
-                               e.Handled=true;
+                               }                               
                        }
                        base.onMouseUp (sender, e);
                }
+               public override void onMouseWheel(object sender, MouseWheelEventArgs e)
+               {
+                       if (initialized) {                              
+                               try
+                               {
+                                       e.Handled = delMouseWheelChanged (e.Delta);                     
+                               }
+                               catch (System.Exception ex)
+                               {
+                                       Console.WriteLine($"[Error][DebugIFace mouse wheel change]{ex}");
+                               }                               
+                       }
+                       base.onMouseWheel(sender, e);
+               }
 
                protected override void RecreateCache()
                {
@@ -286,22 +355,52 @@ namespace Crow
                        
                }
 
+               int firstWidgetIndexToGet = 0;
                void getLog () {
+                       DebugLogAnalyzer.Program dla = IFace as DebugLogAnalyzer.Program;
+
                        using (Stream stream = new MemoryStream (1024)) {
                                Type debuggerType = crowAssembly.GetType("Crow.DbgLogger");
-                               debuggerType.GetMethod("Save", new Type[] {dbgIfaceType, typeof(Stream)}).Invoke(null, new object[] {dbgIFace, stream});
+                               MethodInfo miSave = debuggerType.GetMethod("Save",
+                                       new Type[] {
+                                               dbgIfaceType,
+                                               typeof(Stream),
+                                               typeof(int),
+                                               typeof(bool)
+                                       });
+
+
+                               widgets = new List<DbgWidgetRecord>();
+                               events = new List<DbgEvent>();
+                               miSave.Invoke(null, new object[] {dbgIFace, stream, firstWidgetIndexToGet, true});
                                //debuggerType.GetMethod("Save", new Type[] {dbgIfaceType, typeof(string)}).Invoke(null, new object[] {dbgIFace, "debug.log"});
                                //delSaveDebugLog(dbgIFace, "debug.log");
                                stream.Seek(0, SeekOrigin.Begin);
-                               events = new List<DbgEvent>();
-                               widgets = new List<DbgWidgetRecord>();
                                DbgLogger.Load (stream, events, widgets);
-                               //DbgLogger.Load ("debug.log", events, widgets);
-                               DebugLogAnalyzer.Program dla = IFace as DebugLogAnalyzer.Program;
-                               dla.Widgets = widgets;
-                               dla.Events = events;
+
+                               lock (dla.UpdateMutex) {
+                                       for (int i = 0; i < widgets.Count; i++) {
+                                               widgets[i].listIndex = dla.Widgets.Count;
+                                               dla.Widgets.Add (widgets[i]);
+                                       }
+                                       for (int i = 0; i < events.Count; i++) {
+                                               dla.Events.Add (events[i]);
+                                               updateWidgetEvents (dla.Widgets, events[i]);
+                                       }
+                               }                               
+                               firstWidgetIndexToGet += widgets.Count;                         
+                               if (widgets.Count > 0 && firstWidgetIndexToGet != widgets.Last().InstanceIndex + 1)
+                                       Debugger.Break ();
                        }
                }
+               void updateWidgetEvents (List<DbgWidgetRecord> widgets, DbgEvent evt) {
+                       if (evt is DbgWidgetEvent we)
+                               widgets.FirstOrDefault (w => w.InstanceIndex == we.InstanceIndex)?.Events.Add (we);
+                       if (evt.Events == null)
+                               return;
+                       foreach (DbgEvent e in evt.Events) 
+                               updateWidgetEvents (widgets, e);                        
+               }
 
                public virtual object GetScreenCoordinates () => ScreenCoordinates(Slot).TopLeft;
        }
index 7da9f5a114ea682682225bf979b3a882e330437e..a2711dda7fc75a826321c8d527cbbde0f2c1fafe 100644 (file)
@@ -11,6 +11,7 @@ using Crow.Text;
 using System.Collections.Generic;
 using Encoding = System.Text.Encoding;
 using Crow.DebugLogger;
+using System.Linq;
 
 namespace DebugLogAnalyzer
 {
@@ -41,7 +42,8 @@ namespace DebugLogAnalyzer
 
                        /*TreeView tv = FindByName("dbgTV") as TreeView;
                        dbgTreeViewScroller = tv.FindByNameInTemplate ("scroller1") as Scroller;*/
-
+                       if (DebugLogOnStartup)
+                               DebugLogRecording = true;
 
                        if (!File.Exists (CurrentFile))
                                newFile ();
@@ -50,20 +52,52 @@ namespace DebugLogAnalyzer
 
                        reloadFromFile ();
                }
+
+               public override void UpdateFrame()
+               {
+                       base.UpdateFrame();
+
+               }
+
                        
-               List<DbgEvent> events = new List<DbgEvent>();
-               List<DbgWidgetRecord> widgets = new List<DbgWidgetRecord>();
-               DbgEvent curEvent = new DbgEvent();
+               ObservableList<DbgEvent> events = new ObservableList<DbgEvent>();
+               ObservableList<DbgWidgetRecord> widgets = new ObservableList<DbgWidgetRecord>();
+               DbgEvent curEvent;
+               bool disableCurrentEventHistory;
+               Stack<DbgEvent> CurrentEventHistoryForward = new Stack<DbgEvent>();
+               Stack<DbgEvent> CurrentEventHistoryBackward = new Stack<DbgEvent>();
                DbgWidgetRecord curWidget = new DbgWidgetRecord();
                bool debugLogRecording;
-               Scroller dbgTreeViewScroller;           
                int targetTvScroll = -1;
 
+               public string[] AllEventTypes => Enum.GetNames (typeof(DbgEvtType));
+               string searchEventType;
+               DbgWidgetRecord searchWidget;
+               public string SearchEventType {
+                       get => searchEventType;
+                       set {
+                               if (searchEventType == value)
+                                       return;
+                               searchEventType = value;
+                               NotifyValueChanged (searchEventType);
+                       }
+               }
+
+               public DbgWidgetRecord SearchWidget {
+                       get => searchWidget;
+                       set {
+                               if (searchWidget == value)
+                                       return;
+                               searchWidget = value;
+                               NotifyValueChanged (searchWidget);
+                       }
+               }
 
 
 
                public Command CMDNew, CMDOpen, CMDSave, CMDSaveAs, CMDQuit, CMDShowLeftPane,
-                                       CMDUndo, CMDRedo, CMDCut, CMDCopy, CMDPaste, CMDHelp, CMDAbout, CMDOptions;
+                                       CMDUndo, CMDRedo, CMDCut, CMDCopy, CMDPaste, CMDHelp, CMDAbout, CMDOptions,
+                                       CMDGotoParentEvent, CMDEventHistoryForward, CMDEventHistoryBackward;
                public CommandGroup EventCommands, DirectoryCommands;
                public CommandGroup EditorCommands => new CommandGroup (CMDUndo, CMDRedo, CMDCut, CMDCopy, CMDPaste, CMDSave, CMDSaveAs);
                void initCommands ()
@@ -78,8 +112,12 @@ namespace DebugLogAnalyzer
                        CMDCopy = new Command ("Copy", new Action (() => copy ()), "#Icons.copy-file.svg", false);
                        CMDPaste= new Command ("Paste", new Action (() => paste ()), "#Icons.paste-on-document.svg", false);
 
+                       CMDGotoParentEvent = new Command("parent", ()=> { CurrentEvent = CurrentEvent?.parentEvent; }, null, false);
+                       CMDEventHistoryBackward = new Command("back.", currentEventHistoryGoBack, null, false);
+                       CMDEventHistoryForward = new Command("forw.", currentEventHistoryGoForward, null, false);
+
                        EventCommands = new CommandGroup(
-                               new Command("Goto parent event", ()=> { CurrentEvent = CurrentEvent?.parentEvent; })
+                               CMDGotoParentEvent, CMDEventHistoryBackward, CMDEventHistoryForward
                        );
                        DirectoryCommands = new CommandGroup(
                                new Command("Set as root directory", ()=> { CurrentEvent = CurrentEvent?.parentEvent; })
@@ -100,7 +138,7 @@ namespace DebugLogAnalyzer
                                NotifyValueChanged(CrowDbgAssemblyLocation);
                        }
                }
-               public List<DbgEvent> Events {
+               public ObservableList<DbgEvent> Events {
                        get => events;
                        set {
                                if (events == value)
@@ -109,7 +147,7 @@ namespace DebugLogAnalyzer
                                NotifyValueChanged (nameof (Events), events);
                        }
                }
-               public List<DbgWidgetRecord> Widgets {
+               public ObservableList<DbgWidgetRecord> Widgets {
                        get => widgets;
                        set {
                                if (widgets == value)
@@ -118,18 +156,83 @@ namespace DebugLogAnalyzer
                                NotifyValueChanged (nameof (Widgets), widgets);
                        }
                }
+               /*IEnumerable<DbgWidgetEvent> widgetEvents (DbgWidgetRecord wr, DbgEvent evt) {
+                       if (evt is DbgWidgetEvent we && we.InstanceIndex == wr.InstanceIndex)
+                               yield return we;
+                       if (evt.Events != null) {
+                               foreach (DbgEvent e in evt.Events)
+                                       foreach (DbgWidgetEvent ye in widgetEvents (wr, e))                             
+                                               yield return ye;
+                       }
+               }
+               IEnumerable<DbgWidgetEvent> currentWidgetEvents;
+
+               public IEnumerable<DbgWidgetEvent> CurrentWidgetEvents {
+                       get => currentWidgetEvents;
+                       set {
+                               currentWidgetEvents = value;
+                               NotifyValueChanged (currentWidgetEvents);
+                               curWidget.Events = new List<DbgEvent> (currentWidgetEvents);
+                       }
+               }
+               IEnumerable<DbgWidgetEvent> getCurrentWidgetEvents () {
+                       if (CurrentWidget == null)
+                               yield return null;
+                       else {
+                               foreach (DbgEvent evt in Events)
+                                       foreach (DbgWidgetEvent dwe in widgetEvents (CurrentWidget, evt))
+                                               yield return dwe;
+                       }
+               }*/
+
+                
                public DbgEvent CurrentEvent {
                        get => curEvent;
                        set {
                                if (curEvent == value)
                                        return;
+
+                               if (!disableCurrentEventHistory) {
+                                       CurrentEventHistoryForward.Clear ();
+                                       CMDEventHistoryForward.CanExecute = false;
+                                       if (!(value == null || curEvent == null)) {
+                                               CurrentEventHistoryBackward.Push (curEvent);
+                                               CMDEventHistoryBackward.CanExecute = true;
+                                       }
+                               }                               
                                
                                curEvent = value;
+
                                NotifyValueChanged (nameof (CurrentEvent), curEvent);
                                NotifyValueChanged ("CurEventChildEvents", curEvent?.Events);
-                               
+                               if (CurrentEvent != null && CurrentEvent.parentEvent != null)
+                                       CMDGotoParentEvent.CanExecute = true;
+                               else
+                                       CMDGotoParentEvent.CanExecute = false;                          
+                       }
+               }
+               void currentEventHistoryGoBack () {
+                       disableCurrentEventHistory = true;
+                       if (CurrentEvent != null) {
+                               CurrentEventHistoryForward.Push (CurrentEvent);
+                               CMDEventHistoryForward.CanExecute = true;
                        }
+                       CurrentEvent = CurrentEventHistoryBackward.Pop ();
+                       CMDEventHistoryBackward.CanExecute = CurrentEventHistoryBackward.Count > 0;
+
+                       disableCurrentEventHistory = false;
+               }
+
+               void currentEventHistoryGoForward () {
+                       disableCurrentEventHistory = true;
+                       CurrentEventHistoryBackward.Push (CurrentEvent);
+                       CMDEventHistoryBackward.CanExecute = true;
+                       CurrentEvent = CurrentEventHistoryForward.Pop ();
+                       CMDEventHistoryForward.CanExecute = CurrentEventHistoryForward.Count > 0;
+
+                       disableCurrentEventHistory = false;
                }
+
                public DbgWidgetRecord CurrentWidget {
                        get => curWidget;
                        set {
@@ -138,8 +241,7 @@ namespace DebugLogAnalyzer
                                curWidget = value;
                                NotifyValueChanged (nameof (CurrentWidget), curWidget);
                                NotifyValueChanged ("CurWidgetRootEvents", curWidget?.RootEvents);
-                               NotifyValueChanged ("CurWidgetEvents", curWidget?.Events);
-                               
+                               NotifyValueChanged ("CurrentWidgetEvents", curWidget?.Events);
                        }
                }
                public List<DbgWidgetEvent> CurWidgetRootEvents => curWidget == null? new List<DbgWidgetEvent>() : curWidget.RootEvents;
@@ -192,7 +294,16 @@ namespace DebugLogAnalyzer
                                debugLogRecording = value;
                                NotifyValueChanged(debugLogRecording);
                        }
-               }               
+               }
+               public bool DebugLogOnStartup {
+                       get => Configuration.Global.Get<bool> (nameof(DebugLogOnStartup));
+                       set {
+                               if (DbgLogger.ConsoleOutput != value)
+                                       return;                         
+                               Configuration.Global.Set (nameof(DebugLogOnStartup), value);
+                               NotifyValueChanged(DebugLogOnStartup);
+                       }
+               }                               
 
                
                const string _defaultFileName = "unnamed.txt";
diff --git a/Samples/DebugLogAnalyzer/ui/ComboBox.template b/Samples/DebugLogAnalyzer/ui/ComboBox.template
new file mode 100644 (file)
index 0000000..1b8e439
--- /dev/null
@@ -0,0 +1,30 @@
+<?xml version="1.0"?>
+<HorizontalStack Spacing="5" Background="{./Background}">
+       <Label Text="{./Caption}"/>
+       <Popper Caption="{./SelectedItem}" Name="popper" PopDirection="Bottom" Foreground="{./Foreground}" Background="{./Background}">
+               <Template>
+                       <CheckBox Caption="{./Caption}" IsChecked="{²./IsPopped}" Foreground="{./Foreground}" Background="{./Background}">
+                               <Template>
+                                       <Border Style="ControlBorder" Background="{./Background}">
+                                               <HorizontalStack Margin="0" Spacing="1">
+                                                       <TextBox Style="ControlEditableText" Text="{./Caption}"/>
+                                                       <Shape Style="ArrowBut" MouseDown="./onScrollForth" Width="10" Height="Stretched"
+                                                               Size="10,10" Path="M 0.5,0.5 L 9.5,0.5 L 4.5,9.5 Z F"/>
+                                               </HorizontalStack>
+                                       </Border>
+                               </Template>
+                       </CheckBox>
+               </Template>
+               <Border Background="Onyx" Foreground="DimGrey" BorderWidth="1" Margin="1" Height="Fit" Width="Fit"
+                       MinimumSize="{../../MinimumPopupSize}" >
+                       <Scroller Name="scroller1" Margin="1" 
+                               MaximumSize="0,200"
+                               HorizontalAlignment="Left">
+                               <VerticalStack
+                                       Height="Fit" Name="ItemsContainer" Margin="0"
+                                       HorizontalAlignment="Left"
+                                       VerticalAlignment="Top"/>
+                       </Scroller>
+               </Border>
+       </Popper>
+</HorizontalStack>
index 96de2dc66205347b40fa366c63e37bf2e77fd1b7..0dd44c748950c0503554605b1c04ec099008a9f0 100644 (file)
@@ -19,7 +19,7 @@
                                                                        MouseEnter="{Background=LightGrey}"
                                                                        MouseLeave="{Background=Transparent}"/>
                                                                <Label Text="{./Caption}" Width="80" Font="mono, 8" />
-                                                               <Label Text="{Duration}" Width="40" Font="mono, 8" TextAlignment="Center" Background="DimGrey"/>
+                                                               <Label Text="{DurationMS}" Width="40" Font="mono, 8" TextAlignment="Center" Background="DimGrey"/>
                                                                <DbgEventWidget Event="{}" Tooltip="#Dbg.DbgEvtTooltip.crow" Width="Stretched" Height="5"/>
                                                        </HorizontalStack>
                                                </Border>
diff --git a/Samples/DebugLogAnalyzer/ui/DbgEventView.template b/Samples/DebugLogAnalyzer/ui/DbgEventView.template
new file mode 100644 (file)
index 0000000..6679f15
--- /dev/null
@@ -0,0 +1,43 @@
+<?xml version="1.0"?>
+<VerticalStack Margin="${TooltipMargin}" DataSource="{./Event}">
+       <Label Text="{type}" Background="{Color}" Foreground="Black" Width="200" TextAlignment="Center" Margin="6"/>
+       <HorizontalStack Height="Fit" Width="Stretched" Spacing="2" Visible="{IsWidgetEvent}" Background="DimGrey" Margin="2">
+               <Label Text="Instance:" Foreground="White" Width="50%" />       
+               <Label Text="{InstanceIndex}" Foreground="White" Background="Onyx" Width="Stretched" TextAlignment="Center"/>                           
+       </HorizontalStack>
+       <HorizontalStack Height="Fit" Width="Stretched" Spacing="2" Background="DimGrey" Margin="2">
+               <Label Text="Duration(ms):" Foreground="White" Width="50%" />   
+               <Label Text="{DurationMS}" Foreground="White" Background="Onyx" Width="Stretched" TextAlignment="Right"/>                               
+       </HorizontalStack>
+       <HorizontalStack Height="Fit" Width="Stretched" Spacing="2">
+               <Label Text="Begin(s):" Foreground="${TooltipForeground}" Width="50%"/> 
+               <Label Text="{BeginMS}" Foreground="${TooltipForeground}" Width="Stretched" TextAlignment="Right"/>                             
+       </HorizontalStack>
+       <HorizontalStack Height="Fit" Width="Stretched" Spacing="2">
+               <Label Text="End(s):" Foreground="${TooltipForeground}" Width="50%"/>   
+               <Label Text="{EndMS}" Foreground="${TooltipForeground}" Width="Stretched" TextAlignment="Right"/>                               
+       </HorizontalStack>
+       <VerticalStack Height="Fit" Width="Stretched" IsVisible="{IsLayoutEvent}" >
+               <HorizontalStack Height="Fit" Width="Stretched" Spacing="2" Background="DimGrey" Margin="2">
+                       <Label Text="Layout:" Foreground="White" Width="50%" /> 
+                       <Label Text="{layouting}" Foreground="White" Background="Onyx" Width="Stretched" TextAlignment="Center"/>                               
+               </HorizontalStack>
+               <HorizontalStack Height="Fit" Width="Stretched" Spacing="2" Background="DimGrey" Margin="2">
+                       <Label Text="Result:" Foreground="White" Width="50%" /> 
+                       <Label Text="{result}" Foreground="White" Background="Onyx" Width="Stretched" TextAlignment="Center"/>                          
+               </HorizontalStack>
+               <HorizontalStack Height="Fit" Width="Stretched" Spacing="2" Background="DimGrey" Margin="2">
+                       <Label Text="Old Slot:" Foreground="White" Width="50%" />       
+                       <Label Text="{OldSlot}" Foreground="White" Background="Onyx" Width="Stretched" TextAlignment="Center"/>                         
+               </HorizontalStack>
+               <HorizontalStack Height="Fit" Width="Stretched" Spacing="2" Background="DimGrey" Margin="2">
+                       <Label Text="New Slot:" Foreground="White" Width="50%" />       
+                       <Label Text="{NewSlot}" Foreground="White" Background="Onyx" Width="Stretched" TextAlignment="Center"/>                         
+               </HorizontalStack>
+       </VerticalStack>
+       <DbgEventWidget Height="10" Width="Stretched" Event="{}" Tooltip="#Dbg.DbgEvtTooltip.crow" />
+       <GroupBox Caption="Parent Event" Height="Fit" >
+               <DbgEventWidget Height="10" Width="Stretched" Event="{parentEvent}" Tooltip="#Dbg.DbgEvtTooltip.crow" />
+       </GroupBox>
+       <!--<Label Text="{}" Foreground="${TooltipForeground}"/>-->
+</VerticalStack>                                       
\ No newline at end of file
index 26839642f720001aa8d64788a4a807ac6181b93f..2b5ab978a03760700a4ebac4a9da1f30ff69e201 100644 (file)
@@ -6,8 +6,8 @@
                                <EnumSelector RadioButtonStyle="CheckBox2" Template="#Dbg.EnumSelector.template"
                                                Caption="Discarded Events" EnumValue="{²../dbv.Filter}" BitFieldExcludeMask="255" />                                   
                                <HorizontalStack>
-                                       <DbgLogViewer Visible="true" Name="dbv" Events="{Events}" Widgets="{Widgets}" MouseWheelSpeed="3" Font="mono, 8" 
-                                                                                        CurrentEvent="{²CurrentEvent}" CurrentWidget="{²CurrentWidget}" Background="Onyx"/>
+                                       <DbgLogViewer Visible="true" Name="dbv" Events="{Events}" Widgets="{Widgets}" 
+                                                                                        CurrentEvent="{²CurrentEvent}" CurrentWidget="{²CurrentWidget}" />
                                        <ScrollBar Maximum="{../dbv.MaxScrollY}" Value="{²../dbv.ScrollY}" SmallIncrement="1" LargeIncrement="10"
                                                                                        CursorRatio="{../dbv.ChildHeightRatio}"/>
                                </HorizontalStack>
                                        CursorRatio="{../dbv.ChildWidthRatio}"/>
                                <HorizontalStack Height="Fit" DataSource="{CurrentWidget}" Spacing="3">
                                        <Label Style="smallLabValue" Text="{name}"/>
-                                       <Label Style="smallLabValue" Text="{listIndex}"/>
-                                       <Label Style="smallLabValue" Text="{treeIndex}"/>
-                                       <Label Style="smallLabValue" Text="{yIndex}"/>
-                                       <Label Style="smallLabValue" Text="{xLevel}"/>
+                                       <Label Style="smallLabValue" Text="{listIndex}" Tooltip="List index"/>
+                                       <Label Style="smallLabValue" Text="{treeIndex}" Tooltip="tree index"/>
+                                       <Label Style="smallLabValue" Text="{yIndex}" Tooltip="yIndex"/>
+                                       <Label Style="smallLabValue" Text="{xLevel}" Tooltip="xLevel"/>
                                        <Label Style="smallLabCaption" Text="Width:"/>
                                        <Label Style="smallLabValue" Text="{Width}"/>
                                        <Label Style="smallLabCaption" Text="Height:" />
@@ -31,7 +31,7 @@
                                        <Label Style="smallLabValue" Tooltip="VisibleTicks" Text="{../../dbv.VisibleTicks}"/>                           
                                </HorizontalStack>
                        </VerticalStack>
-                       <VerticalStack Name="AllEvents" Width="Stretched" IsVisible="false">
+                       <!--<VerticalStack Name="AllEvents" Width="Stretched" IsVisible="false">
                                <TreeView Height="Stretched" Name="dbgTV" Data="{Events}" SelectedItem="{²CurrentEvent}" Background="DarkGrey"                                                 
                                                        ItemTemplate="#Dbg.DbgEventTreeItems.itemp"/> 
                                <ListBox Data="{CurWidgetEvents}" Height="100" SelectedItem="{²CurrentEvent}">
                                </ListBox>                              
                        </VerticalStack>
                        <VerticalStack Name="CurWidgetEvents" Width="Stretched" IsVisible="false">
-                               <TreeView Height="Stretched" Data="{CurWidgetEvents}" SelectedItem="{²CurrentEvent}" Background="DarkGrey"                                                     
+                               <TreeView Height="Stretched" Data="{CurrentWidgetEvents}" Background="DarkGrey"                                                 
                                                        ItemTemplate="#Dbg.DbgEventTreeItems.itemp"/> 
-                       </VerticalStack>
+                       </VerticalStack>-->
                </TabView>
                <Splitter/>
                <HorizontalStack Height="30%">
-                       <ListBox Data="{Widgets}" Width="50%" SelectedItem="{²CurrentWidget}">
-                               <Template>
-                               </Template>
+                       <ListBox Data="{Widgets}" Width="200" SelectedItem="{²CurrentWidget}"
+                               ItemTemplate="#Dbg.WidgetRecord.itemp">                         
                        </ListBox>
                        <Splitter/>
                        <VerticalStack>
                                        <Label Text="{CurrentWidget}"/>
                                        <Label Text="events"/>
                                </HorizontalStack>
-                               <ListBox  Data="{CurWidgetEvents}" Background="Black" SelectedItem="{²CurrentEvent}">
+                               <ListBox  Data="{CurrentWidgetEvents}" Background="Black" SelectedItem="{²CurrentEvent}">
                                        <ItemTemplate>
                                                <ListItem Margin="0" Height="16" IsSelected="{²IsSelected}" Width="Fit"
-                                                                       Selected="{Background=${ControlHighlight}}"
+                                                                       Selected="{Background=${ControlHighlight}}" Template="Crow.ScrollingListBox.template"
                                                                        Unselected="{Background=Transparent}">
-                                                       <DbgEventWidget Height="10" Width="Fit" Event="{}" Tooltip="#Dbg.DbgEvtTooltip.crow" TicksPerPixel="300" VerticalAlignment="Center"/>
+                                                       <DbgEventWidget Height="10" Width="Fit" Event="{}" Tooltip="#Dbg.DbgEvtTooltip.crow" TicksPerPixel="50" VerticalAlignment="Center"/>
                                                </ListItem>
                                        </ItemTemplate>
                                        <Template>
                                                        ItemTemplate="#Dbg.DbgEventTreeItems.itemp"/>-->
                        </VerticalStack>
                        <Splitter/>
-                       <VerticalStack Height="Stretched" Width="20%" Margin="${TooltipMargin}" DataSource="{CurrentEvent}">
-                               <Label Text="{type}" Background="{Color}" Foreground="Black" Width="200" TextAlignment="Center" Margin="6"/>
-                               <HorizontalStack Height="Fit" Width="Stretched" Spacing="2" Visible="{IsWidgetEvent}" Background="DimGrey" Margin="2">
-                                       <Label Text="Instance:" Foreground="White" Width="50%" />       
-                                       <Label Text="{InstanceIndex}" Foreground="White" Background="Onyx" Width="Stretched" TextAlignment="Center"/>                           
-                               </HorizontalStack>
-                               <HorizontalStack Height="Fit" Width="Stretched" Spacing="2" Background="DimGrey" Margin="2">
-                                       <Label Text="Duration:" Foreground="White" Width="50%" />       
-                                       <Label Text="{DurationMS}" Foreground="White" Background="Onyx" Width="Stretched" TextAlignment="Right"/>                               
-                               </HorizontalStack>
-                               <HorizontalStack Height="Fit" Width="Stretched" Spacing="2">
-                                       <Label Text="Begin:" Foreground="${TooltipForeground}" Width="50%"/>    
-                                       <Label Text="{BeginMS}" Foreground="${TooltipForeground}" Width="Stretched" TextAlignment="Right"/>                             
-                               </HorizontalStack>
-                               <HorizontalStack Height="Fit" Width="Stretched" Spacing="2">
-                                       <Label Text="End:" Foreground="${TooltipForeground}" Width="50%"/>      
-                                       <Label Text="{EndMS}" Foreground="${TooltipForeground}" Width="Stretched" TextAlignment="Right"/>                               
-                               </HorizontalStack>
-                               <VerticalStack Height="Fit" Width="Stretched" IsVisible="{IsLayoutEvent}" >
-                                       <HorizontalStack Height="Fit" Width="Stretched" Spacing="2" Background="DimGrey" Margin="2">
-                                               <Label Text="Layout:" Foreground="White" Width="50%" /> 
-                                               <Label Text="{layouting}" Foreground="White" Background="Onyx" Width="Stretched" TextAlignment="Center"/>                               
-                                       </HorizontalStack>
-                                       <HorizontalStack Height="Fit" Width="Stretched" Spacing="2" Background="DimGrey" Margin="2">
-                                               <Label Text="Result:" Foreground="White" Width="50%" /> 
-                                               <Label Text="{result}" Foreground="White" Background="Onyx" Width="Stretched" TextAlignment="Center"/>                          
-                                       </HorizontalStack>
-                                       <HorizontalStack Height="Fit" Width="Stretched" Spacing="2" Background="DimGrey" Margin="2">
-                                               <Label Text="Old Slot:" Foreground="White" Width="50%" />       
-                                               <Label Text="{OldSlot}" Foreground="White" Background="Onyx" Width="Stretched" TextAlignment="Center"/>                         
-                                       </HorizontalStack>
-                                       <HorizontalStack Height="Fit" Width="Stretched" Spacing="2" Background="DimGrey" Margin="2">
-                                               <Label Text="New Slot:" Foreground="White" Width="50%" />       
-                                               <Label Text="{NewSlot}" Foreground="White" Background="Onyx" Width="Stretched" TextAlignment="Center"/>                         
-                                       </HorizontalStack>
+                       <DbgEventView Template="#Dbg.DbgEventView.template" Event="{../../dbv.HoverEvent}"/>
+                       <Splitter/>
+                       <DbgEventView Template="#Dbg.DbgEventView.template" Event="{CurrentEvent}"/>
+               </HorizontalStack>
+               <HorizontalStack Height="Fit" Background="Onyx" Margin="1">
+                       <HorizontalStack Height="Fit" DataSource="{CurrentEvent}">
+                               <Label Foreground="Black" Text="Current Event:" Background="{Color}" Margin="2" />
+                               <DbgEventWidget Height="14" Width="Stretched" Event="{}" Tooltip="#Dbg.DbgEvtTooltip.crow" />
+                       </HorizontalStack>
+                       <Menu Fit="true" Data="{EventCommands}">
+                               <ItemTemplate>
+                                       <Button Command="{}"/>
+                               </ItemTemplate>
+                       </Menu>
+                       <Popper Caption="Search...">
+                               <VerticalStack Fit="true" Background="Onyx" Margin="10">
+                                       <ComboBox Caption="Event Type" Data="{AllEventTypes}" SelectedItem="{²SearchEventType}"/>
+                                       <ComboBox Caption="Widget" Data="{Widgets}" SelectedItem="{²SearchWidget}"/>
                                </VerticalStack>
-                               <DbgEventWidget Height="10" Width="Stretched" Event="{}" Tooltip="#Dbg.DbgEvtTooltip.crow" />
-                               <GroupBox Caption="Parent Event" Height="Fit" >
-                                       <DbgEventWidget Height="10" Width="Stretched" Event="{parentEvent}" Tooltip="#Dbg.DbgEvtTooltip.crow" />
-                               </GroupBox>
-                               <!--<Label Text="{}" Foreground="${TooltipForeground}"/>-->
-                       </VerticalStack>                                        
+                       </Popper>
                </HorizontalStack>
        </VerticalStack>
 </Window>
\ No newline at end of file
diff --git a/Samples/DebugLogAnalyzer/ui/WidgetRecord.itemp b/Samples/DebugLogAnalyzer/ui/WidgetRecord.itemp
new file mode 100644 (file)
index 0000000..2b1297d
--- /dev/null
@@ -0,0 +1,11 @@
+<ListItem Height="Fit" Margin="1" Focusable="true" HorizontalAlignment="Left" 
+                               Selected = "{Background=${ControlHighlight}}"
+                               Unselected = "{Background=Transparent}">
+       <HorizontalStack>
+               <Label Text="{name}" Width="Stretched"/>
+               <Label Style="labWidgetRecordList" Text="{listIndex}" Tooltip="List index"/>
+               <Label Style="labWidgetRecordList" Text="{treeIndex}" Tooltip="tree index"/>
+               <Label Style="labWidgetRecordList" Text="{yIndex}" Tooltip="yIndex"/>
+               <Label Style="labWidgetRecordList" Text="{xLevel}" Tooltip="xLevel"/>
+       </HorizontalStack>
+</ListItem>
\ No newline at end of file
index 77772f1057e26aade935fcd3b034c24a6f7dbb3c..90ec61dab2ebede705a8c60f0c210b6138b6b6ac 100644 (file)
@@ -12,4 +12,25 @@ smallLabCaption {
 smallLabValue {
        Font="mono, 10";
        Foreground="White";
+}
+DbgLogViewer {
+       MouseWheelSpeed="3";
+       Font="mono, 8";
+       Background="Onyx";
+}
+DbgEventView {
+       Height="Fit";
+       Width="150";
+}
+ComboBox {
+       Template="#Dbg.ComboBox.template";
+       Background="Jet";
+}
+labWidgetRecordList {
+       Font="mono, 11";
+       Background="Grey";
+       Foreground="Jet";
+       Margin="0";
+       Width="24";
+       TextAlignment="Right";
 }
\ No newline at end of file
diff --git a/Samples/DebugLogAnalyzer/ui/dockWindows/winLogGraph.crow b/Samples/DebugLogAnalyzer/ui/dockWindows/winLogGraph.crow
new file mode 100644 (file)
index 0000000..7e6a11b
--- /dev/null
@@ -0,0 +1,15 @@
+<?xml version="1.0"?>
+<DockWindow Caption="Debug Log" Background="0.05,0.05,0.1,0.9" Width="80%" Height="80%">
+       <VerticalStack Name="LogGraph" Background="DarkGrey">
+               <EnumSelector RadioButtonStyle="CheckBox2" Template="#Dbg.EnumSelector.template"
+                               Caption="Discarded Events" EnumValue="{²../dbv.Filter}" BitFieldExcludeMask="255" />                                   
+               <HorizontalStack>
+                       <DbgLogViewer Visible="true" Name="dbv" Events="{Events}" Widgets="{Widgets}" 
+                                                                        CurrentEvent="{²CurrentEvent}" CurrentWidget="{²CurrentWidget}" />
+                       <ScrollBar Maximum="{../dbv.MaxScrollY}" Value="{²../dbv.ScrollY}" SmallIncrement="1" LargeIncrement="10"
+                                                                                       CursorRatio="{../dbv.ChildHeightRatio}"/>
+               </HorizontalStack>
+               <ScrollBar Style="HScrollBar"  Maximum="{../dbv.MaxScrollX}" Value="{²../dbv.ScrollX}" SmallIncrement="1" LargeIncrement="10"
+                                       CursorRatio="{../dbv.ChildWidthRatio}"/>
+       </VerticalStack>
+</Window>
\ No newline at end of file
index 913220db1f2c3b18824cfd57e72a1f01178dbf04..22d0920de11a5da9344045474408e628379425d5 100644 (file)
@@ -1,8 +1,8 @@
 <?xml version="1.0"?>
 <VerticalStack Background="DarkGrey">
        <HorizontalStack >
-               <TabView Width="25%" >
-                       <VerticalStack Name="Explorer" Background="Onyx">
+               <HorizontalStack Width="25%" >
+                       <VerticalStack Width="50%" Name="Explorer" Background="Onyx">
                                <HorizontalStack Height="Fit" Margin="2" >
                                        <Image Margin="2" Width="16" Height="16" Path="#Crow.Icons.level-up.svg" MouseClick="goUpDirClick"
                                                                 Background="Jet" MouseEnter="{Background=Grey}" MouseLeave="{Background=Jet}" />                       
@@ -60,7 +60,8 @@
                                        </Template>             
                                </DirectoryView>
                        </VerticalStack>
-                       <VerticalStack Name="DebugLogger" Margin="5" IsVisible="false" Background="Onyx">
+                       <Splitter/>
+                       <VerticalStack Name="DebugLogger" Margin="5" IsVisible="true" Background="Onyx">
                                <HorizontalStack Height="Fit">
                                        <Image Width="30" Height="20" Path="#Crow.Icons.IconAlerte.svg" Visible="{../../../../dbgIfaceWidget.CrowDebuggerNOK}"/>
                                        <Label Fit="true" Text="Crow debug assembly path:"/>
@@ -80,7 +81,8 @@
                                                Caption="Recorded Events" EnumValue="{²RecordedEvents}" BitFieldExcludeMask="255" />                                   
                                <EnumSelector RadioButtonStyle="CheckBox2" Template="#Dbg.EnumSelector.template"
                                                Background="Onyx"
-                                               Caption="Discarded Events" EnumValue="{²DiscardedEvents}" BitFieldExcludeMask="255" />                                 
+                                               Caption="Discarded Events" EnumValue="{²DiscardedEvents}" BitFieldExcludeMask="255" />
+                               <CheckBox Caption="Begin recording on startup" IsChecked="{²DebugLogOnStartup}" Background="Onyx"/>                            
                                <HorizontalStack Height="Fit">
                                        <CheckBox Caption="Recording" IsChecked="{²DebugLogRecording}" Height="40" Width="60"  
                                                Checked="{sh.Path='A 8,8,7.5,0,6.3 O 0.8,0,0,1 f O 0,0,0,0.5 G'}"
                                        </Menu>                                 
                                </HorizontalStack>                                      
                        </VerticalStack>                        
-               </TabView>
+               </HorizontalStack>
                <Splitter Width="6" />
                <VerticalStack>
                        <DebugInterfaceWidget Name="dbgIfaceWidget" Height="60%" Background="Black" Focusable="true"
index 915b6b105f110f73c1263fa31b71f74111e19a3e..529c47722721a18ffa18b3f0eef6f0aae307db9e 100644 (file)
        </VerticalStack>
        <Splitter Width="6" />
        <VerticalStack>
+               <!--<VerticalStack Name="Watches" Background="Black" Height="Fit" Width="Stretched">
+                       <HorizontalStack Height="Fit">
+                               <Label Style="smallLabel" Text="hover:" Width="50"/>
+                               <Label Style="smallLabel" Text="{HoverWidget}"/>
+                       </HorizontalStack>
+                       <HorizontalStack Height="Fit">
+                               <Label Style="smallLabel" Text="focus:" Width="50"/>
+                               <Label Style="smallLabel" Text="{FocusedWidget}"/>
+                       </HorizontalStack>
+                       <HorizontalStack Height="Fit">
+                               <Label Style="smallLabel" Text="active:" Width="50"/>
+                               <Label Style="smallLabel" Text="{ActiveWidget}"/>
+                       </HorizontalStack>
+               </VerticalStack>-->
                <Container Name="CrowContainer" Height="60%" Background="Black"/>
                <Splitter/>
                <VerticalStack>
index 1b5d337b0bc5284d05704f6316a51a91d0a0e319..95de45691219e43b65e01e0685b44e5faafb72a0 100644 (file)
@@ -72,8 +72,8 @@ namespace Crow
                        Tokenizer tokenizer = new Tokenizer();
                        Tokens = tokenizer.Tokenize (Source);
 
-                       foreach (Token t in Tokens)
-                               Console.WriteLine ($"{t,-40} {Source.AsSpan(t.Start, t.Length).ToString()}");
+                       /*foreach (Token t in Tokens)
+                               Console.WriteLine ($"{t,-40} {Source.AsSpan(t.Start, t.Length).ToString()}");*/
                }
                public class TokenizerException : Exception {
                        public readonly int Position;
diff --git a/Samples/common/ui/Interfaces/Divers/fitListWithStretchedItems.crow b/Samples/common/ui/Interfaces/Divers/fitListWithStretchedItems.crow
new file mode 100644 (file)
index 0000000..c2342c6
--- /dev/null
@@ -0,0 +1,15 @@
+<?xml version="1.0"?>
+
+<ListBox Data="{TestList}" Width="Fit" >
+       <Template>
+               <Scroller Height="Stretched" Background="DarkRed" Margin="1">
+                       <VerticalStack Name="ItemsContainer" Orientation="Horizontal" VerticalAlignment="Top" Height="Fit" Background="Grey" Margin="20"/>
+               </Scroller>
+       </Template>
+       <ItemTemplate>
+               <!--<Label Text="{}" TextAlignment="Center" Font="mono, 9" Foreground="Black" Margin="10" Width="Stretched" Background="{}"/>-->
+               <Label Text="{}" TextAlignment="Center" Font="mono, 9" Foreground="Black" Margin="10" Background="{}" Width="Stretched" />
+       </ItemTemplate>
+
+</ListBox>
+
diff --git a/Samples/common/ui/Interfaces/Divers/progress.crow b/Samples/common/ui/Interfaces/Divers/progress.crow
new file mode 100644 (file)
index 0000000..b4086cd
--- /dev/null
@@ -0,0 +1,11 @@
+<HorizontalStack Margin="0" Height="Fit" Visible="{ProgressVisible}">
+       <ProgressBar Value="50" Maximum="100" Caption="Progress caption" Width="Stretched" Height="Fit">
+               <Template>
+                       <Group>
+                               <Gauge Background="DarkGrey" Foreground="RoyalBlue" Height="Stretched"
+                                               Orientation="{./Orientation}" Minimum="{./Minimum}" Maximum="{./Maximum}" Value="{./Value}"/>
+                               <Label Foreground="White" Text="{ProgressMessage}" Width="Stretched" Margin="3" Background="Transparent" Height="Fit"/>
+                       </Group>
+               </Template>
+       </ProgressBar>
+</HorizontalStack>
\ No newline at end of file
diff --git a/Samples/common/ui/Interfaces/Divers/splitterWithScrollBar.crow b/Samples/common/ui/Interfaces/Divers/splitterWithScrollBar.crow
new file mode 100644 (file)
index 0000000..2c213ff
--- /dev/null
@@ -0,0 +1,9 @@
+<HorizontalStack Margin="50">
+       <VerticalStack Height="Stretched" Width="33%" Background="SeaGreen">
+               <DirectoryView Margin="1" Name="dv" CurrentDirectory="{CurrentDir}" SelectedItemChanged="Dv_SelectedItemChanged"/>
+       </VerticalStack>
+       <Splitter/>
+       <Label Text="{/Width}" Height="Stretched" Background="SeaGreen" Width="33%" Margin="5"/>
+       <Splitter/>
+       <Label Text="{/Width}" Height="Stretched" Background="SeaGreen" Width="Stretched" Margin="5"/>
+</HorizontalStack>
index 19db194330e74f6254e9db3a5e16631570e9490e..6c916bd9015de449d3141227bbaa559a8dc33a2b 100644 (file)
@@ -1,3 +1,3 @@
 <Menu>
-       <MenuItem Data="{EditsCommands}"/>
+       <MenuItem Data="{AllCommands}" ItemTemplate="#ui.MenuItem.itemp"/>
 </Menu>
\ No newline at end of file
diff --git a/Samples/common/ui/Interfaces/Experimental/menuAllCommands.crow b/Samples/common/ui/Interfaces/Experimental/menuAllCommands.crow
new file mode 100644 (file)
index 0000000..556ce30
--- /dev/null
@@ -0,0 +1,21 @@
+<ListBox Data="{AllCommands}">
+       <Template>
+               <HorizontalStack Name="ItemsContainer" Margin="20" Background="DarkGrey" Fit="true"/>
+       </Template>
+       <ItemTemplate DataType="Crow.Command">
+               <Button Command="{}"/>
+       </ItemTemplate>
+       <ItemTemplate DataType="Crow.CommandGroup">
+               <VerticalStack Fit="true" Background="DarkRed" Margin="10">
+                       <Label Text="{Caption}"/>
+                       <ListBox Data="{Commands}">
+                               <Template>
+                                       <VerticalStack Name="ItemsContainer" Margin="20" Background="DarkGrey" Fit="true"/>
+                               </Template>
+                               <ItemTemplate DataType="Crow.Command">
+                                       <Button Command="{}" />
+                               </ItemTemplate>
+                       </ListBox>
+               </VerticalStack>
+       </ItemTemplate>
+</ListBox>
\ No newline at end of file
diff --git a/Samples/common/ui/Interfaces/Experimental/menuAllCommands2.crow b/Samples/common/ui/Interfaces/Experimental/menuAllCommands2.crow
new file mode 100644 (file)
index 0000000..fe18232
--- /dev/null
@@ -0,0 +1,21 @@
+<Menu>
+       <MenuItem Caption="test" Fit="true">
+               <MenuItem Caption="test" Fit="true"/>
+               <MenuItem Caption="test" Fit="true"/>
+       </MenuItem>
+       <MenuItem Caption="test" Fit="true"/>
+       <MenuItem Data="{AllCommands}" Fit="true">
+               <ItemTemplate DataType="Command">
+                       <MenuItem Command="{}" Fit="true"/>
+               </ItemTemplate>
+               <ItemTemplate DataType="CommandGroup">
+                       <Popper Caption="{Caption}" Fit="true">
+                               <ListBox Data="{Commands}" Fit="true">
+                                       <ItemTemplate>                          
+                                               <MenuItem Command="{}" Fit="true"/>
+                                       </ItemTemplate>
+                               </ListBox>
+                       </Popper>
+               </ItemTemplate>
+       </MenuItem>
+</Menu>
\ No newline at end of file
diff --git a/Samples/common/ui/Interfaces/Experimental/menuAllCommands3.crow b/Samples/common/ui/Interfaces/Experimental/menuAllCommands3.crow
new file mode 100644 (file)
index 0000000..aee3649
--- /dev/null
@@ -0,0 +1,40 @@
+<Menu Data="{AllCommands}">
+       <ItemTemplate DataType="Command">
+               <MenuItem Command="{}" Fit="true"/>
+       </ItemTemplate>
+       <ItemTemplate DataType="CommandGroup">
+               <MenuItem Caption="{Caption}" Fit="true">
+                       <Template>
+                               <ListItem>
+                                       <Popper Font="{./Font}" Caption="{./Caption}"  Background="{./Background}" PopDirection="{./PopDirection}"
+                                               Foreground = "{./Foreground}" CanPop="{./HasChildren}"
+                                               IsPopped="{²./IsOpened}" PopWidth="{./PopWidth}" PopHeight="{./PopHeight}">
+                                               <Template>
+                                                       <CheckBox IsChecked="{²./IsPopped}" Caption="{./Caption}" Background="{./Background}" Foreground="{./Foreground}">
+                                                               <Template>              
+                                                                       <Border Name="border1"
+                                                                                       MinimumSize = "60,0"
+                                                                                       Foreground="Transparent"
+                                                                                       Background="{./Background}">
+                                                                                       <Label Text="{./Caption}"
+                                                                                               Foreground="{./Foreground}"
+                                                                                               Margin="2" HorizontalAlignment="Left"
+                                                                                               Font="{./Font}" />
+                                                                       </Border>
+                                                               </Template>             
+                                                       </CheckBox>
+                                               </Template>
+                                               <Border Foreground="Red" Width="{../PopWidth}" Height="{../PopHeight}" Background="${MenuBackground}">
+                                                       <VerticalStack Name="ItemsContainer" Width="Stretched" />
+                                               </Border>
+                                       </Popper>
+                               </ListItem>
+                       </Template>
+                       <ListBox Data="{Commands}" Fit="true">
+                               <ItemTemplate>
+                                       <MenuItem Command="{}" Fit="true"/>
+                               </ItemTemplate>
+                       </ListBox>
+               </MenuItem>
+       </ItemTemplate>
+</Menu>
\ No newline at end of file
diff --git a/Samples/common/ui/Interfaces/Experimental/menus.crow b/Samples/common/ui/Interfaces/Experimental/menus.crow
new file mode 100644 (file)
index 0000000..6a6855a
--- /dev/null
@@ -0,0 +1,13 @@
+<Menu Caption="test">
+       <MenuItem Caption="parent" Width="Fit">
+               <MenuItem Caption="Test" Width="Fit"/>
+               <MenuItem Data="{Commands}" Caption="menu">
+                       <Template>
+                               <VerticalStack Name="ItemsContainer" Width="Stretched" />
+                       </Template>
+                       <ItemTemplate>
+                               <MenuItem Command="{}"/>
+                       </ItemTemplate>
+               </MenuItem>
+       </MenuItem>
+</Menu>
\ No newline at end of file
diff --git a/Samples/common/ui/Interfaces/Experimental/tabView1.crow b/Samples/common/ui/Interfaces/Experimental/tabView1.crow
new file mode 100644 (file)
index 0000000..5df13d0
--- /dev/null
@@ -0,0 +1,4 @@
+<TabView>
+       <GroupBox Caption="test" Background="Black"/>
+       <GroupBox Caption="test" Background="Black"/>
+</TabView>
\ No newline at end of file
diff --git a/Samples/common/ui/Interfaces/Experimental/tabViewUpdate.crow b/Samples/common/ui/Interfaces/Experimental/tabViewUpdate.crow
new file mode 100644 (file)
index 0000000..11ff78f
--- /dev/null
@@ -0,0 +1,12 @@
+<TabView>
+       <Border Name="container1" Background="Grey">
+       <VerticalStack>
+                       <TextBox Text="{²TestString}" MouseEnter="{Background=Salmon}" MouseLeave="{Background=White}"/>
+       </VerticalStack>
+       </Border>
+       <Border  Name="container2" Background="Grey">
+       <VerticalStack>
+                       <TextBox Text="{²TestString}" Foreground="Blue" MouseEnter="{Background=Salmon}" MouseLeave="{Background=White}"/>
+       </VerticalStack>
+       </Border>
+</TabView>
\ No newline at end of file
index b8277a2b82427507b353602f2b617d4daffe9bf1..b80ee378d3f36e66c139a6f65cc0f64b211504a4 100644 (file)
@@ -1,14 +1,45 @@
-<Table Columns="test,Fit;test,200" Width="Fit" Background="Blue"> 
-       <TableRow Height="Fit" Background="Red" Margin="5">
-               <Label Text="col1" Background="Grey"/>
-               <Label Text="col2" Background="Grey"/>
-       </TableRow>
-       <TableRow Height="Fit" Background="Red" Margin="5">
-               <Label Text="this is a test" Background="Grey"/>
-               <Label Text="{/Width}" Background="Grey"/>
-       </TableRow>
-       <TableRow Height="Fit" Background="Red" Margin="5">
-               <Label Text="{/Width}" Background="Grey"/>
-               <Label Text="fkdksls" Background="Grey"/>
+<Table Columns="test,Fit;test,Fit;test,Stretched;test,Fit" Margin="10" 
+       ColumnSpacing="5" Spacing="5" 
+       Foreground="Red"
+       RowsMargin="0"
+       BorderLineWidth="0"
+       VerticalLineWidth="1"
+       HorizontalLineWidth="1"
+       Background="DarkGrey" >         
+       <TableRow Height="Fit" >
+               <Label Text="firstlkjdqsfmlkjqsl" Background="1,0,0,0.5" HorizontalAlignment="Left" Height="Stretched"/>
+               <Label Text="second" Background="0,1,0,0.5" Height="Stretched"/>
+               <Label Text="third" Background="0,0,1,0.5" Height="Stretched"/>
+               <Label Text="forth" Background="0,1,1,0.5" Height="Stretched"/>
+       </TableRow>
+       <TableRow Height="Fit" >
+               <Label Text="first" Background="1,0,0,0.5" HorizontalAlignment="Left"/>
+               <Label Text="seconddsqfsqdfsdqff" Background="0,1,0,0.5"/>
+               <Label Text="thirdkljhkljhkljhkljhkljhkjhkjh" Background="0,0,1,0.5"/>
+               <Label Text="forthbbbbbbbbbb" Background="0,1,1,0.5"/>
+       </TableRow>
+       <TableRow Height="Fit">
+               <Label Text="first" Background="1,0,0,0.5" HorizontalAlignment="Left"/>
+               <Label Text="second" Background="0,1,0,0.5"/>
+               <Label Text="third" Background="0,0,1,0.5"/>
+               <Label Text="forth" Background="0,1,1,0.5"/>
+       </TableRow>
+       <TableRow Height="Fit" >
+               <Label Text="first" Background="1,0,0,0.5" HorizontalAlignment="Left"/>
+               <Label Text="second" Background="0,1,0,0.5"/>
+               <Label Text="third" Background="0,0,1,0.5"/>
+               <Label Text="forth" Background="0,1,1,0.5"/>
+       </TableRow>
+       <TableRow Height="Fit" >
+               <Label Text="first" Background="1,0,0,0.5" HorizontalAlignment="Left"/>
+               <Label Text="second" Background="0,1,0,0.5"/>
+               <Label Text="third" Background="0,0,1,0.5"/>
+               <Label Text="forth" Background="0,1,1,0.5"/>
+       </TableRow>
+       <TableRow Height="Fit" >
+               <Label Text="first" Background="1,0,0,0.5" HorizontalAlignment="Left"/>
+               <Label Text="second" Background="0,1,0,0.5"/>
+               <Label Text="third" Background="0,0,1,0.5"/>
+               <Label Text="forth" Background="0,1,1,0.5"/>
        </TableRow>
 </Table>
\ No newline at end of file
diff --git a/Samples/common/ui/Interfaces/Experimental/tabviewOrientation.crow b/Samples/common/ui/Interfaces/Experimental/tabviewOrientation.crow
new file mode 100644 (file)
index 0000000..158cb16
--- /dev/null
@@ -0,0 +1,26 @@
+<TabView Orientation="Horizontal">
+       <Template>
+               <GenericStack Orientation="{./OppositeOrientation}" Spacing="0" Background="{./Background}"> 
+                       <ListBox  Data="{./Items}" Fit="true" HorizontalAlignment="Left" VerticalAlignment="Top" SelectedItem="{²./SelectedItem}"> 
+                               <Template>
+                                       <GenericStack Orientation="{../../../Orientation}" Name="ItemsContainer" />
+                               </Template>
+                               <ItemTemplate>
+                                       <ListItem Fit="true" Background="${InactiveTabItem}" IsSelected="{IsVisible}" Margin="5"
+                                                       Selected="{.DataSource.Visible='true'};{Background=.DataSource.Background}"
+                                                       Unselected="{.DataSource.Visible='false'};{Background=${InactiveTabItem}}"> 
+                                               <Label Text="{Name}" />
+                                       </ListItem>
+                               </ItemTemplate>
+                       </ListBox>
+                       <Group Name="ItemsContainer" />
+               </GenericStack>
+       </Template>
+       <GroupBox Name="item 1" Caption="item 1" IsVisible="true" Background="Violet"/>                 
+       <GroupBox Name="item 2" Caption="item 2" IsVisible="false" Background="CornflowerBlue"/>
+       <GroupBox Name="item 3" Caption="item 3" IsVisible="false" Background="Red"/>
+       <GroupBox Name="item 4" Caption="item 4" IsVisible="false" Background="Green"/>
+       <GroupBox Name="item 5" Caption="item 5" IsVisible="false" Background="Brown"/>
+       <GroupBox Name="item 6" Caption="item 6" IsVisible="false" Background="RoyalBlue"/>
+       <GroupBox Name="item 7" Caption="item 7" IsVisible="false" Background="Yellow"/>
+</TabView>
\ No newline at end of file
diff --git a/Samples/common/ui/Interfaces/Experimental/tabviewOrientationDynamic.crow b/Samples/common/ui/Interfaces/Experimental/tabviewOrientationDynamic.crow
new file mode 100644 (file)
index 0000000..cfddcb9
--- /dev/null
@@ -0,0 +1,30 @@
+<VerticalStack>
+<!--   <EnumSelector EnumValue="{²../tv.Orientation}" />-->
+       <TabView Name="tv" Orientation="Horizontal" >
+               <Template>
+                       <GenericStack Orientation="{./OppositeOrientation}" Spacing="0" Background="{./Background}" > 
+                               <ListBox  Data="{./Items}" Width="{./TabHeight}" Height="{./TabWidth}" HorizontalAlignment="Left" VerticalAlignment="Top"
+                                                       SelectedItem="{²./SelectedItem}"> 
+                                       <Template>
+                                               <GenericStack Orientation="{../../../Orientation}" Name="ItemsContainer"  />
+                                       </Template>
+                                       <ItemTemplate>
+                                               <ListItem Fit="true" Background="${InactiveTabItem}" IsSelected="{IsVisible}" Margin="5"
+                                                               Selected="{.DataSource.Visible='true'};{Background=.DataSource.Background}"
+                                                               Unselected="{.DataSource.Visible='false'};{Background=${InactiveTabItem}}"> 
+                                                       <Label Text="{Name}" />
+                                               </ListItem>
+                                       </ItemTemplate>
+                               </ListBox>
+                               <Group Name="ItemsContainer" />
+                       </GenericStack>
+               </Template>
+               <GroupBox Name="item 1" Caption="item 1" IsVisible="true" Background="Violet"/>                 
+               <GroupBox Name="item 2" Caption="item 2" IsVisible="false" Background="CornflowerBlue"/>
+               <GroupBox Name="item 3" Caption="item 3" IsVisible="false" Background="Red"/>
+               <GroupBox Name="item 4" Caption="item 4" IsVisible="false" Background="Green"/>
+               <GroupBox Name="item 5" Caption="item 5" IsVisible="false" Background="Brown"/>
+               <GroupBox Name="item 6" Caption="item 6" IsVisible="false" Background="RoyalBlue"/>
+               <GroupBox Name="item 7" Caption="item 7" IsVisible="false" Background="Yellow"/>
+       </TabView>
+</VerticalStack>
\ No newline at end of file
index b876ab7f6dd290a8d6f1aa15596570432b7c6791..a73f9471d9c5ceb71a79c956e7c4f91dbaeac026 100644 (file)
@@ -1,28 +1,27 @@
-<VerticalStack>
-       <ListBox Name="lb">
-               <Template>
-                       <VerticalStack Spacing="0"> 
-                               <ListBox Data="{./Items}" Height="Fit" SelectedItem="{²./SelectedItem}">
-                                       <Template>
-                                               <HorizontalStack Name="ItemsContainer" Background="{./Background}"/>
-                                       </Template>
-                                       <ItemTemplate>
-                                               <ListItem Width="Fit" Background="Transparent" IsSelected="{²IsVisible}"
-                                                               Tooltip="{GetType}"
-                                                               Selected="{DataSource.Visible='true'};{Background=CornflowerBlue}"
-                                                               Unselected="{.DataSource.Visible='false'};{Background=Transparent}"> 
-                                                       <Label Text="{Caption}" Margin="5" />
-                                               </ListItem>
-                                       </ItemTemplate>
-                               </ListBox>                      
-                               <Group Name="ItemsContainer"/>
-                       </VerticalStack>
-               </Template>
-               <GroupBox Caption="item 1" IsVisible="true" Background="CornflowerBlue">
-                       <Label Text="{Caption}"/>
-               </GroupBox>
-               <GroupBox Caption="item 2" IsVisible="false" Background="CornflowerBlue"/>
-               <GroupBox Caption="item 3" IsVisible="false" Background="CornflowerBlue"/>
-       </ListBox>
-       <Label DataSource="{../lb.SelectedItem}" Text="{Caption}"/> 
-</VerticalStack>
\ No newline at end of file
+<TabView Orientation="Vertical">
+       <Template>
+               <GenericStack Orientation="{./OppositeOrientation}" Spacing="0" Background="{./Background}" > 
+                       <ListBox  Data="{./Items}" Width="Fit" Height="Fit" HorizontalAlignment="Left" VerticalAlignment="Top"
+                                               SelectedItem="{²./SelectedItem}"> 
+                               <Template>
+                                       <GenericStack Orientation="{../../../Orientation}" Name="ItemsContainer" Width="Fit" />
+                               </Template>
+                               <ItemTemplate>
+                                       <ListItem Width="Stretched" Height="Fit" Background="${InactiveTabItem}" IsSelected="{IsVisible}" Margin="5"
+                                                       Selected="{.DataSource.Visible='true'};{Background=.DataSource.Background}"
+                                                       Unselected="{.DataSource.Visible='false'};{Background=${InactiveTabItem}}"> 
+                                               <Label Text="{Name}" Width="Fit" />
+                                       </ListItem>
+                               </ItemTemplate>
+                       </ListBox>
+                       <Group Name="ItemsContainer" />
+               </GenericStack>
+       </Template>
+       <GroupBox Name="item 1qdsf" Caption="item 1" IsVisible="true" Background="Violet"/>                     
+       <GroupBox Name="item 2qdsmlkjqsdlfkj" Caption="item 2" IsVisible="false" Background="CornflowerBlue"/>
+       <GroupBox Name="item 3" Caption="item 3" IsVisible="false" Background="Red"/>
+       <GroupBox Name="item 4qsdfmlkjqs" Caption="item 4" IsVisible="false" Background="Green"/>
+       <GroupBox Name="item 5" Caption="item 5" IsVisible="false" Background="Brown"/>
+       <GroupBox Name="item 6" Caption="item 6" IsVisible="false" Background="RoyalBlue"/>
+       <GroupBox Name="item 7qsdf" Caption="item 7" IsVisible="false" Background="Yellow"/>
+</TabView>
\ No newline at end of file
index 6ecc74ed32549f94759530ef25dc69275cdd1078..d1f24c4fa17127a55278c3717ef08948dd6ae324 100644 (file)
@@ -1,4 +1,5 @@
-<HorizontalStack Spacing="0" > 
+<?xml version="1.0"?>
+<HorizontalStack Spacing="0" > 
        <ListBox Data="{../grp.Children}" Width="Fit"> 
                <Template>
                        <VerticalStack Name="ItemsContainer" Background="{./Background}"/> 
diff --git a/Samples/common/ui/Interfaces/Experimental/treeViewMenu.crow b/Samples/common/ui/Interfaces/Experimental/treeViewMenu.crow
new file mode 100644 (file)
index 0000000..bd45b85
--- /dev/null
@@ -0,0 +1,45 @@
+<TreeView Data="{AllCommands}" Fit="true">
+       <Template>
+               <VerticalStack Name="ItemsContainer"/>
+       </Template>
+       <ItemTemplate DataType="Crow.Command">
+               <ListItem CornerRadius="2" Margin="0" Fit="true"
+                               Selected="{Background=${ControlHighlight}}"
+                               Unselected="{Background=Transparent}">
+                       <Button Command="{}" />
+               </ListItem>
+       </ItemTemplate>
+       <ItemTemplate DataType="Crow.CommandGroup" Data="Commands">
+               <ListItem
+                               Selected="{/exp.Background=${ControlHighlight}}"
+                               Unselected="{/exp.Background=Transparent}">
+                       <Expandable Name="exp" Caption="{Name}" MouseDoubleClick="/onClickForExpand">
+                               <Template>
+                                       <VerticalStack>
+                                               <Border CornerRadius="2" Margin="0" Height="Fit" MouseDoubleClick="./onClickForExpand"
+                                                               Foreground="Transparent"
+                                                               MouseEnter="{Foreground=DimGrey}"
+                                                               MouseLeave="{Foreground=Transparent}">
+                                                       <HorizontalStack Background="{./Background}" Spacing="1">
+                                                               <Image Margin="1" Width="9" Height="9" Focusable="true" MouseDown="./onClickForExpand"
+                                                                       Path="{./Image}"
+                                                                       Visible="{./IsExpandable}"
+                                                                       SvgSub="{./IsExpanded}"
+                                                                       MouseEnter="{Background=LightGrey}"
+                                                                       MouseLeave="{Background=Transparent}"/>
+                                                               <Image Margin="1" Width="16" Height="16"
+                                                                       Path="#Crow.Icons.folder.svg" SvgSub="{./IsExpanded}"/>
+                                                               <Label Text="{./Caption}"/>
+                                                       </HorizontalStack>
+                                               </Border>
+                                               <Container Name="Content" Visible="false"/>
+                                       </VerticalStack>
+                               </Template>
+                               <HorizontalStack Height="Fit">
+                                       <Widget Width="12" Height="10"/>
+                                       <VerticalStack Height="Fit" Name="ItemsContainer"/>
+                               </HorizontalStack>
+                       </Expandable>
+               </ListItem>
+       </ItemTemplate>
+</TreeView>
\ No newline at end of file
diff --git a/Samples/common/ui/Interfaces/GraphicObject/blueLine.crow b/Samples/common/ui/Interfaces/GraphicObject/blueLine.crow
new file mode 100644 (file)
index 0000000..32d5c16
--- /dev/null
@@ -0,0 +1,3 @@
+<?xml version="1.0"?>
+<Widget Margin="10" Width="0" Height="20"
+               Background = "vgradient|0:0.1,0.1,0.1,0.1|0.5:Blue|1:0.1,0.1,0.1,0.1"/>
\ No newline at end of file
index fdd5edcf8dbd8a9b0e251c0872f2bc66af5de019..dc230cb661f0a8b3ab21860f31fba086674104db 100644 (file)
@@ -4,4 +4,17 @@
        <Label Text="this is a test" Margin="0" Width="Stretched" Height="Fit" Background="SeaGreen"/>
        <Label Text="this is a test" Margin="0" Width="Stretched" Height="Fit" Background="SeaGreen"/>
        <Label Text="this is a test" Margin="0" Width="Stretched" Height="Fit" Background="SeaGreen"/>
+       <Label Text="this is a test" Margin="0" Width="Stretched" Height="Fit" Background="SeaGreen"/>
+       <Label Text="this is a test" Margin="0" Width="Stretched" Height="Fit" Background="SeaGreen"/>
+       <Label Text="this is a test" Margin="0" Width="Stretched" Height="Fit" Background="SeaGreen"/>
+       <Label Text="this is a test" Margin="0" Width="Stretched" Height="Fit" Background="SeaGreen"/>
+       <Label Text="this is a test" Margin="0" Width="Stretched" Height="Fit" Background="SeaGreen"/>
+       <Label Text="this is a test" Margin="0" Width="Stretched" Height="Fit" Background="SeaGreen"/>
+       <Label Text="this is a test" Margin="0" Width="Stretched" Height="Fit" Background="SeaGreen"/>
+       <Label Text="this is a test" Margin="0" Width="Stretched" Height="Fit" Background="SeaGreen"/>
+       <Label Text="this is a test" Margin="0" Width="Stretched" Height="Fit" Background="SeaGreen"/>
+       <Label Text="this is a test" Margin="0" Width="Stretched" Height="Fit" Background="SeaGreen"/>
+       <Label Text="this is a test" Margin="0" Width="Stretched" Height="Fit" Background="SeaGreen"/>
+       <Label Text="this is a test" Margin="0" Width="Stretched" Height="Fit" Background="SeaGreen"/>
+       <Label Text="this is a test" Margin="0" Width="Stretched" Height="Fit" Background="SeaGreen"/>
 </VerticalStack>
\ No newline at end of file
index 57a57609b36c06c227198ba589fcf8a412ce3d59..612caeb5b47276467b96942609e644664d5e47e7 100644 (file)
@@ -4,10 +4,10 @@
                <VerticalStack Width="Stretched" Margin="10" Background="FireBrick">
                        <VerticalStack Width="Stretched" Margin="10" Background="Teal">
                                <VerticalStack Width="Stretched" Margin="10" Background="CornflowerBlue">
-                                       <Label Text="{./Caption}" Width="Stretched"/>
-                                       <Label Text="{./Caption}" Width="Stretched"/>
-                                       <Label Text="{./Caption}" Width="Stretched"/>
-                                       <Label Text="{./Caption}" Width="Stretched"/>
+                                       <Label Text="test" Width="Stretched" Foreground="Black"/>
+                                       <Label Text="Caption" Width="Stretched"/>
+                                       <Label Text="Caption" Width="Stretched"/>
+                                       <Label Text="Caption" Width="Stretched"/>
                                </VerticalStack>
                        </VerticalStack>
                </VerticalStack>
diff --git a/Samples/common/ui/templates/MenuItem.itemp b/Samples/common/ui/templates/MenuItem.itemp
new file mode 100644 (file)
index 0000000..5cd22d2
--- /dev/null
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<ItemTemplate DataType="Command">
+       <Button Command="{}" Fit="true"/>
+</ItemTemplate>
+<ItemTemplate DataType="CommandGroup">
+       <MenuItem Data="{}" Fit="true" />
+</ItemTemplate>
+