</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'))">
MenuBackground = "Jet";
-InactiveTabItem = "Jet";
+InactiveTabItem = "DarkGrey";
Button, CheckBox, RadioButton, ComboBox, Expandable,
MessageBox, Popper, Slider, Spinner, TextBox {
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
{
AliceBlue = 0xF0F8FFFF,
AntiqueWhite = 0xFAEBD7FF,
- Aqua = 0x00FFFFFF,
+ //Aqua = 0x00FFFFFF,
Aquamarine = 0x7FFFD4FF,
Azure = 0xF0FFFFFF,
Beige = 0xF5F5DCFF,
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;
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:
case DbgEvtType.GORegisterClip:
return Colors.Turquoise;
case DbgEvtType.GOResetClip:
- return Colors.DarkRed;
+ return Colors.DarkSalmon;
case DbgEvtType.GORegisterForGraphicUpdate:
return Colors.LightPink;
case DbgEvtType.GOEnqueueForRepaint:
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;
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;
}
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 ();
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)
{
#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();
}
}
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;
}
}
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();
+
}
}
}
//
// 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
Element = element;
}
}
+ public class ListClearEventArg : EventArgs
+ {
+ public IEnumerable<object> Elements;
+ public ListClearEventArg (IEnumerable<object> elements) {
+ Elements = elements;
+ }
+ }
}
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) });
event EventHandler<ListChangedEventArg> ListAdd;
event EventHandler<ListChangedEventArg> ListRemove;
event EventHandler<ListChangedEventArg> ListEdit;
- event EventHandler<ListChangedEventArg> ListClear;
+ event EventHandler<ListClearEventArg> ListClear;
void Insert ();
void Remove ();
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>
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>
/// <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>
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];
#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 ();
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)) {
using System;
using System.Collections.Generic;
+using System.Linq;
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 () {}
}
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)
#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);
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;
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);
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; }
//
// 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; }
+ }
+ }
}
}
public override int measureRawSize(LayoutingType lt)
{
+ DbgLogger.StartEvent(DbgEvtType.GOMeasure, this, lt);
+
if ((bool)lines?.IsEmpty)
getLines ();
measureTextBounds (gr);
}
}
+ DbgLogger.EndEvent(DbgEvtType.GOMeasure);
return Margin * 2 + (lt == LayoutingType.Height ? cachedTextSize.Height : cachedTextSize.Width);
}
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;
}
protected override void onDraw (Context gr)
{
+ DbgLogger.StartEvent(DbgEvtType.GODraw, this);
+
base.onDraw (gr);
gr.SelectFontFace (Font.Name, Font.Slant, Font.Wheight);
}
gr.Restore ();
+ DbgLogger.EndEvent (DbgEvtType.GODraw);
}
#endregion
orientation = value;
NotifyValueChangedAuto (orientation);
NotifyValueChanged ("OppositeOrientation", OppositeOrientation);
+ NotifyValueChanged ("TabWidth", TabWidth);
+ NotifyValueChanged ("TabHeight", TabHeight);
+ RegisterForLayouting (LayoutingType.Sizing);
}
}
public Orientation OppositeOrientation
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;
+ }
}
}
}
object selectedItem;
- Widget selectedItemContainer = null;
+ protected Widget selectedItemContainer = null;
[XmlIgnore]public virtual object SelectedItem{
get => selectedItem;
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 ();
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);
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);
// 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;
/*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) {
return;
}
RegisterForLayouting (LayoutingType.ArrangeChildren);
- raiseLayoutChanged (new LayoutingEventArgs (layoutType));
+ raiseLayoutChanged (layoutType);
}
#endregion
}
<Compile Include="src\**\*.cs"/>
</ItemGroup>
<ItemGroup>
- <EmbeddedResource Include="ui\*.*">
+ <EmbeddedResource Include="ui\**\*.*">
<LogicalName>Dbg.%(Filename)%(Extension)</LogicalName>
</EmbeddedResource>
</ItemGroup>
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 (){}
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);
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)
{
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)
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;
}
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;
}
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 {
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)
using CrowDbgShared;
using System.Collections.Generic;
using Crow.DebugLogger;
+using System.Linq;
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;
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>),
}
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);
}
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);
}
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()
{
}
+ 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;
}
using System.Collections.Generic;
using Encoding = System.Text.Encoding;
using Crow.DebugLogger;
+using System.Linq;
namespace DebugLogAnalyzer
{
/*TreeView tv = FindByName("dbgTV") as TreeView;
dbgTreeViewScroller = tv.FindByNameInTemplate ("scroller1") as Scroller;*/
-
+ if (DebugLogOnStartup)
+ DebugLogRecording = true;
if (!File.Exists (CurrentFile))
newFile ();
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 ()
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; })
NotifyValueChanged(CrowDbgAssemblyLocation);
}
}
- public List<DbgEvent> Events {
+ public ObservableList<DbgEvent> Events {
get => events;
set {
if (events == value)
NotifyValueChanged (nameof (Events), events);
}
}
- public List<DbgWidgetRecord> Widgets {
+ public ObservableList<DbgWidgetRecord> Widgets {
get => widgets;
set {
if (widgets == value)
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 {
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;
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";
--- /dev/null
+<?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>
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>
--- /dev/null
+<?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
<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:" />
<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
--- /dev/null
+<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
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
--- /dev/null
+<?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
<?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}" />
</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:"/>
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"
</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>
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;
--- /dev/null
+<?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>
+
--- /dev/null
+<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
--- /dev/null
+<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>
<Menu>
- <MenuItem Data="{EditsCommands}"/>
+ <MenuItem Data="{AllCommands}" ItemTemplate="#ui.MenuItem.itemp"/>
</Menu>
\ No newline at end of file
--- /dev/null
+<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
--- /dev/null
+<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
--- /dev/null
+<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
--- /dev/null
+<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
--- /dev/null
+<TabView>
+ <GroupBox Caption="test" Background="Black"/>
+ <GroupBox Caption="test" Background="Black"/>
+</TabView>
\ No newline at end of file
--- /dev/null
+<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
-<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
--- /dev/null
+<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
--- /dev/null
+<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
-<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
-<HorizontalStack Spacing="0" >
+<?xml version="1.0"?>
+<HorizontalStack Spacing="0" >
<ListBox Data="{../grp.Children}" Width="Fit">
<Template>
<VerticalStack Name="ItemsContainer" Background="{./Background}"/>
--- /dev/null
+<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
--- /dev/null
+<?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
<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
<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>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" ?>
+<ItemTemplate DataType="Command">
+ <Button Command="{}" Fit="true"/>
+</ItemTemplate>
+<ItemTemplate DataType="CommandGroup">
+ <MenuItem Data="{}" Fit="true" />
+</ItemTemplate>
+