May 22, 2014
On Tuesday, 20 May 2014 at 18:13:36 UTC, Vadim Lopatin wrote:
>
> I'm keeping in mind a goal to write D language IDE based on dlangui. :)

That would be even more cool, with component palettes like in the Lazarus IDE for Free Pascal! :)
May 23, 2014
On Thursday, 22 May 2014 at 14:51:07 UTC, John wrote:
> On Tuesday, 20 May 2014 at 18:13:36 UTC, Vadim Lopatin wrote:
>>
>> I'm keeping in mind a goal to write D language IDE based on dlangui. :)
>
> That would be even more cool, with component palettes like in the Lazarus IDE for Free Pascal! :)

It could be a killer feature :)
May 23, 2014
On Tuesday, 20 May 2014 at 18:13:36 UTC, Vadim Lopatin wrote:
> Hello!
>
> I would like to announce my project, DlangUI library - cross-platform GUI for D.
> https://github.com/buggins/dlangui
> License: Boost License 1.0
>
> Native library written in D (not a wrapper to other GUI library) - easy to extend.
> As a backend, uses SDL2 on any platform, Win32 API on Windows, XCB on Linux. Other backends can be added easy.
> Tested on Windows and Linux.
> Supports hardware acceleration - drawing using OpenGL when built with version=USE_OPENGL.
> Unicode support.
> Internationalization support.
> Uses Win32 API fonts on Windows, and FreeType on other platforms.
> Same look and feel can be achieved on all platforms.
> Flexible look and feel - themes and styles.
> API is a bit similar to Android UI.
> Flexible layout, support of different screen DPI, scaling.
> Uses two phase layout like in Android.
> Supports drawable resources in .png and .jpeg, nine-patch pngs and state drawables like in Android.
> Single threaded. Use other threads for performing slow tasks.
> Mouse oriented.
>
> Actually, it's a port (with major redesign) of my library used for cross-platform version of my application CoolReader from C++.
>
>
> State of project: alpha. But, already can be used for simple 2D games and simple GUI apps.
> I'm keeping in mind a goal to write D language IDE based on dlangui. :)
> Adding support of 3D graphics is planned.
>
>
> Currently implemented widgets:
>
> TextWidget - simple static text (TODO: implement multiline formatting)
> ImageWidget - static image
> Button - simple button with text label
> ImageButton - image only button
> TextImageButton - button with icon and label
> CheckBox - check button with label
> RadioButton - radio button with label
> EditLine - single line edit
> EditBox - multiline editor
> VSpacer - vertical spacer - just an empty widget with layoutHeight == FILL_PARENT, to fill vertical space in layouts
> HSpacer - horizontal spacer - just an empty widget with layoutWidth == FILL_PARENT, to fill horizontal space in layouts
> ScrollBar - scroll bar
> TabControl - tabs widget, allows to select one of tabs
> TabHost - container for pages controlled by TabControl
> TabWidget - combination of TabControl and TabHost
>
> Layouts - Similar to layouts in Android
>
> LinearLayout - layout children horizontally or vertically depending on orientation
> VerticalLayout - just a LinearLayout with vertical orientation
> HorizontalLayout - just a LinearLayout with vertical orientation
> FrameLayout - all children occupy the same place; usually onle one of them is visible
> TableLayout - children are aligned into rows and columns of table
>
> List Views - similar to lists in Android UI API.
> ListWidget - layout dynamic items horizontally or vertically (one in row/column) with automatic scrollbar; can reuse widgets for similar items
> ListAdapter - interface to provide data and widgets for ListWidget
> WidgetListAdapter - simple implementation of ListAdapter interface - just a list of widgets (one per list item) to show
>
>
> Sample project, example1 contains demo code for most of dlangui API.
>
> Try it using DUB:
>
>     git clone https://github.com/buggins/dlangui.git
>     cd dlangui
>     dub run dlangui:example1
>
> Fonts note: on Linux, several .TTFs are loaded from hardcoded paths (suitable for Ubuntu).
> TODO: add fontconfig support to access all available system fonts.
>
> Helloworld:
>
> // main.d
> import dlangui.all;
> mixin DLANGUI_ENTRY_POINT;
>
> /// entry point for dlangui based application
> extern (C) int UIAppMain(string[] args) {
>     // resource directory search paths
>     string[] resourceDirs = [
>         appendPath(exePath, "../res/"),   // for Visual D and DUB builds
>         appendPath(exePath, "../../res/") // for Mono-D builds
>     ];
>
>     // setup resource directories - will use only existing directories
>     Platform.instance.resourceDirs = resourceDirs;
>     // select translation file - for english language
>     Platform.instance.uiLanguage = "en";
>     // load theme from file "theme_default.xml"
>     Platform.instance.uiTheme = "theme_default";
>
>     // create window
>     Window window = Platform.instance.createWindow("My Window", null);
>     // create some widget to show in window
>     window.mainWidget = (new Button()).text("Hello world"d).textColor(0xFF0000); // red text
>     // show window
>     window.show();
>     // run message loop
>     return Platform.instance.enterMessageLoop();
> }
>
> DDOC generated documentation can be found there: https://github.com/buggins/dlangui/tree/master/docs
> For more info see readme and example1 code.
>
> I would be glad to see any feedback.
> Can this project be useful for someone? What features/widgets are must have for you?
>
>
> Best regards,
>      Vadim  <coolreader.org@gmail.com>
> 	

