Differences From Artifact [bcbc7e6a97423060]:
- File
src/gui.d
- 2012-07-14 16:04:29 - part of checkin [0c10424b3c] on branch trunk - Minor fix for danger avoidance. (user: kinaba) [annotate]
To Artifact [6f9d0f82c55a2152]:
- File
src/gui.d
- 2012-07-14 16:07:05 - part of checkin [db3405fee7] on branch trunk - Not to responde keyboard when auto-gui mode. (user: kinaba) [annotate]
6 6 class GUI(Solver) : Form, GameObserver
7 7 {
8 8 this(in Game g)
9 9 {
10 10 this.solver = new Solver(g);
11 11 setup_size(g.map.W, g.map.H);
12 12 setup_resources();
13 - setup_keyhandling();
14 13 draw(g);
15 14 }
16 15
17 16 private void delegate(char c) fn;
18 17 void set_fn(F)(F f) { this.fn = f; }
19 18
20 19 void run(bool automate = false)
................................................................................
23 22 Timer t = new Timer;
24 23 t.interval = 50;
25 24 t.tick ~= (Timer sender, EventArgs ea){
26 25 fn(solver.single_step());
27 26 };
28 27 t.start();
29 28 this.closing ~= (Form f,CancelEventArgs c){t.stop();};
29 + } else {
30 + setup_keyhandling();
30 31 }
31 32 Application.run(this);
32 33 }
33 34
34 35 override void on_game_changed(char c, in Game g, bool finished)
35 36 {
36 37 draw(g);