Subject | Hash | Author | Date (UTC) |
---|---|---|---|
Implement 'delete shape' feature. | 16d42472d44a9dae988c4745c90c791a8770541b | Jan Allersma | 2018-09-19 09:04:40 |
Fix undo/redo for 'MoveCmd'. | be51bea021bfe5ff79e16a92d350677aed736ddd | Jan Allersma | 2018-09-19 08:49:55 |
Implement shapeOptions without undo/redo. | bbe699f41e5dacbfdadfaa879452ac2f4501f5a1 | Jan Allersma | 2018-09-18 19:44:44 |
WIP: Restore 'shapeOptions.d'. | 888b8ea647c0f25cfbeefcd97ee7ebb59e7f0751 | Jan Allersma | 2018-09-18 15:46:05 |
Rebuild project from scratch. | df0f2f82a86581ba9fa3a169d63a950229341a9f | Jan Allersma | 2018-09-18 15:04:32 |
Add resize option. | 961e464090918d83690ff66838f2fc96c6ad213a | Jan Allersma | 2018-09-13 18:29:44 |
Make `MoveCmd` Command-oriented. | 2970a8d862285752551be2464422375ca958357f | Jan Allersma | 2018-09-12 15:33:17 |
Change of strategy: Make project command-oriented. | ce40dffb1675661922411eeb07f148f61a176c22 | Jan Allersma | 2018-09-12 11:35:45 |
Initial commit. | 38c8818349679937ae25dde38949202ec45ea7b2 | Jan Allersma | 2018-09-11 20:21:57 |
File | Lines added | Lines deleted |
---|---|---|
source/commands/destruct.d | 6 | 6 |
source/shapeOptions.d | 4 | 4 |
File source/commands/destruct.d copied from file source/commands/create.d (similarity 69%) (mode: 100644) (index 0383ac4..893b57c) | |||
1 | module dp.command.create; | ||
1 | module dp.command.destruct; // don't use 'dp.command.delete' as module. Causes bug. | ||
2 | 2 | ||
3 | 3 | import dp.command.cmd; | import dp.command.cmd; |
4 | 4 | import dp.shape.shape; | import dp.shape.shape; |
5 | 5 | ||
6 | 6 | import Global = dp.global; | import Global = dp.global; |
7 | 7 | ||
8 | public class CreateCmd : Command { | ||
8 | public class DestructCmd : Command { | ||
9 | 9 | private Shape s; | private Shape s; |
10 | 10 | ||
11 | 11 | this(Shape shape) { | this(Shape shape) { |
12 | s = shape; | ||
13 | execute(); // Obsolete, but remained for consistency between 'Command' classes. | ||
12 | s = shape; | ||
13 | execute(); | ||
14 | 14 | } | } |
15 | 15 | ||
16 | 16 | public override void execute() { | public override void execute() { |
17 | s.active = true; | ||
17 | s.active = false; | ||
18 | 18 | } | } |
19 | 19 | ||
20 | 20 | public override void undo() { | public override void undo() { |
21 | s.active = false; | ||
21 | s.active = true; | ||
22 | 22 | } | } |
23 | 23 | ||
24 | 24 | public override void render() { | public override void render() { |
File source/shapeOptions.d changed (mode: 100644) (index 00dba09..6ec1d54) | |||
... | ... | import gtk.Widget; | |
5 | 5 | import gdk.Event; | import gdk.Event; |
6 | 6 | ||
7 | 7 | import dp.shape.shape; | import dp.shape.shape; |
8 | import dp.command.destruct; | ||
8 | 9 | //import dp.win.resize; | //import dp.win.resize; |
9 | 10 | import Global = dp.global; | import Global = dp.global; |
10 | 11 | ||
... | ... | protected Shape s; | |
16 | 17 | public class ShapeOptions : Menu { | public class ShapeOptions : Menu { |
17 | 18 | this() { | this() { |
18 | 19 | super(); | super(); |
19 | //this.append(new DeleteShape()); | ||
20 | this.append(new DeleteShape()); | ||
20 | 21 | this.append(new MoveShape()); | this.append(new MoveShape()); |
21 | 22 | //this.append(new ResizeShape()); | //this.append(new ResizeShape()); |
22 | 23 | } | } |
... | ... | protected class DeleteShape : MenuItem { | |
34 | 35 | addOnButtonRelease(&relCallback); | addOnButtonRelease(&relCallback); |
35 | 36 | } | } |
36 | 37 | ||
37 | // Omgekeerde CreateCmd misschien? | ||
38 | 38 | private bool relCallback (Event event, Widget widget) { | private bool relCallback (Event event, Widget widget) { |
39 | //s.remove(); | ||
40 | //Global.canvas.repaint(); | ||
39 | Global.History.addCommand(new DestructCmd(s)); | ||
40 | Global.canvas.repaint(); | ||
41 | 41 | return false; // Hide ShapeOptions when button is released. | return false; // Hide ShapeOptions when button is released. |
42 | 42 | } | } |
43 | 43 | } | } |