Thanks a million! Please keep it up. Finally we get our own GUI. I've been dreaming of this for years. As has been mentioned before, bindings are only as good as the UI they bind to. With a native UI you can use the full power of the language itself. Talking about templates and stuff ...

Are you planning to make it C(++) compatible so that non-D-people could use it too?
June 05, 2014
"Vadim Lopatin" <coolreader.org@gmail.com> wrote in message news:fylchhowgmwmqhkewavo@forum.dlang.org...
> Hello!
>
> I would like to announce my project, DlangUI library - cross-platform GUI for D.
> https://github.com/buggins/dlangui
> License: Boost License 1.0
>
> Native library written in D (not a wrapper to other GUI library) - easy to extend.
> As a backend, uses SDL2 on any platform, Win32 API on Windows, XCB on Linux. Other backends can be added easy.
> Tested on Windows and Linux.
> Supports hardware acceleration - drawing using OpenGL when built with version=USE_OPENGL.
> Unicode support.
> Internationalization support.
> Uses Win32 API fonts on Windows, and FreeType on other platforms.
> Same look and feel can be achieved on all platforms.
> Flexible look and feel - themes and styles.
> API is a bit similar to Android UI.
> Flexible layout, support of different screen DPI, scaling.
> Uses two phase layout like in Android.
> Supports drawable resources in .png and .jpeg, nine-patch pngs and state drawables like in Android.
> Single threaded. Use other threads for performing slow tasks.
> Mouse oriented.
>
> Actually, it's a port (with major redesign) of my library used for cross-platform version of my application CoolReader from C++.
>
>
> State of project: alpha. But, already can be used for simple 2D games and simple GUI apps.
> I'm keeping in mind a goal to write D language IDE based on dlangui. :)
> Adding support of 3D graphics is planned.
>
>
> Currently implemented widgets:
>
> TextWidget - simple static text (TODO: implement multiline formatting)
> ImageWidget - static image
> Button - simple button with text label
> ImageButton - image only button
> TextImageButton - button with icon and label
> CheckBox - check button with label
> RadioButton - radio button with label
> EditLine - single line edit
> EditBox - multiline editor
> VSpacer - vertical spacer - just an empty widget with layoutHeight == FILL_PARENT, to fill vertical space in layouts
> HSpacer - horizontal spacer - just an empty widget with layoutWidth == FILL_PARENT, to fill horizontal space in layouts
> ScrollBar - scroll bar
> TabControl - tabs widget, allows to select one of tabs
> TabHost - container for pages controlled by TabControl
> TabWidget - combination of TabControl and TabHost
>
> Layouts - Similar to layouts in Android
>
> LinearLayout - layout children horizontally or vertically depending on orientation
> VerticalLayout - just a LinearLayout with vertical orientation
> HorizontalLayout - just a LinearLayout with vertical orientation
> FrameLayout - all children occupy the same place; usually onle one of them is visible
> TableLayout - children are aligned into rows and columns of table
>
> List Views - similar to lists in Android UI API.
> ListWidget - layout dynamic items horizontally or vertically (one in row/column) with automatic scrollbar; can reuse widgets for similar items
> ListAdapter - interface to provide data and widgets for ListWidget
> WidgetListAdapter - simple implementation of ListAdapter interface - just a list of widgets (one per list item) to show
>
>
> Sample project, example1 contains demo code for most of dlangui API.
>
> Try it using DUB:
>
>     git clone https://github.com/buggins/dlangui.git
>     cd dlangui
>     dub run dlangui:example1
>
> Fonts note: on Linux, several .TTFs are loaded from hardcoded paths (suitable for Ubuntu).
> TODO: add fontconfig support to access all available system fonts.
>
> Helloworld:
>
> // main.d
> import dlangui.all;
> mixin DLANGUI_ENTRY_POINT;
>
> /// entry point for dlangui based application
> extern (C) int UIAppMain(string[] args) {
>     // resource directory search paths
>     string[] resourceDirs = [
>         appendPath(exePath, "../res/"),   // for Visual D and DUB builds
>         appendPath(exePath, "../../res/") // for Mono-D builds
>     ];
>
>     // setup resource directories - will use only existing directories
>     Platform.instance.resourceDirs = resourceDirs;
>     // select translation file - for english language
>     Platform.instance.uiLanguage = "en";
>     // load theme from file "theme_default.xml"
>     Platform.instance.uiTheme = "theme_default";
>
>     // create window
>     Window window = Platform.instance.createWindow("My Window", null);
>     // create some widget to show in window
>     window.mainWidget = (new Button()).text("Hello world"d).textColor(0xFF0000); // red text
>     // show window
>     window.show();
>     // run message loop
>     return Platform.instance.enterMessageLoop();
> }
>
> DDOC generated documentation can be found there: https://github.com/buggins/dlangui/tree/master/docs
> For more info see readme and example1 code.
>
> I would be glad to see any feedback.
> Can this project be useful for someone? What features/widgets are must have for you?
>
>
> Best regards,
>      Vadim  <coolreader.org@gmail.com>
>

