diff --git a/ChangeLog b/ChangeLog index 2e8540771..606c058bd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2002-08-09 Duncan Mak + + * sample/Fifteen.cs (Position): Made it a property instead of a + public field. + + * sample/pixmaps/gnome-color-browser.png: Icon for Fifteen#. + 2002-08-09 Mike Kestner * generator/SymbolTable.cs : make GLib.Value a manually_wrapped_type diff --git a/sample/Fifteen.cs b/sample/Fifteen.cs index b63a2688a..80ed44cbb 100644 --- a/sample/Fifteen.cs +++ b/sample/Fifteen.cs @@ -121,12 +121,13 @@ public class Fifteen string [] documenters = new string [] {}; string translaters = null; + Pixbuf pixbuf = new Pixbuf ("pixmaps/gnome-color-browser.png"); Gnome.About about = new Gnome.About ("Fifteen #", "0.1", "Copyright (C) 2002, Ximian Inc.", "A C# port of Fifteen, a gnomecanvas demo", authors, documenters, translaters, - new Gdk.Pixbuf ()); + pixbuf); about.Show (); } @@ -179,7 +180,7 @@ public class BoardPiece : Gnome.CanvasGroup { public static int PIECE_SIZE = 50; public int Number; - public int Position; + int position; public CanvasText Text; public BoardPiece [] Board; public static bool Debug = false; @@ -226,7 +227,17 @@ public class BoardPiece : Gnome.CanvasGroup return String.Format ("#{0:x2}{1:x2}{2:x2}", r, g, b); } } - + + public int Position { + get { + return position; + } + + set { + Board [value] = this; + position = value; + } + } static void Piece_Event (object o, CanvasEventArgs args) { @@ -272,8 +283,7 @@ public class BoardPiece : Gnome.CanvasGroup if (toMove) { int new_position = y * 4 + x; Print_Position ("to", new_position, false); - piece.Board [piece.Position] = null; - piece.Board [new_position] = piece; + piece.Board [piece.Position] = null; piece.Position = new_position; piece.Move (dx * PIECE_SIZE, dy * PIECE_SIZE); } else diff --git a/sample/pixmaps/gnome-color-browser.png b/sample/pixmaps/gnome-color-browser.png new file mode 100644 index 000000000..be41582fc Binary files /dev/null and b/sample/pixmaps/gnome-color-browser.png differ