diff --git a/dlangide.visualdproj b/dlangide.visualdproj index b18e88d..7e31b86 100644 --- a/dlangide.visualdproj +++ b/dlangide.visualdproj @@ -66,7 +66,7 @@ 0 0 - USE_SDL USE_OPENGL + Unicode USE_OPENGL 0 3 0 @@ -190,15 +190,16 @@ + + + + + - - - - - + diff --git a/src/app.d b/src/app.d index 9f7bdbd..1f9218a 100644 --- a/src/app.d +++ b/src/app.d @@ -38,12 +38,11 @@ extern (C) int UIAppMain(string[] args) { // create window Window window = Platform.instance.createWindow("Dlang IDE", null); + IDEFrame frame = new IDEFrame(window); + frame.loadWorkspace(appendPath(exePath, "../workspaces/sample1/sample1.dlangidews")); // create some widget to show in window - window.mainWidget = new IDEFrame(window); + window.mainWidget = frame; - // testing workspace loader - Workspace ws = new Workspace(); - ws.load(appendPath(exePath, "../workspaces/sample1/sample1.dlangidews")); // show window window.show(); diff --git a/src/dlangide/ui/frame.d b/src/dlangide/ui/frame.d index a497c12..9d0269a 100644 --- a/src/dlangide/ui/frame.d +++ b/src/dlangide/ui/frame.d @@ -9,6 +9,8 @@ import dlangui.dialogs.dialog; import dlangui.dialogs.filedlg; import dlangide.ui.commands; +import dlangide.ui.wspanel; +import dlangide.workspace.workspace; import std.conv; @@ -25,6 +27,7 @@ class IDEFrame : VerticalLayout, MenuItemClickHandler { MainMenu mainMenu; MenuItem mainMenuItems; + WorkspacePanel _wsPanel; this(Window window) { super("IDEFrame"); @@ -33,18 +36,24 @@ class IDEFrame : VerticalLayout, MenuItemClickHandler { createMenu(); createTabs(); + layoutWidth = FILL_PARENT; layoutHeight = FILL_PARENT; //window.mainWidget = this; } + + void createTabs() { // editor tabs TabWidget tabs = new TabWidget("TABS"); tabs.layoutWidth = FILL_PARENT; tabs.layoutHeight = FILL_PARENT; + _wsPanel = new WorkspacePanel("workspace"); + HorizontalLayout wsLayout = new HorizontalLayout(); + wsLayout.layoutWidth(FILL_PARENT).layoutHeight(FILL_PARENT); // create Editors test tab VerticalLayout editors = new VerticalLayout("editors"); @@ -57,7 +66,10 @@ class IDEFrame : VerticalLayout, MenuItemClickHandler { //editBox.popupMenu = editPopupItem; tabs.addTab(editors, "Sample"d); - addChild(tabs); + wsLayout.addChild(tabs); + wsLayout.addChild(new ResizerWidget("wsresizer")); + wsLayout.addChild(_wsPanel); + addChild(wsLayout); tabs.selectTab("editors"); @@ -130,6 +142,15 @@ class IDEFrame : VerticalLayout, MenuItemClickHandler { } return false; } + + bool loadWorkspace(string path) { + // testing workspace loader + Workspace ws = new Workspace(); + ws.load(path); + currentWorkspace = ws; + _wsPanel.workspace = ws; + return true; + } } Widget createAboutWidget() diff --git a/src/dlangide/workspace/project.d b/src/dlangide/workspace/project.d index 6e02ad0..af42683 100644 --- a/src/dlangide/workspace/project.d +++ b/src/dlangide/workspace/project.d @@ -33,6 +33,26 @@ class WorkspaceItem { } } + /// name + @property dstring name() { + return _name; + } + + /// name + @property void name(dstring s) { + _name = s; + } + + /// name + @property dstring description() { + return _description; + } + + /// name + @property void description(dstring s) { + _description = s; + } + /// load bool load(string fname) { // override it diff --git a/src/dlangide/workspace/workspace.d b/src/dlangide/workspace/workspace.d index 81c3e3a..75afed2 100644 --- a/src/dlangide/workspace/workspace.d +++ b/src/dlangide/workspace/workspace.d @@ -27,6 +27,10 @@ class Workspace : WorkspaceItem { super(fname); } + @property Project[] projects() { + return _projects; + } + override bool load(string fname = null) { if (fname.length > 0) filename = fname; @@ -62,4 +66,9 @@ class Workspace : WorkspaceItem { } return true; } + void close() { + } } + +/// global workspace +__gshared Workspace currentWorkspace;