aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/GraphicObjects
diff options
context:
space:
mode:
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>2018-11-24 10:48:34 +0100
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>2018-11-24 10:48:34 +0100
commit98eada369aa50115e677a1b337662fee9f0ca011 (patch)
tree6855bc602c4da5f6a13c90276452b438172c1d3d /src/GraphicObjects
parent4db409fdff013e3e4249d567e4d6fdb0ee877256 (diff)
debug log viewer, X backends
Diffstat (limited to 'src/GraphicObjects')
-rw-r--r--src/GraphicObjects/GraphicObject.cs32
-rw-r--r--src/GraphicObjects/Scroller.cs4
-rw-r--r--src/GraphicObjects/ScrollingObject.cs4
-rw-r--r--src/GraphicObjects/TextBox.cs11
4 files changed, 27 insertions, 24 deletions
diff --git a/src/GraphicObjects/GraphicObject.cs b/src/GraphicObjects/GraphicObject.cs
index c7fbcb18..a55682b1 100644
--- a/src/GraphicObjects/GraphicObject.cs
+++ b/src/GraphicObjects/GraphicObject.cs
@@ -423,9 +423,9 @@ namespace Crow
/// <summary>Occurs when mouse leave this object</summary>
public event EventHandler<MouseMoveEventArgs> MouseLeave;
/// <summary>Occurs when key is pressed when this object is active</summary>
- public event EventHandler<KeyboardKeyEventArgs> KeyDown;
+ public event EventHandler<KeyEventArgs> KeyDown;
/// <summary>Occurs when key is released when this object is active</summary>
- public event EventHandler<KeyboardKeyEventArgs> KeyUp;
+ public event EventHandler<KeyEventArgs> KeyUp;
/// <summary>Occurs when translated key event occurs in the host when this object is active</summary>
public event EventHandler<KeyPressEventArgs> KeyPress;
/// <summary>Occurs when this object received focus</summary>
@@ -505,7 +505,7 @@ namespace Crow
this.RegisterForRedraw ();
}
}
- #if DEBUG
+ #if DEBUG_LOG
[XmlIgnore]public string TreePath {
get { return this.GetType().Name + GraphicObjects.IndexOf(this).ToString (); }
}
@@ -518,7 +518,7 @@ namespace Crow
[DesignCategory ("Divers")][DefaultValue(null)]
public virtual string Name {
get {
- #if DEBUG
+ #if DEBUG_LOG
return string.IsNullOrEmpty(name) ? this.GetType().Name + GraphicObjects.IndexOf(this).ToString () : name;
#else
return name;
@@ -1027,9 +1027,9 @@ namespace Crow
/// <summary> Loads the default values from XML attributes default </summary>
public void loadDefaultValues()
{
-// #if DEBUG_LOAD
-// Debug.WriteLine ("LoadDefValues for " + this.ToString ());
-// #endif
+ #if DEBUG_LOG
+ DbgEvent dbgEvt = DebugLog.AddEvent(DbgEvtType.GOInitialization, this);
+ #endif
Type thisType = this.GetType ();
@@ -1193,12 +1193,14 @@ namespace Crow
} catch (Exception ex) {
throw new Exception ("Error applying style <" + styleKey + ">:", ex);
}
+
+ #if DEBUG_LOG
+ dbgEvt.end = DebugLog.chrono.ElapsedTicks;
+ #endif
+
onInitialized (this, null);
}
protected virtual void onInitialized (object sender, EventArgs e){
- #if DEBUG_LOG
- DebugLog.AddEvent(DbgEvtType.GOInitialized, this);
- #endif
Initialized.Raise(sender, e);
}
bool getDefaultEvent(EventInfo ei, List<Style> styling,
@@ -1375,7 +1377,7 @@ namespace Crow
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void RegisterForRedraw ()
{
- IsDirty = true;
+ //IsDirty = true;
if (RegisteredLayoutings == LayoutingType.None)
IFace.EnqueueForRepaint (this);
}
@@ -1673,8 +1675,8 @@ namespace Crow
RecreateCache ();
UpdateCache (ctx);
- if (!isEnabled)
- paintDisabled (ctx, Slot + Parent.ClientRectangle.Position);
+ if (!isEnabled)
+ paintDisabled (ctx, Slot + Parent.ClientRectangle.Position);
} else {
Rectangle rb = Slot + Parent.ClientRectangle.Position;
ctx.Save ();
@@ -1700,10 +1702,10 @@ namespace Crow
#endregion
#region Keyboard handling
- public virtual void onKeyDown(object sender, KeyboardKeyEventArgs e){
+ public virtual void onKeyDown(object sender, KeyEventArgs e){
KeyDown.Raise (this, e);
}
- public virtual void onKeyUp(object sender, KeyboardKeyEventArgs e){
+ public virtual void onKeyUp(object sender, KeyEventArgs e){
KeyUp.Raise (this, e);
}
public virtual void onKeyPress(object sender, KeyPressEventArgs e){
diff --git a/src/GraphicObjects/Scroller.cs b/src/GraphicObjects/Scroller.cs
index 30dd1480..4f270725 100644
--- a/src/GraphicObjects/Scroller.cs
+++ b/src/GraphicObjects/Scroller.cs
@@ -222,13 +222,13 @@ namespace Crow
public override void onMouseWheel (object sender, MouseWheelEventArgs e)
{
base.onMouseWheel (sender, e);
- if (IFace.Keyboard.IsKeyDown (Key.ShiftLeft))
+ if (IFace.IsKeyDown (Key.Shift_L))
ScrollX += e.Delta * ScrollSpeed;
else
ScrollY -= e.Delta * ScrollSpeed;
}
/// <summary> Process scrolling with arrow keys, home and end keys. </summary>
- public override void onKeyDown (object sender, KeyboardKeyEventArgs e)
+ public override void onKeyDown (object sender, KeyEventArgs e)
{
base.onKeyDown (sender, e);
diff --git a/src/GraphicObjects/ScrollingObject.cs b/src/GraphicObjects/ScrollingObject.cs
index de4b2113..43343c59 100644
--- a/src/GraphicObjects/ScrollingObject.cs
+++ b/src/GraphicObjects/ScrollingObject.cs
@@ -149,13 +149,13 @@ namespace Crow
public override void onMouseWheel (object sender, MouseWheelEventArgs e)
{
base.onMouseWheel (sender, e);
- if (IFace.Keyboard.IsKeyDown (Key.ShiftLeft))
+ if (IFace.Keyboard.Shift)
ScrollX += e.Delta * MouseWheelSpeed;
else
ScrollY -= e.Delta * MouseWheelSpeed;
}
/// <summary> Process scrolling with arrow keys, home and end keys. </summary>
- public override void onKeyDown (object sender, KeyboardKeyEventArgs e)
+ public override void onKeyDown (object sender, KeyEventArgs e)
{
base.onKeyDown (sender, e);
diff --git a/src/GraphicObjects/TextBox.cs b/src/GraphicObjects/TextBox.cs
index e29ff9bf..7d14f800 100644
--- a/src/GraphicObjects/TextBox.cs
+++ b/src/GraphicObjects/TextBox.cs
@@ -66,15 +66,15 @@ namespace Crow
#endregion
#region Keyboard handling
- public override void onKeyDown (object sender, KeyboardKeyEventArgs e)
+ public override void onKeyDown (object sender, KeyEventArgs e)
{
base.onKeyDown (sender, e);
-
+ /*
Key key = e.Key;
switch (key)
{
- case Key.Back:
+ case Key.BackSpace:
if (CurrentPosition == 0)
return;
this.DeleteChar();
@@ -89,8 +89,8 @@ namespace Crow
IFace.Clipboard = this.SelectedText;
this.DeleteChar ();
break;
- case Key.Enter:
- case Key.KeypadEnter:
+ case Key.ISO_Enter:
+ case Key.KP_Enter:
if (!selectionIsEmpty)
this.DeleteChar ();
if (Multiline)
@@ -211,6 +211,7 @@ namespace Crow
default:
break;
}
+ */
RegisterForGraphicUpdate();
}
public override void onKeyPress (object sender, KeyPressEventArgs e)