Jump to page: 1 2 3
Thread overview
Need sounding board for GUI library
Dec 15, 2013
Boyd
Dec 15, 2013
MrSmith
Dec 15, 2013
Boyd
Dec 15, 2013
Zz
Dec 15, 2013
Boyd
Dec 15, 2013
John Colvin
Dec 15, 2013
Idan Arye
Dec 15, 2013
MrSmith
Dec 15, 2013
Boyd
Dec 15, 2013
MrSmith
Dec 16, 2013
Boyd
Dec 15, 2013
MrSmith
Dec 15, 2013
Boyd
Dec 15, 2013
MrSmith
Dec 15, 2013
Boyd
Dec 15, 2013
Walter Bright
Dec 15, 2013
Marco Leise
Dec 15, 2013
Boyd
Dec 16, 2013
John J
Dec 16, 2013
Rikki Cattermole
Dec 16, 2013
Marco Leise
Dec 16, 2013
Boyd
December 15, 2013
Hey everyone,

I'm looking for help with a GUI library I'm working on. Right now I have a pretty good basis, but it's mostly catering to my own whims. I'm looking for someone to help me figure out which of my design choices are a good idea, and which need some revising. This is currently the biggest obstacle that prevents me from making it public.

The other obstacle I could use some help with, is deployment. I don't have a lot of experience with open source projects, but I want to get this one out there and I want to do it right.

If you're willing to help out, let me know.

Cheers,
Boyd.


PS. Here is a description of the project.

The goal of this library, like any GUI library, is to make GUI's a lot easier to build. Here are some of the characteristics of the library:

- It's non-native. If I'm going to support native components it will be far into the future, because in my experience, native components tend to be much too limiting.

- It's platform independent. That said, I currently only support win32, but it's written in a platform independent way and should easily be portable to other platforms. Once the first version is out of the way, this will be a top priority.

- Its main goal is to make custom widgets easy to create. Even without supplying any widgets this library should be useful. That said I do plan to eventually add many widgets to it, but the first version will only have a few.

- Multi-touch support. This is built into the very core of the library. Every widget you create can use it.

- Grid layout techniques. The library contains ways to layout your components, so that you won't need to calculate positions or sizes in the majority of cases.

Here is some sample code, to show you what it looks like.

public class TestApplication: TUiApplication
{
    /// Initialize the application
    public override void Initialize()
    {
        auto title = new TTextGraphic(
            "An uninteresting application",
            TFont("Verdana", 30),
            TColor.Rgb(1,1,1),
            TColor.Rgb(0,0,0),
            TAnchor.Center
        );

        auto image = new TImageGraphic(
            LocalFileStore.GetFile(`C:\Images\GrandPiano.png`)
        );

        auto exitButton = new TButtonWidget("Quit");
        exitButton.PressEvent.Bind(&this.Quit);

        auto main = new TVerticalLayout(
            [
                title,
                image,
                exitButton
            ],
            [
                new TGridLayoutRow(TSizeUnit.Auto),
                new TGridLayoutRow(TSizeUnit.Remainder(1)),
                new TGridLayoutRow(TSizeUnit.Auto)
            ]
        );

        Ui.ShowWidgetFullScreen(
            Ui.GetScreens()[0],
            main
        );
    }

    /// Clean up the application
    public override void Finalize(){ }

    /// Whether or not the application will quit.
    /// Use this, for example, to ask the user whether to save changes
    public override bool AllowQuit() { return true; }
}

int main(string[] argv)
{
    Run(new TestApplication());
}
December 15, 2013
Hi Boyd.

Have you uploaded your code somewhere so anyone can take a look at it?
Let me ask you some questions.
1. How have you done event propagation? Sinking and boobling or something else? Can you cancel event propagation?
2. How do you create platform dependent windows. Using WinAPI, SFML, GLFW(+), SDL(+), GLUT?
3. How are you rendering widgets? Using OpenGL(+), DirectX, SDL, SFML, GDI? If it is OpenGL than what version of it?
4. How your widgets are rendered? Do you have separate GuiRenderer which knows how to render basic GUI elements(+) or all widgets are directly calling OpenGL code?
5. Do you have any styling of your widgets, external config, CSS etc? If any how it is done? Can you set any image or color, gradient to any widget?
6. How is your resource management implemented? Do you have any dedicated texture, font manager?
7. Do you have animation support (plans to do it)?
8. How is your widget events and properties implemented? Signals, variants, reactive programming etc?
8. Do you have model and view separation? Controllers, presenters?
9. How is your layouts implemented? Do you have layout interface? What methods it has? When they are called?
10. Can you access property by its name like widget.getProperty("width");
11. Do you know that in D is common to use camelCase for method names?
12. What other gui's are you looking at while making your own?
December 15, 2013
On Sunday, 15 December 2013 at 12:59:27 UTC, MrSmith wrote:
> Hi Boyd.
>
> Have you uploaded your code somewhere so anyone can take a look at it?
I Have not yet uploaded it, though I would like to. Where would be a good place to put it?

