fix project

This commit is contained in:
Vadim Lopatin 2015-01-22 10:07:54 +03:00
parent 5af53ca271
commit bbdafb4c8e
12 changed files with 61 additions and 19 deletions

View File

@ -211,6 +211,6 @@
<File path="src\dlangide\workspace\workspace.d" /> <File path="src\dlangide\workspace\workspace.d" />
</Folder> </Folder>
</Folder> </Folder>
<File path="src\app.d" /> <File path="src\dlangide.d" />
</Folder> </Folder>
</DProject> </DProject>

View File

@ -9,26 +9,10 @@
"targetPath": "bin", "targetPath": "bin",
"targetType": "executable", "targetType": "executable",
"sourcePaths": ["src"],
"sourceFiles": [
"src/app.d"
],
"copyFiles-windows": [
"lib/FreeImage.dll"
],
"copyFiles": [ "copyFiles": [
"res" "res"
], ],
"versions-posix": [
"USE_SDL", "USE_OPENGL"
],
"mainSourceFile": "src/app.d",
"dependencies": { "dependencies": {
"dlangui:dlanguilib": "~master" "dlangui:dlanguilib": "~master"
} }

BIN
res/mdpi/debug-run.png Normal file

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

View File

@ -297,6 +297,12 @@
margins="1,1,1,1" margins="1,1,1,1"
padding="4,4,4,4" 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" <style id="TOOLBAR_SEPARATOR"
align="Center" align="Center"
/> />

View File

@ -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>

View File

@ -1,6 +1,6 @@
module dlangide.ui.commands; module dlangide.ui.commands;
import dlangui.core.events; public import dlangui.core.events;
import dlangui.widgets.editors; import dlangui.widgets.editors;
enum IDEActions : int { enum IDEActions : int {
@ -11,6 +11,8 @@ enum IDEActions : int {
FileSave, FileSave,
FileClose, FileClose,
FileExit, FileExit,
DebugStart,
DebugStartNoDebug,
HelpAbout, 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_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_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_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_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_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); __gshared Action ACTION_EDIT_CUT = new Action(EditorActions.Cut, "Cut"d, "edit-cut"c, KeyCode.KEY_X, KeyFlag.Control);

View File

@ -10,6 +10,7 @@ import ddc.lexer.tokenizer;
import dlangide.workspace.workspace; import dlangide.workspace.workspace;
import dlangide.workspace.project; import dlangide.workspace.project;
import dlangide.ui.commands;
import std.algorithm; import std.algorithm;
@ -59,6 +60,25 @@ class DSourceEdit : SourceEdit {
setHighlighter(); setHighlighter();
return true; 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);
}
} }

View File

@ -9,6 +9,7 @@ import dlangui.widgets.controls;
import dlangui.widgets.appframe; import dlangui.widgets.appframe;
import dlangui.widgets.docks; import dlangui.widgets.docks;
import dlangui.widgets.toolbars; import dlangui.widgets.toolbars;
import dlangui.widgets.combobox;
import dlangui.dialogs.dialog; import dlangui.dialogs.dialog;
import dlangui.dialogs.filedlg; import dlangui.dialogs.filedlg;
@ -155,7 +156,12 @@ class IDEFrame : AppFrame {
ToolBarHost res = new ToolBarHost(); ToolBarHost res = new ToolBarHost();
ToolBar tb; ToolBar tb;
tb = res.getOrAddToolbar("Standard"); 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 = res.getOrAddToolbar("Edit");
tb.addButtons(ACTION_EDIT_COPY, ACTION_EDIT_PASTE, ACTION_EDIT_CUT, ACTION_SEPARATOR, tb.addButtons(ACTION_EDIT_COPY, ACTION_EDIT_PASTE, ACTION_EDIT_CUT, ACTION_SEPARATOR,
ACTION_EDIT_UNDO, ACTION_EDIT_REDO); ACTION_EDIT_UNDO, ACTION_EDIT_REDO);