www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - DGui

reply Andrej Mitrovic <none none.none> writes:
On 4/3/11, Matthias Pleh <matthias none.net> wrote:
 * dgui -> windows only, also really .Net-like
So what's the state of things for this new(?) Windows GUI library? I gave it a test run yesterday, examples seem to compile and apps seem to load really fast (well, it's GDI and simple examples, but still pretty fast to load). There doesn't seem to be any unittests at all which is a bit worrisome. It has been put on the dwiki as a beta library, but has anyone used it for anything yet? I'd like to know more (plans, etc) from the author. :)
Apr 03 2011
next sibling parent Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
Actually, it does seem to use a lot of contracts now that I'm looking
through it in more detail.
Apr 03 2011
prev sibling next sibling parent reply Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
Damn, gotta love that `with` keyword. Here's an app with a couple of
menus, icons, and a context menu:

module test;

import dgui.all;

class MyApplication : Form
{
    ToolBar bar;
    ContextMenu ctx;
    MenuBar mainMenu;

	public this()
	{
		this.text = "My App!";
		this.size = Size(500, 400);
		this.startPosition = FormStartPosition.CENTER_SCREEN;

        auto images = new ImageList();
        images.addImage(Icon.fromFile("red.ico"));
        images.addImage(Icon.fromFile("green.ico"));
        images.addImage(Icon.fromFile("blue.ico"));

        with(bar = new ToolBar)
        {
            parent = this;
            imageList = images;
            addButton(0, true);
            addButton(1, true);
            addSeparator();
        }

        with(ctx = new ContextMenu)
        {
            addItem("Context Menu 2.1");
            addItem("Context Menu 2.2", false);
            addSeparator();
            addItem("Context Menu 2.3");
            bar.addDropdownButton(2, ctx, true);
        }

        with(mainMenu = new MenuBar)
        {
            with(addItem("Menu 1"))
            {
                addItem("Menu 1.1");
                addItem("Menu 1.2");
                addItem("Menu 1.3");
            }

            with(addItem("Menu 2"))
            {
                addItem("Menu 2.1");
                addItem("Menu 2.2");
                addItem("Menu 2.3");
            }

            with(addItem("Menu 3"))
            {
                addItem("Menu 3.1");
                addItem("Menu 3.2");
                addItem("Menu 3.3");
            }
            this.menu = mainMenu;
        }
	}
}

int main(string[] args)
{
	return Application.run(new MyApplication());
}

And a screenshot:
http://i.imgur.com/ETPzq.jpg

Takes about 0.3 seconds to compile. And yeah, I'm a sucker for that
Windows 98 look. :p
Apr 03 2011
parent reply "Nick Sabalausky" <a a.a> writes:
"Andrej Mitrovic" <andrej.mitrovich gmail.com> wrote in message 
news:mailman.3130.1301893443.4748.digitalmars-d puremagic.com...
 And a screenshot:
 http://i.imgur.com/ETPzq.jpg

 Takes about 0.3 seconds to compile. And yeah, I'm a sucker for that
 Windows 98 look. :p
Best window skin ever to come out of MS.
Apr 03 2011
parent Matthias Pleh <jens konrad.net> writes:
Am 04.04.2011 07:16, schrieb Nick Sabalausky:
 Windows 98 look. :p
Best window skin ever to come out of MS.
That's true. I still use it in my daily work. At home linux of course. :)
Apr 04 2011
prev sibling next sibling parent Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
I'm taking `with` to the extreme!

http://codepad.org/dS97SDFS

Using a foreach loop to construct anonymous objects, and using an
index to label them in their constructor. I also hook them up to the
dispatch function. Just how cool is that?
Apr 03 2011
prev sibling next sibling parent Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
P.S. in case it wasn't obvious, addItem adds a newly constructed Menu
object to a MenuBar, and this function returns the instance of the
Menu for chaining. Thanks to `with` I can play with the newly
constructed object without referring explicitly to its name.

On 4/4/11, Andrej Mitrovic <andrej.mitrovich gmail.com> wrote:
 I'm taking `with` to the extreme!

 http://codepad.org/dS97SDFS

 Using a foreach loop to construct anonymous objects, and using an
 index to label them in their constructor. I also hook them up to the
 dispatch function. Just how cool is that?