> Let me ask you some questions.
> 1. How have you done event propagation? Sinking and boobling or something else? Can you cancel event propagation?
The event propagation method I use is event capturing. First the event goes to the outer most widget which determines whether to send it to child widgets.

> 2. How do you create platform dependent windows. Using WinAPI, SFML, GLFW(+), SDL(+), GLUT?
Platform dependent widgets are not supported at this time. I may add native widgets in the future, but right now it seems more trouble than it's worth.

> 3. How are you rendering widgets? Using OpenGL(+), DirectX, SDL, SFML, GDI? If it is OpenGL than what version of it?
I currently use GDI. It should not be that hard to change this, though.

> 4. How your widgets are rendered? Do you have separate GuiRenderer which knows how to render basic GUI elements(+) or all widgets are directly calling OpenGL code?
I have created a Canvas class that does all the drawing. This ensures platform independences.

You can also use graphic objects to do the drawing instead; the TImageGraphic object draws an image, TTextGraphic draws text, etc..

> 5. Do you have any styling of your widgets, external config, CSS etc? If any how it is done? Can you set any image or color, gradient to any widget?
I have plans for stylable widgets, but I don't have a concrete design for this yet. I have some ideas though, and I intend for it to be immensely flexible. Basically a stylable widget would be a widget without a style at all. The widget would only define a list of placeholder blocks that the theme would need to fill.

For example: The TButtonWidget could define the placeholders Normal, Hover, Down, DownHover. The theme would then determine the exact content of these placeholders. Gradients, images, text, borders, layout, you name it.

> 6. How is your resource management implemented? Do you have any dedicated texture, font manager?
No I don't, although the theme system will do some resource management. Would you consider this as an important feature outside of themes?

> 7. Do you have animation support (plans to do it)?
No concrete plans, but eventually I do want to support it.

> 8. How is your widget events and properties implemented? Signals, variants, reactive programming etc?
At first simply changing properties will have to do. I do intend to support something similar to signals.

> 8. Do you have model and view separation? Controllers, presenters?
I'm not sure what you mean. A GUI library by its very nature is pure view.

> 9. How is your layouts implemented? Do you have layout interface? What methods it has? When they are called?
There are to ways to do layout. You can inherit from a layout component, in which case you would need to implement a few functions. For example the gridlayout requires the implementation of the following functions:

/// iterates through the rows of the grid
void ForeachRow(TCanvas canvas, void delegate(TGridLayoutRow) exec);
/// iterates through the columns of the grid
void ForeachColumn(TCanvas canvas, void delegate(TGridLayoutRow) exec);
/// returns the content of the specified grid cell
TGraphic GetCell(int x, int y);

The other method is to create a TGridWidget using the constructor:

this(TGridLayoutRow[] columns, TGridLayoutRow[] rows, TGraphic[][] cells)

> 10. Can you access property by its name like widget.getProperty("width");
No. In what situation would you consider using this?

Also Widgets don't have any positional information in them, or style information. This is one of main issues I have with the existing GUI libraries.

> 11. Do you know that in D is common to use camelCase for method names?
As I said earlier I built this library to cater to my every whim, so I probably need to change my coding style slightly.

> 12. What other gui's are you looking at while making your own?
There are many gui libraries that have influenced my design, but I don't plan to immitate any of them. Most influence come from the old Borland delphi design, which is still used in many of the current ones among which is QT, WxWidgets, other ideas are from ExtJs and html/css. It is a fairly unique design though, which is why I worry about whether it will be usable by other programmers.



Thanks for the questions, I look forward to hear what you think of my answers. Feel free to criticise.

Cheers,
Boyd
December 15, 2013
Am Sun, 15 Dec 2013 12:41:54 +0100
schrieb "Boyd" <gaboonviper@gmx.net>:

> Hey everyone,
> 
> I'm looking for help with a GUI library I'm working on. Right now I have a pretty good basis, but it's mostly catering to my own whims. I'm looking for someone to help me figure out which of my design choices are a good idea, and which need some revising. This is currently the biggest obstacle that prevents me from making it public.
> 
> The other obstacle I could use some help with, is deployment. I don't have a lot of experience with open source projects, but I want to get this one out there and I want to do it right.
> 
> If you're willing to help out, let me know.
> 
> Cheers,
> Boyd.
> 
> 
> PS. Here is a description of the project.
> 
> The goal of this library, like any GUI library, is to make GUI's a lot easier to build. Here are some of the characteristics of the library:
> 
> - It's non-native. If I'm going to support native components it will be far into the future, because in my experience, native components tend to be much too limiting.
> 
> - It's platform independent. That said, I currently only support win32, but it's written in a platform independent way and should easily be portable to other platforms. Once the first version is out of the way, this will be a top priority.
> 
> - Its main goal is to make custom widgets easy to create. Even without supplying any widgets this library should be useful. That said I do plan to eventually add many widgets to it, but the first version will only have a few.
> 
> - Multi-touch support. This is built into the very core of the library. Every widget you create can use it.
> 
> - Grid layout techniques. The library contains ways to layout your components, so that you won't need to calculate positions or sizes in the majority of cases.
> 
> Here is some sample code, to show you what it looks like.
> 
> public class TestApplication: TUiApplication
> {
>      /// Initialize the application
>      public override void Initialize()
>      {
>          auto title = new TTextGraphic(
>              "An uninteresting application",
>              TFont("Verdana", 30),
>              TColor.Rgb(1,1,1),
>              TColor.Rgb(0,0,0),
>              TAnchor.Center
>          );
> 
>          auto image = new TImageGraphic(
>              LocalFileStore.GetFile(`C:\Images\GrandPiano.png`)
>          );
> 
>          auto exitButton = new TButtonWidget("Quit");
>          exitButton.PressEvent.Bind(&this.Quit);
> 
>          auto main = new TVerticalLayout(
>              [
>                  title,
>                  image,
>                  exitButton
>              ],
>              [
>                  new TGridLayoutRow(TSizeUnit.Auto),
>                  new TGridLayoutRow(TSizeUnit.Remainder(1)),
>                  new TGridLayoutRow(TSizeUnit.Auto)
>              ]
>          );
> 
>          Ui.ShowWidgetFullScreen(
>              Ui.GetScreens()[0],
>              main
>          );
>      }
> 
>      /// Clean up the application
>      public override void Finalize(){ }
> 
>      /// Whether or not the application will quit.
>      /// Use this, for example, to ask the user whether to save
> changes
>      public override bool AllowQuit() { return true; }
> }
> 
> int main(string[] argv)
> {
>      Run(new TestApplication());
> }

A Delphi VCL user!

-- 
Marco

December 15, 2013
Hi Boyd,

