mirror of https://github.com/buggins/dlangide.git
fixes
This commit is contained in:
parent
84f7fdc0f9
commit
5af53ca271
|
@ -3,10 +3,6 @@ module dlangide.ui.commands;
|
||||||
import dlangui.core.events;
|
import dlangui.core.events;
|
||||||
import dlangui.widgets.editors;
|
import dlangui.widgets.editors;
|
||||||
|
|
||||||
enum : int {
|
|
||||||
ACTION_HELP_ABOUT = 5500,
|
|
||||||
}
|
|
||||||
|
|
||||||
enum IDEActions : int {
|
enum IDEActions : int {
|
||||||
None = 0,
|
None = 0,
|
||||||
ProjectOpen = 1010000,
|
ProjectOpen = 1010000,
|
||||||
|
@ -15,6 +11,7 @@ enum IDEActions : int {
|
||||||
FileSave,
|
FileSave,
|
||||||
FileClose,
|
FileClose,
|
||||||
FileExit,
|
FileExit,
|
||||||
|
HelpAbout,
|
||||||
}
|
}
|
||||||
|
|
||||||
__gshared Action ACTION_FILE_NEW = new Action(IDEActions.FileOpen, "MENU_FILE_NEW"c, "document-new", KeyCode.KEY_N, KeyFlag.Control);
|
__gshared Action ACTION_FILE_NEW = new Action(IDEActions.FileOpen, "MENU_FILE_NEW"c, "document-new", KeyCode.KEY_N, KeyFlag.Control);
|
||||||
|
@ -26,3 +23,4 @@ __gshared Action ACTION_EDIT_PASTE = new Action(EditorActions.Paste, "Paste"d, "
|
||||||
__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);
|
||||||
__gshared Action ACTION_EDIT_UNDO = new Action(EditorActions.Undo, "Undo"d, "edit-undo"c, KeyCode.KEY_Z, KeyFlag.Control);
|
__gshared Action ACTION_EDIT_UNDO = new Action(EditorActions.Undo, "Undo"d, "edit-undo"c, KeyCode.KEY_Z, KeyFlag.Control);
|
||||||
__gshared Action ACTION_EDIT_REDO = new Action(EditorActions.Redo, "Redo"d, "edit-redo"c, KeyCode.KEY_Z, KeyFlag.Control|KeyFlag.Shift);
|
__gshared Action ACTION_EDIT_REDO = new Action(EditorActions.Redo, "Redo"d, "edit-redo"c, KeyCode.KEY_Z, KeyFlag.Control|KeyFlag.Shift);
|
||||||
|
__gshared Action ACTION_HELP_ABOUT = new Action(IDEActions.HelpAbout, "MENU_HELP_ABOUT"c);
|
||||||
|
|
|
@ -1,5 +1,19 @@
|
||||||
module dlangide.ui.dsourceedit;
|
module dlangide.ui.dsourceedit;
|
||||||
|
|
||||||
|
import dlangui.core.logger;
|
||||||
|
import dlangui.widgets.editors;
|
||||||
|
import dlangui.widgets.srcedit;
|
||||||
|
|
||||||
|
import ddc.lexer.textsource;
|
||||||
|
import ddc.lexer.exceptions;
|
||||||
|
import ddc.lexer.tokenizer;
|
||||||
|
|
||||||
|
import dlangide.workspace.workspace;
|
||||||
|
import dlangide.workspace.project;
|
||||||
|
|
||||||
|
import std.algorithm;
|
||||||
|
|
||||||
|
|
||||||
/// DIDE source file editor
|
/// DIDE source file editor
|
||||||
class DSourceEdit : SourceEdit {
|
class DSourceEdit : SourceEdit {
|
||||||
this(string ID) {
|
this(string ID) {
|
||||||
|
|
|
@ -15,13 +15,10 @@ import dlangui.dialogs.filedlg;
|
||||||
import dlangide.ui.commands;
|
import dlangide.ui.commands;
|
||||||
import dlangide.ui.wspanel;
|
import dlangide.ui.wspanel;
|
||||||
import dlangide.ui.outputpanel;
|
import dlangide.ui.outputpanel;
|
||||||
|
import dlangide.ui.dsourceedit;
|
||||||
import dlangide.workspace.workspace;
|
import dlangide.workspace.workspace;
|
||||||
import dlangide.workspace.project;
|
import dlangide.workspace.project;
|
||||||
|
|
||||||
import ddc.lexer.textsource;
|
|
||||||
import ddc.lexer.exceptions;
|
|
||||||
import ddc.lexer.tokenizer;
|
|
||||||
|
|
||||||
import std.conv;
|
import std.conv;
|
||||||
import std.utf;
|
import std.utf;
|
||||||
import std.algorithm;
|
import std.algorithm;
|
||||||
|
@ -141,14 +138,7 @@ class IDEFrame : AppFrame {
|
||||||
windowItem.add(new Action(30, "MENU_WINDOW_PREFERENCES"));
|
windowItem.add(new Action(30, "MENU_WINDOW_PREFERENCES"));
|
||||||
MenuItem helpItem = new MenuItem(new Action(4, "MENU_HELP"c));
|
MenuItem helpItem = new MenuItem(new Action(4, "MENU_HELP"c));
|
||||||
helpItem.add(new Action(40, "MENU_HELP_VIEW_HELP"));
|
helpItem.add(new Action(40, "MENU_HELP_VIEW_HELP"));
|
||||||
MenuItem aboutItem = new MenuItem(new Action(ACTION_HELP_ABOUT, "MENU_HELP_ABOUT"));
|
helpItem.add(ACTION_HELP_ABOUT);
|
||||||
helpItem.add(aboutItem);
|
|
||||||
aboutItem.onMenuItemClick = delegate(MenuItem item) {
|
|
||||||
Window wnd = Platform.instance.createWindow("About...", window, WindowFlag.Modal);
|
|
||||||
wnd.mainWidget = createAboutWidget();
|
|
||||||
wnd.show();
|
|
||||||
return true;
|
|
||||||
};
|
|
||||||
mainMenuItems.add(fileItem);
|
mainMenuItems.add(fileItem);
|
||||||
mainMenuItems.add(editItem);
|
mainMenuItems.add(editItem);
|
||||||
//mainMenuItems.add(viewItem);
|
//mainMenuItems.add(viewItem);
|
||||||
|
@ -165,8 +155,10 @@ 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, ACTION_SEPARATOR,
|
tb.addButtons(ACTION_FILE_OPEN, ACTION_FILE_SAVE);
|
||||||
ACTION_EDIT_COPY, ACTION_EDIT_PASTE, ACTION_EDIT_CUT);
|
tb = res.getOrAddToolbar("Edit");
|
||||||
|
tb.addButtons(ACTION_EDIT_COPY, ACTION_EDIT_PASTE, ACTION_EDIT_CUT, ACTION_SEPARATOR,
|
||||||
|
ACTION_EDIT_UNDO, ACTION_EDIT_REDO);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -175,8 +167,9 @@ class IDEFrame : AppFrame {
|
||||||
if (a) {
|
if (a) {
|
||||||
switch (a.id) {
|
switch (a.id) {
|
||||||
case IDEActions.FileExit:
|
case IDEActions.FileExit:
|
||||||
|
window.close();
|
||||||
return true;
|
return true;
|
||||||
case ACTION_HELP_ABOUT:
|
case IDEActions.HelpAbout:
|
||||||
Window wnd = Platform.instance.createWindow("About...", window, WindowFlag.Modal);
|
Window wnd = Platform.instance.createWindow("About...", window, WindowFlag.Modal);
|
||||||
wnd.mainWidget = createAboutWidget();
|
wnd.mainWidget = createAboutWidget();
|
||||||
wnd.show();
|
wnd.show();
|
||||||
|
|
Loading…
Reference in New Issue