Apr 03 2011
prev sibling parent reply Francisco Almeida <francisco.m.almeida gmail.com> writes:
== Quote from Andrej Mitrovic (none none.none)'s article
 On 4/3/11, Matthias Pleh <matthias none.net> wrote:
 * dgui -> windows only, also really .Net-like
So what's the state of things for this new(?) Windows GUI library? I gave it a test run yesterday, examples seem to compile and apps seem to load
really fast (well, it's GDI and simple examples, but still pretty fast to load).
 There doesn't seem to be any unittests at all which is a bit worrisome. It has
been put on the dwiki as a beta library, but has anyone used it for anything yet? I'd like to know more (plans, etc) from the author. :) I would like to try it too (DFL hasn't been updated in a long time), but couldn't find its project page. Could you please share a link?
Apr 04 2011
next sibling parent Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
On 4/4/11, Francisco Almeida <francisco.m.almeida gmail.com> wrote:
 == Quote from Andrej Mitrovic (none none.none)'s article
 On 4/3/11, Matthias Pleh <matthias none.net> wrote:
 * dgui -> windows only, also really .Net-like
So what's the state of things for this new(?) Windows GUI library? I gave it a test run yesterday, examples seem to compile and apps seem to load
really fast (well, it's GDI and simple examples, but still pretty fast to load).
 There doesn't seem to be any unittests at all which is a bit worrisome. It
 has
been put on the dwiki as a beta library, but has anyone used it for anything yet? I'd like to know more (plans, etc) from the author. :) I would like to try it too (DFL hasn't been updated in a long time), but couldn't find its project page. Could you please share a link?
You need to clone it from mercurial for D2. Use: hg clone https://dgui.googlecode.com/hg/ dgui Then you need to copy these two files from \tags\tools\scripts into \trunk\: dgui_build_dbg.bat dbg_dgui_cmdfile.args Then run dgui_build_dbg.bat to build the library in debug mode. To build the samples, copy the \tags\samples\ folder into \trunk\, and then copy the following files from \tags\tools\scripts into \trunk\samples\: dbg_events.args dbg_hello.args dbg_menu.args dbg_picture.args dbg_rawbitmap.args dbg_resources.args To build each sample just run dmd filename, e.g.: dmd dbg_events.args
Apr 04 2011
prev sibling next sibling parent reply Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
Well I've managed to get Scintilla running on it.

Honestly I'd just like to use QtD, but I've had problems with it and
the author is busy with his GSOC proposal afaik. I'm not blaming him,
quite the contrary he's done a lot. :). But I wish more people worked
on QtD.
Apr 04 2011
parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 4/4/11 8:16 PM, Andrej Mitrovic wrote:
 Well I've managed to get Scintilla running on it.

 Honestly I'd just like to use QtD, but I've had problems with it and
 the author is busy with his GSOC proposal afaik. I'm not blaming him,
 quite the contrary he's done a lot. :). But I wish more people worked
 on QtD.
A GSoC proposal for QtD would be appropriate. We have students who are willing to work on D but can't find a project. Andrei
Apr 04 2011
parent reply Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
What the funk. I was trying to contact the author but google just gave
me an invalid email address. If I try to expand his email by clicking
on "troguant... gmail.com", I get username "troguantoniodavide", but I
can't email him at this address.

:/
Apr 05 2011
parent AntonioDavide <fake fakeemail.com> writes:
On Wed, 6 Apr 2011 04:04:50 +0200, Andrej Mitrovic 
<andrej.mitrovich gmail.com> wrote:
 What the funk. I was trying to contact the author but google just 
gave
 me an invalid email address. If I try to expand his email by 
clicking
 on "troguant... gmail.com", I get username "troguantoniodavide", 
but I
 can't email him at this address.
 :/
Hi, I don't read newsgroups very often. I saw this discussion today, the valid mail is trogu [dot] davide [at] gmail [dot] com The mail in the project page doesn't exist...(I don't know why) Oh, I'm the DGui developer :)
Apr 05 2011
prev sibling parent Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
Here we go:
http://i.imgur.com/55tMG.jpg

I'm not yet sure how I'm supposed to align GUI elements so they "snap"
near each other. I had to hardcode the location of the scintilla
element.
Apr 04 2011