diff --git a/dlangide.visualdproj b/dlangide.visualdproj
index 1c16f2c..2f30419 100644
--- a/dlangide.visualdproj
+++ b/dlangide.visualdproj
@@ -211,6 +211,6 @@
-
+
diff --git a/dub.json b/dub.json
index 54cf70e..8ada80d 100644
--- a/dub.json
+++ b/dub.json
@@ -9,26 +9,10 @@
"targetPath": "bin",
"targetType": "executable",
- "sourcePaths": ["src"],
-
- "sourceFiles": [
- "src/app.d"
- ],
-
- "copyFiles-windows": [
- "lib/FreeImage.dll"
- ],
-
"copyFiles": [
"res"
],
- "versions-posix": [
- "USE_SDL", "USE_OPENGL"
- ],
-
- "mainSourceFile": "src/app.d",
-
"dependencies": {
"dlangui:dlanguilib": "~master"
}
diff --git a/res/mdpi/debug-run.png b/res/mdpi/debug-run.png
new file mode 100644
index 0000000..eee3e90
Binary files /dev/null and b/res/mdpi/debug-run.png differ
diff --git a/res/stdres/mdpi/toolbar_control_disabled.9.png b/res/stdres/mdpi/toolbar_control_disabled.9.png
new file mode 100644
index 0000000..1ecea1b
Binary files /dev/null and b/res/stdres/mdpi/toolbar_control_disabled.9.png differ
diff --git a/res/stdres/mdpi/toolbar_control_normal.9.png b/res/stdres/mdpi/toolbar_control_normal.9.png
new file mode 100644
index 0000000..3e94da9
Binary files /dev/null and b/res/stdres/mdpi/toolbar_control_normal.9.png differ
diff --git a/res/stdres/theme_default.xml b/res/stdres/theme_default.xml
index add1b54..0b1b8bb 100644
--- a/res/stdres/theme_default.xml
+++ b/res/stdres/theme_default.xml
@@ -297,6 +297,12 @@
margins="1,1,1,1"
padding="4,4,4,4"
/>
+
diff --git a/res/stdres/toolbar_control_background.xml b/res/stdres/toolbar_control_background.xml
new file mode 100644
index 0000000..4b0df5f
--- /dev/null
+++ b/res/stdres/toolbar_control_background.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
diff --git a/src/app.d b/src/dlangide.d
similarity index 100%
rename from src/app.d
rename to src/dlangide.d
diff --git a/src/dlangide/ui/commands.d b/src/dlangide/ui/commands.d
index 8d4b87c..a5778fc 100644
--- a/src/dlangide/ui/commands.d
+++ b/src/dlangide/ui/commands.d
@@ -1,6 +1,6 @@
module dlangide.ui.commands;
-import dlangui.core.events;
+public import dlangui.core.events;
import dlangui.widgets.editors;
enum IDEActions : int {
@@ -11,6 +11,8 @@ enum IDEActions : int {
FileSave,
FileClose,
FileExit,
+ DebugStart,
+ DebugStartNoDebug,
HelpAbout,
}
@@ -18,6 +20,7 @@ __gshared Action ACTION_FILE_NEW = new Action(IDEActions.FileOpen, "MENU_FILE_NE
__gshared Action ACTION_FILE_OPEN = new Action(IDEActions.FileOpen, "MENU_FILE_OPEN"c, "document-open", KeyCode.KEY_O, KeyFlag.Control);
__gshared Action ACTION_FILE_SAVE = new Action(IDEActions.FileSave, "MENU_FILE_SAVE"c, "document-save", KeyCode.KEY_S, KeyFlag.Control);
__gshared Action ACTION_FILE_EXIT = new Action(IDEActions.FileExit, "MENU_FILE_EXIT"c, "document-close"c, KeyCode.KEY_X, KeyFlag.Alt);
+__gshared Action ACTION_DEBUG_START = new Action(IDEActions.DebugStart, "Start Debugging"d, "debug-run"c, KeyCode.F5, 0);
__gshared Action ACTION_EDIT_COPY = new Action(EditorActions.Copy, "Copy"d, "edit-copy"c, KeyCode.KEY_C, KeyFlag.Control);
__gshared Action ACTION_EDIT_PASTE = new Action(EditorActions.Paste, "Paste"d, "edit-paste"c, KeyCode.KEY_V, KeyFlag.Control);
__gshared Action ACTION_EDIT_CUT = new Action(EditorActions.Cut, "Cut"d, "edit-cut"c, KeyCode.KEY_X, KeyFlag.Control);
diff --git a/src/dlangide/ui/dsourceedit.d b/src/dlangide/ui/dsourceedit.d
index 152f258..29d1215 100644
--- a/src/dlangide/ui/dsourceedit.d
+++ b/src/dlangide/ui/dsourceedit.d
@@ -10,6 +10,7 @@ import ddc.lexer.tokenizer;
import dlangide.workspace.workspace;
import dlangide.workspace.project;
+import dlangide.ui.commands;
import std.algorithm;
@@ -59,6 +60,25 @@ class DSourceEdit : SourceEdit {
setHighlighter();
return true;
}
+
+ /// save to the same file
+ bool save() {
+ return _content.save();
+ }
+
+ /// override to handle specific actions
+ override bool handleAction(const Action a) {
+ if (a) {
+ switch (a.id) {
+ case IDEActions.FileSave:
+ save();
+ return true;
+ default:
+ break;
+ }
+ }
+ return super.handleAction(a);
+ }
}
diff --git a/src/dlangide/ui/frame.d b/src/dlangide/ui/frame.d
index a568a17..202cc57 100644
--- a/src/dlangide/ui/frame.d
+++ b/src/dlangide/ui/frame.d
@@ -9,6 +9,7 @@ import dlangui.widgets.controls;
import dlangui.widgets.appframe;
import dlangui.widgets.docks;
import dlangui.widgets.toolbars;
+import dlangui.widgets.combobox;
import dlangui.dialogs.dialog;
import dlangui.dialogs.filedlg;
@@ -155,7 +156,12 @@ class IDEFrame : AppFrame {
ToolBarHost res = new ToolBarHost();
ToolBar tb;
tb = res.getOrAddToolbar("Standard");
- tb.addButtons(ACTION_FILE_OPEN, ACTION_FILE_SAVE);
+ tb.addButtons(ACTION_FILE_OPEN, ACTION_FILE_SAVE, ACTION_SEPARATOR);
+
+ tb.addButtons(ACTION_DEBUG_START);
+ ToolBarComboBox cbBuildConfiguration = new ToolBarComboBox("buildConfig", ["Debug"d, "Release"d, "Unittest"d]);
+ tb.addControl(cbBuildConfiguration);
+
tb = res.getOrAddToolbar("Edit");
tb.addButtons(ACTION_EDIT_COPY, ACTION_EDIT_PASTE, ACTION_EDIT_CUT, ACTION_SEPARATOR,
ACTION_EDIT_UNDO, ACTION_EDIT_REDO);
diff --git a/workspaces/sample1/sampleproject1/source/main.d b/workspaces/sample1/sampleproject1/source/main.d
index d5df88b..8f037da 100644
Binary files a/workspaces/sample1/sampleproject1/source/main.d and b/workspaces/sample1/sampleproject1/source/main.d differ