From 1de90b5434b2fa9214d491e5791edc56d855e4e1 Mon Sep 17 00:00:00 2001 From: Vadim Lopatin Date: Wed, 31 Dec 2014 09:56:46 +0300 Subject: [PATCH] FileDialog path segment buttons --- README.md | 8 +++++--- src/dlangui/dialogs/filedlg.d | 22 +++++++++++++++++++--- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index c0490979..56ebbf35 100644 --- a/README.md +++ b/README.md @@ -123,16 +123,18 @@ Run Tetris game example dub run dlangui:tetris --build=release -To develop using Visual-D, download sources for dlabgui and dependencies into some directory: +To develop using Visual-D or MonoD, download sources for dlabgui and dependencies into some directory: git clone https://github.com/buggins/dlangui.git git clone https://github.com/DerelictOrg/DerelictUtil.git git clone https://github.com/DerelictOrg/DerelictGL3.git - git clone https://github.com/DerelictOrg/DerelictFI.git git clone https://github.com/DerelictOrg/DerelictFT.git git clone https://github.com/DerelictOrg/DerelictSDL2.git + git clone https://github.com/gecko0307/dlib.git + git clone https://github.com/Devisualization/image.git de_image + -Then open .sln using Visual D. +Then open dlangui.sln using Visual D (or dlangui-monod.sln for MonoD) diff --git a/src/dlangui/dialogs/filedlg.d b/src/dlangui/dialogs/filedlg.d index 8b4f1144..caba1b6a 100644 --- a/src/dlangui/dialogs/filedlg.d +++ b/src/dlangui/dialogs/filedlg.d @@ -351,8 +351,8 @@ class FilePathPanelItem : HorizontalLayout { class FilePathPanelButtons : WidgetGroup { protected string _path; - this() { - super(null); + this(string ID = null) { + super(ID); } void init(string path) { _path = path; @@ -447,9 +447,25 @@ class FilePathPanelButtons : WidgetGroup { } class FilePathPanel : FrameLayout { - protected HorizontalLayout _segments; + static const ID_SEGMENTS = "SEGMENTS"; + static const ID_EDITOR = "ED_PATH"; + protected FilePathPanelButtons _segments; protected EditLine _edPath; + protected string _path; this(string ID = null) { super(ID); + _segments = new FilePathPanelButtons(ID_SEGMENTS); + _edPath = new EditLine(ID_EDITOR); + addChild(_segments); + addChild(_edPath); + showChild(ID_SEGMENTS); } + @property void path(string value) { + _segments.init(value); + _edPath.text = toUTF32(value); + _path = path; + } + @property string path() { + return _path; + } }