aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/ScrollingWidget.cs
diff options
context:
space:
mode:
authorjpbruyere <jp.bruyere@hotmail.com>2014-12-18 22:41:10 +0100
committerjpbruyere <jp.bruyere@hotmail.com>2014-12-18 22:41:10 +0100
commitd5a5d9516969d7a0fb665a72be7269e7bd51ad58 (patch)
tree64807d55e1994b3c700e9628ac7a6ba602a4426f /src/ScrollingWidget.cs
parent02fed0f59e37aa66381023ec1543cca9a54ac118 (diff)
misa a jour
Diffstat (limited to 'src/ScrollingWidget.cs')
-rw-r--r--src/ScrollingWidget.cs138
1 files changed, 0 insertions, 138 deletions
diff --git a/src/ScrollingWidget.cs b/src/ScrollingWidget.cs
deleted file mode 100644
index 5a541bcf..00000000
--- a/src/ScrollingWidget.cs
+++ /dev/null
@@ -1,138 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Drawing;
-using Cairo;
-
-namespace go
-{
- public class ScrollingWidget : GraphicObject
- {
- public ScrollingWidget(int _width = 30, int _height = 30)
- : base(new Rectangle(0, 0, _width, _height))
- {
-
- }
-
- public ScrollingWidget()
- : base()
- {
-
- }
- public bool VerticalScrolling = false;
- public bool HorizontalScrolling = false;
-
- public int scrollX = 0;
- public int scrollY = 0;
-
-
- public override Rectangle ScreenCoordBounds
- {
- get
- {
- return Parent == null ? bounds :
- new Rectangle(
- Parent.ScreenCoordBounds.X + renderBounds.X + scrollX,
- Parent.ScreenCoordBounds.Y + renderBounds.Y + scrollY,
- renderBounds.Width,
- renderBounds.Height);
- }
- }
-
- public override Rectangle renderBoundsInContextCoordonate
- {
- get
- {
- //should be in go with cache, scrolling widget have no cache
- if (cachingInProgress)
- return new Rectangle(renderBounds.Size);
- //if (Parent.isCached)
- // return renderBounds.Clone;
-
- Rectangle tmp = Parent.renderBoundsInContextCoordonate;
-
- return new Rectangle(
- tmp.X + renderBounds.X + scrollX,
- tmp.Y + renderBounds.Y + scrollY,
- renderBounds.Width,
- renderBounds.Height);
-
- }
- }
-
- public override Rectangle ClientBoundsInContextCoordonate
- {
- get
- {
- if (cachingInProgress)
- return new Rectangle(
- clientBounds.X,
- clientBounds.Y,
- clientBounds.Width,
- clientBounds.Height);
-
- //if (Parent is Panel && !(this is ScrollingWidget))
- // return Parent.clientBounds;
-
- Rectangle tmp = Parent.renderBoundsInContextCoordonate;
-
- return new Rectangle(
- tmp.X + renderBounds.X + clientBounds.X + scrollX,
- tmp.Y + renderBounds.Y + clientBounds.Y + scrollY,
- clientBounds.Width,
- clientBounds.Height);
- }
- }
- public override Rectangle renderBoundsInBackendSurfaceCoordonate
- {
- get
- {
- Rectangle tmp = Parent.renderBoundsInBackendSurfaceCoordonate;
-
- return new Rectangle(
- tmp.X + renderBounds.X + scrollX,
- tmp.Y + renderBounds.Y + scrollY,
- renderBounds.Width,
- renderBounds.Height);
- }
- }
-
- public override bool ProcessMousePosition(Point mousePos)
- {
- return base.ProcessMousePosition(mousePos);
- }
- public override void ProcessMouseWeel(int delta)
- {
- if (!isVisible)
- return;
-
-
- if (VerticalScrolling && renderBounds.Height > Parent.clientBounds.Height)
- {
- //add redraw call with old bounds to errase old position
- registerForRedraw();
-
- scrollY += delta;
-
- if (scrollY > 0)
- scrollY = 0;
- else if (scrollY < -renderBounds.Height + Parent.clientBounds.Height)
- scrollY = -renderBounds.Height + Parent.clientBounds.Height;
-
- }
- if (HorizontalScrolling && renderBounds.Width > Parent.clientBounds.Width)
- {
- //add redraw call with old bounds to errase old position
- registerForRedraw();
-
- scrollX += delta;
- }
-
-
- //renderBounds.Y = -scrollY;
- registerForRedraw();
- }
-
- }
-}