Hi Vadim,

I am evaluating GUIs for a project I have in mind and the DLangUI looks interesting...

First problem: you need to add gl3n to the git clone list for developing under Visual-D.

I am having problems running (debugging) the example1 program. When loading the resources it gets to tab_up_background.9.png (line 579 in file resources.d) and then fails with an exception:

"Unhandled exception at 0x0044f932 in example1.exe: 0xC0000005: Access violation reading location 0x00000000."

Do you have any clues as to what the problem could be?

Regards,
-=mike=- 

June 05, 2014
On Thursday, 5 June 2014 at 14:22:46 UTC, Mike James wrote:
> I am having problems running (debugging) the example1 program. When loading the resources it gets to tab_up_background.9.png (line 579 in file resources.d) and then fails with an exception:
>
> "Unhandled exception at 0x0044f932 in example1.exe: 0xC0000005: Access violation reading location 0x00000000."
>
> Do you have any clues as to what the problem could be?

I didn't compile this, so take it with a grain of salt.

Access violation reading 0x00000000 is a null pointer dereference. Looking at the source:

_drawbuf = loadImage(_filename);
if (_filename.endsWith(".9.png"))
    _drawbuf.detectNinePatch();

I'm making a wild guess that loadImage returns a null if it can't find the file. Dereferencing thus throws. You probably lack the image or it's in the wrong place.
June 05, 2014
On Thursday, 5 June 2014 at 15:15:48 UTC, Casper Færgemand wrote:
> On Thursday, 5 June 2014 at 14:22:46 UTC, Mike James wrote:
>> I am having problems running (debugging) the example1 program. When loading the resources it gets to tab_up_background.9.png (line 579 in file resources.d) and then fails with an exception:
>>
>> "Unhandled exception at 0x0044f932 in example1.exe: 0xC0000005: Access violation reading location 0x00000000."
>>
>> Do you have any clues as to what the problem could be?
>
> I didn't compile this, so take it with a grain of salt.
>
> Access violation reading 0x00000000 is a null pointer dereference. Looking at the source:
>
> _drawbuf = loadImage(_filename);
> if (_filename.endsWith(".9.png"))
>     _drawbuf.detectNinePatch();
>
> I'm making a wild guess that loadImage returns a null if it can't find the file. Dereferencing thus throws. You probably lack the image or it's in the wrong place.

