Skip to content

Commit 9fb3ccb

Browse files
Update MattyControls library (and refactor a bit).
1 parent c13b5d0 commit 9fb3ccb

File tree

3 files changed

+10
-29
lines changed

3 files changed

+10
-29
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Manual entries
22
puzzles.js
33
*.swp
4+
.vs/*
45

56
## Ignore Visual Studio temporary files, build results, and
67
## files generated by popular Visual Studio add-ons.

Picross/MattyControls.dll

2.5 KB
Binary file not shown.

Picross/UI/MainControl.cs

+9-29
Original file line numberDiff line numberDiff line change
@@ -84,37 +84,22 @@ private void updateButtonsForThreadHelper(object o, EventArgs e) {
8484

8585
// -- Buttons --
8686
private void addControls() {
87-
// Switch editor and play mode
88-
this.btnEditorMode = new Btn(Settings.Get.EditorMode ? "Mode: editor" : "Mode: play", this);
89-
this.btnEditorMode.Click += this.editorModeClick;
87+
this.btnEditorMode = new Btn(Settings.Get.EditorMode ? "Mode: editor" : "Mode: play", this, this.editorModeClick);
9088

91-
// Create a new puzzle
92-
this.btnNewPuzzle = new Btn("New puzzle", this);
93-
this.btnNewPuzzle.Click += this.newPuzzleClick;
89+
this.btnNewPuzzle = new Btn("New puzzle", this, this.newPuzzleClick);
9490

95-
// Load a puzzle
96-
this.btnLoad = new Btn("Load", this);
97-
this.btnLoad.Click += this.loadClick;
91+
this.btnLoad = new Btn("Load", this, this.loadClick);
9892

99-
// Save a puzzle
100-
this.btnSave = new Btn("Save", this);
101-
this.btnSave.Click += this.saveClick;
93+
this.btnSave = new Btn("Save", this, this.saveClick);
10294

103-
// Solve the puzzle
104-
this.btnSolve = new Btn("Solve", this);
105-
this.btnSolve.Click += this.solveClick;
95+
this.btnSolve = new Btn("Solve", this, this.solveClick);
10696

107-
// Check if you have no mistakes so far
108-
this.btnCheck = new Btn("Check", this);
97+
this.btnCheck = new Btn("Check", this, this.checkClick);
10998
if (this.puzzleBoard.EditorMode)
11099
this.btnCheck.Hide();
111-
this.btnCheck.Click += this.checkClick;
112100

113-
// Clear
114-
this.btnClear = new Btn("Clear", this);
115-
this.btnClear.Click += this.clearClick;
101+
this.btnClear = new Btn("Clear", this, this.clearClick);
116102

117-
// The colour buttons
118103
this.btnColorBlack = new Btn("", this);
119104
this.btnColorBlack.BackColor = this.puzzleBoard.Painter.GetColor(Field.Black);
120105
this.btnColorBlack.Size = new Size(this.btnColorBlack.Height, this.btnColorBlack.Height);
@@ -124,19 +109,14 @@ private void addControls() {
124109
this.btnColorEmpty.Size = this.btnColorBlack.Size;
125110
this.btnColorEmpty.MouseDown += this.colorBtnMouseDown;
126111

127-
// The move button
128-
this.btnMove = new Btn("Move", this);
112+
this.btnMove = new Btn("Move", this, this.moveClick);
129113
if (!this.puzzleBoard.EditorMode)
130114
this.btnMove.Hide();
131-
this.btnMove.Click += this.moveClick;
132115

133-
// The size button
134-
this.btnSize = new Btn("Change size", this);
116+
this.btnSize = new Btn("Change size", this, this.sizeClick);
135117
if (!this.puzzleBoard.EditorMode)
136118
this.btnSize.Hide();
137-
this.btnSize.Click += this.sizeClick;
138119

139-
// The settings button
140120
this.btnSettings = new Btn("Settings", this);
141121
this.btnSettings.Click += (o, e) => { this.ShowUserControl<SettingsControl>(); };
142122
}

0 commit comments

Comments
 (0)