diff options
| author | jpbruyere <jp.bruyere@hotmail.com> | 2014-12-18 22:41:10 +0100 |
|---|---|---|
| committer | jpbruyere <jp.bruyere@hotmail.com> | 2014-12-18 22:41:10 +0100 |
| commit | d5a5d9516969d7a0fb665a72be7269e7bd51ad58 (patch) | |
| tree | 64807d55e1994b3c700e9628ac7a6ba602a4426f /src/Container.cs | |
| parent | 02fed0f59e37aa66381023ec1543cca9a54ac118 (diff) | |
misa a jour
Diffstat (limited to 'src/Container.cs')
| -rw-r--r-- | src/Container.cs | 139 |
1 files changed, 0 insertions, 139 deletions
diff --git a/src/Container.cs b/src/Container.cs deleted file mode 100644 index 76e81c29..00000000 --- a/src/Container.cs +++ /dev/null @@ -1,139 +0,0 @@ -using System; - -namespace go -{ - public class Container : GraphicObject - { - public Container() - : base() - { - } - public Container(Rectangle _bounds) - : base(_bounds) - { - } - - public GraphicObject child; - public T setChild<T>(T _child) - { - - if (child != null) - child.Parent = null; - - child = _child as GraphicObject; - - if (child != null) - child.Parent = this; - - return (T)_child; - } - public override void invalidateLayout() - { - base.invalidateLayout(); - - if (child != null) - child.invalidateLayout(); - } - public override bool layoutIsValid - { - get - { - if (!isVisible) - return true; - - if (!base.layoutIsValid) - return false; - else if (child != null) - if (!child.layoutIsValid) - return false; - - return true; - } - set - { - base.layoutIsValid = value; - } - } - - public override void updateLayout() - { - if (!isVisible) - return; - - if (!(sizeIsValid && positionIsValid)) - base.updateLayout(); - - if (child != null) - { - child.updateLayout(); - if (sizeToContent && child.sizeIsValid) - { - renderBounds.Size = child.renderBounds.Size + 2 * margin + 2 * borderWidth; - child.renderBounds.TopLeft = clientBounds.TopLeft; - sizeIsValid = true; - } - } - - if (layoutIsValid) - registerForRedraw(); - } - - public override bool ProcessMousePosition(Point mousePos) - { - if (!isVisible) - return false; - - bool result = base.ProcessMousePosition(mousePos); - - //if (this is Panel) - // return result; - //else - - if (result) - if (child != null) - child.ProcessMousePosition(mousePos); - - return result; - } - public override void ProcessMouseWeel(int delta) - { - if (!isVisible) - return; - - if (child != null) - child.ProcessMouseWeel(delta); - } - - public override void cairoDraw(ref Cairo.Context ctx, Rectangles clip = null) - { - if (!isVisible)//check if necessary?? - return; - - ctx.Save(); - - ctx.Rectangle(renderBoundsInContextCoordonate); - ctx.Clip(); - - if (clip != null) - clip.clip(ctx); - - base.cairoDraw(ref ctx, clip); - - //clip to client zone - - ctx.Rectangle(ClientBoundsInContextCoordonate); - ctx.Clip(); - - if (clip != null) - clip.Rebase(this); - - if (child != null) - child.cairoDraw(ref ctx, clip); - - ctx.Restore(); - //ctx.Target.WriteToPng(@"/home/jp/test.png"); - - } - } -} - |