aboutsummaryrefslogtreecommitdiffstatsci
diff options
context:
space:
mode:
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>2021-09-22 06:22:39 +0000
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>2021-09-22 06:22:39 +0000
commitebe7a7444df1340698d175b7e524824c9dcecb37 (patch)
treeed69ce555fa57e83b89ec92a8027598e6057ae5f
parent0cc2b90922af9ddb19d7e8a830323fc9c7fb2254 (diff)
add virtual onSelectedItemChanged in TemplatedGroup
-rw-r--r--Crow/src/Widgets/ScrollingStack.cs20
-rw-r--r--Crow/src/Widgets/TemplatedGroup.cs5
-rw-r--r--Directory.Build.props2
-rw-r--r--Samples/ShowCase/ShowCase.cs1
4 files changed, 16 insertions, 12 deletions
diff --git a/Crow/src/Widgets/ScrollingStack.cs b/Crow/src/Widgets/ScrollingStack.cs
index 6bda175c..07f968a0 100644
--- a/Crow/src/Widgets/ScrollingStack.cs
+++ b/Crow/src/Widgets/ScrollingStack.cs
@@ -47,7 +47,7 @@ namespace Crow {
NotifyValueChangedAuto (maxScroll);
//RegisterForGraphicUpdate ();
}
- }
+ }
@@ -84,11 +84,11 @@ namespace Crow {
Widget go = sender as Widget;
if (Orientation == Orientation.Horizontal) {
- if (arg.LayoutType == LayoutingType.Width && itemSize < go.Slot.Width)
+ if (arg.LayoutType == LayoutingType.Width && itemSize < go.Slot.Width)
itemSize = go.Slot.Width;
} else if (arg.LayoutType == LayoutingType.Height && itemSize < go.Slot.Height)
itemSize = go.Slot.Height;
-
+
base.OnChildLayoutChanges (sender, arg);
DbgLogger.EndEvent(DbgEvtType.GOOnChildLayoutChange);
}
@@ -105,7 +105,7 @@ namespace Crow {
{
DbgLogger.StartEvent (DbgEvtType.GODraw, this);
- base.onDraw (gr);
+ base.onDraw (gr);
if (ClipToClientRect) {
gr.Save ();
@@ -115,7 +115,7 @@ namespace Crow {
}
childrenRWLock.EnterReadLock ();
- try {
+ try {
for (int i = Scroll; i < Children.Count && i < Scroll + visibleItems; i++) {
if (!Children[i].IsVisible)
continue;
@@ -177,10 +177,10 @@ namespace Crow {
}/*else
Console.WriteLine("GROUP REPAINT WITH EMPTY CLIPPING");*/
paintCache (ctx, Slot + Parent.ClientRectangle.Position);
- DbgLogger.EndEvent(DbgEvtType.GOUpdateCache);
- }
+ DbgLogger.EndEvent(DbgEvtType.GOUpdateCache);
+ }
+
-
public override void checkHoverWidget (MouseMoveEventArgs e) {
base.checkHoverWidget (e);//TODO:check if not possible to put it at beginning of meth to avoid doubled check to DropTarget.
if (!childrenRWLock.TryEnterReadLock (10))
@@ -197,9 +197,9 @@ namespace Crow {
}
}
/// <summary> Process scrolling vertically, or if shift is down, vertically </summary>
- public override void onMouseWheel (object sender, MouseWheelEventArgs e) {
+ public override void onMouseWheel (object sender, MouseWheelEventArgs e) {
e.Handled = true;
- Scroll += e.Delta * itemSize;
+ Scroll += e.Delta * itemSize;
base.onMouseWheel (sender, e);
}
}
diff --git a/Crow/src/Widgets/TemplatedGroup.cs b/Crow/src/Widgets/TemplatedGroup.cs
index e67625fe..bc00a0f3 100644
--- a/Crow/src/Widgets/TemplatedGroup.cs
+++ b/Crow/src/Widgets/TemplatedGroup.cs
@@ -203,9 +203,12 @@ namespace Crow {
NotifyValueChanged ("SelectedItem", SelectedItem);
NotifyValueChanged ("SelectedIndex", SelectedIndex);
- SelectedItemChanged.Raise (this, new SelectionChangeEventArgs (SelectedItem));
+ onSelectedItemChanged (this, new SelectionChangeEventArgs (SelectedItem));
}
}
+ public virtual void onSelectedItemChanged (object sender, SelectionChangeEventArgs e) {
+ SelectedItemChanged.Raise (sender, e);
+ }
[XmlIgnore]public virtual int SelectedIndex{
get => selectedItemContainer == null ? -1 : itemsContainer.Children.IndexOf (selectedItemContainer);
set {
diff --git a/Directory.Build.props b/Directory.Build.props
index ba354726..a0ea5fb5 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -15,7 +15,7 @@
<!-- Compile with logging enabled, this will slow down apps, use this only
for debugging purpose-->
- <CrowDebugLogEnabled>true</CrowDebugLogEnabled>
+ <CrowDebugLogEnabled>false</CrowDebugLogEnabled>
<!-- Collect several statistics on widgets-->
<CrowDebugStatsEnabled>false</CrowDebugStatsEnabled>
diff --git a/Samples/ShowCase/ShowCase.cs b/Samples/ShowCase/ShowCase.cs
index 37582cfe..71556f01 100644
--- a/Samples/ShowCase/ShowCase.cs
+++ b/Samples/ShowCase/ShowCase.cs
@@ -79,6 +79,7 @@ namespace ShowCase
}
void showError (Exception ex) {
+ Console.WriteLine (ex);
NotifyValueChanged ("ErrorMessage", ex);
NotifyValueChanged ("ShowError", true);
}