Hi Casper,

I checked the sub-directory the loading refers to and all the pngs seems to be there.

Regards,
-=mike=-
June 05, 2014
On Thursday, 5 June 2014 at 16:10:00 UTC, Mike James wrote:
> I checked the sub-directory the loading refers to and all the pngs seems to be there.

I managed to get the files from github just fine, but dub says it is unable to copy a libpng file to the example case. I'm not sure what is wrong, the instructions are three lines of code after all. =/

git clone https://github.com/buggins/dlangui.git
cd dlangui
dub run dlangui:example1
June 11, 2014
On Thursday, 5 June 2014 at 14:22:46 UTC, Mike James wrote:
> First problem: you need to add gl3n to the git clone list for developing under Visual-D.

Fixed. I've removed gl3n and libpng references from project.

> I am having problems running (debugging) the example1 program. When loading the resources it gets to tab_up_background.9.png (line 579 in file resources.d) and then fails with an exception:
>
> "Unhandled exception at 0x0044f932 in example1.exe: 0xC0000005: Access violation reading location 0x00000000."
>
> Do you have any clues as to what the problem could be?

Search log file examples/example1/ui.log for lines like
2014-06-11 13:21:11.070 D  DrawableCache: adding path C:\projects\d\dlangui\examples\example1\Debug\..\..\..\res\ to resource dir list.
2014-06-11 13:21:11.070 D  DrawableCache: adding path C:\projects\d\dlangui\examples\example1\Debug\..\..\..\res\mdpi\ to resource dir list.
2014-06-11 13:21:11.070 D  DrawableCache: path C:\projects\d\dlangui\examples\example1\Debug\..\..\..\..\res\ does not exist.
....
2014-06-11 13:21:11.086 D  DrawableCache: path C:\projects\d\dlangui\examples\example1\Debug\..\..\res\mdpi\ does not exist.

In examples/example1/main.d several directories are added as resource path
candidates

    // resource directory search paths
    string[] resourceDirs = [
        appendPath(exePath, "../../../res/"),   // for Visual D and DUB builds
        appendPath(exePath, "../../../res/mdpi/"),   // for Visual D and DUB builds
        appendPath(exePath, "../../../../res/"),// for Mono-D builds
        appendPath(exePath, "../../../../res/mdpi/"),// for Mono-D builds
		appendPath(exePath, "res/"), // when res dir is located at the same directory as executable
		appendPath(exePath, "../res/"), // when res dir is located at project directory
		appendPath(exePath, "../../res/"), // when res dir is located at the same directory as executable
		appendPath(exePath, "res/mdpi/"), // when res dir is located at the same directory as executable
		appendPath(exePath, "../res/mdpi/"), // when res dir is located at project directory
		appendPath(exePath, "../../res/mdpi/") // when res dir is located at the same directory as executable
	];

If your executable is not located in examples/example1/Debug, probably you add path to your directory to list of resource dirs.

Another possible reason - FreeImage.dll is found.
Try to copy FreeImage.dll from lib directory to examples/example1/Debug
June 11, 2014
Project Update:
Grid control is implemented.
June 11, 2014
On Thursday, 5 June 2014 at 19:58:10 UTC, Casper Færgemand wrote:
> On Thursday, 5 June 2014 at 16:10:00 UTC, Mike James wrote:
>> I checked the sub-directory the loading refers to and all the pngs seems to be there.
>
> I managed to get the files from github just fine, but dub says it is unable to copy a libpng file to the example case. I'm not sure what is wrong, the instructions are three lines of code after all. =/
>
> git clone https://github.com/buggins/dlangui.git
> cd dlangui
> dub run dlangui:example1

libpng is not needed anymore.

These three lines worked ok for me some time ago.
But now I'm facing with another problem while trying dub build:

Building dlangui:example1 configuration "application", build type debug.
Compiling...
Error: conflicting Ddoc and obj generation options

Does anyone know how to fix it?