Here something that might be interesting for you the gui is rendered using the C++ version of AntiGrain Geometry (with C# wrappers).

http://www.creativedocs.net/devs/gui
http://www.creativedocs.net/devs/agg
http://www.creativedocs.net/screenshots/

Zz

On Sunday, 15 December 2013 at 14:19:10 UTC, Boyd wrote:
> On Sunday, 15 December 2013 at 12:59:27 UTC, MrSmith wrote:
>> Hi Boyd.
>>
>> Have you uploaded your code somewhere so anyone can take a look at it?
> I Have not yet uploaded it, though I would like to. Where would be a good place to put it?
>
>> Let me ask you some questions.
>> 1. How have you done event propagation? Sinking and boobling or something else? Can you cancel event propagation?
> The event propagation method I use is event capturing. First the event goes to the outer most widget which determines whether to send it to child widgets.
>
>> 2. How do you create platform dependent windows. Using WinAPI, SFML, GLFW(+), SDL(+), GLUT?
> Platform dependent widgets are not supported at this time. I may add native widgets in the future, but right now it seems more trouble than it's worth.
>
>> 3. How are you rendering widgets? Using OpenGL(+), DirectX, SDL, SFML, GDI? If it is OpenGL than what version of it?
> I currently use GDI. It should not be that hard to change this, though.
>
>> 4. How your widgets are rendered? Do you have separate GuiRenderer which knows how to render basic GUI elements(+) or all widgets are directly calling OpenGL code?
> I have created a Canvas class that does all the drawing. This ensures platform independences.
>
> You can also use graphic objects to do the drawing instead; the TImageGraphic object draws an image, TTextGraphic draws text, etc..
>
>> 5. Do you have any styling of your widgets, external config, CSS etc? If any how it is done? Can you set any image or color, gradient to any widget?
> I have plans for stylable widgets, but I don't have a concrete design for this yet. I have some ideas though, and I intend for it to be immensely flexible. Basically a stylable widget would be a widget without a style at all. The widget would only define a list of placeholder blocks that the theme would need to fill.
>
> For example: The TButtonWidget could define the placeholders Normal, Hover, Down, DownHover. The theme would then determine the exact content of these placeholders. Gradients, images, text, borders, layout, you name it.
>
>> 6. How is your resource management implemented? Do you have any dedicated texture, font manager?
> No I don't, although the theme system will do some resource management. Would you consider this as an important feature outside of themes?
>
>> 7. Do you have animation support (plans to do it)?
> No concrete plans, but eventually I do want to support it.
>
>> 8. How is your widget events and properties implemented? Signals, variants, reactive programming etc?
> At first simply changing properties will have to do. I do intend to support something similar to signals.
>
>> 8. Do you have model and view separation? Controllers, presenters?
> I'm not sure what you mean. A GUI library by its very nature is pure view.
>
>> 9. How is your layouts implemented? Do you have layout interface? What methods it has? When they are called?
> There are to ways to do layout. You can inherit from a layout component, in which case you would need to implement a few functions. For example the gridlayout requires the implementation of the following functions:
>
> /// iterates through the rows of the grid
> void ForeachRow(TCanvas canvas, void delegate(TGridLayoutRow) exec);
> /// iterates through the columns of the grid
> void ForeachColumn(TCanvas canvas, void delegate(TGridLayoutRow) exec);
> /// returns the content of the specified grid cell
> TGraphic GetCell(int x, int y);
>
> The other method is to create a TGridWidget using the constructor:
>
> this(TGridLayoutRow[] columns, TGridLayoutRow[] rows, TGraphic[][] cells)
>
>> 10. Can you access property by its name like widget.getProperty("width");
> No. In what situation would you consider using this?
>
> Also Widgets don't have any positional information in them, or style information. This is one of main issues I have with the existing GUI libraries.
>
>> 11. Do you know that in D is common to use camelCase for method names?
> As I said earlier I built this library to cater to my every whim, so I probably need to change my coding style slightly.
>
>> 12. What other gui's are you looking at while making your own?
> There are many gui libraries that have influenced my design, but I don't plan to immitate any of them. Most influence come from the old Borland delphi design, which is still used in many of the current ones among which is QT, WxWidgets, other ideas are from ExtJs and html/css. It is a fairly unique design though, which is why I worry about whether it will be usable by other programmers.
>
>
>
> Thanks for the questions, I look forward to hear what you think of my answers. Feel free to criticise.
>
> Cheers,
> Boyd

December 15, 2013
Yeah, this is definitely interesting. GDI is pretty limiting, though for the moment it's enough. I think I've actually used this a long long time ago. Is there a D binding for AntiGrain?

On Sunday, 15 December 2013 at 14:40:09 UTC, Zz wrote:
> Hi Boyd,
>
> Here something that might be interesting for you the gui is rendered using the C++ version of AntiGrain Geometry (with C# wrappers).
>
> http://www.creativedocs.net/devs/gui
> http://www.creativedocs.net/devs/agg
> http://www.creativedocs.net/screenshots/
>
> Zz
December 15, 2013
On Sunday, 15 December 2013 at 14:38:12 UTC, Marco Leise wrote:
> Am Sun, 15 Dec 2013 12:41:54 +0100
>
> A Delphi VCL user!

A long time ago, yes:) Some of it stuck.
December 15, 2013
On Sunday, 15 December 2013 at 14:19:10 UTC, Boyd wrote:
> On Sunday, 15 December 2013 at 12:59:27 UTC, MrSmith wrote:
>> Hi Boyd.
>>
>> Have you uploaded your code somewhere so anyone can take a look at it?
> I Have not yet uploaded it, though I would like to. Where would be a good place to put it?

Github is the usual destination these days. Or Bitbucket.
December 15, 2013
On Sunday, 15 December 2013 at 14:19:10 UTC, Boyd wrote:
> On Sunday, 15 December 2013 at 12:59:27 UTC, MrSmith wrote:
>> Hi Boyd.
>>
>> Have you uploaded your code somewhere so anyone can take a look at it?
> I Have not yet uploaded it, though I would like to. Where would be a good place to put it?

https://github.com/

GitHub has many advantages, but the most relevant would be it's awesome code-review system.
December 15, 2013
> I Have not yet uploaded it, though I would like to. Where would be a good place to put it?
Look for github. They also have pretty convenient client for Windows.

Do widgets internally hold their position and size or they are recalculated every time gui is rendered?
When widget will relayout its children.
How are you drawing text?
What type of string do use for text rendering (string, wstring, dstring etc)?
Do you plannig to do declarative markup like QML or XUL?
Do you have any working text editing components?
Have you looked at QTQuick/DQuick? https://github.com/D-Quick/DQuick

> Also Widgets don't have any positional information in them, or style information. This is one of main issues I have with the existing GUI libraries.
Does it mean that you have one theme for the whole application. Do you have any size restrictions in your widget styles or it is pure appearence information? If later it is fine.
« First   ‹ Prev
1 2 3