mirror of https://github.com/buggins/dlangide.git
fix project
This commit is contained in:
parent
5af53ca271
commit
bbdafb4c8e
|
@ -211,6 +211,6 @@
|
|||
<File path="src\dlangide\workspace\workspace.d" />
|
||||
</Folder>
|
||||
</Folder>
|
||||
<File path="src\app.d" />
|
||||
<File path="src\dlangide.d" />
|
||||
</Folder>
|
||||
</DProject>
|
||||
|
|
16
dub.json
16
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"
|
||||
}
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 383 B |
Binary file not shown.
After Width: | Height: | Size: 249 B |
Binary file not shown.
After Width: | Height: | Size: 247 B |
|
@ -297,6 +297,12 @@
|
|||
margins="1,1,1,1"
|
||||
padding="4,4,4,4"
|
||||
/>
|
||||
<style id="TOOLBAR_CONTROL"
|
||||
backgroundImageId="toolbar_control_background"
|
||||
align="Center"
|
||||
margins="1,1,1,1"
|
||||
padding="4,4,4,4"
|
||||
/>
|
||||
<style id="TOOLBAR_SEPARATOR"
|
||||
align="Center"
|
||||
/>
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
<item
|
||||
android:drawable="toolbar_control_disabled"
|
||||
android:state_enabled="false"
|
||||
android:state_focused="true" />
|
||||
<item
|
||||
android:drawable="toolbar_button_hover"
|
||||
android:state_hovered="true"
|
||||
android:state_focused="true" />
|
||||
<item
|
||||
android:drawable="toolbar_button_hover"
|
||||
android:state_focused="true"
|
||||
/>
|
||||
<item
|
||||
android:drawable="toolbar_button_pressed"
|
||||
android:state_pressed="true" />
|
||||
<item
|
||||
android:drawable="toolbar_button_hover"
|
||||
android:state_hovered="true" />
|
||||
<item
|
||||
android:drawable="toolbar_control_normal" />
|
||||
</selector>
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue