2002-08-09 Duncan Mak <duncan@ximian.com>
* sample/Fifteen.cs (Position): Made it a property instead of a public field. * sample/pixmaps/gnome-color-browser.png: Icon for Fifteen#. svn path=/trunk/gtk-sharp/; revision=6560
This commit is contained in:
parent
2d733eacb6
commit
03a91f8672
3 changed files with 22 additions and 5 deletions
|
@ -1,3 +1,10 @@
|
|||
2002-08-09 Duncan Mak <duncan@ximian.com>
|
||||
|
||||
* 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 <mkestner@speakeasy.net>
|
||||
|
||||
* generator/SymbolTable.cs : make GLib.Value a manually_wrapped_type
|
||||
|
|
|
@ -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;
|
||||
|
@ -227,6 +228,16 @@ public class BoardPiece : Gnome.CanvasGroup
|
|||
}
|
||||
}
|
||||
|
||||
public int Position {
|
||||
get {
|
||||
return position;
|
||||
}
|
||||
|
||||
set {
|
||||
Board [value] = this;
|
||||
position = value;
|
||||
}
|
||||
}
|
||||
|
||||
static void Piece_Event (object o, CanvasEventArgs args)
|
||||
{
|
||||
|
@ -273,7 +284,6 @@ public class BoardPiece : Gnome.CanvasGroup
|
|||
int new_position = y * 4 + x;
|
||||
Print_Position ("to", new_position, false);
|
||||
piece.Board [piece.Position] = null;
|
||||
piece.Board [new_position] = piece;
|
||||
piece.Position = new_position;
|
||||
piece.Move (dx * PIECE_SIZE, dy * PIECE_SIZE);
|
||||
} else
|
||||
|
|
BIN
sample/pixmaps/gnome-color-browser.png
Normal file
BIN
sample/pixmaps/gnome-color-browser.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.2 KiB |
Loading…
Reference in a new issue