aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/Interface.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Interface.cs')
-rw-r--r--src/Interface.cs78
1 files changed, 45 insertions, 33 deletions
diff --git a/src/Interface.cs b/src/Interface.cs
index 542cf2dd..d06870ef 100644
--- a/src/Interface.cs
+++ b/src/Interface.cs
@@ -41,7 +41,7 @@ namespace Crow
/// - helpers to load XML interfaces files
/// - global constants and variables of CROW
/// </summary>
- public class Interface : ILayoutable
+ public class Interface : GraphicObject
{
#region CTOR
static Interface(){
@@ -580,9 +580,9 @@ namespace Crow
//check topmost graphicobject first
GraphicObject tmp = HoverWidget;
GraphicObject topc = null;
- while (tmp is GraphicObject) {
+ while (!(tmp is Interface)) {
topc = tmp;
- tmp = tmp.LogicalParent as GraphicObject;
+ tmp = tmp.LogicalParent;
}
int idxhw = GraphicTree.IndexOf (topc);
if (idxhw != 0) {
@@ -592,7 +592,7 @@ namespace Crow
if (GraphicTree [i].MouseIsIn (e.Position)) {
while (HoverWidget != null) {
HoverWidget.onMouseLeave (HoverWidget, e);
- HoverWidget = HoverWidget.LogicalParent as GraphicObject;
+ HoverWidget = HoverWidget.LogicalParent;
}
GraphicTree [i].checkHoverWidget (e);
@@ -610,8 +610,8 @@ namespace Crow
} else {
HoverWidget.onMouseLeave (HoverWidget, e);
//seek upward from last focused graph obj's
- while (HoverWidget.LogicalParent as GraphicObject != null) {
- HoverWidget = HoverWidget.LogicalParent as GraphicObject;
+ while (!(HoverWidget.LogicalParent is Interface)) {
+ HoverWidget = HoverWidget.LogicalParent;
if (HoverWidget.MouseIsIn (e.Position)) {
HoverWidget.checkHoverWidget (e);
return true;
@@ -683,6 +683,26 @@ namespace Crow
HoverWidget.onMouseWheel (this, e);
return true;
}
+
+
+ public override void onMouseMove (object sender, MouseMoveEventArgs e)
+ {
+ }
+ public override void onMouseUp (object sender, MouseButtonEventArgs e)
+ {
+ }
+ public override void onMouseDown (object sender, MouseButtonEventArgs e)
+ {
+ }
+ public override void onMouseClick (object sender, MouseButtonEventArgs e)
+ {
+ }
+ public override void onMouseDoubleClick (object sender, MouseButtonEventArgs e)
+ {
+ }
+ public override void onMouseWheel (object sender, MouseWheelEventArgs e)
+ {
+ }
#endregion
#region Keyboard
@@ -752,39 +772,31 @@ namespace Crow
#endregion
#region ILayoutable implementation
- public void RegisterClip(Rectangle r){
- clipping.AddRectangle (r);
- }
- public bool ArrangeChildren { get { return false; }}
- public int LayoutingTries {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
- public LayoutingType RegisteredLayoutings {
+ public override void RegisterClip(Rectangle r){ clipping.AddRectangle (r); }
+ public override LayoutingType RegisteredLayoutings {
get { return LayoutingType.None; }
set { throw new NotImplementedException (); }
}
- public void RegisterForLayouting (LayoutingType layoutType) { throw new NotImplementedException (); }
- public bool UpdateLayout (LayoutingType layoutType) { throw new NotImplementedException (); }
- public Rectangle ContextCoordinates (Rectangle r) { return r;}
- public Rectangle ScreenCoordinates (Rectangle r) { return r; }
-
- public ILayoutable Parent {
- get { return null; }
- set { throw new NotImplementedException (); }
+ public override Rectangle ContextCoordinates (Rectangle r) { return r;}
+ public override Rectangle ScreenCoordinates (Rectangle r) { return r; }
+ public override Rectangle ClientRectangle { get { return clientRectangle; }}
+ public override Rectangle getSlot () { return ClientRectangle; }
+ public override Measure WidthPolicy { get { return Measure.Stretched; }}
+ public override Measure HeightPolicy { get { return Measure.Stretched; }}
+ public override Measure Width {
+ get { return clientRectangle.Width; }
+ set {}
}
- public ILayoutable LogicalParent {
- get { return null; }
- set { throw new NotImplementedException (); }
- }
-
- public Rectangle ClientRectangle {
- get { return clientRectangle; }
+ public override Measure Height {
+ get { return clientRectangle.Height; }
+ set {}
}
- public Interface HostContainer {
- get { return this; }
+ public override bool MouseIsIn (Point m){ return true; }
+ public override void RegisterForLayouting (LayoutingType layoutType)
+ {
+ //base.RegisterForLayouting (layoutType);
+ return;
}
- public Rectangle getSlot () { return ClientRectangle; }
#endregion
}
}