mirror of https://github.com/buggins/dlangide.git
workspace panel
This commit is contained in:
parent
8e211b1adc
commit
3e93506c27
|
@ -66,7 +66,7 @@
|
|||
<debuglevel>0</debuglevel>
|
||||
<debugids />
|
||||
<versionlevel>0</versionlevel>
|
||||
<versionids>USE_SDL USE_OPENGL</versionids>
|
||||
<versionids>Unicode USE_OPENGL</versionids>
|
||||
<dump_source>0</dump_source>
|
||||
<mapverbosity>3</mapverbosity>
|
||||
<createImplib>0</createImplib>
|
||||
|
@ -190,15 +190,16 @@
|
|||
</Config>
|
||||
<Folder name="dlangide">
|
||||
<Folder name="dlangide">
|
||||
<Folder name="ui">
|
||||
<File path="src\dlangide\ui\commands.d" />
|
||||
<File path="src\dlangide\ui\frame.d" />
|
||||
<File path="src\dlangide\ui\wspanel.d" />
|
||||
</Folder>
|
||||
<Folder name="workspace">
|
||||
<File path="src\dlangide\workspace\project.d" />
|
||||
<File path="src\dlangide\workspace\workspace.d" />
|
||||
</Folder>
|
||||
<Folder name="ui">
|
||||
<File path="src/dlangide/ui/commands.d" />
|
||||
<File path="src/dlangide/ui/frame.d" />
|
||||
</Folder>
|
||||
</Folder>
|
||||
<File path="src/app.d" />
|
||||
<File path="src\app.d" />
|
||||
</Folder>
|
||||
</DProject>
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue