mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2025-01-25 21:51:06 +00:00
Flush.
svn path=/trunk/gtk-sharp/; revision=6512
This commit is contained in:
parent
643b79481d
commit
29e6647bee
|
@ -56,13 +56,6 @@ public class Fifteen
|
||||||
box.PackStart (new HSeparator (), false, false, 0);
|
box.PackStart (new HSeparator (), false, false, 0);
|
||||||
HBox hbox = new HBox (false, 4);
|
HBox hbox = new HBox (false, 4);
|
||||||
box.PackStart (hbox, true, false, 4);
|
box.PackStart (hbox, true, false, 4);
|
||||||
hbox.Direction = TextDirection.Rtl;
|
|
||||||
|
|
||||||
// Close button
|
|
||||||
Button close = new Button ("_Close");
|
|
||||||
close.BorderWidth = 8;
|
|
||||||
close.Clicked += new EventHandler (Quit);
|
|
||||||
hbox.PackStart (close, true, true, 4);
|
|
||||||
|
|
||||||
// Scramble button here.
|
// Scramble button here.
|
||||||
Button scramble = new Button ("_Scramble");
|
Button scramble = new Button ("_Scramble");
|
||||||
|
@ -72,6 +65,12 @@ public class Fifteen
|
||||||
hbox.PackStart (scramble, true, true, 4);
|
hbox.PackStart (scramble, true, true, 4);
|
||||||
scramble.GrabDefault ();
|
scramble.GrabDefault ();
|
||||||
|
|
||||||
|
// Close button
|
||||||
|
Button close = new Button ("_Close");
|
||||||
|
close.BorderWidth = 8;
|
||||||
|
close.Clicked += new EventHandler (Quit);
|
||||||
|
hbox.PackStart (close, true, true, 4);
|
||||||
|
|
||||||
window.ShowAll ();
|
window.ShowAll ();
|
||||||
fifteen.Run ();
|
fifteen.Run ();
|
||||||
}
|
}
|
||||||
|
@ -90,7 +89,7 @@ public class Fifteen
|
||||||
scramble_item.Image = new Gtk.Image (Stock.Refresh, IconSize.Menu);
|
scramble_item.Image = new Gtk.Image (Stock.Refresh, IconSize.Menu);
|
||||||
scramble_item.Activated += new EventHandler (Scramble);
|
scramble_item.Activated += new EventHandler (Scramble);
|
||||||
|
|
||||||
ImageMenuItem quit_item = new ImageMenuItem ("Quit");
|
ImageMenuItem quit_item = new ImageMenuItem ("_Quit");
|
||||||
quit_item.Image = new Gtk.Image (Stock.Quit, IconSize.Menu);
|
quit_item.Image = new Gtk.Image (Stock.Quit, IconSize.Menu);
|
||||||
quit_item.Activated += new EventHandler (Quit);
|
quit_item.Activated += new EventHandler (Quit);
|
||||||
|
|
||||||
|
@ -199,7 +198,7 @@ public class BoardPiece : Gnome.CanvasGroup
|
||||||
rect.Y2 = 0.0;
|
rect.Y2 = 0.0;
|
||||||
rect.X2 = PIECE_SIZE;
|
rect.X2 = PIECE_SIZE;
|
||||||
rect.Y2 = PIECE_SIZE;
|
rect.Y2 = PIECE_SIZE;
|
||||||
rect.FillColor = Get_Color (i);
|
rect.FillColor = Color;
|
||||||
rect.OutlineColor = "black";
|
rect.OutlineColor = "black";
|
||||||
rect.WidthPixels = 0;
|
rect.WidthPixels = 0;
|
||||||
|
|
||||||
|
@ -215,10 +214,10 @@ public class BoardPiece : Gnome.CanvasGroup
|
||||||
this.CanvasEvent += new CanvasEventHandler (Piece_Event);
|
this.CanvasEvent += new CanvasEventHandler (Piece_Event);
|
||||||
}
|
}
|
||||||
|
|
||||||
static string Get_Color (int piece)
|
public string Color {
|
||||||
{
|
get {
|
||||||
int y = piece / 4;
|
int y = Number / 4;
|
||||||
int x = piece % 4;
|
int x = Number % 4;
|
||||||
|
|
||||||
int r = ((4 - x) * 255) / 4;
|
int r = ((4 - x) * 255) / 4;
|
||||||
int g = ((4 - y) * 255) / 4;
|
int g = ((4 - y) * 255) / 4;
|
||||||
|
@ -226,6 +225,8 @@ public class BoardPiece : Gnome.CanvasGroup
|
||||||
|
|
||||||
return String.Format ("#{0:x2}{1:x2}{2:x2}", r, g, b);
|
return String.Format ("#{0:x2}{1:x2}{2:x2}", r, g, b);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static void Piece_Event (object o, CanvasEventArgs args)
|
static void Piece_Event (object o, CanvasEventArgs args)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue