@@ -84,37 +84,22 @@ private void updateButtonsForThreadHelper(object o, EventArgs e) {
84
84
85
85
// -- Buttons --
86
86
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 ) ;
90
88
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 ) ;
94
90
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 ) ;
98
92
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 ) ;
102
94
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 ) ;
106
96
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 ) ;
109
98
if ( this . puzzleBoard . EditorMode )
110
99
this . btnCheck . Hide ( ) ;
111
- this . btnCheck . Click += this . checkClick ;
112
100
113
- // Clear
114
- this . btnClear = new Btn ( "Clear" , this ) ;
115
- this . btnClear . Click += this . clearClick ;
101
+ this . btnClear = new Btn ( "Clear" , this , this . clearClick ) ;
116
102
117
- // The colour buttons
118
103
this . btnColorBlack = new Btn ( "" , this ) ;
119
104
this . btnColorBlack . BackColor = this . puzzleBoard . Painter . GetColor ( Field . Black ) ;
120
105
this . btnColorBlack . Size = new Size ( this . btnColorBlack . Height , this . btnColorBlack . Height ) ;
@@ -124,19 +109,14 @@ private void addControls() {
124
109
this . btnColorEmpty . Size = this . btnColorBlack . Size ;
125
110
this . btnColorEmpty . MouseDown += this . colorBtnMouseDown ;
126
111
127
- // The move button
128
- this . btnMove = new Btn ( "Move" , this ) ;
112
+ this . btnMove = new Btn ( "Move" , this , this . moveClick ) ;
129
113
if ( ! this . puzzleBoard . EditorMode )
130
114
this . btnMove . Hide ( ) ;
131
- this . btnMove . Click += this . moveClick ;
132
115
133
- // The size button
134
- this . btnSize = new Btn ( "Change size" , this ) ;
116
+ this . btnSize = new Btn ( "Change size" , this , this . sizeClick ) ;
135
117
if ( ! this . puzzleBoard . EditorMode )
136
118
this . btnSize . Hide ( ) ;
137
- this . btnSize . Click += this . sizeClick ;
138
119
139
- // The settings button
140
120
this . btnSettings = new Btn ( "Settings" , this ) ;
141
121
this . btnSettings . Click += ( o , e ) => { this . ShowUserControl < SettingsControl > ( ) ; } ;
142
122
}
0 commit comments