From 4359a816c6f28e7f580149144894fe1497a01f2a Mon Sep 17 00:00:00 2001 From: Martin Willemoes Hansen Date: Sat, 7 Feb 2004 22:02:52 +0000 Subject: [PATCH] * sample/CanvasFigure.cs: Added * sample/sample.cs: Exercises CanvasFigure * sample/makefile.am: Reduced code svn path=/trunk/diacanvas-sharp/; revision=22864 --- ChangeLog | 3 +++ sample/CanvasFigure.cs | 21 +++++++++++++++++++++ sample/makefile.am | 9 +++------ sample/sample.cs | 4 ++++ 4 files changed, 31 insertions(+), 6 deletions(-) create mode 100644 sample/CanvasFigure.cs diff --git a/ChangeLog b/ChangeLog index 6bb2826..18ebf01 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,9 @@ * autogen.sh: Executes aclocal first, this fixes a lot of warnings and build errors. + * sample/CanvasFigure.cs: Added + * sample/sample.cs: Exercises CanvasFigure + * sample/makefile.am: Reduced code 2004-02-06 Martin Willemoes Hansen diff --git a/sample/CanvasFigure.cs b/sample/CanvasFigure.cs new file mode 100644 index 0000000..2d6b228 --- /dev/null +++ b/sample/CanvasFigure.cs @@ -0,0 +1,21 @@ +using System; +using Dia; + +public class CanvasFigure : CanvasBox { + + static GLib.GType gtype; + + static CanvasFigure() + { + gtype = RegisterGType (typeof (CanvasFigure)); + } + + public CanvasFigure() : base (gtype) + { + ShapeEllipse ellipse = new ShapeEllipse(); + ellipse.center = new Point (20, 20); + ellipse.width = 20; + ellipse.height = 20; + ellipse.line_width = 1; + } +} diff --git a/sample/makefile.am b/sample/makefile.am index df68f5f..b3e327c 100644 --- a/sample/makefile.am +++ b/sample/makefile.am @@ -1,5 +1,5 @@ SUBDIRS=pixmaps glade -EXTRA_DIST= sample.cs CanvasTextBox.cs +EXTRA_DIST= *.cs ASSEMBLIES= -r glib-sharp \ -r gtk-sharp \ @@ -20,13 +20,10 @@ RESOURCES= -resource:glade/gui.glade \ SAMPLE= sample.exe -CODE= CanvasTextBox.cs \ - sample.cs - all: $(SAMPLE) -$(SAMPLE): $(CODE) ../dia/diacanvas-sharp.dll - mcs $(ASSEMBLIES) $(RESOURCES) $(CODE) -o $(SAMPLE) +$(SAMPLE): *.cs ../dia/diacanvas-sharp.dll + mcs $(ASSEMBLIES) $(RESOURCES) *.cs -o $(SAMPLE) clean: rm -f $(SAMPLE) diff --git a/sample/sample.cs b/sample/sample.cs index d957a31..eb5b577 100644 --- a/sample/sample.cs +++ b/sample/sample.cs @@ -91,6 +91,10 @@ public class Sample { textbox.Move (50, 150); canvas.Root.Add (textbox); + CanvasFigure figure = new CanvasFigure(); + figure.Move (50, 250); + canvas.Root.Add (figure); + CanvasImage image = new CanvasImage (new Pixbuf (null, "pixmaps/logo.png")); image.Move (50, 50); canvas.Root.Add (image);