added .gitignore for all to enjoy
[chess] / src / promotion.ec
1 /****************************************************************************
2    CHESS Game
3
4    Copyright (c) 2001 Jerome Jacovella-St-Louis
5    All Rights Reserved.
6    
7    promotion.c - Pawn Promotion Window
8 ****************************************************************************/
9 import "chessutils.ec"
10
11 class Promotion : Window
12 {
13    background = gray, text = "Pawn Promotion", borderStyle = fixed, tabCycle = true,
14    minClientSize = Size { 120, 140 };
15
16    bool ButtonClicked(Button button, int x, int y, Modifiers mods)
17    {
18       Destroy(button.id);
19       return true;
20    }
21
22    Button
23    {
24       parent = this, bevel = true, text = "Knight", position = Point { 20, 10 },
25       size = Size { 80, 20 }, id = PieceType::Knight, NotifyClicked = ButtonClicked
26    };
27    Button
28    {
29       parent = this, bevel = true, text = "Bishop", position = Point { 20, 35 },
30       size = Size { 80, 20 }, id = PieceType::Bishop, NotifyClicked = ButtonClicked
31    };
32    Button
33    {
34       parent = this, bevel = true, text = "Rook", position = Point { 20, 60 },
35       size = Size { 80, 20 }, id = PieceType::Rook, NotifyClicked = ButtonClicked
36    };
37    Button
38    {
39       parent = this, bevel = true, text = "Queen", position = Point { 20, 85 },
40       size = Size { 80, 20 }, id = PieceType::Queen, NotifyClicked = ButtonClicked,
41       isDefault = true
42    };
43 }