kapstok / NHL-DePa2 (public) (License: Unspecified) (since 2018-11-09) (hash sha1)
Design Patterns school project; a GUI using multiple Design Patterns.
List of commits:
Subject Hash Author Date (UTC)
Make ornament interface compatible with Entities. 21383d5f200a338f8255d7d33b6989937c19fed6 Jan Allersma 2018-10-08 20:36:23
Build interface for ornament creation. adcf22a4e878edc45ac0775a5e15ebf0bb1a937d Jan Allersma 2018-10-08 13:53:52
Use different strats instead of seperate Shapes. a56e1e665a0292d15139eddfd8ebdeb8c95251b4 Jan Allersma 2018-10-01 11:37:45
Fix bug in Rect from commit 6c91140 in other Shapes as well. 4165a5da98dd9a548a222c6160390e4e54026d48 Jan Allersma 2018-09-28 14:53:40
Fully implement File I/O. 45cbb48489a24857cfc76144b38b12ccebfd9e61 Jan Allersma 2018-09-27 16:03:40
Fix GroupMenu bug. be41e51819be1a23e7761ea0662eb188ac641aca Jan Allersma 2018-09-27 14:55:20
Fix TODO's from previous commit. 89d8172b77336a6c18f30521147eb81287961f11 Jan Allersma 2018-09-27 14:06:30
Add groups as preparation for step 3. a91368128e7444f69b3a30ee4d17f9063c8846b8 Jan Allersma 2018-09-26 18:31:49
Fix minor bug. Small cleanup 'ellipse' code. 6c911405eb8e48ffe2d63aaff5255adbd4aec889 Jan Allersma 2018-09-21 18:10:01
Implement file I/O. 6219eca932d454a7dab5fe8679f07865ce3cf49d Jan Allersma 2018-09-21 15:52:45
Add shape 'ellipse'. 99d8b029c769bc291af73df3fd445da3cbf5bef4 Jan Allersma 2018-09-21 10:44:36
Add shape 'circle'. 092cb3c3f788b461192a6e164955c53acaf58720 Jan Allersma 2018-09-21 09:35:27
Add resize option (again). 08c95e97268cf9d74bcb963503eec512e528edfe Jan Allersma 2018-09-20 18:09:03
Fix undo bug. 6ab126be633075923cdcce53044e2468f967db41 Jan Allersma 2018-09-20 10:46:50
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
Commit 21383d5f200a338f8255d7d33b6989937c19fed6 - Make ornament interface compatible with Entities.
Author: Jan Allersma
Author date (UTC): 2018-10-08 20:36
Committer name: Jan Allersma
Committer date (UTC): 2018-10-16 13:42
Parent(s): adcf22a4e878edc45ac0775a5e15ebf0bb1a937d
Signing key:
Tree: 5ca91450c37f5b0509a7f5d4f8ce4cc316eb45b3
File Lines added Lines deleted
source/frontend/menubar.d 13 0
source/frontend/ornamentDialog.d 16 9
File source/frontend/menubar.d changed (mode: 100644) (index c3dc6c6..73f1333)
... ... import gdk.Event;
8 8 import dp.ent.group; import dp.ent.group;
9 9 import dp.command.load; import dp.command.load;
10 10 import dp.command.create; import dp.command.create;
11 import dp.win.ornament;
11 12
12 13 import std.conv; import std.conv;
13 14
14 15 import Global = dp.global; import Global = dp.global;
15 16
17 private OrnamentDialog od;
18
16 19 public class Menubar : Box { public class Menubar : Box {
17 20 this() { this() {
18 21 super(Orientation.VERTICAL, 10); super(Orientation.VERTICAL, 10);
 
... ... public class ShapeMenu : MenuItem { // protected
152 155 public class GroupMenu : MenuItem { // protected public class GroupMenu : MenuItem { // protected
153 156 Menu groupMenu; Menu groupMenu;
154 157
158 MenuItem attachOrnament;
155 159 MenuItem newGroup; MenuItem newGroup;
156 160 MenuItem clearGroup; MenuItem clearGroup;
157 161 MenuItem[] existingGroups = []; MenuItem[] existingGroups = [];
 
... ... public class GroupMenu : MenuItem { // protected
161 165 groupMenu = new Menu(); groupMenu = new Menu();
162 166 this.addOnButtonPress(&activateCallback); this.addOnButtonPress(&activateCallback);
163 167
168 attachOrnament = new MenuItem("Attach ornament to selected group");
169 attachOrnament.addOnButtonPress(&attOrnamentCallback);
170 groupMenu.append(attachOrnament);
171
164 172 clearGroup = new MenuItem("Clear group selection"); clearGroup = new MenuItem("Clear group selection");
165 173 clearGroup.addOnButtonPress(&clearGroupCallback); clearGroup.addOnButtonPress(&clearGroupCallback);
166 174 groupMenu.append(clearGroup); groupMenu.append(clearGroup);
 
... ... public class GroupMenu : MenuItem { // protected
186 194 return false; return false;
187 195 } }
188 196
197 private bool attOrnamentCallback(Event event, Widget widget) {
198 od = new OrnamentDialog(Global.Brush.group);
199 return true;
200 }
201
189 202 private bool clearGroupCallback(Event event, Widget widget) { private bool clearGroupCallback(Event event, Widget widget) {
190 203 Global.Brush.group = null; Global.Brush.group = null;
191 204 Global.selection.update(null); Global.selection.update(null);
File source/frontend/ornamentDialog.d changed (mode: 100644) (index 5b5a173..205f18f)
... ... import gtk.Entry;
8 8 import gtk.RadioButton, gtk.ToggleButton; import gtk.RadioButton, gtk.ToggleButton;
9 9 import gtk.Box; import gtk.Box;
10 10
11 import dp.ent.shape;
11 import dp.ent.entity;
12 12
13 13 import Global = dp.global; import Global = dp.global;
14 14
15 15 class OrnamentDialog : Dialog { class OrnamentDialog : Dialog {
16 Shape shape;
16 Entity e;
17 17 Entry factorEntry; Entry factorEntry;
18 18 RadioButton topRd, bottomRd, leftRd, rightRd; RadioButton topRd, bottomRd, leftRd, rightRd;
19 19 string position = "Top"; // Default value since 'topRd' is mnemonic. string position = "Top"; // Default value since 'topRd' is mnemonic.
20 20
21 this(Shape shape) {
21 this(Entity e) {
22 22 super(); super();
23 23 setTitle("Attach ornament"); setTitle("Attach ornament");
24 this.shape = shape;
24 this.e = e;
25 25
26 26 Box box = new Box(Orientation.VERTICAL, 50); Box box = new Box(Orientation.VERTICAL, 50);
27 27
 
... ... class OrnamentDialog : Dialog {
49 49 factorEntry.setPlaceholderText("Enter ornament text here"); factorEntry.setPlaceholderText("Enter ornament text here");
50 50
51 51 Box btnBox = new Box(Orientation.HORIZONTAL, 30); Box btnBox = new Box(Orientation.HORIZONTAL, 30);
52 Button shapeBtn = new Button("Add ornament to shape", &clickCallback);
53 Button groupBtn = new Button("Add ornament to group", &clickCallback);
52 Button cancelBtn = new Button("Cancel", &cancelCallback);
53 Button confirmBtn = new Button("Add ornament to shape/group", &clickCallback);
54 54
55 btnBox.add(shapeBtn);
56 btnBox.add(groupBtn);
55 btnBox.add(cancelBtn);
56 btnBox.add(confirmBtn);
57 57
58 58 // Content area, containing non-interactable GTK objects. // Content area, containing non-interactable GTK objects.
59 59 getContentArea().add(new Label("Position of ornament relative to shape/group:")); getContentArea().add(new Label("Position of ornament relative to shape/group:"));
 
... ... class OrnamentDialog : Dialog {
69 69 showAll(); showAll();
70 70 } }
71 71
72 private void clickCallback (Button button) {
72 private void clickCallback(Button button) {
73 73 string input = factorEntry.getText(); string input = factorEntry.getText();
74 74
75 if(e is null)
76 this.close();
77
75 78 if(input != "") { if(input != "") {
76 79 final switch(position) { final switch(position) {
77 80 case "Top": case "Top":
 
... ... class OrnamentDialog : Dialog {
96 99 } }
97 100 } }
98 101
102 private void cancelCallback(Button button) {
103 this.close();
104 }
105
99 106 private void toggledRd(ToggleButton rd) { private void toggledRd(ToggleButton rd) {
100 107 if(rd.getActive) if(rd.getActive)
101 108 position = rd.getLabel(); position = rd.getLabel();
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/kapstok/NHL-DePa2

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/kapstok/NHL-DePa2

Clone this repository using git:
git clone git://git.rocketgit.com/user/kapstok/NHL-DePa2

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main